s3: reduce db_ctdb_marshall_loop_next to specialized db_ctdb_marshall_buf_parse
[Samba/gebeck_regimport.git] / buildtools / wafadmin / Tools / dmd.py
blob9c7490844db04328b81d34cc72c921f8a25c4758
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # Carlos Rafael Giani, 2007 (dv)
4 # Thomas Nagy, 2008 (ita)
6 import sys
7 import Utils, ar
8 from Configure import conftest
10 @conftest
11 def find_dmd(conf):
12 conf.find_program(['dmd', 'ldc'], var='D_COMPILER', mandatory=True)
14 @conftest
15 def common_flags_ldc(conf):
16 v = conf.env
17 v['DFLAGS'] = ['-d-version=Posix']
18 v['DLINKFLAGS'] = []
19 v['D_shlib_DFLAGS'] = ['-relocation-model=pic']
21 @conftest
22 def common_flags_dmd(conf):
23 v = conf.env
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']
31 v['D_SRC_F'] = ''
32 v['D_TGT_F'] = ['-c', '-of']
33 v['DPATH_ST'] = '-I%s' # template for adding import paths
35 # linker
36 v['D_LINKER'] = v['D_COMPILER']
37 v['DLNK_SRC_F'] = ''
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
43 # linker debug levels
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']
55 def detect(conf):
56 conf.find_dmd()
57 conf.check_tool('ar')
58 conf.check_tool('d')
59 conf.common_flags_dmd()
60 conf.d_platform_flags()
62 if conf.env.D_COMPILER.find('ldc') > -1:
63 conf.common_flags_ldc()