From: Greg Hudson Date: Mon, 8 Jun 2009 10:01:57 +0000 (+0000) Subject: Restore limited support for static linking X-Git-Tag: krb5-1.8-alpha1~441 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=af44e8dee9b5bfffb05eb5a9b89c79c02ab7c2ff;p=krb5.git 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 --- diff --git a/src/Makefile.in b/src/Makefile.in index dc80d2fe4..4f459a30e 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -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) diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 10182ec5f..86031ba95 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]) diff --git a/src/config/libnover.in b/src/config/libnover.in index 5f89827e2..4aa419ac9 100644 --- a/src/config/libnover.in +++ b/src/config/libnover.in @@ -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) diff --git a/src/config/libpriv.in b/src/config/libpriv.in index c7e3443b1..4fe13c3bc 100644 --- a/src/config/libpriv.in +++ b/src/config/libpriv.in @@ -10,4 +10,3 @@ LIBINSTLIST= SHLIBEXT=.so-nobuild SHLIBVEXT=.so.v-nobuild SHLIBSEXT=.so.s-nobuild -STLIBEXT=$(STLIBEXT_if_static) diff --git a/src/config/pre.in b/src/config/pre.in index 6923ade7d..fa766190f 100644 --- a/src/config/pre.in +++ b/src/config/pre.in @@ -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! diff --git a/src/include/k5-plugin.h b/src/include/k5-plugin.h index f5f4f43c2..2190c0349 100644 --- a/src/include/k5-plugin.h +++ b/src/include/k5-plugin.h @@ -65,6 +65,23 @@ #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 { diff --git a/src/lib/kdb/kdb5.c b/src/lib/kdb/kdb5.c index ed85d89a6..360b469a1 100644 --- a/src/lib/kdb/kdb5.c +++ b/src/lib/kdb/kdb5.c @@ -60,14 +60,6 @@ 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; diff --git a/src/plugins/authdata/greet/Makefile.in b/src/plugins/authdata/greet/Makefile.in index d88ba5bc4..1c71c4521 100644 --- a/src/plugins/authdata/greet/Makefile.in +++ b/src/plugins/authdata/greet/Makefile.in @@ -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 diff --git a/src/plugins/kdb/db2/Makefile.in b/src/plugins/kdb/db2/Makefile.in index c355c3773..dd3045c16 100644 --- a/src/plugins/kdb/db2/Makefile.in +++ b/src/plugins/kdb/db2/Makefile.in @@ -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 diff --git a/src/plugins/kdb/db2/db2_exp.c b/src/plugins/kdb/db2/db2_exp.c index 5c8162468..85864ac6f 100644 --- a/src/plugins/kdb/db2/db2_exp.c +++ b/src/plugins/kdb/db2/db2_exp.c @@ -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, diff --git a/src/plugins/kdb/ldap/Makefile.in b/src/plugins/kdb/ldap/Makefile.in index ae8028737..7f45c15db 100644 --- a/src/plugins/kdb/ldap/Makefile.in +++ b/src/plugins/kdb/ldap/Makefile.in @@ -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 diff --git a/src/plugins/kdb/ldap/ldap_exp.c b/src/plugins/kdb/ldap/ldap_exp.c index dcfe93cf9..18a89fd61 100644 --- a/src/plugins/kdb/ldap/ldap_exp.c +++ b/src/plugins/kdb/ldap/ldap_exp.c @@ -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, diff --git a/src/plugins/locate/python/Makefile.in b/src/plugins/locate/python/Makefile.in index 175bf6ef0..1f5f9e214 100644 --- a/src/plugins/locate/python/Makefile.in +++ b/src/plugins/locate/python/Makefile.in @@ -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 diff --git a/src/plugins/preauth/encrypted_challenge/Makefile.in b/src/plugins/preauth/encrypted_challenge/Makefile.in index 8f6a8a640..57c0392f4 100644 --- a/src/plugins/preauth/encrypted_challenge/Makefile.in +++ b/src/plugins/preauth/encrypted_challenge/Makefile.in @@ -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 diff --git a/src/plugins/preauth/pkinit/Makefile.in b/src/plugins/preauth/pkinit/Makefile.in index f066454ca..b6c4ea509 100644 --- a/src/plugins/preauth/pkinit/Makefile.in +++ b/src/plugins/preauth/pkinit/Makefile.in @@ -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 diff --git a/src/plugins/preauth/pkinit/pkinit_clnt.c b/src/plugins/preauth/pkinit/pkinit_clnt.c index f7cd99890..40ec8c058 100644 --- a/src/plugins/preauth/pkinit/pkinit_clnt.c +++ b/src/plugins/preauth/pkinit/pkinit_clnt.c @@ -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 */ diff --git a/src/plugins/preauth/pkinit/pkinit_srv.c b/src/plugins/preauth/pkinit/pkinit_srv.c index 031752974..5942c91b1 100644 --- a/src/plugins/preauth/pkinit/pkinit_srv.c +++ b/src/plugins/preauth/pkinit/pkinit_srv.c @@ -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) */