[Scons-users] Versioned Shareable Library issues #2

LRN lrn1986 at gmail.com
Tue Aug 20 05:46:04 EDT 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

When building shared library with mingw, i get:

scons: Reading SConscript files ...
IndexError: list index out of range:
File "site-packages\scons-2.3.0\SCons\Tool\link.py", line 79:
target[0].name = version_names[0]

Problem is, shlib_emitter_names() is not implemented completely, and
lacks a piece of code that would emit names for mingw (only has posix
and darwin sections).

Here's a crude hack that fixes this.

Note that the correct way of naming versioned shared libraries (at least
on W32) is to only use the major version. Minor or micro version bump
does not break binary compatibility (that is the convention), thus it's
ok for programs to keep using libfoobar-<major>.dll as long as <major>
stays the same, even if minor and micro versions change.
This must be enforced at build time, as shared library basename is
hardcoded into the import library[1].

[1] And don't get me started on how SCons can't even name import
libraries properly...

- --
O< ascii ribbon - stop html email! - www.asciiribbon.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)

iQEcBAEBAgAGBQJSEzrcAAoJEOs4Jb6SI2CwMNcH/3OmoskcfzeXxz5Pe+uCfEUr
PbCivNfQc/a2bcTOnD9vxWAai9meCxERD3r+m49HQ03a7VOcYuKycA3Iv6TGx5A4
kh163aFNZUqxx1hPT4BBFuGXU483SL4a4NzrpshC/EUTwQPEngMD5z8FZx9Jr+Mf
1FHnM2njuXegcVeP3/G1FjEJR1EUC+C/AeQgCsDGjo8lJBhpcbJVg93IxkrGFuVE
CzKOStx7OS5gFOB+jSchryJLZNlE1k3QzVTVLHju5UQG7/835uQE0ymLYP6hgHYX
LARyAPIK4NMK8ANM3uu/2NsrwHP7D3xd7g/LPLvsE5118QanL0Aks8vr2Sk6qOA=
=YGNM
-----END PGP SIGNATURE-----
-------------- next part --------------
--- scons-2.3.0/SCons/Tool/link.py.orig 2013-03-03 14:48:40.000000000 +0000
+++ scons-2.3.0/SCons/Tool/link.py 2013-08-20 09:27:22.824543400 +0000
@@ -127,6 +127,30 @@
print "shlib_emitter_names: side effect: ", name
# add version_name to list of names to be a Side effect
version_names.append(version_name)
+ elif platform == 'win32':
+ versionparts = version.split('.')
+ name = target[0].name
+ dll = ""
+ if target[0].name.endswith ('.dll'):
+ dll = ".dll"
+ name = name[:-4]
+ # generate library name with the version number
+ version_name = name + '-' + version[0] + dll
+ if Verbose:
+ print "shlib_emitter_names: target is ", version_name
+ print "shlib_emitter_names: side effect: ", name
+ # add version_name to list of names to be a Side effect
+ version_names.append(version_name)
+ if Verbose:
+ print "shlib_emitter_names: versionparts ",versionparts
+ acc_ver = versionparts[0]
+ for ver in versionparts[1:]:
+ acc_ver += '.' + ver
+ vname = name + '-' + acc_ver + dll
+ if Verbose:
+ print "shlib_emitter_names: side effect: ", vname
+ # add name to list of names to be a Side effect
+ version_names.append(vname)
except KeyError:
version = None
return version_names


More information about the Scons-users mailing list