~ubuntu-branches/ubuntu/karmic/xmms2/karmic

« back to all changes in this revision

Viewing changes to wafadmin/Tools/compiler_d.py

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2008-05-29 10:14:25 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080529101425-ycw1nbd980uhvzfp
Tags: 0.4DrKosmos-4ubuntu1
* Merge from debian unstable (LP: #178477), remaining changes:
  - debian/control: Update Maintainer field
  - debian/control: add lpia to xmms2-plugin-alsa supported architectures
* This version reads AAC files (LP: #156359)

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
 
 
5
import os, sys, imp, types
 
6
import optparse
 
7
import Utils, Action, Params, checks, Configure
 
8
 
 
9
def setup(env):
 
10
        pass
 
11
 
 
12
def detect(conf):
 
13
        if Params.g_options.check_dmd_first:
 
14
                test_for_compiler = ['dmd', 'gdc']
 
15
        else:
 
16
                test_for_compiler = ['gdc', 'dmd']
 
17
 
 
18
        for d_compiler in test_for_compiler:
 
19
                if conf.check_tool(d_compiler):
 
20
                        conf.check_message("%s" % d_compiler, '', True)
 
21
                        return (1)
 
22
                conf.check_message("%s" % d_compiler, '', False)
 
23
        return 0
 
24
 
 
25
def set_options(opt):
 
26
        d_compiler_opts = opt.add_option_group("D Compiler Options")
 
27
        try:
 
28
                d_compiler_opts.add_option('--check-dmd-first', action = "store_true", help = 'checks for the gdc compiler before dmd (default is the other way round)', dest = 'check_dmd_first',default = False)
 
29
        except optparse.OptionConflictError:
 
30
                # the g++ tool might have added that option already
 
31
                pass
 
32
 
 
33
        for d_compiler in ['gdc', 'dmd']:
 
34
                opt.tool_options('%s' % d_compiler, option_group=d_compiler_opts)
 
35