~ubuntu-branches/ubuntu/raring/xmms2/raring

« back to all changes in this revision

Viewing changes to waflib/Tools/d.py

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-11-25 19:23:15 UTC
  • mto: This revision was merged to the branch mainline in revision 51.
  • Revision ID: package-import@ubuntu.com-20121125192315-m9z6nu9wwlzrrz9z
ImportĀ upstreamĀ versionĀ 0.8+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/env python
 
2
# encoding: utf-8
 
3
# WARNING! Do not edit! http://waf.googlecode.com/svn/docs/wafbook/single.html#_obtaining_the_waf_file
 
4
 
 
5
import os,sys
 
6
from waflib import Utils,Task,Errors
 
7
from waflib.TaskGen import taskgen_method,feature,after_method,before_method,extension
 
8
from waflib.Configure import conf
 
9
from waflib.Tools.ccroot import link_task
 
10
from waflib.Tools import d_scan,d_config
 
11
from waflib.Tools.ccroot import link_task,stlink_task
 
12
class d(Task.Task):
 
13
        color='GREEN'
 
14
        run_str='${D} ${DFLAGS} ${DINC_ST:INCPATHS} ${D_SRC_F:SRC} ${D_TGT_F:TGT}'
 
15
        scan=d_scan.scan
 
16
class d_with_header(d):
 
17
        run_str='${D} ${DFLAGS} ${DINC_ST:INCPATHS} ${D_HDR_F:tgt.outputs[1].bldpath()} ${D_SRC_F:SRC} ${D_TGT_F:tgt.outputs[0].bldpath()}'
 
18
class d_header(Task.Task):
 
19
        color='BLUE'
 
20
        run_str='${D} ${D_HEADER} ${SRC}'
 
21
class dprogram(link_task):
 
22
        run_str='${D_LINKER} ${DLNK_SRC_F}${SRC} ${DLNK_TGT_F:TGT} ${RPATH_ST:RPATH} ${DSTLIB_MARKER} ${DSTLIBPATH_ST:STLIBPATH} ${DSTLIB_ST:STLIB} ${DSHLIB_MARKER} ${LIBPATH_ST:LIBPATH} ${DSHLIB_ST:LIB} ${LINKFLAGS}'
 
23
        inst_to='${BINDIR}'
 
24
        chmod=Utils.O755
 
25
class dshlib(dprogram):
 
26
        inst_to='${LIBDIR}'
 
27
class dstlib(stlink_task):
 
28
        pass
 
29
def d_hook(self,node):
 
30
        if getattr(self,'generate_headers',None):
 
31
                task=self.create_compiled_task('d_with_header',node)
 
32
                header_node=node.change_ext(self.env['DHEADER_ext'])
 
33
                task.outputs.append(header_node)
 
34
        else:
 
35
                task=self.create_compiled_task('d',node)
 
36
        return task
 
37
def generate_header(self,filename,install_path=None):
 
38
        try:
 
39
                self.header_lst.append([filename,install_path])
 
40
        except AttributeError:
 
41
                self.header_lst=[[filename,install_path]]
 
42
def process_header(self):
 
43
        for i in getattr(self,'header_lst',[]):
 
44
                node=self.path.find_resource(i[0])
 
45
                if not node:
 
46
                        raise Errors.WafError('file %r not found on d obj'%i[0])
 
47
                self.create_task('d_header',node,node.change_ext('.di'))
 
48
 
 
49
extension('.d','.di','.D')(d_hook)
 
50
taskgen_method(generate_header)
 
51
feature('d')(process_header)
 
 
b'\\ No newline at end of file'