summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2010-07-23 05:13:23 (GMT)
committerSteven Knight <knight@baldmt.com>2010-07-23 05:13:23 (GMT)
commit6edc938ac25bfbb9c6a0ae0cd539121ffb40f67f (patch)
tree9232be5dd8a10564b09ca4f12f769ba3814fb3e7 /src/engine
parent68ac24295c5783711065c0981408628d11813761 (diff)
downloadSCons-6edc938ac25bfbb9c6a0ae0cd539121ffb40f67f.zip
SCons-6edc938ac25bfbb9c6a0ae0cd539121ffb40f67f.tar.gz
SCons-6edc938ac25bfbb9c6a0ae0cd539121ffb40f67f.tar.bz2
Issue 2549: Add support for DMD version 2. (Russel Winder)
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/SCons/Tool/dmd.py27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/engine/SCons/Tool/dmd.py b/src/engine/SCons/Tool/dmd.py
index d7156dd..a8faf5d 100644
--- a/src/engine/SCons/Tool/dmd.py
+++ b/src/engine/SCons/Tool/dmd.py
@@ -6,6 +6,9 @@ Tool-specific initialization for the Digital Mars D compiler.
Coded by Andy Friesen (andy@ikagames.com)
15 November 2003
+Amended by Russel Winder (russel@russel.org.uk)
+2010-02-07
+
There are a number of problems with this script at this point in time.
The one that irritates me the most is the Windows linker setup. The D
linker doesn't have a way to add lib paths on the commandline, as far
@@ -199,11 +202,25 @@ def generate(env):
libs = env['LIBS']
except KeyError:
libs = []
- if 'phobos' not in libs and 'gphobos' not in libs:
- if dc is 'dmd':
- env.Append(LIBS = ['phobos'])
- elif dc is 'gdmd':
- env.Append(LIBS = ['gphobos'])
+ if dc == 'dmd':
+ # TODO: This assumes that the dmd executable is in the
+ # bin directory and that the libraries are in a peer
+ # directory lib. This true of the Digital Mars
+ # distribution but . . .
+ import glob
+ dHome = env.WhereIs(dc).replace('/dmd' , '/..')
+ if glob.glob(dHome + '/lib/*phobos2*'):
+ if 'phobos2' not in libs:
+ env.Append(LIBPATH = [dHome + '/lib'])
+ env.Append(LIBS = ['phobos2'])
+ # TODO: Find out when there will be a
+ # 64-bit version of D.
+ env.Append(LINKFLAGS = ['-m32'])
+ else:
+ if 'phobos' not in libs:
+ env.Append(LIBS = ['phobos'])
+ elif dc is 'gdmd':
+ env.Append(LIBS = ['gphobos'])
if 'pthread' not in libs:
env.Append(LIBS = ['pthread'])
if 'm' not in libs: