ctdb-daemon: Use ctdb_parse_node_address() in ctdbd
[samba4-gss.git] / third_party / waf / waflib / extras / fc_nec.py
blob67c8680898516d8e3651a53a5edfb95a761d4c88
1 #! /usr/bin/env python
2 # encoding: utf-8
3 # harald at klimachs.de
5 import re
6 from waflib.Tools import fc, fc_config, fc_scan
7 from waflib.Configure import conf
9 from waflib.Tools.compiler_fc import fc_compiler
10 fc_compiler['linux'].append('fc_nec')
12 @conf
13 def find_sxfc(conf):
14 """Find the NEC fortran compiler (will look in the environment variable 'FC')"""
15 fc = conf.find_program(['sxf90','sxf03'], var='FC')
16 conf.get_sxfc_version(fc)
17 conf.env.FC_NAME = 'NEC'
18 conf.env.FC_MOD_CAPITALIZATION = 'lower'
20 @conf
21 def sxfc_flags(conf):
22 v = conf.env
23 v['_FCMODOUTFLAGS'] = [] # enable module files and put them in the current directory
24 v['FCFLAGS_DEBUG'] = [] # more verbose compiler warnings
25 v['FCFLAGS_fcshlib'] = []
26 v['LINKFLAGS_fcshlib'] = []
28 v['FCSTLIB_MARKER'] = ''
29 v['FCSHLIB_MARKER'] = ''
31 @conf
32 def get_sxfc_version(conf, fc):
33 version_re = re.compile(r"FORTRAN90/SX\s*Version\s*(?P<major>\d*)\.(?P<minor>\d*)", re.I).search
34 cmd = fc + ['-V']
35 out,err = fc_config.getoutput(conf, cmd, stdin=False)
36 if out:
37 match = version_re(out)
38 else:
39 match = version_re(err)
40 if not match:
41 version_re=re.compile(r"NEC Fortran 2003 Compiler for\s*(?P<major>\S*)\s*\(c\)\s*(?P<minor>\d*)",re.I).search
42 if out:
43 match = version_re(out)
44 else:
45 match = version_re(err)
46 if not match:
47 conf.fatal('Could not determine the NEC Fortran compiler version.')
48 k = match.groupdict()
49 conf.env['FC_VERSION'] = (k['major'], k['minor'])
51 def configure(conf):
52 conf.find_sxfc()
53 conf.find_program('sxar',var='AR')
54 conf.add_os_flags('ARFLAGS')
55 if not conf.env.ARFLAGS:
56 conf.env.ARFLAGS=['rcs']
58 conf.fc_flags()
59 conf.fc_add_flags()
60 conf.sxfc_flags()