summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-01-15 01:28:31 (GMT)
committerSteven Knight <knight@baldmt.com>2003-01-15 01:28:31 (GMT)
commit64d27f9efc30088f70214b4585b83707c56f6c0a (patch)
tree032614050226717b9da589a3a669562488fcace5 /src
parent6bc341a516112626e301004808205731f4bc4c9e (diff)
downloadSCons-64d27f9efc30088f70214b4585b83707c56f6c0a.zip
SCons-64d27f9efc30088f70214b4585b83707c56f6c0a.tar.gz
SCons-64d27f9efc30088f70214b4585b83707c56f6c0a.tar.bz2
Add .def file support to the mingw tool. (Anthony Roach)
Diffstat (limited to 'src')
-rw-r--r--src/engine/SCons/Tool/mingw.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/engine/SCons/Tool/mingw.py b/src/engine/SCons/Tool/mingw.py
index 7221cd6..d0f1eaf 100644
--- a/src/engine/SCons/Tool/mingw.py
+++ b/src/engine/SCons/Tool/mingw.py
@@ -57,6 +57,9 @@ def shlib_generator(target, source, env, for_signature):
implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')
if implib: cmd.append('-Wl,--out-implib,'+str(implib))
+ def_target = env.FindIxes(target, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')
+ if def_target: cmd.append('-Wl,--output-def,'+str(def_target))
+
return [cmd]
def shlib_emitter(target, source, env):
@@ -73,6 +76,17 @@ def shlib_emitter(target, source, env):
target.append(env.ReplaceIxes(dll,
'SHLIBPREFIX', 'SHLIBSUFFIX',
'LIBPREFIX', 'LIBSUFFIX'))
+
+ # Append a def file target if there isn't already a def file target
+ # or a def file source. There is no option to disable def file
+ # target emitting, because I can't figure out why someone would ever
+ # want to turn it off.
+ def_source = env.FindIxes(source, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')
+ def_target = env.FindIxes(target, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')
+ if not def_source and not def_target:
+ target.append(env.ReplaceIxes(dll,
+ 'SHLIBPREFIX', 'SHLIBSUFFIX',
+ 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX'))
return (target, source)
@@ -112,6 +126,8 @@ def generate(env, platform):
env['SHLIBEMITTER']= shlib_emitter
env['LINK'] = 'g++'
env['AS'] = 'as'
+ env['WIN32DEFPREFIX'] = ''
+ env['WIN32DEFSUFFIX'] = '.def'
env['RC'] = 'windres'
env['RCFLAGS'] = ''