summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct19
1 files changed, 19 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index 51da3106..b63c000a 100644
--- a/SConstruct
+++ b/SConstruct
@@ -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")