~ubuntu-branches/ubuntu/trusty/ldb/trusty-proposed

« back to all changes in this revision

Viewing changes to buildtools/wafadmin/Tools/dmd.py

  • Committer: Package Import Robot
  • Author(s): Jelmer Vernooij
  • Date: 2012-02-07 16:04:26 UTC
  • mfrom: (1.3.11)
  • Revision ID: package-import@ubuntu.com-20120207160426-hz17vq8gs1epwkf2
Tags: 1:1.1.4+git20120206-1
* New upstream snapshot.
 + Extracts waf source code. Closes: #654482
 + Disable tdb2 support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
# encoding: utf-8
 
3
# Carlos Rafael Giani, 2007 (dv)
 
4
# Thomas Nagy, 2008 (ita)
 
5
 
 
6
import sys
 
7
import Utils, ar
 
8
from Configure import conftest
 
9
 
 
10
@conftest
 
11
def find_dmd(conf):
 
12
        conf.find_program(['dmd', 'ldc'], var='D_COMPILER', mandatory=True)
 
13
 
 
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']
 
20
 
 
21
@conftest
 
22
def common_flags_dmd(conf):
 
23
        v = conf.env
 
24
 
 
25
        # _DFLAGS _DIMPORTFLAGS
 
26
 
 
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']
 
30
 
 
31
        v['D_SRC_F']           = ''
 
32
        v['D_TGT_F']           = ['-c', '-of']
 
33
        v['DPATH_ST']          = '-I%s' # template for adding import paths
 
34
 
 
35
        # linker
 
36
        v['D_LINKER']          = v['D_COMPILER']
 
37
        v['DLNK_SRC_F']        = ''
 
38
        v['DLNK_TGT_F']        = '-of'
 
39
 
 
40
        v['DLIB_ST']           = '-L-l%s' # template for adding libs
 
41
        v['DLIBPATH_ST']       = '-L-L%s' # template for adding libpaths
 
42
 
 
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']
 
48
 
 
49
        v['D_shlib_DFLAGS']    = ['-fPIC']
 
50
        v['D_shlib_LINKFLAGS'] = ['-L-shared']
 
51
 
 
52
        v['DHEADER_ext']       = '.di'
 
53
        v['D_HDR_F']           = ['-H', '-Hf']
 
54
 
 
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()
 
61
 
 
62
        if conf.env.D_COMPILER.find('ldc') > -1:
 
63
                conf.common_flags_ldc()
 
64