From 67add7ce15f01e788d8cecbc60c61fb47d5e759f Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Sun, 25 Mar 2007 23:07:09 +0000 Subject: Never set krb5_force_static. Instead, set the defaults for building shared libraries, and allow a Makefile.in to include a new makefile fragment for building private (static, not installed) libraries. Created another makefile fragment to be included to indicate the shared library has no dependencies. (Currently this is the case only for the libdb2 library, which we don't install, but do build for testing.) The way we construct the library dependency search path arguments doesn't work for an empty list on some platforms. Updated Makefile.in to use @libpriv_frag@ and @libnodeps_frag@ as necessary. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19265 dc483132-0cff-0310-8789-dd5450dbe970 --- src/aclocal.m4 | 10 +++++++++- src/appl/libpty/Makefile.in | 2 +- src/appl/telnet/libtelnet/Makefile.in | 1 + src/config/libnodeps.in | 4 ++++ src/config/libpriv.in | 13 +++++++++++++ src/config/pre.in | 23 ++++++++++++++++++----- src/lib/apputils/Makefile.in | 1 + src/plugins/kdb/db2/libdb2/Makefile.in | 1 + src/util/ss/Makefile.in | 2 +- 9 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 src/config/libnodeps.in create mode 100644 src/config/libpriv.in diff --git a/src/aclocal.m4 b/src/aclocal.m4 index aaacac2fff..c6c6a36bff 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -98,6 +98,10 @@ libobj_frag=$srcdir/$ac_config_fragdir/libobj.in AC_SUBST_FILE(libobj_frag) libnover_frag=$srcdir/$ac_config_fragdir/libnover.in AC_SUBST_FILE(libnover_frag) +libpriv_frag=$srcdir/$ac_config_fragdir/libpriv.in +AC_SUBST_FILE(libpriv_frag) +libnodeps_frag=$srcdir/$ac_config_fragdir/libnodeps.in +AC_SUBST_FILE(libnodeps_frag) dnl KRB5_AC_PRAGMA_WEAK_REF WITH_LDAP @@ -1119,7 +1123,8 @@ dnl Force static library build. AC_DEFUN(KRB5_AC_FORCE_STATIC,[dnl AC_BEFORE([$0],[KRB5_LIB_AUX])dnl -krb5_force_static=yes]) +# krb5_force_static=yes +]) AC_DEFUN(KRB5_BUILD_LIBRARY_STATIC, dnl Use define rather than AC_DEFUN to avoid ordering problems. [AC_REQUIRE([KRB5_AC_FORCE_STATIC])dnl @@ -1244,11 +1249,13 @@ 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" @@ -1257,6 +1264,7 @@ else OBJLISTS="OBJS.SH" fi CC_LINK="$CC_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/appl/libpty/Makefile.in b/src/appl/libpty/Makefile.in index 521341db0b..92b33f8335 100644 --- a/src/appl/libpty/Makefile.in +++ b/src/appl/libpty/Makefile.in @@ -106,7 +106,7 @@ pty_err.c: pty_err.et $(BUILDTOP)/include/autoconf.h: $(SRCTOP)/include/autoconf.h.in (cd $(BUILDTOP)/include; $(MAKE) autoconf.h) - +@libpriv_frag@ @lib_frag@ @libobj_frag@ diff --git a/src/appl/telnet/libtelnet/Makefile.in b/src/appl/telnet/libtelnet/Makefile.in index 2a6c7dc517..38ff9055f7 100644 --- a/src/appl/telnet/libtelnet/Makefile.in +++ b/src/appl/telnet/libtelnet/Makefile.in @@ -89,6 +89,7 @@ enc_des.o: key-proto.h enc_des.o: misc-proto.h install:: +@libpriv_frag@ @lib_frag@ @libobj_frag@ diff --git a/src/config/libnodeps.in b/src/config/libnodeps.in new file mode 100644 index 0000000000..6416a30073 --- /dev/null +++ b/src/config/libnodeps.in @@ -0,0 +1,4 @@ +# Must override when there are no dependencies, because on some +# platforms there's a prefix stuck in front of the library path that +# we won't set (SHLIB_RDIRS). +SHLIB_EXPFLAGS= diff --git a/src/config/libpriv.in b/src/config/libpriv.in new file mode 100644 index 0000000000..c7e3443b19 --- /dev/null +++ b/src/config/libpriv.in @@ -0,0 +1,13 @@ +# Additional definitions for private libraries, which we build as archive +# libraries (or equivalent) and do not install. +# +# The defaults (for installed shared libraries) are in pre.in. We +# override them here, before lib.in uses them. +LIBLIST=lib$(LIBBASE)$(STLIBEXT) +LIBLINKS=$(TOPLIBD)/lib$(LIBBASE)$(STLIBEXT) +OBJLISTS=OBJS.ST +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 1c151bb075..01c083be5b 100644 --- a/src/config/pre.in +++ b/src/config/pre.in @@ -472,6 +472,12 @@ MAKE_COMMANDS-k5= $(BUILDTOP)/util/ss/mk_cmds ## Parameters to be set by configure for use in lib.in: ## +# +# These settings are for building shared libraries only. Including +# libpriv.in will override with values appropriate for static +# libraries that we don't install. Some values will depend on whether +# the platform supports major and minor version number extensions on +# shared libraries, hence the FOO_@@ settings. LN_S=@LN_S@ AR=@AR@ @@ -479,19 +485,26 @@ 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@ +LIBLIST=$(LIBLIST_@SHLIB_HAVE_MINOR_VERS@) +LIBLIST_yes=lib$(LIBBASE)$(SHLIBEXT) lib$(LIBBASE)$(SHLIBSEXT) +LIBLIST_no=lib$(LIBBASE)$(SHLIBEXT) # Set by configure; list of library symlinks to make to $(TOPLIBD) -LIBLINKS=@LIBLINKS@ +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) # Set by configure; list of install targets -LIBINSTLIST=@LIBINSTLIST@ +LIBINSTLIST=$(LIBINSTLIST_@SHLIB_HAVE_MINOR_VERS@) +LIBINSTLIST_yes=install-shlib-soname +LIBINSTLIST_no=install-shared # 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=@STLIBEXT@ +STLIBEXT_if_static=@STLIBEXT@ +STLIBEXT=.a-nobuild # usually .so.$(LIBMAJOR).$(LIBMINOR) SHLIBVEXT=@SHLIBVEXT@ @@ -533,7 +546,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=@OBJLISTS@ +OBJLISTS=OBJS.SH # Note that $(LIBSRCS) *cannot* contain any variable references, or # the suffix substitution will break on some platforms! diff --git a/src/lib/apputils/Makefile.in b/src/lib/apputils/Makefile.in index bc8b8a07ba..38bb0f0415 100644 --- a/src/lib/apputils/Makefile.in +++ b/src/lib/apputils/Makefile.in @@ -32,6 +32,7 @@ LIBOBJS=$(OUTPRE)daemon.$(OBJEXT) SRCS= $(srcdir)/daemon.c \ $(srcdir)/dummy.c +@libpriv_frag@ @lib_frag@ @libobj_frag@ diff --git a/src/plugins/kdb/db2/libdb2/Makefile.in b/src/plugins/kdb/db2/libdb2/Makefile.in index c993f34a7a..77326a2392 100644 --- a/src/plugins/kdb/db2/libdb2/Makefile.in +++ b/src/plugins/kdb/db2/libdb2/Makefile.in @@ -40,4 +40,5 @@ $(srcdir)/include/autoconf.stmp: $(srcdir)/configure.in $(SRCTOP)/aclocal.m4 clean-includes:: $(RM) $(HDRS) include/*.stmp +@libnodeps_frag@ @lib_frag@ diff --git a/src/util/ss/Makefile.in b/src/util/ss/Makefile.in index b719b135f7..a11072bac8 100644 --- a/src/util/ss/Makefile.in +++ b/src/util/ss/Makefile.in @@ -166,7 +166,7 @@ clean:: ss.ar ss.tar \ TAGS test_ss - +@libpriv_frag@ @lib_frag@ @libobj_frag@ -- cgit