From 83ee23909b9dcfaf85d756f51242a16bdd4adae8 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Mon, 3 Jul 1995 01:46:55 +0000 Subject: [PATCH] * Replace Gcc test from top level configure.in with one from util/configure.in. * Modify top level configure.in and util/makeshlib.sh so AIX can build/use shared libs with Gcc. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6223 dc483132-0cff-0310-8789-dd5450dbe970 --- src/ChangeLog | 7 +++++++ src/configure.in | 23 ++++++++++------------- src/util/ChangeLog | 6 ++++++ src/util/configure.in | 13 +++++-------- src/util/makeshlib.sh | 7 +++++-- 5 files changed, 33 insertions(+), 23 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3598cc829..fbf0bc1f6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +Sun Jul 2 20:25:58 1995 Sam Hartman + + * configure.in: For paranoid GPL reasons, don't take the Gcc test + directly from the autoconf sources. Instead, borrow my paraphrase + of this test from util/configure.in. It's slightly cleaner + anyway. Also, adjust AIX shared libs to work with Gcc. + Sun Jul 2 04:40:50 1995 Tom Yu * aclocal.m4 (_MAKE_SUBDIRS): Fixed so that error propogates upward if -[ik] not specified. diff --git a/src/configure.in b/src/configure.in index 6b8870bb2..0bf33dc50 100644 --- a/src/configure.in +++ b/src/configure.in @@ -6,18 +6,10 @@ dnl We cannot use the autoconf form as it is too generic and sets other dnl variables. This is only for the purpose of changing the link options. AC_MSG_CHECKING(whether we are using GNU C) AC_CACHE_VAL(krb5_cv_prog_gcc, -[dnl The semicolon is to pacify NeXT's syntax-checking cpp. -cat > conftest.c <&AC_FD_CC | egrep yes >/dev/null 2>&1; then - krb5_cv_prog_gcc=yes -else - krb5_cv_prog_gcc=no -fi -rm -f conftest* +[ +AC_EGREP_CPP(yes,[#ifdef __GNUC__ +yes; +#endif],krb5_cv_prog_gcc=yes,krb5_cv_prog_gcc=no) ])dnl AC_MSG_RESULT($krb5_cv_prog_gcc) dnl @@ -51,8 +43,13 @@ case $krb5_cv_host in krb5_cv_shlibs_ext=a krb5_cv_noshlibs_ext=do-not-make krb5_cv_shlibs_dir= - krb5_cv_shlibs_ldflag="-bex4:\$(BUILDTOP)/util/aix.bincmds" + if test $krb5_cv_prog_gcc = yes ; then + krb5_cv_shlibs_ldflag="-Xlinker -bex4:\$(BUILDTOP)/util/aix.bincmds" + krb5_cv_noshlibs_ldflag= +else + krb5_cv_shlibs_ldflag="-bex4:\$(BUILDTOP)/util/aix.bincmds" krb5_cv_noshlibs_ldflag= +fi krb5_cv_shlibs_sym_ufo= krb5_cv_shlibs_dirhead="-L" krb5_cv_exe_need_dirs=yes diff --git a/src/util/ChangeLog b/src/util/ChangeLog index e94a43310..bbd20fea7 100644 --- a/src/util/ChangeLog +++ b/src/util/ChangeLog @@ -1,3 +1,9 @@ +Sun Jul 2 20:42:45 1995 Sam Hartman + + * makeshlib.sh (ldflags): Adapt AIX case to work with Gcc. + + * configure.in: Move Gcc test to top level configure.in. + Fri Jun 23 19:11:20 1995 Sam Hartman * configure.in: Add aix.bincmds as target on AIX. diff --git a/src/util/configure.in b/src/util/configure.in index b5520236c..3e042aed5 100644 --- a/src/util/configure.in +++ b/src/util/configure.in @@ -2,14 +2,11 @@ AC_INIT(configure.in) CONFIG_RULES AC_PROG_ARCHIVE AC_PROG_ARCHIVE_ADD -AC_MSG_CHECKING(whether running Gcc) -AC_EGREP_CPP(yes,[#ifdef __GNUC__ -yes; -#endif],HAVE_GCC=yes,HAVE_GCC=) -if test -n "$HAVE_GCC" ; then - AC_MSG_RESULT(yes) - else AC_MSG_RESULT(no) - fi +if test $krb5_cv_prog_gcc = yes ; then + HAVE_GCC=yes + else HAVE_GCC= +fi + AC_SUBST(HAVE_GCC) HOST_TYPE=$krb5_cv_host AC_SUBST(HOST_TYPE) diff --git a/src/util/makeshlib.sh b/src/util/makeshlib.sh index 729d7f2d3..4bc56bfc1 100644 --- a/src/util/makeshlib.sh +++ b/src/util/makeshlib.sh @@ -38,8 +38,11 @@ ar cq $library $FILES || exit $? 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 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 + fi + stat=$? if [ $stat -eq 0 ] then rm $library ${library}.syms -- 2.26.2