From: Sam Hartman Date: Sat, 22 Feb 1997 08:04:07 +0000 (+0000) Subject: * Make shared libs work on AIX X-Git-Tag: krb5-1.1-beta1~1238 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1345f4257b28cb248022abd94ea9be13a90b1991;p=krb5.git * Make shared libs work on AIX * Remove non-AIX stuff from makeshlib.sh as it is no longer needed git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9953 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/ChangeLog b/src/util/ChangeLog index 5f074079b..d4a013163 100644 --- a/src/util/ChangeLog +++ b/src/util/ChangeLog @@ -1,3 +1,8 @@ +Fri Feb 21 15:58:19 1997 Sam Hartman + + * makeshlib.sh : Remove non AIX stuff; rewrite AIX stuff to work + with new build system. + Fri Dec 6 10:59:32 1996 Tom Yu * getsyms: Don't echo filename if there are no bad symbols. diff --git a/src/util/Makefile.in b/src/util/Makefile.in index d8296904f..656a7c464 100644 --- a/src/util/Makefile.in +++ b/src/util/Makefile.in @@ -42,7 +42,7 @@ makeshlib: $(srcdir)/makeshlib.sh Makefile $(SLIBSH) $(srcdir)/makeshlib.sh >$@.tmp&&chmod a+x $@.tmp&&mv $@.tmp $@ aix.bincmds: Makefile - echo libpath $(KRB5_SHLIBDIR):`pwd`/$(TOPLIBD):/usr/lib:/lib >aix.bincmds + echo libpath $(KRB5_LIBDIR):`pwd`/$(TOPLIBD):/usr/lib:/lib >aix.bincmds clean:: $(RM) libupdate makeshlib diff --git a/src/util/makeshlib.sh b/src/util/makeshlib.sh index a8afb3b11..f305e2df6 100644 --- a/src/util/makeshlib.sh +++ b/src/util/makeshlib.sh @@ -1,165 +1,68 @@ #!/bin/sh # # makeshlib: Make a shared library..... +# This script is used on platforms +# like AIX where making +# a shared library is somewhat more complex than just +# calling ld. # -# Usage: makeshlib \ -# +# Usage: makeshlib -o + # host=@HOST_TYPE@ CC="@CC@" HAVE_GCC=@HAVE_GCC@ -library=$1 ; shift -libdirfl=$1; shift -liblist=$1; shift -ldflags=$1; shift -VERSION="$1" ; shift +version=$1;shift +shift; # discard -o +library=$1; shift +for opt in $* ; do + case $opt in + -*) + LDFLAGS="$LDFLAGS $opt" + ;; + *) + OBJS="$OBJS $opt" + ;; + esac +done case $host in -*-*-netbsd*) - FILES=`for i - do - sed -e "s;^;$i/shared/;" -e "s; ; $i/shared/;g" -e "s;^$i/shared/\$;;" $i/DONE - done` - # Hack to deal with the fact that with cc options are different - # from ld... - ldflags=`echo $ldflags |sed -e "s/-Wl,//g"` - echo ld -Bshareable $ldflags -o $library $FILES $libdirfl $liblist - ld -Bshareable $ldflags -o $library $FILES $libdirfl $liblist - stat=$? - ;; -*-*-hpux*) - FILES=`for i - do - sed -e "s;^;$i/shared/;" -e "s; ; $i/shared/;g" $i/DONE - done` - ldflags="`echo $ldflags | sed 's/-Wl,+b,/+b /g'`" - echo ld -b $ldflags -o $library $FILES $libdirfl $liblist - ld -b $ldflags -o $library $FILES $libdirfl $liblist - stat=$? - ;; -*-*-linux*) - FILES=`for i - do - sed -e "s;^;$i/shared/;" -e "s; ; $i/shared/;g" $i/DONE - done` - - echo $CC -G $ldflags -o $library $optflags $FILES $libdirfl $liblist - $CC --shared $ldflags -o $library $FILES $libdirfl $liblist - stat=$? - ;; -mips-sni-sysv4) - FILES=`for i - do - sed -e "s;^;$i/shared/;" -e "s; ; $i/shared/;g" $i/DONE - done` - - optflags="" - if test "$HAVE_GCC"x = "x" ; then - optflags="-h $library" - else - # XXX assumes that we're either using - # recent gld (binutils 2.7?) or else using native ld - optflags="-Wl,-h -Wl,$library" - fi - ldflags="`echo $ldflags | sed -e 's/-R /-R/g'`" - - echo $CC -G $ldflags -o $library $optflags $FILES $libdirfl $liblist - $CC -G $ldflags -o $library $optflags $FILES $libdirfl $liblist - stat=$? - ;; -*-*-solaris*) - FILES=`for i - do - sed -e "s;^;$i/shared/;" -e "s; ; $i/shared/;g" $i/DONE - done` - - optflags="" - if test "$HAVE_GCC"x = "x" ; then - optflags="-h $library" - else - # XXX assumes that we're either using - # recent gld (binutils 2.7?) or else using native ld - optflags="-Wl,-h -Wl,$library" - fi - - echo $CC -G $ldflags -o $library $optflags $FILES $libdirfl $liblist - $CC -G $ldflags -o $library $optflags $FILES $libdirfl $liblist - stat=$? - ;; -*-*-sunos*) - FILES=`for i - do - sed -e "s;^;$i/shared/;" -e "s; ; $i/shared/;g" $i/DONE - done` - - optflags="" - if test "$HAVE_GCC"x = "x" ; then - optflags="" - CC=ld - else - # XXX assumes that we're either using - # recent gld (binutils 2.7?) or else using native ld - optflags="" - fi - - echo ld -dp -assert pure-text $ldflags -o $library $optflags $FILES $libdirfl -ld -dp -assert pure-text $ldflags -o $library $optflags $FILES $libdirfl - stat=$? - ;; *-*-aix*) - FILES=`for i - do - sed -e "s;^;$i/;" -e "s; ; $i/;g" $i/DONE - done` echo rm $library rm -f $library 2>/dev/null - echo ar cq $library $FILES - ar cq $library $FILES || exit $? + echo ar cq $library $OBJS + ar cq $library $OBJS || exit $? dump -g $library | sed -e 's/^[ ]*[0-9][0-9]*[ ]*\([^ .][^ ]*\)$/\1/p;d' | sort | uniq > ${library}.syms stat=$? if [ $stat -eq 0 ] ; then - if test "$HAVE_GCC" = "yes-broken" ; then - # yikes! this part won't handle gnu ld either! - # disable it for now. - $CC -o shr.o.$VERSION $library -nostartfiles -Xlinker -bgcbypass:1 -Xlinker -bfilelist -Xlinker -bM:SRE -Xlinker -bE:${library}.syms $ldflags $liblist $libdirfl + if test "$HAVE_GCC" = "yes" ; then + + + $CC -o shr.o.$version $library -nostartfiles -Xlinker -bgcbypass:1 -Xlinker -bfilelist -Xlinker -bM:SRE -Xlinker -bE:${library}.syms $LDFLAGS -lc else # Pull in by explicit pathname so we don't get gnu ld if # installed (it could be even if we chose not to use gcc). # Better still would be to do this through $CC -- how do # we get crt0.o left out? - echo /bin/ld -o shr.o.$VERSION $library -H512 -T512 -bM:SRE $ldflags -bgcbypass:1 -bnodelcsect -bE:${library}.syms $libdirfl $liblist -lc - /bin/ld -o shr.o.$VERSION $library -H512 -T512 -bM:SRE $ldflags -bgcbypass:1 -bnodelcsect -bE:${library}.syms $libdirfl $liblist -lc + echo /bin/ld -o shr.o.$version $library -H512 -T512 -bM:SRE $LDFLAGS -bgcbypass:1 -bnodelcsect -bE:${library}.syms $libdirfl $liblist -lc + /bin/ld -o shr.o.$version $library -H512 -T512 -bM:SRE $LDFLAGS -bgcbypass:1 -bnodelcsect -bE:${library}.syms -lc fi stat=$? if [ $stat -eq 0 ] ; then rm $library ${library}.syms - ar cq $library shr.o.$VERSION + ar cq $library shr.o.$version stat=$? - rm shr.o.$VERSION + rm shr.o.$version else rm -f $library fi fi ;; -alpha-*-osf*) - FILES=`for i - do - sed -e "s;^;$i/;" -e "s; ; $i/;g" $i/DONE - done` - - # The "-expect_unresolved *" argument hides the fact that we don't - # provide the (static) db library when building the (dynamic) kadm5 - # libraries. - echo ld -shared -expect_unresolved \* $ldflags -o $library -all $FILES $libdirfl $liblist -none -lc -update_registry ../../so_locations - ld -shared -expect_unresolved \* $ldflags -o $library -all $FILES $libdirfl $liblist -none -lc -update_registry ../../so_locations - stat=$? - ;; *) echo "Host type $host not supported!" exit 1 esac exit $stat -