[Scons-dev] Issue 2869 - Versioned shared libraries
Managan, Rob
managan1 at llnl.gov
Wed Nov 7 12:06:51 EST 2012
Russel,
I am about to add a test to that repo. I have attached it as a zip file.
Try that and you will see what links are already built into the system I
have created.
For OSX you get the version number added to the real file name and a link
(w/o version number) to that file.
It would be great to get feedback from someone really using it for a real
application and can point out things that did not occur to me!
While the example does not do this, I recommend that you create the
environment with SHLIBVERSION, instead of defining it on the env.SharedLib
command which just defines that for the build and not the install step.
On OSX you get:
scons: Reading SConscript files ...
SHLIBVERSION '' does not match the version # '2.5.4' in the filename,
proceeding based on file name
scons: done reading SConscript files.
scons: Building targets ...
gcc -o test.os -c -fPIC test.c
gcc -o libtest.2.5.4.dylib -dynamiclib -current_version 2.5.4
-compatibility_version 2.5.4 -undefined dynamic_lookup test.os
Install file: "libtest.2.5.4.dylib" as
"/Users/managan1/My_Downloads/install_test/libtest.2.5.4.dylib"
SHLIBVERSION '' does not match the version # '2.5.4' in the filename,
proceeding based on file name
scons: done building targets.
ll . ../install_test/
.:
total 56
-rw-r--r--@ 1 managan1 staff 352 Nov 2 10:31 SConstruct
-rwxr-xr-x 1 managan1 staff 4192 Nov 7 09:00 libtest.2.5.4.dylib*
lrwxr-xr-x 1 managan1 staff 19 Nov 7 09:00 libtest.dylib@ ->
libtest.2.5.4.dylib
-rw-r--r--@ 1 managan1 staff 37 Oct 15 06:57 test.c
-rw-r--r-- 1 managan1 staff 568 Nov 7 09:00 test.os
-rw-r--r--@ 1 managan1 staff 146 Oct 26 13:33 testapp.c
../install_test/:
total 24
-rwxr-xr-x 1 managan1 staff 4192 Nov 7 09:00 libtest.2.5.4.dylib*
lrwxr-xr-x 1 managan1 staff 19 Nov 7 09:00 libtest.dylib@ ->
libtest.2.5.4.dylib
On posix systems the version number comes after the .so instead of before
the .dylib and there are two additional symlinks, lib test.so.2, lib
test.so.2.5,...
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Rob Managan email managan at llnl.gov
LLNL phone: 925-423-0903
P.O. Box 808, L-095 FAX: 925-422-3389
Livermore, CA 94551-0808
On 11/7/12 8:47 AM, "Russel Winder" <russel at winder.org.uk> wrote:
>Rob,
>
>I have a SCons build and install of a shared and static library that I
>can run on Linux and OS X, would it help to try this? The proble, is I
>have a whole load of hacks in there to do all the symbolic link and
>soname creation, so wopuld need a little guidance as to what is done in
>the new SCons variant.
>
>--
>Russel.
>==========================================================================
>===
>Dr Russel Winder t: +44 20 7585 2200 voip:
>sip:russel.winder at ekiga.net
>41 Buckmaster Road m: +44 7770 465 077 xmpp: russel at winder.org.uk
>London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_so2.zip
Type: application/zip
Size: 5457 bytes
Desc: test_so2.zip
Url : <http://two.pairlist.net/pipermail/scons-dev/attachments/20121107/d63c42fa/attachment.zip>
More information about the Scons-dev
mailing list