[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

another [PATCH] --enable-soname-depend-on-apr

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2006-04-11 03:37:15 CEST

"Justin Erenkrantz" <justin@erenkrantz.com> writes:

> On 4/10/06, Philip Martin <philip@codematters.co.uk> wrote:
>> I don't understand, are you claiming that a third-party application
>> must use libtool?
>
> If they are linking against our libraries, yes.
>
> Linking against our libraries will only work consistently across all
> supported platforms if the downstream app uses libtool. libtool has
> the ability to tweak internal link options that we didn't know were
> being touched. Therefore, if you try to bypass libtool and use the
> bare linker, you may not select the right linker flags or dependencies
> on specific platforms.

I don't think libtool is necessary on an ELF platform. Of course all
sorts of compiler flags could break the ABI, but once again I am not
interested in corner cases. Subversion's own Perl bindings don't use
libtool, and while the perl bindings have problems (ones that would
not apply to a third-party user of the Subversion libraries) it does
indicate that libtool is not strictly necessary. If libtool were to
produce libraries that were incompatible with "standard" shared
libraries on a platform which has good support for such libraries then
I think that would be a libtool bug.

>> Are we talking at cross purposes on libtool? I'm proposing a patch
>> along the lines of Peter's patch, but under some --enable-foo flag and
>> possibly restricting APR to either 0.9.x or 1.2.x
>
> Which patch are you referring to specifically?

http://svn.haxx.se/dev/archive-2006-03/0522.shtml

> If you want to tweak
> the SONAME, you have to alter libtool as it produces the SONAMEs - not
> Subversion. The feature Peter wanted was to install multiple versions
> of the SVN libraries in the same directory but have them linked
> against different APRs. Like so:
>
> libsvn_fs-1.so.0.0.0.APR0APRUTIL0
> libsvn_fs-1.so.0.0.0.APR1APRUTIL1

Not quite, Peter's patch produced a SONAME like libsvn_fs-1.so.1 so
the library would be libsvn_fs-1.so.1.0.0.

I'd suggest a patch where APR 0.9.x leads to libsvn_fs-1.so.0.0.0, as
at present, and APR 1.2.x produces libsvn_fs-1.so.1.0.0, with
everything else being an error. Not tested, but something like:

Index: Makefile.in
===================================================================
--- Makefile.in (revision 19191)
+++ Makefile.in (working copy)
@@ -92,6 +92,7 @@
 SHELL = @SHELL@
 LIBTOOL = @SVN_LIBTOOL@
 LTFLAGS = @SVN_LT_CCTAG@ --silent
+LT_SOVERSION = @SVN_LT_SOVERSION@
 LTCXXFLAGS = @SVN_LT_CXXTAG@ --silent
 LT_LDFLAGS = @LT_LDFLAGS@
 LT_NO_UNDEFINED = @LT_NO_UNDEFINED@
@@ -156,7 +157,7 @@
 COMPILE_JAVAHL_JAVAC = $(JAVAC) $(JAVAC_FLAGS)
 COMPILE_JAVAHL_JAVAH = $(JAVAH)
 
-LINK = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(CFLAGS) $(LDFLAGS) -rpath $(libdir)
+LINK = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(CFLAGS) $(LDFLAGS) $(LT_SOVERSION) -rpath $(libdir)
 
 # special link rule for mod_dav_svn
 LINK_APACHE_MOD = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(CFLAGS) $(LDFLAGS) -rpath $(APACHE_LIBEXECDIR) -avoid-version -module $(APACHE_LDFLAGS)
Index: configure.in
===================================================================
--- configure.in (revision 19191)
+++ configure.in (working copy)
@@ -58,6 +58,28 @@
 SVN_LIB_APR($APR_VER_REGEXES)
 SVN_LIB_APRUTIL($APU_VER_REGEXES)
 
+SVN_LT_SOVERSION="-version-info 0"
+AC_ARG_ENABLE(soname-depend-on-apr,
+ AC_HELP_STRING([--enable-soname-depend-on-apr],
+ [make the Subversion SONAME depend on the APR version]),
+ [
+ if test "$enableval" = "yes" ; then
+ AC_MSG_CHECKING([which Subversion SONAME to use])
+ if test `expr $apr_version : 0.9` -ne 0; then
+ AC_MSG_RESULT([libsvn_xxx-1.so.0])
+ else
+ if test `expr $apr_version : 1.2` -ne 0; then
+ AC_MSG_RESULT([libsvn_xxx-1.so.1])
+ SVN_LT_SOVERSION="-version-info 1"
+ else
+ AC_MSG_ERROR([APR $apr_version unsupported])
+ fi
+ fi
+ fi
+ ],
+ [])
+AC_SUBST(SVN_LT_SOVERSION)
+
 # Either a space-separated list of allowable Neon versions, or "any" to
 # mean allow anything.
 NEON_ALLOWED_LIST="0.24.7 0.25.0 0.25.1 0.25.2 0.25.3 0.25.4 0.25.5"

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Apr 11 03:37:48 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.