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

[PATCH] shared-only build for libsvn_auth_ and apache modules

From: Philip Martin <philip_at_codematters.co.uk>
Date: Wed, 19 Jul 2017 23:16:22 +0100

Philip Martin <philip_at_codematters.co.uk> writes:

> but perhaps some Makefile magic to disable all the static auth provider
> builds would be better.

The way to do this is to pass the libtool argument -shared to the
compile and link commands. If we do this for the libsvn_auth_ libraries
then we should probably do it for the apache modules as well. I don't
see any point in building static libraries for things that are only ever
loaded via dlopen().

A 2 line change in Makefile.in will do this for the apache modules, but
the libsvn_auth_ libraries need changes to gen-make.py to provide
explict compile/link commands.

Does this look like the right thing to do?

===================================================================

Disable static builds of the apache modules and the auth provider
modules as these are only ever used via. dlopen(). Further, the
kwallet auth provider no longer supports static builds when using
KDE5.

* build/generator/gen_base.py
  (TargetSharedOnlyLib, TargetSharedOnlyCxxLib): New target types to
   provide explicit compile/link commands for shared-only builds.

* build.conf
  (libsvn_auth_gnome_keyring): Change to shared-only-lib.
  (libsvn_auth_kwallet): Change to shared-only-cxx-lib.

* Makefile.in
  (COMPILE_APACHE_MOD, LINK_APACHE_MOD): Add -shared.
  (COMPILE_SHARED_ONLY_LIB, COMPILE_SHARED_ONLY_CXX_LIB,
   LINK_SHARED_ONLY_LIB, LINK_SHARED_ONLY_CXX_LIB,
   shared_only_LDFLAGS): New.
  (libsvn_auth_gnome_keyring_LDFLAGS, libsvn_auth_kwallet_LDFLAGS): Remove.

* configure.ac
  (shared_only_LDFLAGS): New.
  (libsvn_auth_gnome_keyring_LDFLAGS, libsvn_auth_kwallet_LDFLAGS): Remove.

Index: Makefile.in
===================================================================
--- Makefile.in (revision 1802406)
+++ Makefile.in (working copy)
@@ -200,7 +200,9 @@
 LT_EXECUTE = $(LIBTOOL) $(LTFLAGS) --mode=execute `for f in $(abs_builddir)/subversion/*/*.la; do echo -dlopen $$f; done`
 
 # special compilation for files destined for mod_dav_svn
-COMPILE_APACHE_MOD = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CMODEFLAGS) $(CPPFLAGS) $(CFLAGS) $(CMAINTAINERFLAGS) $(LT_CFLAGS) $(APACHE_INCLUDES) $(INCLUDES) -o $@ -c
+COMPILE_APACHE_MOD = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CMODEFLAGS) $(CPPFLAGS) $(CFLAGS) $(CMAINTAINERFLAGS) $(LT_CFLAGS) $(APACHE_INCLUDES) $(INCLUDES) -o $@ -c -shared
+COMPILE_SHARED_ONLY_LIB = $(LT_COMPILE) -o $@ -c -shared
+COMPILE_SHARED_ONLY_CXX_LIB = $(LT_COMPILE_CXX) -o $@ -c -shared
 
 # special compilation for files destined for libsvn_swig_* (e.g. swigutil_*.c)
 COMPILE_SWIG_PY = $(LIBTOOL) $(LTFLAGS) --mode=compile $(SWIG_PY_COMPILE) $(CPPFLAGS) $(LT_CFLAGS) -DSWIGPYTHON $(SWIG_PY_INCLUDES) $(INCLUDES) -o $@ -c
@@ -262,11 +264,9 @@
 LINK_CXX_LIB = $(LINK_CXX) $(LT_SO_VERSION)
 
 # 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)
+LINK_APACHE_MOD = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(CFLAGS) $(LDFLAGS) -rpath $(APACHE_LIBEXECDIR) -avoid-version -module $(APACHE_LDFLAGS) -shared
 
 # Special LDFLAGS for some libraries
-libsvn_auth_gnome_keyring_LDFLAGS = @libsvn_auth_gnome_keyring_LDFLAGS@
-libsvn_auth_kwallet_LDFLAGS = @libsvn_auth_kwallet_LDFLAGS@
 libsvn_client_LDFLAGS = @libsvn_client_LDFLAGS@
 libsvn_delta_LDFLAGS = @libsvn_delta_LDFLAGS@
 libsvn_diff_LDFLAGS = @libsvn_diff_LDFLAGS@
@@ -281,7 +281,11 @@
 libsvn_repos_LDFLAGS = @libsvn_repos_LDFLAGS@
 libsvn_subr_LDFLAGS = @libsvn_subr_LDFLAGS@
 libsvn_wc_LDFLAGS = @libsvn_wc_LDFLAGS@
+shared_only_LDFLAGS = @shared_only_LDFLAGS@
 
+LINK_SHARED_ONLY_LIB = $(LINK_LIB) $(shared_only_LDFLAGS) -shared
+LINK_SHARED_ONLY_CXX_LIB = $(LINK_CXX_LIB) $(shared_only_LDFLAGS) -shared
+
 # Compilation of SWIG-generated C source code
 COMPILE_PY_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=compile $(SWIG_PY_COMPILE) $(LT_CFLAGS) $(CPPFLAGS) $(SWIG_PY_INCLUDES) -prefer-pic -c -o $@
 COMPILE_RB_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=compile $(SWIG_RB_COMPILE) $(LT_CFLAGS) $(CPPFLAGS) $(SWIG_RB_INCLUDES) -prefer-pic -c -o $@
Index: build/generator/gen_base.py
===================================================================
--- build/generator/gen_base.py (revision 1802406)
+++ build/generator/gen_base.py (working copy)
@@ -719,6 +719,22 @@
     self.compile_cmd = '$(COMPILE_APACHE_MOD)'
     self.link_cmd = '$(LINK_APACHE_MOD)'
 
+class TargetSharedOnlyLib(TargetLib):
+
+ def __init__(self, name, options, gen_obj):
+ TargetLib.__init__(self, name, options, gen_obj)
+
+ self.compile_cmd = '$(COMPILE_SHARED_ONLY_LIB)'
+ self.link_cmd = '$(LINK_SHARED_ONLY_LIB)'
+
+class TargetSharedOnlyCxxLib(TargetLib):
+
+ def __init__(self, name, options, gen_obj):
+ TargetLib.__init__(self, name, options, gen_obj)
+
+ self.compile_cmd = '$(COMPILE_SHARED_ONLY_CXX_LIB)'
+ self.link_cmd = '$(LINK_SHARED_ONLY_CXX_LIB)'
+
 class TargetRaModule(TargetLib):
   pass
 
@@ -1031,6 +1047,8 @@
   'ra-module': TargetRaModule,
   'fs-module': TargetFsModule,
   'apache-mod': TargetApacheMod,
+ 'shared-only-lib': TargetSharedOnlyLib,
+ 'shared-only-cxx-lib': TargetSharedOnlyCxxLib,
   'javah' : TargetJavaHeaders,
   'java' : TargetJavaClasses,
   'i18n' : TargetI18N,
Index: build.conf
===================================================================
--- build.conf (revision 1802406)
+++ build.conf (working copy)
@@ -224,7 +224,7 @@
 # Support for GNOME Keyring
 [libsvn_auth_gnome_keyring]
 description = Subversion GNOME Keyring Library
-type = lib
+type = shared-only-lib
 install = gnome-keyring-lib
 path = subversion/libsvn_auth_gnome_keyring
 libs = libsvn_subr apr gnome-keyring
@@ -232,7 +232,7 @@
 # Support for KWallet
 [libsvn_auth_kwallet]
 description = Subversion KWallet Library
-type = lib
+type = shared-only-cxx-lib
 install = kwallet-lib
 path = subversion/libsvn_auth_kwallet
 libs = libsvn_subr apr kwallet
Index: configure.ac
===================================================================
--- configure.ac (revision 1802406)
+++ configure.ac (working copy)
@@ -1005,6 +1005,7 @@
     for library_dir in "$abs_srcdir/subversion/libsvn_"*; do
       eval "`basename $library_dir`_LDFLAGS=-Wl,--no-undefined"
     done
+ shared_only_LDFLAGS="-Wl,--no-undefined"
   else
     AC_MSG_RESULT([no])
     if test "$enable_disallowing_of_undefined_references" = "yes"; then
@@ -1012,8 +1013,6 @@
     fi
   fi
 fi
-AC_SUBST([libsvn_auth_gnome_keyring_LDFLAGS])
-AC_SUBST([libsvn_auth_kwallet_LDFLAGS])
 AC_SUBST([libsvn_client_LDFLAGS])
 AC_SUBST([libsvn_delta_LDFLAGS])
 AC_SUBST([libsvn_diff_LDFLAGS])
@@ -1028,6 +1027,7 @@
 AC_SUBST([libsvn_repos_LDFLAGS])
 AC_SUBST([libsvn_subr_LDFLAGS])
 AC_SUBST([libsvn_wc_LDFLAGS])
+AC_SUBST([shared_only_LDFLAGS])
 
 
 AC_ARG_ENABLE(maintainer-mode,

-- 
Philip
Received on 2017-07-20 00:16:31 CEST

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