Changes to support AIX shared libraries. The interactions
authorSam Hartman <hartmans@mit.edu>
Fri, 23 Jun 1995 00:59:54 +0000 (00:59 +0000)
committerSam Hartman <hartmans@mit.edu>
Fri, 23 Jun 1995 00:59:54 +0000 (00:59 +0000)
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

15 files changed:
src/ChangeLog
src/aclocal.m4
src/config/ChangeLog
src/config/pre.in
src/configure.in
src/lib/crypto/ChangeLog
src/lib/crypto/Makefile.in
src/lib/crypto/configure.in
src/lib/krb5/ChangeLog
src/lib/krb5/Makefile.in
src/lib/krb5/configure.in
src/util/et/ChangeLog
src/util/et/Makefile.in
src/util/et/configure.in
src/util/makeshlib

index ffbb7abd61826f3d74d6a334a8b28b79f06ca047..f32475a9bc0fb005e2a8578935cdbc2c862cc7ed 100644 (file)
@@ -21,7 +21,21 @@ Wed Jun 21 17:38:34 1995  Ezra Peisach  <epeisach@kangaroo.mit.edu>
        * aclocal.m4: Add KRB5_SIGTYPE (taken from include/krb5) so that
                other applications may use defintion. 
 
-Wed Jun 21 14:57:55 1995    <tytso@rsx-11.mit.edu>
+
+Wed Jun 21 16:10:09 1995  Sam Hartman  <hartmans@tardis.MIT.EDU>
+
+       * 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    <tytso@rsx-11.mit.edu>
 
        * aclocal.m4: Removed extra blank lines and added "dnl" to the end
                of some macro definitions to get rid of extra newlines
index 299dc19b5d42d99295ba5c15f51b843b042146a2..23910419e134d0e6fed0dbc5e667e5e66cc8e99f 100644 (file)
@@ -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
index dba841709456bf325e38f4ca5c888530b7abd816..413364ddee5e4a35f78bfd41fd07b59ddadadbcb 100644 (file)
@@ -1,3 +1,6 @@
+Thu Jun 22 13:27:00 1995  Sam Hartman  <hartmans@tardis.MIT.EDU>
+
+       * 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.
index 48e2663663be5d9c6110334b2c7253c6d9ba76fa..15244a8e35c71dac54b0036e7ebeda180d76157c 100644 (file)
@@ -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@
 
index 5c2934f9bf28182fe72a9a7147ab24e81e05c988..31f511713b5ad71eb24eb6cd85de0dbd41d67780 100644 (file)
@@ -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],,)
index 5804981179c965384bd189108bee277fff223b6f..5e183bd996f3a969689feb9b0fc96beadadf95bb 100644 (file)
@@ -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.
index 615626d564e01f9dc760a2e73802f8c302dd669d..1fcb041d4ae9e32eb6a4b7200b7ae742a9d9fb3c 100644 (file)
@@ -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::
index f75bfd29ecd53275f01ead345995667ae976bd1d..ef8c079534218bd92b03f8e2ab19041acd15093c 100644 (file)
@@ -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
index 69f75fad2626d6db683b62cb6d27947f11a78937..fea2a0b49ec5f11be6f9fd05dd092bf4f54b3b05 100644 (file)
@@ -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.
index 7ce3eb256c0c0e628624f1c4c71eb91ded62b320..ee4ba56c0164690892469c701c54e17e833b18a2 100644 (file)
@@ -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::
index 4c60aba5691ebe3d44fb3665d2b3e12b00be7284..86e3545da85384783cca7d139380bb3785dbaaf9 100644 (file)
@@ -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
index 832b27ccd317dcbf8a8634626df0c80f006bcaa6..a1d5fb53a4e77fdc60bd5a6c72d1ab7359845dd5 100644 (file)
@@ -1,3 +1,11 @@
+Thu Jun 22 13:06:47 1995  Sam Hartman  <hartmans@tardis.MIT.EDU>
+
+       * 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    <tytso@rsx-11.mit.edu>
 
        * configure.in: Remove standardized set of autoconf macros, which
index 8c5e549abc74b512edf1ef32c9ce9f876d4196c3..264b92b4689d1af1b29861c7ceb4ec75bf3f89e3 100644 (file)
@@ -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::
index 0263436ca0fc529966710ea76c15be268ee79d19..717dfc09245823be2d26cfab30f24040fcb3890b 100644 (file)
@@ -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
index 71eba9a2953837f7e49a6cb9133403bcea630d3f..8f6f7dc42ce83f87a7d9451b68f9519a3c5da642 100644 (file)
@@ -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