Restore limited support for static linking
authorGreg Hudson <ghudson@mit.edu>
Mon, 8 Jun 2009 10:01:57 +0000 (10:01 +0000)
committerGreg Hudson <ghudson@mit.edu>
Mon, 8 Jun 2009 10:01:57 +0000 (10:01 +0000)
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

17 files changed:
src/Makefile.in
src/aclocal.m4
src/config/libnover.in
src/config/libpriv.in
src/config/pre.in
src/include/k5-plugin.h
src/lib/kdb/kdb5.c
src/plugins/authdata/greet/Makefile.in
src/plugins/kdb/db2/Makefile.in
src/plugins/kdb/db2/db2_exp.c
src/plugins/kdb/ldap/Makefile.in
src/plugins/kdb/ldap/ldap_exp.c
src/plugins/locate/python/Makefile.in
src/plugins/preauth/encrypted_challenge/Makefile.in
src/plugins/preauth/pkinit/Makefile.in
src/plugins/preauth/pkinit/pkinit_clnt.c
src/plugins/preauth/pkinit/pkinit_srv.c

index dc80d2fe4e2b3dc6c47aa0a6a8c2481cbb1bbb78..4f459a30e01c3029c32a054f361d4b043e7b7c8d 100644 (file)
@@ -9,11 +9,12 @@ mydir=.
 #      plugins/preauth/wpse
 #      plugins/preauth/cksum_body
 #      plugins/authdata/greet
-SUBDIRS=util include lib kdc kadmin @ldap_plugin_dir@ slave clients \
+SUBDIRS=util include lib \
+       @ldap_plugin_dir@ \
        plugins/kdb/db2 \
        plugins/preauth/pkinit \
        plugins/preauth/encrypted_challenge \
-       appl tests \
+       kdc kadmin slave clients appl tests \
        config-files gen-manpages
 BUILDTOP=$(REL)$(C)
 LOCALINCLUDES = -I$(srcdir) 
index 10182ec5f9d72966f1e29010da365c5fc6ac3488..86031ba955a7b409c9cac57e53ab564ca31e5bc7 100644 (file)
@@ -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])
index 5f89827e28187855e6a4086a73fe023eb32c3bcc..4aa419ac98a54931f1c97eef3561ebbe11c9f86d 100644 (file)
@@ -27,16 +27,21 @@ LIBPREFIX=
 
 # STOBJLISTS=dir1/OBJS.ST dir2/OBJS.ST etc...
 SHOBJLISTS=$(STOBJLISTS:.ST=.SH)
+PFOBJLISTS=$(STOBJLISTS:.ST=.PF)
 
 dummy-target-1 $(SUBDIROBJLISTS) $(SUBDIROBJLISTS:.ST=.SH) $(SUBDIROBJLISTS:.ST=.PF): all-recurse
 
 # Gets invoked as $(PARSE_OBJLISTS) list-of-OBJS.*-files
 PARSE_OBJLISTS= set -x && $(PERL) -p -e 'BEGIN { $$SIG{__WARN__} = sub {die @_} }; $$e=$$ARGV; $$e =~ s/OBJS\...$$//; s/^/ /; s/ $$//; s/ / $$e/g;'
 
-SHLIBVEXT=$(SHLIBEXT)
-LIBLIST=$(LIBBASE)$(DYNOBJEXT)
 LIBINSTLIST=install-shared
 
+libkrb5_$(LIBBASE)$(STLIBEXT): $(STOBJLISTS)
+       $(RM) $@
+       @echo "building static $(LIBBASE) library"
+       set -x; objlist=`$(PARSE_OBJLISTS) $(STOBJLISTS)` && $(AR) cq $@ $$objlist
+       $(RANLIB) $@
+
 $(LIBBASE)$(DYNOBJEXT): $(SHOBJLISTS) $(DYNOBJ_EXPDEPS) $(SHLIB_EXPORT_FILE_DEP)
        $(RM) $@
        @echo "building dynamic $(LIBBASE) object"
@@ -80,18 +85,29 @@ darwin.exports: $(SHLIB_EXPORT_FILE) Makefile
        $(RM) darwin.exports
        sed "s/^/_/" < $(SHLIB_EXPORT_FILE) > darwin.exports
 
-$(TOPLIBD)/$(LIBBASE)$(SHLIBEXT): $(LIBBASE)$(SHLIBEXT)
+libkrb5_$(LIBBASE)$(PFLIBEXT): $(PFOBJLISTS)
+       $(RM) $@
+       @echo "building profiled $(LIBBASE) library"
+       set -x; objlist=`$(PARSE_OBJLISTS) $(PFOBJLISTS)` && $(AR) cq $@ $$objlist
+       $(RANLIB) $@
+
+$(TOPLIBD)/libkrb5_$(LIBBASE)$(STLIBEXT):
        $(RM) $@
-       (cd $(TOPLIBD) && $(LN_S) $(RELDIR)/$(LIBBASE)$(SHLIBEXT) .)
+       (cd $(TOPLIBD) && $(LN_S) $(RELDIR)/libkrb5_$(LIBBASE)$(STLIBEXT) .)
 
-all-libs: $(LIBBASE)$(DYNOBJEXT) # $(LIBLIST)
+all-liblinks: all-libs $(PLUGINLINK)
+all-libs: $(PLUGIN)
 
 clean-libs:
        $(RM) $(LIBBASE)$(DYNOBJEXT)
        $(RM) binutils.versions osf1.exports darwin.exports hpux10.exports
 
-install-libs: $(LIBINSTLIST)
-install-shared:
+install-libs: $(PLUGININST)
+install-static:
+       $(RM) $(DESTDIR)$(KRB5_LIBDIR)/libkrb5_$(LIBBASE)$(STLIBEXT)
+       $(INSTALL_DATA) libkrb5_$(LIBBASE)$(STLIBEXT) $(DESTDIR)$(KRB5_LIBDIR)
+       $(RANLIB) $(DESTDIR)$(KRB5_LIBDIR)/libkrb5_$(LIBBASE)$(STLIBEXT)
+install-plugin:
        $(RM) $(DESTDIR)$(MODULE_INSTALL_DIR)/$(LIBBASE)$(DYNOBJEXT)
        $(INSTALL_SHLIB) $(LIBBASE)$(DYNOBJEXT) $(DESTDIR)$(MODULE_INSTALL_DIR)
 
index c7e3443b19e043276ebbb6ea1ecee7852e364559..4fe13c3bc73561565a26fc3e4dc412cc02137cee 100644 (file)
@@ -10,4 +10,3 @@ LIBINSTLIST=
 SHLIBEXT=.so-nobuild
 SHLIBVEXT=.so.v-nobuild
 SHLIBSEXT=.so.s-nobuild
-STLIBEXT=$(STLIBEXT_if_static)
index 6923ade7d27154ea18fe4effa3452e7b2d78466c..fa766190fcb3fb7fa4fcd94978e53ba9652ab854 100644 (file)
@@ -315,6 +315,9 @@ PROG_RPATH_FLAGS=@PROG_RPATH_FLAGS@
 # depending on whether we're building with shared libraries.
 DEPLIBEXT=@DEPLIBEXT@
 
+KDB5_PLUGIN_DEPLIBS = @KDB5_PLUGIN_DEPLIBS@
+KDB5_PLUGIN_LIBS = @KDB5_PLUGIN_LIBS@
+
 KADMCLNT_DEPLIB        = $(TOPLIBD)/libkadm5clnt$(DEPLIBEXT)
 KADMSRV_DEPLIB = $(TOPLIBD)/libkadm5srv$(DEPLIBEXT)
 KDB5_DEPLIB    = $(TOPLIBD)/libkdb5$(DEPLIBEXT)
@@ -337,7 +340,7 @@ PTY_DEPLIB  = $(TOPLIBD)/libpty.a
 APPUTILS_DEPLIB        = $(TOPLIBD)/libapputils.a
 
 KRB5_BASE_DEPLIBS      = $(KRB5_DEPLIB) $(CRYPTO_DEPLIB) $(COM_ERR_DEPLIB) $(SUPPORT_DEPLIB)
-KDB5_DEPLIBS           = $(KDB5_DEPLIB)
+KDB5_DEPLIBS           = $(KDB5_DEPLIB) $(KDB5_PLUGIN_DEPLIBS)
 GSS_DEPLIBS            = $(GSS_DEPLIB)
 GSSRPC_DEPLIBS         = $(GSSRPC_DEPLIB) $(GSS_DEPLIBS)
 KADM_COMM_DEPLIBS      = $(GSSRPC_DEPLIBS) $(KDB5_DEPLIBS) $(GSSRPC_DEPLIBS)
@@ -365,7 +368,7 @@ GEN_LIB             = @GEN_LIB@
 SS_LIB         = $(SS_LIB-@SS_VERSION@)
 SS_LIB-sys     = @SS_LIB@
 SS_LIB-k5      = $(TOPLIBD)/libss.a
-KDB5_LIB       = -lkdb5
+KDB5_LIB       = -lkdb5 $(KDB5_PLUGIN_LIBS)
 
 DL_LIB         = @DL_LIB@
 
@@ -471,26 +474,28 @@ AR=@AR@
 # Set to "lib$(LIBBASE)$(STEXT) lib$(LIBBASE)$(SHEXT) lib$(LIBBASE)$(PFEXT)" or
 # some subset thereof by configure; determines which types of libs get
 # built.
-LIBLIST=$(LIBLIST_@SHLIB_HAVE_MINOR_VERS@)
-LIBLIST_yes=lib$(LIBBASE)$(SHLIBEXT) lib$(LIBBASE)$(SHLIBSEXT)
-LIBLIST_no=lib$(LIBBASE)$(SHLIBEXT)
+LIBLIST=@LIBLIST@
 
 # Set by configure; list of library symlinks to make to $(TOPLIBD)
-LIBLINKS=$(LIBLINKS_@SHLIB_HAVE_MINOR_VERS@)
-LIBLINKS_yes=$(TOPLIBD)/lib$(LIBBASE)$(SHLIBEXT) $(TOPLIBD)/lib$(LIBBASE)$(SHLIBVEXT) $(TOPLIBD)/lib$(LIBBASE)$(SHLIBSEXT)
-LIBLINKS_no=$(TOPLIBD)/lib$(LIBBASE)$(SHLIBEXT) $(TOPLIBD)/lib$(LIBBASE)$(SHLIBVEXT)
+LIBLINKS=@LIBLINKS@
+
+# Set by configure; name of plugin module to build (libfoo.a or foo.so)
+PLUGIN=@PLUGIN@
+
+# Set by configure; symlink for plugin module for static plugin linking
+PLUGINLINK=@PLUGINLINK@
+
+# Set by configure; list of install targets for libraries
+LIBINSTLIST=@LIBINSTLIST@
 
-# Set by configure; list of install targets
-LIBINSTLIST=$(LIBINSTLIST_@SHLIB_HAVE_MINOR_VERS@)
-LIBINSTLIST_yes=install-shlib-soname
-LIBINSTLIST_no=install-shared
+# Set by configure; install target
+PLUGININST=@PLUGININST@
 
 # Some of these should really move to pre.in, since programs will need
 # it too. (e.g. stuff that has dependencies on the libraries)
 
 # usually .a
-STLIBEXT_if_static=@STLIBEXT@
-STLIBEXT=.a-nobuild
+STLIBEXT=@STLIBEXT@
 
 # usually .so.$(LIBMAJOR).$(LIBMINOR)
 SHLIBVEXT=@SHLIBVEXT@
@@ -536,7 +541,7 @@ SHLIB_EXPFLAGS=@SHLIB_EXPFLAGS@
 
 # Set to "OBJS.ST OBJS.SH OBJS.PF" or some subset thereof by
 # configure; determines which types of object files get built.
-OBJLISTS=OBJS.SH
+OBJLISTS=@OBJLISTS@
 
 # Note that $(LIBSRCS) *cannot* contain any variable references, or
 # the suffix substitution will break on some platforms!
index f5f4f43c21f07a7e5661f2fbd21b868fc73340f6..2190c034961fbd3496dfa7cb5c4e089ac9e796a0 100644 (file)
 
 #include "k5-err.h"
 
+/*
+ * Plugins normally export fixed symbol names, but when statically
+ * linking plugins, we need a different symbol name for each plugin.
+ * The first argument to PLUGIN_SYMBOL_NAME acts as the
+ * differentiator, and is only used for static plugin linking.
+ *
+ * Although this macro (and thus this header file) are used in plugins
+ * whose code lies inside the krb5 tree, plugins maintained separately
+ * from the krb5 tree do not need it; they can just use the fixed
+ * symbol name unconditionally.
+ */
+#ifdef STATIC_PLUGINS
+#define PLUGIN_SYMBOL_NAME(prefix, symbol) prefix ## _ ## symbol
+#else
+#define PLUGIN_SYMBOL_NAME(prefix, symbol) symbol
+#endif
+
 struct plugin_file_handle;     /* opaque */
 
 struct plugin_dir_handle {
index ed85d89a6215638d2aa9099858015f6115ea6afb..360b469a1951955ca5d32490563a4c002cc9b940 100644 (file)
 
 static k5_mutex_t db_lock = K5_MUTEX_PARTIAL_INITIALIZER;
 
-#ifdef _KDB5_STATIC_LINK
-#undef _KDB5_DYNAMIC_LINK
-#else
-#undef _KDB5_DYNAMIC_LINK
-/* to avoid redefinition problem */
-#define _KDB5_DYNAMIC_LINK
-#endif
-
 static db_library lib_list;
 
 /*
@@ -323,78 +315,54 @@ kdb_setup_opt_functions(db_library lib)
     }
 }
 
-static int kdb_db2_pol_err_loaded = 0;
-#ifdef _KDB5_STATIC_LINK
-#define DEF_SYMBOL(a) extern kdb_vftabl krb5_db_vftabl_ ## a
-#define GET_SYMBOL(a) (krb5_db_vftabl_ ## a)
+#ifdef STATIC_PLUGINS
+
+extern kdb_vftabl krb5_db2_kdb_function_table;
+#ifdef ENABLE_LDAP
+extern kdb_vftabl krb5_db2_ldap_function_table;
+#endif
+
 static krb5_error_code
-kdb_load_library(krb5_context kcontext, char *lib_name, db_library * lib)
+kdb_load_library(krb5_context kcontext, char *lib_name, db_library *libptr)
 {
     krb5_error_code status;
-    void   *vftabl_addr = NULL;
-    char    buf[KRB5_MAX_ERR_STR];
-
-    if (!strcmp("kdb_db2", lib_name) && (kdb_db2_pol_err_loaded == 0)) {
-       initialize_adb_error_table();
-       kdb_db2_pol_err_loaded = 1;
+    db_library lib;
+    kdb_vftabl *vftabl_addr = NULL;
+
+    if (strcmp(lib_name, "db2") == 0)
+       vftabl_addr = &krb5_db2_kdb_function_table;
+#ifdef ENABLE_LDAP
+    if (strcmp(lib_name, "ldap") == 0)
+       vftabl_addr = &krb5_ldap_kdb_function_table;
+#endif
+    if (!vftabl_addr) {
+       krb5_set_error_message(kcontext, KRB5_KDB_DBTYPE_NOTFOUND,
+                              "Unable to find requested database type: %s",
+                              lib_name);
+       return KRB5_KDB_DBTYPE_NOSUP;
     }
 
-    *lib = calloc((size_t) 1, sizeof(**lib));
-    if (*lib == NULL) {
-       status = ENOMEM;
-       goto clean_n_exit;
-    }
+    lib = calloc(1, sizeof(*lib));
+    if (lib == NULL)
+       return ENOMEM;
 
     status = kdb_init_lib_lock(*lib);
-    if (status) {
-       goto clean_n_exit;
-    }
-
-    strlcpy((*lib)->name, lib_name, sizeof((*lib)->name));
-
-#if !defined(KDB5_USE_LIB_KDB_DB2) && !defined(KDB5_USE_LIB_TEST)
-#error No database module defined
-#endif
-
-#ifdef KDB5_USE_LIB_KDB_DB2
-    if (strcmp(lib_name, "kdb_db2") == 0) {
-       DEF_SYMBOL(kdb_db2);
-       vftabl_addr = (void *) &GET_SYMBOL(kdb_db2);
-    } else
-#endif
-#ifdef KDB5_USE_LIB_TEST
-    if (strcmp(lib_name, "test") == 0) {
-       DEF_SYMBOL(test);
-       vftabl_addr = (void *) &GET_SYMBOL(test);
-    } else
-#endif
-    {
-       snprintf(buf, sizeof(buf),
-                "Program not built to support %s database type\n",
-                lib_name);
-       status = KRB5_KDB_DBTYPE_NOSUP;
-       krb5_db_set_err(kcontext, krb5_err_have_str, status, buf);
-       goto clean_n_exit;
-    }
+    if (status)
+       goto cleanup;
 
-    memcpy(&(*lib)->vftabl, vftabl_addr, sizeof(kdb_vftabl));
+    strlcpy(lib->name, lib_name, sizeof(lib->name));
+    memcpy(&lib->vftabl, vftabl_addr, sizeof(kdb_vftabl));
+    kdb_setup_opt_functions(lib);
 
-    kdb_setup_opt_functions(*lib);
+    status = lib->vftabl.init_library();
+    if (status)
+       goto cleanup;
 
-    if ((status = (*lib)->vftabl.init_library())) {
-       /* ERROR. library not initialized cleanly */
-       snprintf(buf, sizeof(buf),
-                "%s library initialization failed, error code %ld\n",
-                lib_name, status);
-       status = KRB5_KDB_DBTYPE_INIT;
-       krb5_db_set_err(kcontext, krb5_err_have_str, status, buf);
-       goto clean_n_exit;
-    }
+    *libptr = lib;
+    return 0;
 
-  clean_n_exit:
-    if (status) {
-       free(*lib), *lib = NULL;
-    }
+cleanup:
+    free(lib);
     return status;
 }
 
@@ -424,11 +392,6 @@ kdb_load_library(krb5_context kcontext, char *lib_name, db_library * lib)
     filebases[0] = lib_name;
     filebases[1] = NULL;
 
-    if (!strcmp(DB2_NAME, lib_name) && (kdb_db2_pol_err_loaded == 0)) {
-       initialize_adb_error_table();
-       kdb_db2_pol_err_loaded = 1;
-    }
-
     *lib = calloc((size_t) 1, sizeof(**lib));
     if (*lib == NULL) {
        status = ENOMEM;
@@ -527,6 +490,12 @@ kdb_find_library(krb5_context kcontext, char *lib_name, db_library * lib)
     krb5_error_code status = 0;
     int     locked = 0;
     db_library curr_elt, prev_elt = NULL;
+    static int kdb_db2_pol_err_loaded = 0;
+
+    if (!strcmp(DB2_NAME, lib_name) && (kdb_db2_pol_err_loaded == 0)) {
+       initialize_adb_error_table();
+       kdb_db2_pol_err_loaded = 1;
+    }
 
     if ((status = kdb_lock_list()) != 0) {
        goto clean_n_exit;
index d88ba5bc4ffa9dba2aa05837d5695396d01e7aae..1c71c4521a5579e3c9c5d51c63e120b92b3fe50d 100644 (file)
@@ -27,7 +27,7 @@ STLIBOBJS= greet_auth.o
 
 SRCS=  greet_auth.c
 
-all-unix:: $(LIBBASE)$(SO_EXT)
+all-unix:: all-liblinks
 install-unix:: install-libs
 clean-unix:: clean-libs clean-libobjs
 
index c355c37739697e907242c86ac40cf3ac45b13617..dd3045c168c8ebc435fca10d16e839c2a627e78d 100644 (file)
@@ -68,7 +68,7 @@ STLIBOBJS= \
        pol_xdr.o \
        db2_exp.o
 
-all-unix:: $(LIBBASE)$(SO_EXT)
+all-unix:: all-liblinks
 install-unix:: install-libs
 clean-unix:: clean-libs clean-libobjs
 
index 5c816246814e8382723147020c0d476211d84e24..85864ac6fe372b80ac739cb02dfc913cf9c1a49d 100644 (file)
@@ -220,7 +220,7 @@ hack_cleanup (void)
  *      Exposed API
  */
 
-kdb_vftabl kdb_function_table = {
+kdb_vftabl PLUGIN_SYMBOL_NAME(krb5_db2, kdb_function_table) = {
   1,                                      /* major version number 1 */
   0,                                      /* minor version number 0 */
   /* init_library */                          hack_init,
index ae8028737197495e345a7a83979e402c9b519621..7f45c15dba59a179af3ffd3ac882d3c8657285eb 100644 (file)
@@ -38,7 +38,7 @@ SRCS=         $(srcdir)/ldap_exp.c
 STOBJLISTS=OBJS.ST
 STLIBOBJS= ldap_exp.o
 
-all-unix:: $(LIBBASE)$(SO_EXT)
+all-unix:: all-liblinks
 install-unix:: install-libs
 clean-unix:: clean-libs clean-libobjs
 
index dcfe93cf9e2660da1aafcd993c98cf279257b13c..18a89fd6197e3143abed8d57fd15eb5ca65f7965 100644 (file)
@@ -45,7 +45,7 @@
  *      Exposed API
  */
 
-kdb_vftabl kdb_function_table = {
+kdb_vftabl PLUGIN_SYMBOL_NAME(krb5_ldap, kdb_function_table) = {
   1,                                      /* major version number 1 */
   0,                                      /* minor version number 0 */
   /* init_library */                          krb5_ldap_lib_init,
index 175bf6ef0d812da1cd6a6540617266da80d55705..1f5f9e2144051ec675df7697b141673b3252e0d8 100644 (file)
@@ -21,7 +21,7 @@ SRCS= \
 STOBJLISTS=OBJS.ST
 STLIBOBJS= py-locate.o
 
-all-unix:: $(LIBBASE)$(SO_EXT)
+all-unix:: all-liblinks
 install-unix:: install-libs
 clean-unix:: clean-libs clean-libobjs
 
index 8f6a8a640b42a4e033779c96c3db93d645b331ec..57c0392f494f126ab8857161647286c5214d5ba4 100644 (file)
@@ -29,7 +29,7 @@ STLIBOBJS=encrypted_challenge_main.o
 
 SRCS= $(srcdir)/encrypted_challenge_main.c
 
-all-unix:: $(LIBBASE)$(SO_EXT)
+all-unix:: all-liblinks
 install-unix:: install-libs
 clean-unix:: clean-libs clean-libobjs
 
index f066454cab08c78cdf6c4a5e8417e1c8250ec417..b6c4ea5098fe1028377979f0b6a805bf7ae5bc09 100644 (file)
@@ -46,7 +46,7 @@ SRCS= \
        $(srcdir)/pkinit_matching.c \
        $(srcdir)/pkinit_crypto_openssl.c
 
-all-unix:: $(LIBBASE)$(SO_EXT)
+all-unix:: all-liblinks
 install-unix:: install-libs
 clean-unix:: clean-libs clean-libobjs
 
index f7cd99890c1ccd57255a2cf3497d51bf838a7687..40ec8c058b0e722248d9a54f05673ae5cda42ca2 100644 (file)
@@ -1489,7 +1489,11 @@ pkinit_client_gic_opt(krb5_context context,
     return 0;
 }
 
-struct krb5plugin_preauth_client_ftable_v1 preauthentication_client_1 = {
+/* Only necessary for static plugin linking support. */
+#include "k5-plugin.h"
+
+struct krb5plugin_preauth_client_ftable_v1
+PLUGIN_SYMBOL_NAME(krb5_preauth, preauthentication_client_1) = {
     "pkinit",                  /* name */
     supported_client_pa_types, /* pa_type_list */
     NULL,                      /* enctype_list */
index 031752974c69944bb0abb3526de9d93315015cdd..5942c91b16adb6c8d2e802d2bda9c88ce8305539 100644 (file)
@@ -1409,7 +1409,11 @@ pkinit_fini_kdc_req_context(krb5_context context, void *ctx)
     free(reqctx);
 }
 
-struct krb5plugin_preauth_server_ftable_v1 preauthentication_server_1 = {
+/* Only necessary for static plugin linking support. */
+#include "k5-plugin.h"
+
+struct krb5plugin_preauth_server_ftable_v1
+PLUGIN_SYMBOL_NAME(krb5_pkinit, preauthentication_server_1) = {
     "pkinit",                  /* name */
     supported_server_pa_types, /* pa_type_list */
     pkinit_server_plugin_init, /* (*init_proc) */