X-Git-Url: http://g0dil.de/git?p=senf.git;a=blobdiff_plain;f=SConfigure;h=64044a80c4e24463d87685371ad9488a0f424c57;hp=40382e8f7e3f1e5fc97c3c7b28dc0c4b77dc51d3;hb=HEAD;hpb=5083ed2a2fe087df2f981b3f66eaf0fb130243eb diff --git a/SConfigure b/SConfigure index 40382e8..64044a8 100644 --- a/SConfigure +++ b/SConfigure @@ -1,5 +1,7 @@ # -*- python -*- +import glob + Import('env') ########################################################################### @@ -12,7 +14,7 @@ def CheckSTLCopyN(context): ('', '__gnu_cxx::copy_n', 'GNUCXX') ] for include, name, define in versions: ret = context.TryCompile("#include %s\n" - "int main(int,char**) { int *a,*b; %s(a,0,b); }\n" + "int main(int,char**) { int *a (NULL); int *b (NULL); %s(a,0,b); }\n" % (include, name), ".cc") if ret: @@ -38,7 +40,7 @@ def CheckTempBufferStrategy(context): # alloca ret = context.TryCompile("#include \n" - "void test(int a){void *b(alloca(a));}" + "void test(int a){void *b(alloca(a));}", ".cc") if ret: return "alloca" @@ -69,37 +71,6 @@ def CheckValgrindWildcards(context): context.Result( ret[0] ) return ret[0] -@env.ConfTest() -def CheckExpression(context, name, expression, header="", language="C"): - import SCons.Conftest - - lang, suffix, msg = SCons.Conftest._lang2suffix(language) - if msg: - context.Message("Cannot check for header file %s: \n" % header_name) - context.Result(msg) - return False - - text = ("#include \n" - "%s\n" - "int main() {\n" - "%s;\n" - "return 0;\n" - "}\n") % (header, expression) - - context.Message("Checking for valid %s expression %s... " % (lang, expression)) - ret = context.TryLink(text, suffix) - context.Result(ret) - if ret: - import re - key = name.upper() - key = re.sub('[^A-Z0-9_]', '_', key) - context.sconf.Define("HAVE_%s" % key, - 1, - "Define to 1 if the expression `%s' is valid on your system" - % expression) - - return ret - ########################################################################### conf = env.Configure(clean=False, help=False, config_h="#/senf/autoconf.hh") @@ -115,11 +86,14 @@ res = conf.CheckCXXHeader("boost/bimap.hpp"); \ res = conf.CheckTempBufferStrategy() # Standard library stuff +res = conf.CheckCHeader("execinfo.h") +res = conf.FindCHeader("timerfd.h", [ 'sys', 'linux' ]) res = conf.CheckFunc("timerfd_create") -res = conf.CheckExpression("le16toh", "le16toh(0)", - "#include ") -res = conf.CheckExpression("le32toh", "le32toh(0)", - "#include ") +res = conf.CheckSymbolWithExpression( + "le16toh", "le16toh(0)", "#include ") +res = conf.CheckSymbolWithExpression( + "le32toh", "le32toh(0)", "#include ") +res = conf.CheckByteorder() res = conf.CheckSTLCopyN(); \ conf.env.Fail(condition=not res, message="No 'copy_n' implementation found") @@ -127,4 +101,16 @@ res = conf.CheckSTLCopyN(); \ res = conf.CheckValgrind() and conf.CheckValgrindWildcards(); \ conf.env.Replace(HAVE_VALGRIND = res) +########################################################################### + +# run configure scripts from external modules +Export('conf') + +sconscripts = sorted(glob.glob("senf/Ext/*/SConfigure")) +if sconscripts: + SConscript(sconscripts) + +########################################################################### + env = conf.Finish() +