From: Sam Hartman Date: Fri, 23 Jun 1995 00:59:54 +0000 (+0000) Subject: Changes to support AIX shared libraries. The interactions X-Git-Tag: krb5-1.0-beta6~1687 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6cd88aa348286b0535b95b84f54beb95abd29a92;p=krb5.git Changes to support AIX shared libraries. The interactions between configure.in and Makefile.in change significantly for shared libraries: the static library target is no longer specified in the Makefile, although a rule to make the static library is specified. Also, none of the libraries have any more unresolved symbols. As discussed, libcom_err.a is made shared and symlinks are created in lib. These changes sort of work, although I suspect cleanup is necessary. I don't think it breaks too much on other platforms. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6126 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/ChangeLog b/src/ChangeLog index ffbb7abd6..f32475a9b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -21,7 +21,21 @@ Wed Jun 21 17:38:34 1995 Ezra Peisach * aclocal.m4: Add KRB5_SIGTYPE (taken from include/krb5) so that other applications may use defintion. -Wed Jun 21 14:57:55 1995 + +Wed Jun 21 16:10:09 1995 Sam Hartman + + * aclocal.m4 (SHARED_RULE_LOCAL): Add support for not making + static libs. Moves the clean and all target for shared libs in + shared lib Makefiles into this rule instead of Makefile.in + + * configure.in: Added krb5_cv_noshlibs_ext, the extension for + static libraries that have shared counterparts. Also added + krb5_cv_staticlibs_enabled, (set by the code for --enable-shared, + not by any extra option) to determine whether static versions of + shared libs are compiled on a per-platform basis. + + + Wed Jun 21 14:57:55 1995 * aclocal.m4: Removed extra blank lines and added "dnl" to the end of some macro definitions to get rid of extra newlines diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 299dc19b5..23910419e 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -717,6 +717,12 @@ dnl This rule adds the additional Makefile fragment necessary to actually dnl create the shared library dnl define(V5_MAKE_SHARED_LIB,[ +if test "[$]krb5_cv_staticlibs_enabled" = yes + then + SHLIB_STATIC_TARGET="$1.[\$](STEXT)" + else + SHLIB_STATIC_TARGET= + fi AC_ARG_ENABLE([shared], [ --enable-shared build with shared libraries],[ SHLIB_TAIL_COMP=$krb5_cv_shlibs_tail_comp @@ -739,13 +745,15 @@ HOST_TYPE=$krb5_cv_host AC_SUBST(HOST_TYPE) SHEXT=$krb5_cv_shlibs_ext AC_SUBST(SHEXT) +STEXT=$krb5_cv_noshlibs_ext +AC_SUBST(STEXT) DO_MAKE_SHLIB="$1.\$""(SHEXT)" AC_PUSH_MAKEFILE()dnl -all:: $(DO_MAKE_SHLIB) +all:: [$](DO_MAKE_SHLIB) [$](SHLIB_STATIC_TARGET) clean:: - $(RM) $1.[$](SHEXT) + $(RM) $1.[$](SHEXT) [$](SHLIB_STATIC_TARGET) $1.[$](SHEXT): [$](LIBDONE) [$](DEPLIBS) [$](SRCTOP)/util/makeshlib [$](HOST_TYPE) [$](CC) [$]@ \ @@ -755,9 +763,15 @@ $1.[$](SHEXT): [$](LIBDONE) [$](DEPLIBS) AC_POP_MAKEFILE()dnl ],[ DO_MAKE_SHLIB= +AC_PUSH_MAKEFILE() +all:: [$](DO_MAKE_SHLIB) [$](SHLIB_STATIC_TARGET) + +clean:: + $(RM) $1.[$](STEXT) +AC_POP_MAKEFILE() ])dnl AC_SUBST(DO_MAKE_SHLIB) -])dnl +AC_SUBST(SHLIB_STATIC_TARGET)])dnl dnl dnl Defines LDARGS correctly so that we actually link with the shared library dnl diff --git a/src/config/ChangeLog b/src/config/ChangeLog index dba841709..413364dde 100644 --- a/src/config/ChangeLog +++ b/src/config/ChangeLog @@ -1,3 +1,6 @@ +Thu Jun 22 13:27:00 1995 Sam Hartman + + * pre.in (STEXT): Add definitions for STEXT and STATIC_TARGET Thu Jun 15 17:47:49 EDT 1995 Paul Park (pjpark@mit.edu) * pre.in - Add definitions for building and using shared libraries. diff --git a/src/config/pre.in b/src/config/pre.in index 48e266366..15244a8e3 100644 --- a/src/config/pre.in +++ b/src/config/pre.in @@ -64,8 +64,9 @@ YACC = @YACC@ HOST_TYPE = @HOST_TYPE@ SHEXT = @SHEXT@ +STEXT=@STEXT@ DO_MAKE_SHLIB = @DO_MAKE_SHLIB@ - +SHLIB_STATIC_TARGET=@SHLIB_STATIC_TARGET@ SRCTOP = $(srcdir)/$(BUILDTOP) SUBDIRS = @subdirs@ diff --git a/src/configure.in b/src/configure.in index 5c2934f9b..31f511713 100644 --- a/src/configure.in +++ b/src/configure.in @@ -12,6 +12,7 @@ case $krb5_cv_host in echo "Enabling shared libraries for Linux...." krb5_cv_shlibs_cflags=-fPIC krb5_cv_shlibs_ext=so +krb5_cv_noshlibs_ext=a krb5_cv_shlibs_dir=shared krb5_cv_shlibs_ldflag="-dy" krb5_cv_noshlibs_ldflag="-dn" @@ -22,10 +23,27 @@ case $krb5_cv_host in krb5_cv_shlibs_tail_comp= krb5_cv_shlibs_enabled=yes ;; +*-*-aix*) + echo "Enabling shared libraries for AIX...." + krb5_cv_shlibs_cflags= + krb5_cv_shlibs_ext=a + krb5_cv_noshlibs_ext=do-not-make + krb5_cv_shlibs_dir= + krb5_cv_shlibs_ldflag= + krb5_cv_noshlibs_ldflag= + krb5_cv_shlibs_sym_ufo= + krb5_cv_shlibs_dirhead="-L" + krb5_cv_exe_need_dirs=yes + krb5_cv_shlibs_use_dirs=no + krb5_cv_staticlibs_enabled= + krb5_cv_shlibs_tail_comp= + krb5_cv_shlibs_enabled=yes +;; *-*-solaris*) echo "Enabling shared libraries for Solaris...." krb5_cv_shlibs_cflags=-Kpic krb5_cv_shlibs_ext=so + krb5_cv_noshlibs_ext=a krb5_cv_shlibs_dir=shared krb5_cv_shlibs_ldflag="-dy" krb5_cv_noshlibs_ldflag="-dn" @@ -34,12 +52,14 @@ case $krb5_cv_host in krb5_cv_exe_need_dirs=yes krb5_cv_shlibs_use_dirs=yes krb5_cv_shlibs_tail_comp= + krb5_cv_staticlibs_enabled=yes krb5_cv_shlibs_enabled=yes ;; alpha-dec-osf*) echo "Enabling shared libraries for Alpha OSF...." krb5_cv_shlibs_cflags= krb5_cv_shlibs_ext=so +krb5_cv_noshlibs_ext=a krb5_cv_shlibs_dir= krb5_cv_shlibs_ldflag="-call_shared" krb5_cv_noshlibs_ldflag="-non_shared" @@ -48,6 +68,7 @@ alpha-dec-osf*) krb5_cv_exe_need_dirs=no krb5_cv_shlibs_use_dirs=yes krb5_cv_shlibs_tail_comp= + krb5_cv_staticlibs_enabled=yes krb5_cv_shlibs_enabled=yes if test ! -f so_locations; then cp -p /usr/shlib/so_locations . @@ -61,12 +82,14 @@ alpha-dec-osf*) ;; esac],[krb5_cv_shlibs_cflags= krb5_cv_shlibs_ext= +krb5_cv_noshlibs_ext=a krb5_cv_shlibs_dir= krb5_cv_shlibs_ldflag= krb5_cv_noshlibs_ldflag= krb5_cv_shlibs_sym_ufo= krb5_cv_shlibs_dirhead= krb5_cv_shlibs_tail_comp= +krb5_cv_staticlibs_enabled=yes krb5_cv_shlibs_enabled=]) AC_ARG_ENABLE([athena], [ --enable-athena build with MIT Project Athena configuration],,) diff --git a/src/lib/crypto/ChangeLog b/src/lib/crypto/ChangeLog index 580498117..5e183bd99 100644 --- a/src/lib/crypto/ChangeLog +++ b/src/lib/crypto/ChangeLog @@ -1,3 +1,8 @@ +Thu Jun 22 18:34:26 1995 Sam Hartman (hartmans@tardis) + + * configure.in: Changed to new scheme for static libs. + + Fri Jun 16 11:14:50 EDT 1995 Paul Park (pjpark@mit.edu) * configure.in - Add install target for shared library. diff --git a/src/lib/crypto/Makefile.in b/src/lib/crypto/Makefile.in index 615626d56..1fcb041d4 100644 --- a/src/lib/crypto/Makefile.in +++ b/src/lib/crypto/Makefile.in @@ -41,7 +41,7 @@ all-mac:: $(OBJS) all-windows:: $(OBJS) -libcrypto.a: $(LIBDONE) +libcrypto.$(STEXT): $(LIBDONE) if test -f $@ ; then \ for i in $(LIB_SUBDIRS) ; \ do \ @@ -59,10 +59,6 @@ libcrypto.a: $(LIBDONE) libcrypto.lib: libdir crypto.lib -install:: libcrypto.a - $(INSTALL_DATA) libcrypto.a $(DESTDIR)$(KRB5_LIBDIR)/libcrypto.a - $(RANLIB) $(DESTDIR)$(KRB5_LIBDIR)/libcrypto.a - clean:: clean-$(WHAT) clean-unix:: diff --git a/src/lib/crypto/configure.in b/src/lib/crypto/configure.in index f75bfd29e..ef8c07953 100644 --- a/src/lib/crypto/configure.in +++ b/src/lib/crypto/configure.in @@ -8,8 +8,6 @@ AC_PROG_INSTALL V5_SHARED_LIB_OBJS SubdirLibraryRule([${OBJS}]) DO_SUBDIRS -LinkFileDir(../libcrypto.a, libcrypto.a, ./crypto) -AppendRule([all-unix:: ../libcrypto.a]) V5_MAKE_SHARED_LIB(libcrypto) AC_ARG_ENABLE([shared], [ --enable-shared build shared libraries],[ @@ -19,6 +17,13 @@ AppendRule([install:: libcrypto.[$](SHEXT) [$](INSTALL_DATA) libcrypto.[$](SHEXT) \ [$](DESTDIR)[$](KRB5_SHLIBDIR)[$](S)libcrypto.[$](SHEXT)]) ])dnl -AppendRule([all-unix:: libcrypto.a]) -AppendRule([all:: all-$(WHAT)]) +if test -n "$krb5_cv_enable_staticlibs" ; then + AppendRule([all-unix:: libcrypto.a]) + LinkFileDir(../libcrypto.a, libcrypto.a, ./crypto) + AppendRule([all-unix:: ../libcrypto.a]) + AppendRule([install:: libcrypto.a + $(INSTALL_DATA) libcrypto.a $(DESTDIR)$(KRB5_LIBDIR)/libcrypto.a + $(RANLIB) $(DESTDIR)$(KRB5_LIBDIR)/libcrypto.a]) +fi + AppendRule([all:: all-$(WHAT)]) V5_AC_OUTPUT_MAKEFILE diff --git a/src/lib/krb5/ChangeLog b/src/lib/krb5/ChangeLog index 69f75fad2..fea2a0b49 100644 --- a/src/lib/krb5/ChangeLog +++ b/src/lib/krb5/ChangeLog @@ -1,3 +1,8 @@ +Thu Jun 22 18:03:35 1995 Sam Hartman (hartmans@tardis) + + * Makefile.in: Treat libcom_err.a as shared, use new conventions + regarding static version. + Fri Jun 16 11:16:44 EDT 1995 Paul Park (pjpark@mit.edu) * configure.in - Add shared library install target. diff --git a/src/lib/krb5/Makefile.in b/src/lib/krb5/Makefile.in index 7ce3eb256..ee4ba56c0 100644 --- a/src/lib/krb5/Makefile.in +++ b/src/lib/krb5/Makefile.in @@ -19,21 +19,21 @@ LIBDONE= error_tables/DONE asn.1/DONE ccache/DONE ccache/stdio/DONE \ KRB4_LIBS=@KRB4_LIB@ KRB4_CRYPTO_LIBS=@KRB4_CRYPTO_LIB@ DEPKRB4_LIBS=@DEPKRB4_LIB@ @DEPKRB4_CRYPTO_LIB@ -DEPLIBS=$(TOPLIBD)/libcrypto.$(SHEXT) -SHLIB_LIBS=$(KRB4_LIBS) $(KRB4_CRYPTO_LIBS) -lcrypto -SHLIB_LDFLAGS= $(LDFLAGS) @SHLIB_RPATH_DIRS@ \ - $(LD_UNRESOLVED_PREFIX)_et_list $(LD_UNRESOLVED_PREFIX)error_message +DEPLIBS=$(TOPLIBD)/libcrypto.$(SHEXT) $(TOPLIBD)/libcom_err.$(SHEXT) +SHLIB_LIBS=$(KRB4_LIBS) $(KRB4_CRYPTO_LIBS) -lcrypto -lcom_err +SHLIB_LDFLAGS= $(LDFLAGS) @SHLIB_RPATH_DIRS@ +# $(LD_UNRESOLVED_PREFIX)_et_list $(LD_UNRESOLVED_PREFIX)error_message SHLIB_LIBDIRS= @SHLIB_LIBDIRS@ all-unix:: all-windows:: -libkrb5.a: $(LIBDONE) +libkrb5.$(STEXT): $(LIBDONE) if test -f $@ ; then \ for i in $(LIB_SUBDIRS) ; \ do \ - $(LIBUPDATE) $@ $$i/DONE $$i ; \ + $(LIBUPDATE)nn $@ $$i/DONE $$i ; \ done ; \ else \ for i in $(LIB_SUBDIRS) ; \ @@ -41,13 +41,15 @@ libkrb5.a: $(LIBDONE) $(LIBUPDATE) --force $@ $$i/DONE $$i ; \ done ; \ fi - $(RANLIB) libkrb5.a + $(RANLIB) libkrb5.$(STEXT) touch libkrb5.stamp -install:: +install-mac:: $(INSTALL_DATA) libkrb5.a $(DESTDIR)$(KRB5_LIBDIR)/libkrb5.a $(RANLIB) $(DESTDIR)$(KRB5_LIBDIR)/libkrb5.a + + clean:: clean-$(WHAT) clean-unix:: diff --git a/src/lib/krb5/configure.in b/src/lib/krb5/configure.in index 4c60aba56..86e3545da 100644 --- a/src/lib/krb5/configure.in +++ b/src/lib/krb5/configure.in @@ -6,17 +6,23 @@ AC_PROG_ARCHIVE_ADD AC_PROG_RANLIB AC_PROG_INSTALL DO_SUBDIRS -AppendRule([all:: libkrb5.a]) +AppendRule([all:: libkrb5.[$](STEXT)]) V5_MAKE_SHARED_LIB(libkrb5) AC_ARG_ENABLE([shared], [ --enable-shared build shared libraries],[ LinkFileDir(../libkrb5.[$](SHEXT), libkrb5.[$](SHEXT), ./krb5) AppendRule([all-unix:: ../libkrb5.$(SHEXT)]) -AppendRule([install:: libkrb5.[$](SHEXT) +AppendRule([install-unix:: libkrb5.[$](SHEXT) [$](INSTALL_DATA) libkrb5.[$](SHEXT) \ [$](DESTDIR)[$](KRB5_SHLIBDIR)[$](S)libkrb5.[$](SHEXT)]) ])dnl -LinkFileDir(../libkrb5.a, libkrb5.a, ./krb5) -AppendRule([all-unix:: ../libkrb5.a]) +if test -n "$krb5_cv_enable_staticlibs" ; then + LinkFileDir(../libkrb5.[$](STEXT), libkrb5.[$](STEXT), ./krb5) + AppendRule([install:: + [$](INSTALL_DATA) libkrb5.[$](STEXT) [$](DESTDIR)[$](KRB5_LIBDIR)/libkrb5.[$](STEXT) + [$](RANLIB) [$](DESTDIR)[$](KRB5_LIBDIR)/libkrb5.[$](STEXT)]) + AppendRule([all-unix:: ../libkrb5.[$](STEXT)]) +fi +AppendRule([install:: install-[$](WHAT)]) AppendRule([all:: all-$(WHAT)]) V5_AC_OUTPUT_MAKEFILE diff --git a/src/util/et/ChangeLog b/src/util/et/ChangeLog index 832b27ccd..a1d5fb53a 100644 --- a/src/util/et/ChangeLog +++ b/src/util/et/ChangeLog @@ -1,3 +1,11 @@ +Thu Jun 22 13:06:47 1995 Sam Hartman + + * Makefile.in Changed libcom_err.a to libcom_err.$(STEXT), removed rule to clean it up on Unix as aclocal.m4 already inserts the rule. If this breaks on Macs, please let me know how I should do this in the future. + + * configure.in: Changed to make libcom_err as a shared library. + + + Fri Jun 9 19:00:05 1995 * configure.in: Remove standardized set of autoconf macros, which diff --git a/src/util/et/Makefile.in b/src/util/et/Makefile.in index 8c5e549ab..264b92b46 100644 --- a/src/util/et/Makefile.in +++ b/src/util/et/Makefile.in @@ -5,6 +5,8 @@ SED = sed ##DOSLIBNAME=comerr.lib ##DOS!include $(BUILDTOP)\config\windows.in +LIBDONE=./done +LIB_SUBDIRS=. INSTALLFILE = cp LINTFLAGS=-uhvb @@ -25,6 +27,12 @@ CFILES= compile_et.c error_table.c error_message.c et_name.c \ SRCS=$(CFILES) + +SHLIB_LIBS= +SHLIB_LDFLAGS= $(LDFLAGS) @SHLIB_RPATH_DIRS@ +SHLIB_LIBDIRS= @SHLIB_LIBDIRS@ +STEXT=@STEXT@ + all:: all-$(WHAT) all-windows: com_err.obj error_message.obj et_name.obj @@ -87,16 +95,19 @@ install:: mit-sipb-copyright.h # ## install_library_target(com_err,$(LIBOBJS),$(LINTFILES),) -all-unix:: libcom_err.a -all-mac:: libcom_err.a -libcom_err.a: $(LIBOBJS) +all-mac:: libcom_err.$(STEXT) + +libcom_err.$(STEXT): $(LIBOBJS) $(ARCHIVE) $@ $(LIBOBJS) $(RANLIB) $@ +done:: $(LIBOBJS) + $(RM) done + echo $(LIBOBJS) >done + clean-unix:: - $(RM) libcom_err.a $(RM) $(LIBOBJS) clean-mac:: diff --git a/src/util/et/configure.in b/src/util/et/configure.in index 0263436ca..717dfc092 100644 --- a/src/util/et/configure.in +++ b/src/util/et/configure.in @@ -24,4 +24,19 @@ AC_FUNC_CHECK(strerror,AC_DEFINE(HAS_STRERROR)) AC_CHECK_HEADERS(stdarg.h) AC_HAVE_HEADERS(stdlib.h) CopySrcHeader(com_err.h,$(BUILDTOP)/include) +V5_MAKE_SHARED_LIB(libcom_err) +AC_ARG_ENABLE([shared], +[ --enable-shared build shared libraries],[ +LinkFileDir([$](TOPLIBD)/libcom_err.[$](SHEXT), libcom_err.[$](SHEXT), ../util/et) +AppendRule([all -unix:: [$](TOPLIBD)/libcom_err.$(SHEXT)]) +AppendRule([install:: libcom_err.[$](SHEXT) + [$](INSTALL_DATA) libcom_err.[$](SHEXT) \ + [$](DESTDIR)[$](KRB5_SHLIBDIR)[$](S)libcom_err.[$](SHEXT)]) +])dnl +if test -n "$krb5_cv_enable_staticlibs" ; then + AppendRule([install:: libcom_err.[$](STEXT) + [$](INSTALL_DATA) libcom_err.[$](STEXT) [$](DESTDIR)[$](KRB5_LIBDIR)[$](S)libcom_err.[$](STEXT)]) + LinkFileDir([$](TOPLIBD)/libcom_err.[$](STEXT),libcom_err.[$](STEXT),../util/et) + AppendRule([all: [$](TOPLIBD)/libcom_err.[$](STEXT)]) +fi V5_AC_OUTPUT_MAKEFILE diff --git a/src/util/makeshlib b/src/util/makeshlib index 71eba9a29..8f6f7dc42 100644 --- a/src/util/makeshlib +++ b/src/util/makeshlib @@ -19,11 +19,35 @@ case $host in do sed -e "s;^;$i/shared/;" -e "s; ; $i/shared/;g" $i/DONE done` - + echo $CC -G $ldflags -o $library $FILES $libdirfl $liblist $CC -G $ldflags -o $library $FILES $libdirfl $liblist stat=$? ;; +*-*-aix*) + FILES=`for i + do + sed -e "s;^;$i/;" -e "s; ; $i/;g" $i/DONE + done` + +ar cq $library $FILES || exit $? + dump -g $library | sed -e 's/^[ ]*[0-9][0-9]*[ ]*\([^ .][^ ]*\)$/\1/p;d' | sort | uniq > ${library}.syms + stat=$? + if [ $stat -eq 0 ] + then + ld -o shr.o $library -H512 -T512 -bM:SRE -lc $ldflags -bfilelist -bgcbypass:1 -bnodelcsect -x -bE:${library}.syms $libdirfl $liblist + stat=$? + if [ $stat -eq 0 ] + then + rm $library ${library}.syms + ar cq $library shr.o + stat=$? + rm shr.o + else + rm -f $library +fi + fi +;; alpha-*-osf*) FILES=`for i do