2 # compiler definition for a generic C 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
['default'] = ['gcc', 'generic_cc']
13 c_compiler
['hpux'] = ['gcc', 'generic_cc']
16 def find_generic_cc(conf
):
19 if v
['CC']: cc
= v
['CC']
20 elif 'CC' in conf
.environ
: cc
= conf
.environ
['CC']
21 if not cc
: cc
= conf
.find_program('cc', var
='CC')
22 if not cc
: conf
.fatal('generic_cc was not found')
23 cc
= conf
.cmd_to_list(cc
)
25 v
['CC_NAME'] = 'generic'
28 def generic_cc_common_flags(conf
):
32 v
['CC_TGT_F'] = ['-c', '-o', '']
33 v
['CPPPATH_ST'] = '-I%s' # template for adding include paths
36 if not v
['LINK_CC']: v
['LINK_CC'] = v
['CC']
38 v
['CCLNK_TGT_F'] = ['-o', '']
40 v
['LIB_ST'] = '-l%s' # template for adding libs
41 v
['LIBPATH_ST'] = '-L%s' # template for adding libpaths
42 v
['STATICLIB_ST'] = '-l%s'
43 v
['STATICLIBPATH_ST'] = '-L%s'
44 v
['CCDEFINES_ST'] = '-D%s'
46 # v['SONAME_ST'] = '-Wl,-h -Wl,%s'
47 # v['SHLIB_MARKER'] = '-Bdynamic'
48 # v['STATICLIB_MARKER'] = '-Bstatic'
51 v
['program_PATTERN'] = '%s'
54 # v['shlib_CCFLAGS'] = ['-Kpic', '-DPIC']
55 # v['shlib_LINKFLAGS'] = ['-G']
56 v
['shlib_PATTERN'] = 'lib%s.so'
59 # v['staticlib_LINKFLAGS'] = ['-Bstatic']
60 # v['staticlib_PATTERN'] = 'lib%s.a'
66 generic_cc_common_flags