Package wafadmin :: Package Tools :: Module gdc
[hide private]
[frames] | no frames]

Source Code for Module wafadmin.Tools.gdc

 1  #!/usr/bin/env python 
 2  # encoding: utf-8 
 3  # Carlos Rafael Giani, 2007 (dv) 
 4   
 5  import sys 
 6  import ar 
 7   
8 -def find_gdc(conf):
9 v = conf.env 10 d_compiler = None 11 if v['D_COMPILER']: 12 d_compiler = v['D_COMPILER'] 13 if not d_compiler: d_compiler = conf.find_program('gdc', var='D_COMPILER') 14 if not d_compiler: return 0 15 v['D_COMPILER'] = d_compiler
16
17 -def common_flags(conf):
18 v = conf.env 19 20 # _DFLAGS _DIMPORTFLAGS _DLIBDIRFLAGS _DLIBFLAGS 21 22 # for mory info about the meaning of this dict see dmd.py 23 v['DFLAGS'] = {'gdc':[], 'dmd':[]} 24 25 v['D_SRC_F'] = '' 26 v['D_TGT_F'] = '-c -o ' 27 v['DPATH_ST'] = '-I%s' # template for adding import paths 28 29 # linker 30 v['D_LINKER'] = v['D_COMPILER'] 31 v['DLNK_SRC_F'] = '' 32 v['DLNK_TGT_F'] = '-o ' 33 34 v['DLIB_ST'] = '-l%s' # template for adding libs 35 v['DLIBPATH_ST'] = '-L%s' # template for adding libpaths 36 37 # debug levels 38 v['DLINKFLAGS'] = [] 39 v['DFLAGS_OPTIMIZED'] = ['-O3'] 40 v['DFLAGS_DEBUG'] = ['-O0'] 41 v['DFLAGS_ULTRADEBUG'] = ['-O0'] 42 43 v['D_shlib_DFLAGS'] = [] 44 v['D_shlib_LINKFLAGS'] = ['-shared'] 45 46 v['DHEADER_ext'] = '.di' 47 v['D_HDR_F'] = '-fintfc -fintfc-file=' 48 49 if sys.platform == "win32": 50 v['D_program_PATTERN'] = '%s.exe' 51 v['D_shlib_PATTERN'] = 'lib%s.dll' 52 v['D_staticlib_PATTERN'] = 'lib%s.a' 53 else: 54 v['D_program_PATTERN'] = '%s' 55 v['D_shlib_PATTERN'] = 'lib%s.so' 56 v['D_staticlib_PATTERN'] = 'lib%s.a'
57
58 -def detect(conf):
59 v = conf.env 60 find_gdc(conf) 61 ar.find_ar(conf) 62 conf.check_tool('d') 63 common_flags(conf)
64
65 -def set_options(opt):
66 pass
67