summaryrefslogtreecommitdiff
path: root/buildtools/wafadmin/Tools/compiler_d.py
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-01-04 00:31:27 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-01-04 22:34:20 +0100
commit4f4bce5301ffd8c12aed1b108affa1a75feefb67 (patch)
tree1607accd70a2c37a9b996f7b42ec926b014cfe5b /buildtools/wafadmin/Tools/compiler_d.py
parent1b45f2aed86dda9fda6e6bcf1c9c7cbdc471c18d (diff)
downloadsamba-4f4bce5301ffd8c12aed1b108affa1a75feefb67.tar.gz
samba-4f4bce5301ffd8c12aed1b108affa1a75feefb67.tar.bz2
samba-4f4bce5301ffd8c12aed1b108affa1a75feefb67.zip
Include waf as an extracted source directory, rather than as a one-in-a-file script.
Diffstat (limited to 'buildtools/wafadmin/Tools/compiler_d.py')
-rw-r--r--buildtools/wafadmin/Tools/compiler_d.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/buildtools/wafadmin/Tools/compiler_d.py b/buildtools/wafadmin/Tools/compiler_d.py
new file mode 100644
index 0000000000..1ea5efa30e
--- /dev/null
+++ b/buildtools/wafadmin/Tools/compiler_d.py
@@ -0,0 +1,33 @@
+#!/usr/bin/env python
+# encoding: utf-8
+# Carlos Rafael Giani, 2007 (dv)
+
+import os, sys, imp, types
+import Utils, Configure, Options
+
+def detect(conf):
+ if getattr(Options.options, 'check_dmd_first', None):
+ test_for_compiler = ['dmd', 'gdc']
+ else:
+ test_for_compiler = ['gdc', 'dmd']
+
+ for d_compiler in test_for_compiler:
+ try:
+ conf.check_tool(d_compiler)
+ except:
+ pass
+ else:
+ break
+ else:
+ conf.fatal('no suitable d compiler was found')
+
+def set_options(opt):
+ d_compiler_opts = opt.add_option_group('D Compiler Options')
+ 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)
+
+ for d_compiler in ['gdc', 'dmd']:
+ opt.tool_options('%s' % d_compiler, option_group=d_compiler_opts)
+