diff options
author | William Deegan <bill@baddogconsulting.com> | 2020-10-07 22:09:32 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2020-10-07 22:09:32 (GMT) |
commit | c014008bfa4db6a5266e94a725fd1b983f837931 (patch) | |
tree | 62455522d9892ccbec02f5fb78673e3781c2129c | |
parent | 4c3cc667056cec3b8841840f01be908531460a3c (diff) | |
download | SCons-c014008bfa4db6a5266e94a725fd1b983f837931.zip SCons-c014008bfa4db6a5266e94a725fd1b983f837931.tar.gz SCons-c014008bfa4db6a5266e94a725fd1b983f837931.tar.bz2 |
incremental checkin. Updates to README for other developers to review
-rw-r--r-- | SCons/Tool/link.py | 23 | ||||
-rw-r--r-- | SCons/Tool/linkCommon/README.md | 8 | ||||
-rw-r--r-- | SCons/Tool/linkCommon/__init__.py | 13 | ||||
-rw-r--r-- | test/LINK/SHLIBVERSIONFLAGS.py | 29 |
4 files changed, 51 insertions, 22 deletions
diff --git a/SCons/Tool/link.py b/SCons/Tool/link.py index 9d6caef..c552273 100644 --- a/SCons/Tool/link.py +++ b/SCons/Tool/link.py @@ -1,13 +1,7 @@ -"""SCons.Tool.link - -Tool-specific initialization for the generic Posix linker. - -There normally shouldn't be any need to import this module directly. -It will usually be imported through the generic SCons.Tool.Tool() -selection method. - -""" - +# +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -28,6 +22,15 @@ selection method. # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # +""" +Tool-specific initialization for the generic Posix linker. + +There normally shouldn't be any need to import this module directly. +It will usually be imported through the generic SCons.Tool.Tool() +selection method. + +""" + import SCons.Tool import SCons.Util diff --git a/SCons/Tool/linkCommon/README.md b/SCons/Tool/linkCommon/README.md index 26bc9a5..8136490 100644 --- a/SCons/Tool/linkCommon/README.md +++ b/SCons/Tool/linkCommon/README.md @@ -4,7 +4,7 @@ The following env variables can affect the command line and created files for these -* `SHLIBVERSION` +* `SHLIBVERSION` - If this is not set, the all of the following will be ignored? * `SONAME` * `SOVERSION` * `APPLELINK_NO_CURRENT_VERSION` (applelink only) @@ -19,6 +19,7 @@ Which will have a soname baked into it as one of the * `${SONAME}` * `${SHLIBPREFIX}lib_name${SOVERSION}${SHLIBSUFFIX}` +* `-Wl,-soname=$_SHLIBSONAME` (for gnulink as similar) * (for applelink only) * `${SHLIBPREFIX}lib_name${major version only from SHLIBVERSION}${SHLIBSUFFIX}` * `-Wl,-compatibility_version,%s` @@ -31,12 +32,15 @@ For **applelink** the version has to follow these rules to verify that the versi * where Y either not specified or 0-255 * where Z either not specified or 0-255 - For most platforms this will lead to a series of symlinks eventually pointing to the actual shared library (or loadable module file). 1. `${SHLIBPREFIX}lib_name${SHLIBSUFFIX} -> ${SHLIBPREFIX}lib_name${SHLIBVERSION}${SHLIBSUFFIX}` 1. `${SHLIBPREFIX}lib_name${SOVERSION}${SHLIBSUFFIX} -> ${SHLIBPREFIX}lib_name${SHLIBVERSION}${SHLIBSUFFIX}` +These symlinks are stored by the emitter in the following +`target[0].attributes.shliblinks = symlinks` +This means that those values are fixed a the time SharedLibrary() is called (generally) + For **openbsd** the following rules for symlinks apply * OpenBSD uses x.y shared library versioning numbering convention and doesn't use symlinks to backwards-compatible libraries diff --git a/SCons/Tool/linkCommon/__init__.py b/SCons/Tool/linkCommon/__init__.py index d96362a..413b13e 100644 --- a/SCons/Tool/linkCommon/__init__.py +++ b/SCons/Tool/linkCommon/__init__.py @@ -1,8 +1,6 @@ -"""SCons.Tool.linkCommon - -Common link/shared library logic -""" - +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -22,6 +20,11 @@ Common link/shared library logic # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +""" +Common link/shared library logic +""" + import os import re import sys diff --git a/test/LINK/SHLIBVERSIONFLAGS.py b/test/LINK/SHLIBVERSIONFLAGS.py index 6cf7290..7bcabf0 100644 --- a/test/LINK/SHLIBVERSIONFLAGS.py +++ b/test/LINK/SHLIBVERSIONFLAGS.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -22,10 +24,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import os -import re import TestSCons import SCons.Platform @@ -69,15 +68,35 @@ test.write('SConstruct', "SharedLibrary('foo','foo.c',SHLIBVERSION='1.2.3')\n") test.run(stdout = versionflags, match = TestSCons.match_re_dotall) test.run(arguments = ['-c']) -# stdout must contain SHLIBVERSIONFLAGS if there is SHLIBVERSION provided +# stdout must contain SONAME if there is SONAME provided test = TestSCons.TestSCons() test.write('foo.c', foo_c_src) test.write('SConstruct', """ SharedLibrary('foo','foo.c',SHLIBVERSION='1.2.3',SONAME='%s') """ % soname) test.run(stdout = sonameVersionFlags, match = TestSCons.match_re_dotall) +test.must_exist(test.workpath(soname)) test.run(arguments = ['-c']) +# stdout must contain SOVERSION if there is SOVERSION provided +test = TestSCons.TestSCons() +test.write('foo.c', foo_c_src) +test.write('SConstruct', """ +SharedLibrary('foo','foo.c',SHLIBVERSION='1.2.3',SOVERSION='4') +""") +test.run(stdout = sonameVersionFlags, match = TestSCons.match_re_dotall) +test.must_exist(test.workpath(soname)) +test.run(arguments = ['-c']) + +# test if both SONAME and SOVERSION are used +test = TestSCons.TestSCons() +test.write('foo.c', foo_c_src) +test.write('SConstruct', """ +SharedLibrary('foo','foo.c',SHLIBVERSION='1.2.3',SONAME='%s',SOVERSION='4') +""" % soname) +test.run(status=2,stderr=None) +test.must_contain_all_lines(test.stderr(), ['Ambiguous library .so naming']) + test.pass_test() # Local Variables: |