2 # compiler definition for irix/MIPSpro cc compiler
3 # based on suncc.py from waf
6 import Utils
, Options
, Configure
8 from Configure
import conftest
10 from compiler_cc
import c_compiler
12 c_compiler
['irix'] = ['gcc', 'irixcc']
15 def find_irixcc(conf
):
18 if v
['CC']: cc
= v
['CC']
19 elif 'CC' in conf
.environ
: cc
= conf
.environ
['CC']
20 if not cc
: cc
= conf
.find_program('cc', var
='CC')
21 if not cc
: conf
.fatal('irixcc was not found')
22 cc
= conf
.cmd_to_list(cc
)
25 if Utils
.cmd_output(cc
+ ['-c99'] + ['-version']) != '':
26 conf
.fatal('irixcc %r was not found' % cc
)
28 conf
.fatal('irixcc -v could not be executed')
30 conf
.env
.append_unique('CCFLAGS', '-c99')
36 def irixcc_common_flags(conf
):
40 v
['CC_TGT_F'] = ['-c', '-o', '']
41 v
['CPPPATH_ST'] = '-I%s' # template for adding include paths
44 if not v
['LINK_CC']: v
['LINK_CC'] = v
['CC']
46 v
['CCLNK_TGT_F'] = ['-o', '']
48 v
['LIB_ST'] = '-l%s' # template for adding libs
49 v
['LIBPATH_ST'] = '-L%s' # template for adding libpaths
50 v
['STATICLIB_ST'] = '-l%s'
51 v
['STATICLIBPATH_ST'] = '-L%s'
52 v
['CCDEFINES_ST'] = '-D%s'
54 # v['SONAME_ST'] = '-Wl,-h -Wl,%s'
55 # v['SHLIB_MARKER'] = '-Bdynamic'
56 # v['STATICLIB_MARKER'] = '-Bstatic'
59 v
['program_PATTERN'] = '%s'
62 # v['shlib_CCFLAGS'] = ['-Kpic', '-DPIC']
63 # v['shlib_LINKFLAGS'] = ['-G']
64 v
['shlib_PATTERN'] = 'lib%s.so'
67 # v['staticlib_LINKFLAGS'] = ['-Bstatic']
68 # v['staticlib_PATTERN'] = 'lib%s.a'