diff options
author | Greg Hudson <ghudson@mit.edu> | 2009-06-08 10:01:57 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2009-06-08 10:01:57 +0000 |
commit | af44e8dee9b5bfffb05eb5a9b89c79c02ab7c2ff (patch) | |
tree | 80783e20aa0a982df33d64b6fbba75f63c03ab18 /src/aclocal.m4 | |
parent | 2bb6a5e140cb3d53ff454e624b5fe8aa1d53409f (diff) | |
download | krb5-af44e8dee9b5bfffb05eb5a9b89c79c02ab7c2ff.tar.gz krb5-af44e8dee9b5bfffb05eb5a9b89c79c02ab7c2ff.tar.xz krb5-af44e8dee9b5bfffb05eb5a9b89c79c02ab7c2ff.zip |
Restore limited support for static linking
Add enough static linking support to run the test suite without shared
libraries, to facilitate gcov and other kinds of instrumentation. The
necessary changes include:
* Undo some of the changes which removed static linking support,
and cannibalize the defunct krb5_force_static conditional block
in aclocal.m4.
* Add --enable-static-only configure option.
* For plugins, use a different symbol name for static and dynamic
builds, via a macro in k5plugin.h.
* Add build machinery for building static libraries for plugins
(somewhat grotty due to the difference in names).
* Move plugin subdirs earlier in SUBDIRS in src/Makefile.in.
* Make the in-tree KDB5 plugins dependencies of libkdb5 in a static
build (aclocal.m4 has to know what they are).
* In kdb5.c, cannibalize the broken _KDB5_STATIC_LINK support to
allow "loading" of statically linked plugin libraries.
Preauth, authdata, locate, and GSSAPI plugins are not handled by this
change, as they are not currently necessary to the test suite.
Supporting GSSAPI plugins may be a bit tricky but the others should be
straightforward if they become needed.
$(STLIBEXT) changes from .a-nobuild to .a in a normal shared build as
a result of these changes (except on AIX where aclocal.m4 changes it).
This does not seem to be important as we avoid selecting the static
library for building via other means.
ticket: 6510
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22406 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/aclocal.m4')
-rw-r--r-- | src/aclocal.m4 | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 10182ec5f9..86031ba955 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -1141,6 +1141,11 @@ if test "$ac_cv_prog_PERL" = "false"; then fi AC_SUBST(LIBLIST) AC_SUBST(LIBLINKS) +AC_SUBST(PLUGIN) +AC_SUBST(PLUGINLINK) +AC_SUBST(PLUGININST) +AC_SUBST(KDB5_PLUGIN_DEPLIBS) +AC_SUBST(KDB5_PLUGIN_LIBS) AC_SUBST(MAKE_SHLIB_COMMAND) AC_SUBST(SHLIB_RPATH_FLAGS) AC_SUBST(SHLIB_EXPFLAGS) @@ -1213,6 +1218,11 @@ AC_ARG_ENABLE([shared], , [if test "$enableval" != yes; then AC_MSG_ERROR([Sorry, this release builds only shared libraries, cannot disable them.]) fi]) +AC_ARG_ENABLE([static-only], +AC_HELP_STRING([--enable-static-only],[use static libraries and plugins]), +[static_only=$enableval], +[static_only=no]) + AC_ARG_ENABLE([rpath], AC_HELP_STRING([--disable-rpath],[suppress run path flags in link lines]), [enable_rpath=$enableval], @@ -1231,15 +1241,23 @@ fi DEPLIBEXT=$SHLIBEXT -if test "$krb5_force_static" = "yes"; then +if test "x$static_only" = xyes; then LIBLIST='lib$(LIBBASE)$(STLIBEXT)' LIBLINKS='$(TOPLIBD)/lib$(LIBBASE)$(STLIBEXT)' + PLUGIN='libkrb5_$(LIBBASE)$(STLIBEXT)' + PLUGINLINK='$(TOPLIBD)/libkrb5_$(LIBBASE)$(STLIBEXT)' + PLUGININST=install-static OBJLISTS=OBJS.ST - # This used to be install-static, but now we only follow this - # path for internal libraries we don't want installed, not for - # configure-time requests for installed static libraries. - LIBINSTLIST= -# CFLAGS="$CFLAGS -D_KDB5_STATIC_LINK" + LIBINSTLIST=install-static + DEPLIBEXT=$STLIBEXT + AC_DEFINE([STATIC_PLUGINS], 1, [Define for static plugin linkage]) + + KDB5_PLUGIN_DEPLIBS='$(TOPLIBD)/libkrb5_db2$(DEPLIBEXT)' + KDB5_PLUGIN_LIBS='-lkrb5_db2' + if test "x$OPENLDAP_PLUGIN" = xyes; then + KDB5_PLUGIN_DEBLIBS=$KDB5_PLUGIN_DEPLIBS' $(TOPLIBD)/libkrb5_ldap$(DEPLIBEXT)' + KDB5_PLUGIN_LIBS=$KDB_LUGIN_LIBS' -lkrb5_ldap' + fi AC_MSG_RESULT([Forcing static libraries.]) # avoid duplicate rules generation for AIX and such @@ -1255,23 +1273,25 @@ else fi case "$SHLIBSEXT" in .so.s-nobuild) - SHLIB_HAVE_MINOR_VERS=no LIBLIST='lib$(LIBBASE)$(SHLIBEXT)' LIBLINKS='$(TOPLIBD)/lib$(LIBBASE)$(SHLIBEXT) $(TOPLIBD)/lib$(LIBBASE)$(SHLIBVEXT)' LIBINSTLIST="install-shared" ;; *) - SHLIB_HAVE_MINOR_VERS=yes LIBLIST='lib$(LIBBASE)$(SHLIBEXT) lib$(LIBBASE)$(SHLIBSEXT)' LIBLINKS='$(TOPLIBD)/lib$(LIBBASE)$(SHLIBEXT) $(TOPLIBD)/lib$(LIBBASE)$(SHLIBVEXT) $(TOPLIBD)/lib$(LIBBASE)$(SHLIBSEXT)' LIBINSTLIST="install-shlib-soname" ;; esac OBJLISTS="OBJS.SH" + PLUGIN='$(LIBBASE)$(DYNOBJEXT)' + PLUGINLINK= + PLUGININST=install-plugin + KDB5_PLUGIN_DEPLIBS= + KDB5_PLUGIN_LIBS= fi CC_LINK="$CC_LINK_SHARED" CXX_LINK="$CXX_LINK_SHARED" -AC_SUBST(SHLIB_HAVE_MINOR_VERS) if test -z "$LIBLIST"; then AC_MSG_ERROR([must enable one of shared or static libraries]) |