akmhoque | fa8ee9b | 2014-03-14 09:06:24 -0500 | [diff] [blame^] | 1 | #! /usr/bin/env python |
| 2 | # encoding: utf-8 |
| 3 | # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file |
| 4 | |
| 5 | import os,sys,imp,types |
| 6 | from waflib.Tools import ccroot |
| 7 | from waflib import Utils,Configure |
| 8 | from waflib.Logs import debug |
| 9 | c_compiler={'win32':['msvc','gcc'],'cygwin':['gcc'],'darwin':['gcc'],'aix':['xlc','gcc'],'linux':['gcc','icc'],'sunos':['suncc','gcc'],'irix':['gcc','irixcc'],'hpux':['gcc'],'gnu':['gcc'],'java':['gcc','msvc','icc'],'default':['gcc'],} |
| 10 | def configure(conf): |
| 11 | try:test_for_compiler=conf.options.check_c_compiler |
| 12 | except AttributeError:conf.fatal("Add options(opt): opt.load('compiler_c')") |
| 13 | for compiler in test_for_compiler.split(): |
| 14 | conf.env.stash() |
| 15 | conf.start_msg('Checking for %r (c compiler)'%compiler) |
| 16 | try: |
| 17 | conf.load(compiler) |
| 18 | except conf.errors.ConfigurationError ,e: |
| 19 | conf.env.revert() |
| 20 | conf.end_msg(False) |
| 21 | debug('compiler_c: %r'%e) |
| 22 | else: |
| 23 | if conf.env['CC']: |
| 24 | conf.end_msg(conf.env.get_flat('CC')) |
| 25 | conf.env['COMPILER_CC']=compiler |
| 26 | break |
| 27 | conf.end_msg(False) |
| 28 | else: |
| 29 | conf.fatal('could not configure a c compiler!') |
| 30 | def options(opt): |
| 31 | opt.load_special_tools('c_*.py',ban=['c_dumbpreproc.py']) |
| 32 | global c_compiler |
| 33 | build_platform=Utils.unversioned_sys_platform() |
| 34 | possible_compiler_list=c_compiler[build_platform in c_compiler and build_platform or'default'] |
| 35 | test_for_compiler=' '.join(possible_compiler_list) |
| 36 | cc_compiler_opts=opt.add_option_group("C Compiler Options") |
| 37 | cc_compiler_opts.add_option('--check-c-compiler',default="%s"%test_for_compiler,help='On this platform (%s) the following C-Compiler will be checked by default: "%s"'%(build_platform,test_for_compiler),dest="check_c_compiler") |
| 38 | for x in test_for_compiler.split(): |
| 39 | opt.load('%s'%x) |