source: waflib/Tools/compiler_fc.py @ c82a034

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since c82a034 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
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,re
6from waflib import Utils,Configure,Options,Logs,Errors
7from waflib.Tools import fc
8fc_compiler={'win32':['gfortran','ifort'],'darwin':['gfortran','g95','ifort'],'linux':['gfortran','g95','ifort'],'java':['gfortran','g95','ifort'],'default':['gfortran'],'aix':['gfortran']}
9def default_compilers():
10        build_platform=Utils.unversioned_sys_platform()
11        possible_compiler_list=fc_compiler.get(build_platform,fc_compiler['default'])
12        return' '.join(possible_compiler_list)
13def configure(conf):
14        try:test_for_compiler=conf.options.check_fortran_compiler or default_compilers()
15        except AttributeError:conf.fatal("Add options(opt): opt.load('compiler_fc')")
16        for compiler in re.split('[ ,]+',test_for_compiler):
17                conf.env.stash()
18                conf.start_msg('Checking for %r (Fortran compiler)'%compiler)
19                try:
20                        conf.load(compiler)
21                except conf.errors.ConfigurationError ,e:
22                        conf.env.revert()
23                        conf.end_msg(False)
24                        Logs.debug('compiler_fortran: %r'%e)
25                else:
26                        if conf.env['FC']:
27                                conf.end_msg(conf.env.get_flat('FC'))
28                                conf.env.COMPILER_FORTRAN=compiler
29                                break
30                        conf.end_msg(False)
31        else:
32                conf.fatal('could not configure a Fortran compiler!')
33def options(opt):
34        test_for_compiler=default_compilers()
35        opt.load_special_tools('fc_*.py')
36        fortran_compiler_opts=opt.add_option_group('Configuration options')
37        fortran_compiler_opts.add_option('--check-fortran-compiler',default=None,help='list of Fortran compiler to try [%s]'%test_for_compiler,dest="check_fortran_compiler")
38        for x in test_for_compiler.split():
39                opt.load('%s'%x)
Note: See TracBrowser for help on using the repository browser.