diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-10-30 11:47:58 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-10-30 11:47:58 -0400 |
commit | e9156e127a0d47a469a67882b00b4e7a635a8f5f (patch) | |
tree | 6428dc7b629940b9266b68e55bb846842bf6acf2 | |
parent | ed99be6df93be541a66602d3f1b296f6c8f9797e (diff) | |
download | gpsd-e9156e127a0d47a469a67882b00b4e7a635a8f5f.tar.gz |
Force pps=no if TIOCMIWAIT is not available.
-rw-r--r-- | SConstruct | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -428,6 +428,20 @@ def CheckCompilerOption(context, option): context.Result(ret) return ret +def CheckDefine(context, define, file): + context.Message( 'Checking if %s supplies %s ...' %(file,define) ) + ret = context.TryLink(""" + #include <%s> + #ifndef %s + #error %s is not defined + #endif + int main(int argc, char **argv) { + return 0; + } + """ % (file, define, define),'.c') + context.Result(ret) + return ret + def CheckEndian(context): context.Message("checking endianess ... ") import struct @@ -448,6 +462,7 @@ config = Configure(env, custom_tests = { 'CheckPKG' : CheckPKG, 'CheckExecutable' : CheckExecutable, 'CheckXsltproc' : CheckXsltproc, 'CheckCompilerOption' : CheckCompilerOption, + 'CheckDefine' : CheckDefine, 'CheckEndian' : CheckEndian}) @@ -621,6 +636,10 @@ if config.CheckFunc("pselect"): else: confdefs.append("#define COMPAT_SELECT\n") +if not config.CheckDefine("TIOCMIWAIT", "sys/ioctl.h"): + announce("Forcing pps=no (TIOCMIWAIT not available)") + env["pps"] = False + endian = config.CheckEndian() if endian == 'big': confdefs.append("#define WORDS_BIGENDIAN 1\n") |