Changes to do shared library versioning under AIX
authorSam Hartman <hartmans@mit.edu>
Wed, 11 Oct 1995 22:55:05 +0000 (22:55 +0000)
committerSam Hartman <hartmans@mit.edu>
Wed, 11 Oct 1995 22:55:05 +0000 (22:55 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6963 dc483132-0cff-0310-8789-dd5450dbe970

src/ChangeLog
src/aclocal.m4
src/config/ChangeLog
src/config/pre.in
src/configure.in
src/util/.Sanitize
src/util/ChangeLog
src/util/makeshlib.sh

index 6844f948db6b73e91825c73628ba75ce988feef2..6483c8c0ea22afb35ce8562e76d58012648a1910 100644 (file)
@@ -1,3 +1,9 @@
+Wed Oct 11 17:23:45 1995  Sam Hartman  <hartmans@tertius.mit.edu>
+
+       * configure.in: For all platforms, set krb5_cv_shlibs_versioned_filenames; no for AIX, yes for all others
+
+       * aclocal.m4 (v5_make_shlib): Add ability not to make versioned archive files for AIX
+
 Tue Oct 10 21:43:15 1995  Theodore Y. Ts'o  <tytso@dcl>
 
        * wconfig.c: Use win-post.in instead of post.in.
index d30741bbd44276df5a5f411b0a44e8e8fb54ff19..a464f427ad599b19ea8a0a0a163b68b447b35b17 100644 (file)
@@ -860,27 +860,36 @@ SHEXT=$krb5_cv_shlibs_ext
 AC_SUBST(SHEXT)
 STEXT=$krb5_cv_noshlibs_ext
 AC_SUBST(STEXT)
-dnl export the version of the library....
-krb5_cv_shlib_version_$1=$2
+if test "$krb5_cv_shlibs_versioned_filenames" = "yes" ; then
+VEXT=".$2" # Version of library goes in archive name
 if test "$krb5_cv_shlibs_need_nover" = yes; then
        DO_MAKE_SHLIB="$1.\$""(SHEXT).$2 $1.\$""(SHEXT)"
 else
        DO_MAKE_SHLIB="$1.\$""(SHEXT).$2"
 fi
+else # $krb5_cv_shlibs_versioned_filenames
+VEXT=
+       DO_MAKE_SHLIB="$1.\$""(SHEXT)"
+fi
+AC_SUBST(VEXT)
+dnl export the version of the library....
+krb5_cv_shlib_version_$1=$2
 AC_SUBST(SHLIB_NAME)
 AC_PUSH_MAKEFILE()dnl
 
 all-unix:: [$](DO_MAKE_SHLIB) [$](SHLIB_STATIC_TARGET)
 
 clean-unix:: 
-       $(RM) $1.[$](SHEXT).$2 $1.[$](SHEXT) [$](SHLIB_STATIC_TARGET)
+       $(RM) $1.[$](SHEXT)$(VEXT) $1.[$](SHEXT) [$](SHLIB_STATIC_TARGET)
 
-$1.[$](SHEXT).$2: [$](LIBDONE) [$](DEPLIBS)
+$1.[$](SHEXT)$(VEXT): [$](LIBDONE) [$](DEPLIBS)
        [$](BUILDTOP)/util/makeshlib [$]@       \
                "[$](SHLIB_LIBDIRS)" \
-               "[$](SHLIB_LIBS)" "[$](SHLIB_LDFLAGS)" [$](LIB_SUBDIRS)
+               "[$](SHLIB_LIBS)" "[$](SHLIB_LDFLAGS)" "$2" [$](LIB_SUBDIRS)
 AC_POP_MAKEFILE()dnl
+if test "$krb5_cv_shlibs_versioned_filenames" = "yes" ; then
 LinkFile($1.[$](SHEXT),$1.[$](SHEXT).$2)
+fi
 ],[
 STEXT=$krb5_cv_noshlibs_ext
 AC_SUBST(STEXT)
@@ -897,7 +906,12 @@ AC_SUBST(SHLIB_STATIC_TARGET)
 
 AC_ARG_ENABLE([shared],
 [  --enable-shared         build shared libraries],[
-LinkFileDir($3/$1.[$](SHEXT).$2, $1.[$](SHEXT).$2, $4)
+# Note that even if we aren't installing versions of the library with
+# Version identifiers in the file name, we still need to make the links
+# in ${BUILDTOP}/lib for dependencies.
+# The following makes sure that the path of symlinks traces back to the real library; it is
+# not an error that $2 is used in some places and $VEXT in others.
+LinkFileDir($3/$1.[$](SHEXT).$2, $1.[$](SHEXT)[$](VEXT), $4)
 AppendRule([$3/$1.[$](SHEXT): $3/$1.[$](SHEXT).$2
        [$](RM) $3/$1.[$](SHEXT)
        [$](LN) $1.[$](SHEXT).$2 $3/$1.[$](SHEXT)
@@ -908,12 +922,12 @@ AppendRule(clean::[
 if test "$krb5_cv_shlibs_need_nover" = "yes" ; then
 AppendRule([all-unix:: $3/$1.$(SHEXT).$2 $3/$1.$(SHEXT)])
 else
-AppendRule([all-unix:: $3/$1.$(SHEXT).$2])
+AppendRule([all-unix:: $3/$1.$(SHEXT)[$](VEXT)])
 fi
-AppendRule([install::  $1.[$](SHEXT).$2
-       [$](RM) [$](DESTDIR)[$](KRB5_SHLIBDIR)[$](S)$1.[$](SHEXT).$2
-       [$](INSTALL_DATA) $1.[$](SHEXT).$2      \
-               [$](DESTDIR)[$](KRB5_SHLIBDIR)[$](S)$1.[$](SHEXT).$2
+AppendRule([install::  $1.[$](SHEXT)[$](VEXT)
+       [$](RM) [$](DESTDIR)[$](KRB5_SHLIBDIR)[$](S)$1.[$](SHEXT)[$](VEXT)
+       [$](INSTALL_DATA) $1.[$](SHEXT)[$](VEXT)        \
+               [$](DESTDIR)[$](KRB5_SHLIBDIR)[$](S)$1.[$](SHEXT)[$](VEXT)
 ])
 if test "$krb5_cv_shlibs_need_nover" = "yes" ; then
 AppendRule([install::  $1.[$](SHEXT).$2
@@ -958,3 +972,7 @@ else
 fi
 AC_SUBST(LDARGS)
 ])dnl
+
+
+
+
index 2ec3d0a95cd88257f9d97a70f5711f1c4a46ebd6..00fbcf48a8174d8fe4965e6d519e45dcf591bcbc 100644 (file)
@@ -1,3 +1,7 @@
+Wed Oct 11 18:13:30 1995  Sam Hartman  <hartmans@tertius.mit.edu>
+
+       * pre.in (DO_MAKE_SHLIB):  substitute VEXT, for the version extension for shared libs
+
 Tue Oct 10 21:42:14 1995  Theodore Y. Ts'o  <tytso@dcl>
 
        * win-post.in: New file
index 7de8d6d74f3d8ae1d3bbd53c6a02ffc6bc07a501..fcd7a485c537cc3fe0fb432cb66fa3edb1954837 100644 (file)
@@ -82,6 +82,7 @@ YACC = @YACC@
 HOST_TYPE = @HOST_TYPE@
 SHEXT = @SHEXT@
 STEXT=@STEXT@
+VEXT=@VEXT@
 DO_MAKE_SHLIB = @DO_MAKE_SHLIB@
 SHLIB_STATIC_TARGET=@SHLIB_STATIC_TARGET@
 
index 5242e856cc4c461d27098ea878c4d2002fd90e00..5531c44bfc4dd33127bd3da01b04ee3fd748df47 100644 (file)
@@ -26,6 +26,7 @@ case $krb5_cv_host in
        krb5_cv_shlibs_cflags=-fpic
        krb5_cv_shlibs_ext=so
        krb5_cv_noshlibs_ext=a
+krb5_cv_shlibs_versioned_filenames = yes # version in filename of library
        krb5_cv_shlibs_need_nover=no
        krb5_cv_shlibs_dir=shared
        krb5_cv_shlibs_ldflag=
@@ -44,6 +45,7 @@ case $krb5_cv_host in
        krb5_cv_shlibs_cflags=-fPIC
        krb5_cv_shlibs_ext=so
        krb5_cv_noshlibs_ext=a
+krb5_cv_shlibs_versioned_filenames = yes
        krb5_cv_shlibs_need_nover=yes
        krb5_cv_shlibs_dir=shared
        krb5_cv_shlibs_ldflag="-dy"
@@ -61,7 +63,8 @@ case $krb5_cv_host in
        echo "Enabling shared libraries for AIX...."
        krb5_cv_shlibs_cflags=
        krb5_cv_shlibs_ext=a
-       krb5_cv_shlibs_need_nover=yes
+       krb5_cv_shlibs_need_nover=no # need_nover *must* be no if versioned_filenames = no
+       krb5_cv_shlibs_versioned_filenames=no
        krb5_cv_noshlibs_ext=do-not-make
        krb5_cv_shlibs_dir=
        if test $krb5_cv_prog_gcc = yes ; then
@@ -89,6 +92,7 @@ fi
        fi
        krb5_cv_shlibs_ext=so
        krb5_cv_noshlibs_ext=a
+krb5_cv_shlibs_versioned_filenames = yes
        krb5_cv_shlibs_need_nover=yes
        krb5_cv_shlibs_dir=shared
        krb5_cv_shlibs_ldflag="-dy"
@@ -107,6 +111,7 @@ alpha-dec-osf*)
        krb5_cv_shlibs_cflags=
        krb5_cv_shlibs_ext=so
        krb5_cv_noshlibs_ext=a
+krb5_cv_shlibs_versioned_filenames = yes
        krb5_cv_shlibs_need_nover=yes
        krb5_cv_shlibs_dir=
        krb5_cv_shlibs_ldflag="-call_shared"
index 81ece2a7ceecbd7ec17ec2640fa211bb78111e5d..02eaaf12265d9363a16856aabc6ded5e1436b400 100644 (file)
@@ -28,9 +28,6 @@ ChangeLog
 Makefile.in
 Sanitize
 autoconf
-berk_db
-getsyms
-getsyms.sed
 configure
 configure.in
 depfix.sed
@@ -38,13 +35,14 @@ et
 kbuild
 kfrags
 libupdate.sh
+makeshlib.sh
 lndir
 makedepend
-makeshlib.sh
 profile
 pty
 reconf
 ss
+unifdef
 
 Things-to-lose:
 
index 4172777b837deb3ceaad1c714cd5b3e836ccca7f..e8fe2fbdebecc5c23e2bd4d779a48184f7e4fc34 100644 (file)
@@ -1,3 +1,7 @@
+Wed Oct 11 17:21:16 1995  Sam Hartman  <hartmans@tertius.mit.edu>
+
+       * makeshlib.sh:  bring in library version and do something with it for AIX.
+
 Mon Oct  9 19:00:13 1995  Ezra Peisach  <epeisach@kangaroo.mit.edu>
 
        * makeshlib.sh: For NetBSD convert flags designed for cc to ones
index 5a8fb7f8b160d1fbd4cbf107379f3ee203380fd3..18697c59ffb69989d68b3ff29852affec7c70072 100644 (file)
@@ -3,7 +3,7 @@
 # makeshlib: Make a shared library.....
 #
 # Usage: makeshlib  <library> <libdirfl> <liblist> <flags>     \
-#      <directories>
+#      <library version> <directories>
 #
 
 host=@HOST_TYPE@
@@ -14,8 +14,9 @@ library=$1 ; shift
 libdirfl=$1; shift
 liblist=$1; shift
 ldflags=$1; shift
+VERSION="$1" ; shift
 
-case $host in
+case $host  in
 *-*-netbsd*)
        FILES=`for i
        do
@@ -56,16 +57,16 @@ ar cq $library $FILES || exit $?
        if [ $stat -eq 0 ]
        then
        if test "$HAVE_GCC" = "yes" ; then
-               $CC -o shr.o $library -nostartfiles -Xlinker -bgcbypass:1 -Xlinker -bfilelist -Xlinker -bM:SRE -Xlinker -bE:${library}.syms $ldflags $liblist $libdirfl
-               else ld -o shr.o $library -H512 -T512 -bM:SRE -lc $ldflags -bfilelist -bgcbypass:1 -bnodelcsect -x -bE:${library}.syms $libdirfl $liblist
+               $CC -o shr.o.$VERSION $library -nostartfiles -Xlinker -bgcbypass:1 -Xlinker -bfilelist -Xlinker -bM:SRE -Xlinker -bE:${library}.syms $ldflags $liblist $libdirfl
+               else ld -o shr.o.$VERSION $library -H512 -T512 -bM:SRE -lc $ldflags -bfilelist -bgcbypass:1 -bnodelcsect -x -bE:${library}.syms $libdirfl $liblist
             fi
  stat=$?
        if [ $stat -eq 0 ]
              then
              rm $library ${library}.syms
-             ar cq $library shr.o
+             ar cq $library shr.o.$VERSION
              stat=$?
-             rm shr.o
+             rm shr.o.$VERSION
             else
             rm -f $library
 fi