source: waflib/Tools/compiler_c.py @ 52b5f34

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 52b5f34 was 0fa325b, checked in by Paul Brossier <piem@piem.org>, 11 years ago

waf: unpack

  • Property mode set to 100644
File size: 1.7 KB
Line 
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
5import os,sys,imp,types
6from waflib.Tools import ccroot
7from waflib import Utils,Configure
8from waflib.Logs import debug
9c_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'],}
10def 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!')
30def 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)
Note: See TracBrowser for help on using the repository browser.