summaryrefslogtreecommitdiff
path: root/src/engine/SCons/Tool/gdc.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/Tool/gdc.py')
-rw-r--r--src/engine/SCons/Tool/gdc.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/engine/SCons/Tool/gdc.py b/src/engine/SCons/Tool/gdc.py
index 7a67501..e1d2c9c 100644
--- a/src/engine/SCons/Tool/gdc.py
+++ b/src/engine/SCons/Tool/gdc.py
@@ -46,7 +46,7 @@ Lib tool variables:
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Tool/gdc.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/gdc.py rel_2.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
import SCons.Action
import SCons.Defaults
@@ -97,7 +97,7 @@ def generate(env):
env['DSHLINK'] = '$DC'
env['DSHLINKFLAGS'] = SCons.Util.CLVar('$DLINKFLAGS -shared')
- env['SHDLINKCOM'] = '$DLINK -o $TARGET $DSHLINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
+ env['SHDLINKCOM'] = '$DLINK -o $TARGET $DSHLINKFLAGS $__DSHLIBVERSIONFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
env['DLIB'] = 'lib' if env['PLATFORM'] == 'win32' else 'ar cr'
env['DLIBCOM'] = '$DLIB $_DLIBFLAGS {0}$TARGET $SOURCES $_DLINKLIBFLAGS'.format('-c ' if env['PLATFORM'] == 'win32' else '')
@@ -115,6 +115,17 @@ def generate(env):
env['RPATHSUFFIX'] = ''
env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'
+ # Support for versioned libraries
+ env['_DSHLIBVERSIONFLAGS'] = '$DSHLIBVERSIONFLAGS -Wl,-soname=$_DSHLIBSONAME'
+ env['_DSHLIBSONAME'] = '${DShLibSonameGenerator(__env__,TARGET)}'
+ # NOTE: this is a quick hack, the soname will only work if there is
+ # c/c++ linker loaded which provides callback for the ShLibSonameGenerator
+ env['DShLibSonameGenerator'] = SCons.Tool.ShLibSonameGenerator
+ # NOTE: this is only for further reference, currently $DSHLIBVERSION does
+ # not work, the user must use $SHLIBVERSION
+ env['DSHLIBVERSION'] = '$SHLIBVERSION'
+ env['DSHLIBVERSIONFLAGS'] = '$SHLIBVERSIONFLAGS'
+
SCons.Tool.createStaticLibBuilder(env)