You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@serf.apache.org by br...@apache.org on 2018/05/08 18:42:42 UTC

svn commit: r1831201 - /serf/trunk/SConstruct

Author: brane
Date: Tue May  8 18:42:42 2018
New Revision: 1831201

URL: http://svn.apache.org/viewvc?rev=1831201&view=rev
Log:
Hack the library versions back into macOS dynamic libraries.

* SConstruct: Use explicit linker flags to set macOS .dylib options
   current_version and compatibility_version, which were broken by
   the SCons 2.4.1 release.

Modified:
    serf/trunk/SConstruct

Modified: serf/trunk/SConstruct
URL: http://svn.apache.org/viewvc/serf/trunk/SConstruct?rev=1831201&r1=1831200&r2=1831201&view=diff
==============================================================================
--- serf/trunk/SConstruct (original)
+++ serf/trunk/SConstruct Tue May  8 18:42:42 2018
@@ -231,13 +231,18 @@ libdir = '$LIBDIR'
 incdir = '$PREFIX/include/serf-$MAJOR'
 
 # This version string is used in the dynamic library name, and for Mac OS X also
-# for the current_version and compatibility_version options in the .dylib
-#
-# Unfortunately we can't set the .dylib compatibility_version option separately
-# from current_version, so don't use the PATCH level to avoid that build and
-# runtime patch levels have to be identical.
+# for the compatibility_version option in the .dylib.
+soversion = '%d.%d.%d' % (MAJOR, MINOR, 0)
+libversion = '%d.%d.%d' % (MAJOR, MINOR, PATCH)
 if sys.platform != 'sunos5':
-  env['SHLIBVERSION'] = '%d.%d.%d' % (MAJOR, MINOR, 0)
+  env['SHLIBVERSION'] = soversion
+
+# XXX Since SCons 2.4.1, the SHLIBVERSION variable is no longer used to set the
+# shared library versions on Mac OS X, so we add explicit linker flags to set
+# the current_version and compatibility_version options.
+if sys.platform == 'darwin':
+  env.Append(LINKFLAGS=['-Wl,-current_version,' + libversion,
+                        '-Wl,-compatibility_version,' + soversion])
 
 LIBNAME   = '%sserf-%d' % (env['LIBPREFIX'], MAJOR)
 if sys.platform == 'win32':