source: waflib/Tools/compiler_c.py @ 44755a0

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 44755a0 was 904702d, checked in by Paul Brossier <piem@piem.org>, 10 years ago

waf, waflib: update to 1.8.7

  • Property mode set to 100644
File size: 1.7 KB
RevLine 
[0fa325b]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
[904702d]5import os,sys,imp,types,re
[0fa325b]6from waflib.Tools import ccroot
7from waflib import Utils,Configure
8from waflib.Logs import debug
[904702d]9c_compiler={'win32':['msvc','gcc','clang'],'cygwin':['gcc'],'darwin':['clang','gcc'],'aix':['xlc','gcc','clang'],'linux':['gcc','clang','icc'],'sunos':['suncc','gcc'],'irix':['gcc','irixcc'],'hpux':['gcc'],'gnu':['gcc','clang'],'java':['gcc','msvc','clang','icc'],'default':['gcc','clang'],}
10def default_compilers():
11        build_platform=Utils.unversioned_sys_platform()
12        possible_compiler_list=c_compiler.get(build_platform,c_compiler['default'])
13        return' '.join(possible_compiler_list)
[0fa325b]14def configure(conf):
[904702d]15        try:test_for_compiler=conf.options.check_c_compiler or default_compilers()
[0fa325b]16        except AttributeError:conf.fatal("Add options(opt): opt.load('compiler_c')")
[904702d]17        for compiler in re.split('[ ,]+',test_for_compiler):
[0fa325b]18                conf.env.stash()
[904702d]19                conf.start_msg('Checking for %r (C compiler)'%compiler)
[0fa325b]20                try:
21                        conf.load(compiler)
22                except conf.errors.ConfigurationError ,e:
23                        conf.env.revert()
24                        conf.end_msg(False)
25                        debug('compiler_c: %r'%e)
26                else:
27                        if conf.env['CC']:
28                                conf.end_msg(conf.env.get_flat('CC'))
29                                conf.env['COMPILER_CC']=compiler
30                                break
31                        conf.end_msg(False)
32        else:
[904702d]33                conf.fatal('could not configure a C compiler!')
[0fa325b]34def options(opt):
[904702d]35        test_for_compiler=default_compilers()
[0fa325b]36        opt.load_special_tools('c_*.py',ban=['c_dumbpreproc.py'])
[904702d]37        cc_compiler_opts=opt.add_option_group('Configuration options')
38        cc_compiler_opts.add_option('--check-c-compiler',default=None,help='list of C compilers to try [%s]'%test_for_compiler,dest="check_c_compiler")
[0fa325b]39        for x in test_for_compiler.split():
40                opt.load('%s'%x)
Note: See TracBrowser for help on using the repository browser.