* aclocal.m4 (KRB5_LIB_PARAMS): Moved bulk of the work into config/shlib.conf.
authorKen Raeburn <raeburn@mit.edu>
Fri, 14 Jul 2000 22:04:39 +0000 (22:04 +0000)
committerKen Raeburn <raeburn@mit.edu>
Fri, 14 Jul 2000 22:04:39 +0000 (22:04 +0000)
(K5_AC_CHECK_FILES): Require AC_PROG_CC be run first.
(WITH_CC): If we're using gcc, enable a bunch of warning options.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12542 dc483132-0cff-0310-8789-dd5450dbe970

src/ChangeLog
src/aclocal.m4

index a412403a0311562bc980a565f4b953074f630e23..1189d8b242205d863f7cbde275056f1322e5ebbe 100644 (file)
@@ -1,3 +1,10 @@
+2000-07-14  Ken Raeburn  <raeburn@mit.edu>
+
+       * aclocal.m4 (KRB5_LIB_PARAMS): Moved bulk of the work into
+       config/shlib.conf.
+       (K5_AC_CHECK_FILES): Require AC_PROG_CC be run first.
+       (WITH_CC): If we're using gcc, enable a bunch of warning options.
+
 2000-07-01  Tom Yu  <tlyu@mit.edu>
 
        * acconfig.h: Add function replacement renaming symbols for
index 78a7a65d86980ffc4dd2962dd0e10e877de104ff..d4d7bb9001965f5d19d630b2f183e2109fa83dd4 100644 (file)
@@ -275,7 +275,8 @@ dnl
 dnl K5_AC_CHECK_FILES(FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 dnl
 AC_DEFUN(K5_AC_CHECK_FILES,
-[for ac_file in $1
+[AC_REQUIRE([AC_PROG_CC])
+for ac_file in $1
 do
 K5_AC_CHECK_FILE($ac_file,
 [changequote(, )dnl
@@ -363,6 +364,13 @@ AC_CACHE_VAL(ac_cv_prog_cc,[dnl
 CC="$ac_cv_prog_cc"
 AC_MSG_RESULT($CC)
 AC_PROG_CC
+# maybe add -Waggregate-return, or can we assume that actually works by now?
+extra_gcc_warn_opts="-Wall -Wmissing-prototypes -Wtraditional -Wcast-qual \
+ -Wcast-align -Wconversion -Wshadow -pedantic"
+if test "$GCC" = yes ; then
+  AC_MSG_RESULT(adding extra warning flags for gcc)
+  CC="$CC $extra_gcc_warn_opts"
+fi
 ])dnl
 dnl
 dnl set $(LD) from --with-linker=value
@@ -1096,260 +1104,8 @@ AC_DEFUN(KRB5_LIB_PARAMS,
 [AC_CANONICAL_HOST
 krb5_cv_host=$host])
 AC_REQUIRE([AC_PROG_CC])
-#
-# Set up some defaults.
-#
-STLIBEXT=.a
-# Default to being unable to build shared libraries.
-SHLIBEXT=.so-nobuild
-SHLIBVEXT=.so.v-nobuild
-SHLIBSEXT=.so.s-nobuild
-# Most systems support profiled libraries.
-PFLIBEXT=_p.a
-# Most systems install shared libs as mode 644, etc. while hpux wants 755
-INSTALL_SHLIB='$(INSTALL_DATA)'
-
-STOBJEXT=.o
-SHOBJEXT=.so
-PFOBJEXT=.po
-# Default for systems w/o shared libraries
-CC_LINK_STATIC='$(CC) $(PROG_LIBPATH)'
-
-# Set up architecture-specific variables.
-case $krb5_cv_host in
-alpha*-dec-osf*)
-       SHLIBVEXT='.so.$(LIBMAJOR).$(LIBMINOR)'
-       SHLIBSEXT='.so.$(LIBMAJOR)'
-       SHLIBEXT=.so
-       # Alpha OSF/1 doesn't need separate PIC objects
-       SHOBJEXT=.o
-       LDCOMBINE='ld -shared -expect_unresolved \* -update_registry $(BUILDTOP)/so_locations -soname lib$(LIB)$(SHLIBSEXT)'
-       SHLIB_EXPFLAGS='-rpath $(SHLIB_RDIRS) $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
-       PROFFLAGS=-pg
-       CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) -Wl,-rpath -Wl,$(PROG_RPATH)'
-       # Need -oldstyle_liblookup to avoid picking up shared libs from
-       # other builds.  OSF/1 / Tru64 ld programs look through the entire
-       # library path for shared libs prior to looking through the
-       # entire library path for static libs.
-       CC_LINK_STATIC='$(CC) $(PROG_LIBPATH) -Wl,-oldstyle_liblookup'
-       # $(PROG_RPATH) is here to handle things like a shared tcl library
-       RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`:$(PROG_RPATH):/usr/shlib:/usr/ccs/lib:/usr/lib/cmplrs/cc:/usr/lib:/usr/local/lib; export LD_LIBRARY_PATH; _RLD_ROOT=/dev/dummy/d; export _RLD_ROOT;'
-       ;;
-
-# HPUX *seems* to work under 10.20.
-# 
-# Note: "-Wl,+s" when building executables enables the use of the
-# SHLIB_PATH environment variable for finding shared libraries 
-# in non-standard directories.  If a non-standard search-path for
-#  shared libraries is compiled into the executable (using 
-# -Wl,+b,$KRB5_SHLIBDIR), then the order of "-Wl,+b,..." and "-Wl,+s" 
-# on the commandline of the linker will determine which path
-# (compiled-in or SHLIB_PATH) will be searched first.
-#
-*-*-hpux*)
-       PICFLAGS=+z
-       INSTALL_SHLIB='$(INSTALL)'
-       SHLIBEXT=.sl
-       SHLIBVEXT='.$(LIBMAJOR).$(LIBMINOR)'
-       SHLIBSEXT='.$(LIBMAJOR)'
-       SHLIB_EXPFLAGS='+s +b $(SHLIB_RDIRS) $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
-       LDCOMBINE='ld -b +h lib$(LIB)$(SHLIBSEXT)'
-       CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) -Wl,+s -Wl,+b,$(PROG_RPATH)'
-       CC_LINK_STATIC='$(CC) $(PROG_LIBPATH)'
-       RUN_ENV='SHLIB_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export SHLIB_PATH;'
-       ;;
-
-mips-sgi-irix6.3)      # This is a Kludge; see below
-       SHLIBVEXT='.so.$(LIBMAJOR).$(LIBMINOR)'
-       SHLIBSEXT='.so.$(LIBMAJOR)'
-       SHLIBEXT=.so
-       SHOBJEXT=.o
-       # Kludge follows: (gcc makes n32 object files but ld expects o32, so we reeducate ld)
-       if test "$krb5_cv_prog_gcc" = yes; then
-               LDCOMBINE='ld -n32 -shared -ignore_unresolved -update_registry $(BUILDTOP)/so_locations -soname lib$(LIB)$(SHLIBSEXT)'
-       else
-               LDCOMBINE='ld -shared -ignore_unresolved -update_registry $(BUILDTOP)/so_locations -soname lib$(LIB)$(SHLIBSEXT)'
-       fi
-       SHLIB_EXPFLAGS='-rpath $(SHLIB_RDIRS) $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
-       # no gprof for Irix...
-       PROFFLAGS=-p
-       CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) -Wl,-rpath -Wl,$(PROG_RPATH)'
-       CC_LINK_STATIC='$(CC) $(PROG_LIBPATH)'
-       RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;'
-       ;;
-
-mips-sgi-irix*)
-       SHLIBVEXT='.so.$(LIBMAJOR).$(LIBMINOR)'
-       SHLIBSEXT='.so.$(LIBMAJOR)'
-       SHLIBEXT=.so
-       SHOBJEXT=.o
-       LDCOMBINE='ld -shared -ignore_unresolved -update_registry $(BUILDTOP)/so_locations -soname lib$(LIB)$(SHLIBSEXT)'
-       SHLIB_EXPFLAGS='-rpath $(SHLIB_RDIRS) $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
-       # no gprof for Irix...
-       PROFFLAGS=-p
-       CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) -Wl,-rpath -Wl,$(PROG_RPATH)'
-       CC_LINK_STATIC='$(CC) $(PROG_LIBPATH)'
-       RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;'
-       ;;
-
-# untested...
-mips-sni-sysv4)
-       if test "$krb5_cv_prog_gcc" = yes; then
-               PICFLAGS=-fpic
-               LDCOMBINE='$(CC) -G -Wl,-h -Wl,lib$(LIB)$(SHLIBSEXT)'
-       else
-               PICFLAGS=-Kpic
-               LDCOMBINE='$(CC) -G -h lib$(LIB)$(SHLIBSEXT)'
-       fi
-       SHLIB_EXPFLAGS='-R$(SHLIB_RDIRS) $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
-       SHLIBEXT=.so
-       SHLIBVEXT='.so.$(LIBMAJOR).$(LIBMINOR)'
-       SHLIBSEXT='.so.$(LIBMAJOR)'
-       CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) -R$(PROG_RPATH)'
-       CC_LINK_STATIC='$(CC) $(PROG_LIBPATH)'
-       RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;'
-       PROFFLAGS=-pg
-       ;;
-
-mips-*-netbsd*)
-       PICFLAGS=-fPIC
-       SHLIBVEXT='.so.$(LIBMAJOR).$(LIBMINOR)'
-       SHLIBSEXT='.so.$(LIBMAJOR)'
-       SHLIBEXT=.so
-       LDCOMBINE='ld -shared -soname lib$(LIB)$(SHLIBSEXT)'
-       SHLIB_EXPFLAGS='-R$(SHLIB_RDIRS) $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
-       CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) -Wl,-rpath -Wl,$(PROG_RPATH)'
-       CC_LINK_STATIC='$(CC) $(PROG_LIBPATH)'
-       RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;'
-       PROFFLAGS=-pg
-       ;;
-
-*-*-netbsd*)
-       PICFLAGS=-fpic
-       SHLIBVEXT='.so.$(LIBMAJOR).$(LIBMINOR)'
-       SHLIBEXT=.so
-       LDCOMBINE='ld -Bshareable'
-       SHLIB_EXPFLAGS='-R$(SHLIB_RDIRS) $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
-       CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) -R$(PROG_RPATH)'
-       CC_LINK_STATIC='$(CC) $(PROG_LIBPATH)'
-       RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;'
-       PROFFLAGS=-pg
-       ;;
-
-*-*-freebsd*)
-       if test -x /usr/bin/objformat ; then
-               objformat=`/usr/bin/objformat`
-       else
-               objformat="aout"
-       fi
-       PICFLAGS=-fpic
-       if test "x$objformat" = "xelf" ; then
-               SHLIBVEXT='.so.$(LIBMAJOR)'
-               CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) -Wl,-rpath -Wl,$(PROG_RPATH)'
-       else
-               SHLIBVEXT='.so.$(LIBMAJOR).$(LIBMINOR)'
-               CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) -R$(PROG_RPATH)'
-       fi
-       SHLIBEXT=.so
-       LDCOMBINE='ld -Bshareable'
-       SHLIB_EXPFLAGS='-R$(SHLIB_RDIRS) $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
-       CC_LINK_STATIC='$(CC) $(PROG_LIBPATH)'
-       RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;'
-       PROFFLAGS=-pg
-       ;;
-
-*-*-openbsd*)
-       PICFLAGS=-fpic
-       SHLIBVEXT='.so.$(LIBMAJOR).$(LIBMINOR)'
-       SHLIBEXT=.so
-       LDCOMBINE='ld -Bshareable'
-       SHLIB_EXPFLAGS='-R$(SHLIB_RDIRS) $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
-       CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) -R$(PROG_RPATH)'
-       CC_LINK_STATIC='$(CC) $(PROG_LIBPATH)'
-       RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;'
-       PROFFLAGS=-pg
-       ;;
-
-*-*-darwin* | *-*-rhapsody*)
-       PICFLAGS=-fno-common
-       SHLIBVEXT='.$(LIBMAJOR).$(LIBMINOR).dylib'
-       SHLIBSEXT='.$(LIBMAJOR).dylib'
-       SHLIB_EXPFLAGS='$(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
-       SHLIBEXT=.dylib
-       LDCOMBINE='$(CC) $(LDFLAGS) -undefined warning -dynamiclib -compatibility_version $(LIBMAJOR) -current_version $(LIBMAJOR).$(LIBMINOR) -install_name "$(KRB5_LIBDIR)/lib$(LIB)$(SHLIBVEXT)"'
-       CC_LINK_SHARED='$(CC) $(LDFLAGS) $(PROG_LIBPATH) -dynamic'
-       CC_LINK_STATIC='$(CC) $(LDFLAGS) $(PROG_LIBPATH)'
-       RUN_ENV='DYLD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export DYLD_LIBRARY_PATH;'
-       ;;
-
-*-*-solaris*)
-       if test "$krb5_cv_prog_gcc" = yes; then
-               PICFLAGS=-fpic
-               LDCOMBINE='$(CC) -shared -h lib$(LIB)$(SHLIBSEXT)'
-       else
-               PICFLAGS=-Kpic
-               # Solaris cc doesn't default to stuffing the SONAME field...
-               LDCOMBINE='$(CC) -dy -G -z text -h lib$(LIB)$(SHLIBSEXT)'
-       fi
-       SHLIBVEXT='.so.$(LIBMAJOR).$(LIBMINOR)'
-       SHLIBSEXT='.so.$(LIBMAJOR)'
-       SHLIBEXT=.so
-       SHLIB_EXPFLAGS='-R$(SHLIB_RDIRS) $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
-       PROFFLAGS=-pg
-       CC_LINK_SHARED='$(PURE) $(CC) $(PROG_LIBPATH) -R$(PROG_RPATH)'
-       CC_LINK_STATIC='$(PURE) $(CC) $(PROG_LIBPATH)'
-       RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;'
-       ;;
-
-*-*-sunos*)
-       PICFLAGS=-fpic
-       SHLIBVEXT='.so.$(LIBMAJOR).$(LIBMINOR)'
-       SHLIBEXT=.so
-       # The following grossness is to prevent relative paths from
-       # creeping into the RPATH of an executable or library built
-       # under SunOS; the explicit setting of LD_LIBRARY_PATH does
-       # does not make it into the output file, while directories
-       # passed by "-Ldirname" do.
-       LDCOMBINE='LD_LIBRARY_PATH=`echo $(SHLIB_DIRS) | sed -e "s/-L//g" -e "s/ /:/g"` ld -dp -assert pure-text'
-       SHLIB_EXPFLAGS='-L$(SHLIB_RDIRS) $(SHLIB_EXPLIBS)'
-       PROFFLAGS=-pg
-       CC_LINK_SHARED='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"` $(PURE) $(CC) -L$(PROG_RPATH)'
-       CC_LINK_STATIC='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g` $(PURE) $(CC)'
-       RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;'
-       ;;
-*-*-linux*)
-       PICFLAGS=-fPIC
-       SHLIBVEXT='.so.$(LIBMAJOR).$(LIBMINOR)'
-       SHLIBSEXT='.so.$(LIBMAJOR)'
-       SHLIBEXT=.so
-       # Linux ld doesn't default to stuffing the SONAME field...
-       # Use objdump -x to examine the fields of the library
-       LDCOMBINE='ld -shared -h lib$(LIB)$(SHLIBSEXT)'
-       SHLIB_EXPFLAGS='-R$(SHLIB_RDIRS) $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
-       PROFFLAGS=-pg
-       CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) -Wl,-rpath -Wl,$(PROG_RPATH)'
-       CC_LINK_STATIC='$(CC) $(PROG_LIBPATH)'
-       RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;'
-       ;;
-
-*-*-aix*)
-       SHLIBVEXT='.a.$(LIBMAJOR).$(LIBMINOR)'
-       SHLIBEXT=.a
-       # AIX doesn't need separate PIC objects
-       SHOBJEXT=.o
-       LDCOMBINE='$(BUILDTOP)/util/makeshlib $(LIBMAJOR).$(LIBMINOR)'
-       SHLIB_EXPFLAGS='  $(SHLIB_DIRS) $(SHLIB_EXPLIBS)'
-       PROFFLAGS=-pg
-       if test "$krb5_cv_prog_gcc" = "yes" ; then
-         CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) -Xlinker -bex4:$(BUILDTOP)/util/aix.bincmds '
-       else
-         CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) -bex4:$(BUILDTOP)/util/aix.bincmds '
-       fi
-       CC_LINK_STATIC='$(CC) $(PROG_LIBPATH)'
-       # $(PROG_RPATH) is here to handle things like a shared tcl library
-       RUN_ENV='LIBPATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`:$(PROG_RPATH):/usr/lib:/usr/local/lib; export LIBPATH; '
-
-esac])
+AC_REQUIRE([V5_SET_TOPDIR])
+. $ac_topdir/config/shlib.conf])
 dnl
 dnl The following was written by jhawk@mit.edu
 dnl
@@ -1464,5 +1220,4 @@ dnl AC_MSG_CHECKING(if DNS should be used to find KDCs by default)
 dnl AC_MSG_RESULT($enable_dns_for_kdc)
 dnl AC_MSG_CHECKING(if DNS should be used to find realm name by default)
 dnl AC_MSG_RESULT($enable_dns_for_realm)
-
 ])