~ubuntu-branches/ubuntu/saucy/xmms2/saucy-proposed

« back to all changes in this revision

Viewing changes to waflib/Tools/bison.py

  • Committer: Package Import Robot
  • Author(s): Benjamin Drung
  • Date: 2012-02-07 17:18:39 UTC
  • mfrom: (38.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20120207171839-89fyv03s32fwoa3h
Tags: 0.8+dfsg-2
* Unpack waf binary (following http://wiki.debian.org/UnpackWaf)
  (Closes: #654512).
* Remove transitional xmms2-plugin-wma package.

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
from waflib import Task
 
6
from waflib.TaskGen import extension
 
7
class bison(Task.Task):
 
8
        color='BLUE'
 
9
        run_str='${BISON} ${BISONFLAGS} ${SRC[0].abspath()} -o ${TGT[0].name}'
 
10
        ext_out=['.h']
 
11
def big_bison(self,node):
 
12
        has_h='-d'in self.env['BISONFLAGS']
 
13
        outs=[]
 
14
        if node.name.endswith('.yc'):
 
15
                outs.append(node.change_ext('.tab.cc'))
 
16
                if has_h:
 
17
                        outs.append(node.change_ext('.tab.hh'))
 
18
        else:
 
19
                outs.append(node.change_ext('.tab.c'))
 
20
                if has_h:
 
21
                        outs.append(node.change_ext('.tab.h'))
 
22
        tsk=self.create_task('bison',node,outs)
 
23
        tsk.cwd=node.parent.get_bld().abspath()
 
24
        self.source.append(outs[0])
 
25
def configure(conf):
 
26
        conf.find_program('bison',var='BISON')
 
27
        conf.env.BISONFLAGS=['-d']
 
28
 
 
29
extension('.y','.yc','.yy')(big_bison)
 
 
b'\\ No newline at end of file'