2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-25 11:19:52 +01:00
This commit is contained in:
Thomas Nagy 2017-01-29 19:59:51 +01:00
parent f2eaf17089
commit f446830935
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA

View File

@ -19,18 +19,23 @@ def options(opt):
def configure(conf):
conf.load('compiler_c gnu_dirs')
conf.check_cc(fragment="int main() { return 0; }\n")
# compile and link in the default mode, which is c++ if present
conf.check(fragment='int main() { return 0; }\n')
# just compile in c mode, and do not link
conf.check(fragment='int main() { return 0; }\n', features='c')
try:
conf.check_cc(fragment="int main() { return 0; }\n", execute=True) # 1
conf.check(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)')
conf.check_library(test_exec=False)
else:
conf.check_cc(fragment="""#include<stdio.h>\nint main(){fprintf(stderr, "mu"); printf("%d", 22);return 0;}\n""", execute=True, define_name='HAVE_MU')
conf.check(fragment="""#include<stdio.h>\nint main(){fprintf(stderr, "mu"); printf("%d", 22);return 0;}\n""", execute=True, define_name='HAVE_MU')
conf.check_library(test_exec=True)
conf.check_cc(lib='m', cflags='-Wall', defines=['var=foo', 'x=y'], uselib_store='M', mandatory=False)
conf.check(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_endianness()
@ -57,9 +62,9 @@ def configure(conf):
#run_all_tests = False # set to False to stop at the first error
)
conf.check_cc(header_name='stdio.h', auto_add_header_name=True)
#conf.check_cc(header_name='unistd.h')
conf.check_cc(fragment='int main() {return 0;}\n')
conf.check(header_name='stdio.h', auto_add_header_name=True)
#conf.check(header_name='unistd.h')
conf.check(fragment='int main() {return 0;}\n')
conf.write_config_header('config.h')
# exclude system libraries, force a particular folder (see strictlib below)