3 # Carlos Rafael Giani, 2007 (dv)
4 # Thomas Nagy, 2008 (ita)
8 from Configure import conftest
12 conf.find_program(['dmd', 'ldc'], var='D_COMPILER', mandatory=True)
15 def common_flags_ldc(conf):
17 v['DFLAGS'] = ['-d-version=Posix']
19 v['D_shlib_DFLAGS'] = ['-relocation-model=pic']
22 def common_flags_dmd(conf):
25 # _DFLAGS _DIMPORTFLAGS
27 # Compiler is dmd so 'gdc' part will be ignored, just
28 # ensure key is there, so wscript can append flags to it
29 v['DFLAGS'] = ['-version=Posix']
32 v['D_TGT_F'] = ['-c', '-of']
33 v['DPATH_ST'] = '-I%s' # template for adding import paths
36 v['D_LINKER'] = v['D_COMPILER']
38 v['DLNK_TGT_F'] = '-of'
40 v['DLIB_ST'] = '-L-l%s' # template for adding libs
41 v['DLIBPATH_ST'] = '-L-L%s' # template for adding libpaths
44 v['DFLAGS_OPTIMIZED'] = ['-O']
45 v['DFLAGS_DEBUG'] = ['-g', '-debug']
46 v['DFLAGS_ULTRADEBUG'] = ['-g', '-debug']
47 v['DLINKFLAGS'] = ['-quiet']
49 v['D_shlib_DFLAGS'] = ['-fPIC']
50 v['D_shlib_LINKFLAGS'] = ['-L-shared']
52 v['DHEADER_ext'] = '.di'
53 v['D_HDR_F'] = ['-H', '-Hf']
59 conf.common_flags_dmd()
60 conf.d_platform_flags()
62 if conf.env.D_COMPILER.find('ldc') > -1:
63 conf.common_flags_ldc()