From caa9cc2cecd0dd28553b2234f1513c9543f3bfc8 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Sat, 19 Nov 2011 17:35:41 +0100 Subject: [PATCH] disable the configuration tests that cannot run when using cross-compiler --- demos/c/wscript | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/demos/c/wscript b/demos/c/wscript index 13136232..7bc41243 100644 --- a/demos/c/wscript +++ b/demos/c/wscript @@ -8,8 +8,8 @@ APPNAME='cc_test' top = '.' -import waflib.Configure -#waflib.Configure.autoconfig = True +from waflib import Configure, Logs +#Configure.autoconfig = True def options(opt): opt.load('compiler_c') @@ -18,13 +18,18 @@ def options(opt): def configure(conf): conf.load('compiler_c') conf.check_cc(fragment="int main() { return 0; }\n") - conf.check_cc(fragment="int main() { return 0; }\n", execute=True) - conf.check_cc(fragment="""#include\nint main(){fprintf(stderr, "mu"); printf("%d", 22);return 0;}\n""", execute=True, define_name='HAVE_MU') - conf.check_cc(lib='m', cflags='-Wall', defines=['var=foo', 'x=y'], uselib_store='M', mandatory=False) + try: + conf.check_cc(fragment="int main() { return 0; }\n", execute=True) # 1 + except conf.errors.WafError: + Logs.warn('You are probably using a cross-compiler (disabling specific configuration tests)') + else: + conf.check_cc(fragment="""#include\nint main(){fprintf(stderr, "mu"); printf("%d", 22);return 0;}\n""", execute=True, define_name='HAVE_MU') + conf.check_library() + + conf.check_cc(lib='m', cflags='-Wall', defines=['var=foo', 'x=y'], uselib_store='M', mandatory=False) conf.check_large_file(mandatory=False) conf.check_inline() - conf.check_library() conf.multicheck( {'header_name':'stdio.h'},