source: vendor/current/buildtools/wafsamba/generic_cc.py

Last change on this file was 988, checked in by Silvan Scherrer, 9 years ago

Samba Server: update vendor to version 4.4.3

File size: 1.8 KB
Line 
1
2# compiler definition for a generic C compiler
3# based on suncc.py from waf
4
5import os, optparse
6import Utils, Options, Configure
7import ccroot, ar
8from Configure import conftest
9
10from compiler_cc import c_compiler
11
12c_compiler['default'] = ['gcc', 'generic_cc']
13c_compiler['hpux'] = ['gcc', 'generic_cc']
14
15@conftest
16def find_generic_cc(conf):
17 v = conf.env
18 cc = None
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)
24 v['CC'] = cc
25 v['CC_NAME'] = 'generic'
26
27@conftest
28def generic_cc_common_flags(conf):
29 v = conf.env
30
31 v['CC_SRC_F'] = ''
32 v['CC_TGT_F'] = ['-c', '-o', '']
33 v['CPPPATH_ST'] = '-I%s' # template for adding include paths
34
35 # linker
36 if not v['LINK_CC']: v['LINK_CC'] = v['CC']
37 v['CCLNK_SRC_F'] = ''
38 v['CCLNK_TGT_F'] = ['-o', '']
39
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'
45
46# v['SONAME_ST'] = '-Wl,-h -Wl,%s'
47# v['SHLIB_MARKER'] = '-Bdynamic'
48# v['STATICLIB_MARKER'] = '-Bstatic'
49
50 # program
51 v['program_PATTERN'] = '%s'
52
53 # shared library
54# v['shlib_CCFLAGS'] = ['-Kpic', '-DPIC']
55# v['shlib_LINKFLAGS'] = ['-G']
56 v['shlib_PATTERN'] = 'lib%s.so'
57
58 # static lib
59# v['staticlib_LINKFLAGS'] = ['-Bstatic']
60# v['staticlib_PATTERN'] = 'lib%s.a'
61
62detect = '''
63find_generic_cc
64find_cpp
65find_ar
66generic_cc_common_flags
67cc_load_tools
68cc_add_flags
69link_add_flags
70'''
71
Note: See TracBrowser for help on using the repository browser.