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

[PATCH] libsvn SONAMEs and APR

From: Peter Samuelson <peter_at_p12n.org>
Date: 2006-03-12 03:06:34 CET

[Peter Samuelson]
> Would you consider accepting a patch to make SONAME handling explicit
> in the Makefile, and also make it sensitive to apr version? Would
> you consider this for 1.3.1 or 1.3.2? I'll try to prepare and test a
> patch in the next day or two.

Here's a patch. It seems to work on my system - but I'll keep testing
other cases to make sure.

There are two approaches to autodetecting the ABI in question - I left
them both in but commented one out - so this patch is more for
illustration than for applying directly.

Peter

[[[
Pass library version information into libtool, taking the ABI of
apr_off_t into account.

Patch by: Peter Samuelson <peter@p12n.org>

* build/ac-macros/apr.m4 (SVN_LIB_APR):
  Test for APR_HAS_LARGE_FILES, and export SVN_LT_SOVERSION, as
  libtool command line options to set the library version.

* Makefile.in:
  New macro LT_SOVERSION for the above; use it in the $(LINK) macro.
]]]
Index: Makefile.in
===================================================================
--- Makefile.in (revisione 18785)
+++ Makefile.in (copia locale)
@@ -94,6 +94,7 @@
 LTFLAGS = @SVN_LT_CCTAG@ --silent
 LTCXXFLAGS = @SVN_LT_CXXTAG@ --silent
 LT_LDFLAGS = @LT_LDFLAGS@
+LT_SOVERSION = @SVN_LT_SOVERSION@
 LT_NO_UNDEFINED = @LT_NO_UNDEFINED@
 LT_CXX_LIBADD = @LT_CXX_LIBADD@
 
@@ -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) $(LT_SOVERSION) $(CFLAGS) $(LDFLAGS) -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: build/ac-macros/apr.m4
===================================================================
--- build/ac-macros/apr.m4 (revisione 18785)
+++ build/ac-macros/apr.m4 (copia locale)
@@ -85,11 +85,31 @@
     AC_MSG_ERROR([apr-config --shlib-path-var failed])
   fi
 
+ dnl Determine whether or not we will be using the 64-bit apr_off_t ABI.
+ dnl This necessarily changes the SONAME of libsvn_*.
+ dnl if test `expr $apr_version : 0` -ne 0; then
+ dnl SVN_LT_SOVERSION="-version-info 0"
+ dnl else
+ dnl SVN_LT_SOVERSION="-version-info 1"
+ dnl fi
+ oldcppflags=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $SVN_APR_INCLUDES"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <apr.h>
+#if APR_HAS_LARGE_FILES
+# error Large file ABI required
+#endif
+ ]])], [apr_lfs_abi=0], [apr_lfs_abi=1])
+ CPPFLAGS=$oldcppflags
+
+SVN_LT_SOVERSION="-version-info $apr_lfs_abi"
+
   AC_SUBST(SVN_APR_PREFIX)
   AC_SUBST(SVN_APR_INCLUDES)
   AC_SUBST(SVN_APR_LIBS)
   AC_SUBST(SVN_APR_EXPORT_LIBS)
   AC_SUBST(SVN_APR_SHLIB_PATH_VAR)
+ AC_SUBST(SVN_LT_SOVERSION)
 ])
 
 dnl SVN_DOWNLOAD_APR()

Received on Sun Mar 12 03:06:54 2006

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