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/config | |
parent | 2bb6a5e140cb3d53ff454e624b5fe8aa1d53409f (diff) | |
download | krb5-af44e8dee9b5bfffb05eb5a9b89c79c02ab7c2ff.zip krb5-af44e8dee9b5bfffb05eb5a9b89c79c02ab7c2ff.tar.gz krb5-af44e8dee9b5bfffb05eb5a9b89c79c02ab7c2ff.tar.bz2 |
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/config')
-rw-r--r-- | src/config/libnover.in | 30 | ||||
-rw-r--r-- | src/config/libpriv.in | 1 | ||||
-rw-r--r-- | src/config/pre.in | 35 |
3 files changed, 43 insertions, 23 deletions
diff --git a/src/config/libnover.in b/src/config/libnover.in index 5f89827..4aa419a 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 c7e3443..4fe13c3 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 6923ade..fa76619 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! |