diff options
author | Jörg Frings-Fürst <jff@merkur> | 2014-07-26 11:45:48 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <jff@merkur> | 2014-07-26 11:45:48 +0200 |
commit | 99469e37d07b9f326c5b2c8157566f2f512cdc56 (patch) | |
tree | 475c0ae1b3b3b8be085b54420894896688ea363c /engine/SCons/Tool/link.py | |
parent | 2176ae74d2f856582dd1e498a63a31949a7e19e2 (diff) | |
parent | 7c6b954c00c2a2eed2e975ec797216c515cd249d (diff) |
Merge tag 'upstream/2.3.2'
Upstream version 2.3.2
Diffstat (limited to 'engine/SCons/Tool/link.py')
-rw-r--r-- | engine/SCons/Tool/link.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/engine/SCons/Tool/link.py b/engine/SCons/Tool/link.py index f6e883f..8e299b9 100644 --- a/engine/SCons/Tool/link.py +++ b/engine/SCons/Tool/link.py @@ -9,7 +9,7 @@ selection method. """ # -# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation +# Copyright (c) 2001 - 2014 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/link.py 2014/03/02 14:18:15 garyo" +__revision__ = "src/engine/SCons/Tool/link.py 2014/07/05 09:42:21 garyo" import re @@ -42,6 +42,8 @@ import SCons.Warnings from SCons.Tool.FortranCommon import isfortran +from SCons.Tool.DCommon import isD + cplusplus = __import__('c++', globals(), locals(), []) issued_mixed_link_warning = False @@ -49,7 +51,8 @@ issued_mixed_link_warning = False def smart_link(source, target, env, for_signature): has_cplusplus = cplusplus.iscplusplus(source) has_fortran = isfortran(env, source) - if has_cplusplus and has_fortran: + has_d = isD(env, source) + if has_cplusplus and has_fortran and not has_d: global issued_mixed_link_warning if not issued_mixed_link_warning: msg = "Using $CXX to link Fortran and C++ code together.\n\t" + \ @@ -59,6 +62,10 @@ def smart_link(source, target, env, for_signature): msg % env.subst('$CXX')) issued_mixed_link_warning = True return '$CXX' + elif has_d: + env['LINKCOM'] = env['DLINKCOM'] + env['SHLINKCOM'] = env['SHDLINKCOM'] + return '$DC' elif has_fortran: return '$FORTRAN' elif has_cplusplus: @@ -138,7 +145,7 @@ def shlib_emitter_names(target, source, env): print "shlib_emitter_names: side effect: ", name # add version_name to list of names to be a Side effect version_names.append(version_name) - + except KeyError: version = None return version_names @@ -178,8 +185,8 @@ def generate(env): # don't set up the emitter, cause AppendUnique will generate a list # starting with None :-( env.Append(LDMODULEEMITTER='$SHLIBEMITTER') - env['LDMODULEPREFIX'] = '$SHLIBPREFIX' - env['LDMODULESUFFIX'] = '$SHLIBSUFFIX' + env['LDMODULEPREFIX'] = '$SHLIBPREFIX' + env['LDMODULESUFFIX'] = '$SHLIBSUFFIX' env['LDMODULEFLAGS'] = '$SHLINKFLAGS' env['LDMODULECOM'] = '$LDMODULE -o $TARGET $LDMODULEFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' |