3 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
6 from waflib.Tools import ar,d
7 from waflib.Configure import conf
10 conf.find_program(['dmd','dmd2','ldc'],var='D')
11 out=conf.cmd_and_log(conf.env.D+['--help'])
12 if out.find("D Compiler v")==-1:
13 out=conf.cmd_and_log(conf.env.D+['-version'])
14 if out.find("based on DMD v1.")==-1:
15 conf.fatal("detected compiler is not dmd/ldc")
17 def common_flags_ldc(conf):
19 v['DFLAGS']=['-d-version=Posix']
21 v['DFLAGS_dshlib']=['-relocation-model=pic']
23 def common_flags_dmd(conf):
29 v['DLNK_TGT_F']='-of%s'
31 v['DSHLIB_MARKER']=v['DSTLIB_MARKER']=''
32 v['DSTLIB_ST']=v['DSHLIB_ST']='-L-l%s'
33 v['DSTLIBPATH_ST']=v['DLIBPATH_ST']='-L-L%s'
34 v['LINKFLAGS_dprogram']=['-quiet']
35 v['DFLAGS_dshlib']=['-fPIC']
36 v['LINKFLAGS_dshlib']=['-L-shared']
37 v['DHEADER_ext']='.di'
38 v.DFLAGS_d_with_header=['-H','-Hf']
42 if sys.platform=='win32':
43 out=conf.cmd_and_log(conf.env.D+['--help'])
44 if out.find("D Compiler v2.")>-1:
45 conf.fatal('dmd2 on Windows is not supported, use gdc or ldc2 instead')
48 conf.common_flags_dmd()
49 conf.d_platform_flags()
50 if str(conf.env.D).find('ldc')>-1:
51 conf.common_flags_ldc()