X-Git-Url: http://g0dil.de/git?p=senf.git;a=blobdiff_plain;f=SConfigure;h=64044a80c4e24463d87685371ad9488a0f424c57;hp=b8ad5cdf12a2ed3e0f3d873408583fd34244346a;hb=HEAD;hpb=41ac85f6c8a96bdefebdbee4e88193d7f23f50cf diff --git a/SConfigure b/SConfigure index b8ad5cd..64044a8 100644 --- a/SConfigure +++ b/SConfigure @@ -1,5 +1,7 @@ # -*- python -*- +import glob + Import('env') ########################################################################### @@ -12,14 +14,14 @@ 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: context.Result(name) context.sconf.Define("HAVE_%s_COPYN" % define, 1, - "Define one of " + "Define one of " + ", ".join(("HAVE_%s_COPYN" % elt[2] for elt in versions))) return ret @@ -38,10 +40,10 @@ 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" - + # fallback: new return "new" @@ -71,33 +73,44 @@ def CheckValgrindWildcards(context): ########################################################################### -conf = env.Configure(clean=False, - help=False, - config_h="#/senf/autoconf.hh") +conf = env.Configure(clean=False, help=False, config_h="#/senf/autoconf.hh") # Boost -res = conf.CheckBoostVersion() -if not res : conf.Fail("Boost includes not found") - +res = conf.CheckBoostVersion(fail=True) res = conf.CheckBoostVariants() - -res = conf.CheckCXXHeader("boost/bimap.hpp") -conf.env.Replace(NEED_BOOST_EXT = not res) - res = conf.CheckCXXHeader("boost/spirit/include/classic.hpp") - +res = conf.CheckCXXHeader("boost/bimap.hpp"); \ + conf.env.Replace(NEED_BOOST_EXT = not res) + # Compiler support res = conf.CheckTempBufferStrategy() # Standard library stuff -res = conf.CheckSTLCopyN() -if not res : conf.Fail("No 'copy_n' implementation found") - +res = conf.CheckCHeader("execinfo.h") +res = conf.FindCHeader("timerfd.h", [ 'sys', 'linux' ]) res = conf.CheckFunc("timerfd_create") +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") # valgrind -res = conf.CheckValgrind() \ - and conf.CheckValgrindWildcards() -conf.env.Replace(HAVE_VALGRIND = res) +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() +