2002-09-13 Ken Raeburn <raeburn@mit.edu>
+ * aclocale.m4 (WITH_CC): Substitute @HAVE_GCC@. Set
+ krb5_cv_prog_gcc from ac_cv_compiler_gnu.
+ * configure.in: Don't explicitly set HAVE_GCC or test for gcc
+ here.
+
* aclocal.m4 (KRB5_AC_CHOOSE_DB): New macro.
(CONFIG_RULES): Invoke it.
(KRB5_LIB_PARAMS): Don't substitute LIB_LINK_OPT.
AC_ARG_WITH([cc],AC_HELP_STRING(--with-cc=COMPILER,deprecated; use CC=...),
AC_MSG_ERROR(option --with-cc is deprecated; use CC=...))
AC_PROG_CC
+krb5_cv_prog_gcc=$ac_cv_c_compiler_gnu
+if test $ac_cv_c_compiler_gnu = yes ; then
+ HAVE_GCC=yes
+ else HAVE_GCC=
+fi
+AC_SUBST(HAVE_GCC)
# maybe add -Waggregate-return, or can we assume that actually works by now?
# -Wno-comment is for SunOS system header <sys/stream.h>
extra_gcc_warn_opts="-Wall -Wmissing-prototypes -Wcast-qual \
corresponding.
(depend-verify-srcdir): New target, split out from .d rules.
(.d): Depend on depend-verify-{et,ss,db,srcdir}.
+ (depend-verify-gcc, depend-verify-gcc-yes, depend-verify-gcc-no):
+ Report an error if not using gcc.
+ (depfix2.sed): Depend on depend-verify-gcc. Supply libgcc file
+ name as fifth input field to depgen.sed.
* pre.in (DB_DEPLIB-k5, DB_DEPLIB-sys, DB_DEPS-sys, DB_DEPS-k5,
DB_DEPS-redirect): New variables.
depend-verify-db-sys:
@echo 1>&2 error: cannot build dependencies using system db package
@exit 1
+depend-verify-gcc: depend-verify-gcc-@HAVE_GCC@
+depend-verify-gcc-yes:
+depend-verify-gcc-no:
+ @echo 1>&2 error: The '"depend"' rules are written for gcc.
+ @echo 1>&2 Please use gcc, or update the rules to handle your compiler.
+ @exit 1
.d: $(ALL_DEP_SRCS) depend-verify-srcdir depend-verify-et depend-verify-ss depend-verify-db
if test "$(ALL_DEP_SRCS)" != " " ; then \
# Generate a script for dropping in the appropriate make variables, using
# directory-specific parameters. General substitutions independent of local
# make variables happen in depfix.sed.
-depfix2.sed: Makefile $(SRCTOP)/util/depgen.sed
- echo '$(SRCTOP)' '$(myfulldir)' '$(srcdir)' '$(BUILDTOP)' | sed -f $(SRCTOP)/util/depgen.sed > depfix2.tmp
+depfix2.sed: depend-verify-gcc Makefile $(SRCTOP)/util/depgen.sed
+ x=`$(CC) -print-libgcc-file-name` ; \
+ echo '$(SRCTOP)' '$(myfulldir)' '$(srcdir)' '$(BUILDTOP)' "$$x" | sed -f $(SRCTOP)/util/depgen.sed > depfix2.tmp
mv -f depfix2.tmp depfix2.sed
DEPLIBOBJNAMEFIX = sed -e 's;^\$$(OUTPRE)\([a-zA-Z0-9_\-]*\)\.\$$(OBJEXT):;\1.so \1.po &;'
KRB5_VERSION="$KRB5_MAJOR_RELEASE.$KRB5_MINOR_RELEASE.$KRB5_PATCHLEVEL"
AC_SUBST(KRB5_VERSION)
dnl
-dnl This causes us to *always* set CPP, instead of doing it below only
-dnl when krb5_cv_prog_gcc isn't set.
AC_REQUIRE_CPP
dnl
-dnl
-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,
-[
-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
dnl The following lines are so that configure --help gives some global
dnl configuration options.
dnl
KRB5_BUILD_LIBRARY
KRB5_BUILD_PROGRAM
dnl
-dnl For util/makeshlib.
-dnl
-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)
dnl
2002-09-13 Ken Raeburn <raeburn@mit.edu>
+ * depgen.sed: Now expects a fifth argument, the pathname for
+ libgcc. Replaces "libgcc" part with "include" and emits sed
+ patterns to discard any names starting with that prefix.
+ * depfix.sed: Drop handling of /mit/gnu and /mit/cygnus.
+
* Makefile.in (MY_SUBDIRS): Use MAYBE_DB_@DB_VERSION@.
(MAYBE_DB_k5, MAYBE_DB_sys): New variables.
# gcc installation in some odd place, you may need to customize this)
s;/usr/include/[^ ]* ;;g
s;/usr/lib/[^ ]* ;;g
-s;/mit/cygnus[^ ]* ;;g
-s;/mit/gnu/[^ ]* ;;g
# remove foo/../ sequences
:dotdot
-# input srctop myfulldir srcdir buildtop
+# input srctop myfulldir srcdir buildtop libgccfilename
# something like ../../../../asrc/lib/krb5/asn.1/../../../ lib/krb5/asn.1
#
# output a sequence of sed commands for recognizing and replacing srctop,
# Output some mostly-fixed patterns first
h
-s|^\([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\)$|# This file is automatically generated by depgen.sed, do not edit it.\
+s|^\([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\)$|# This file is automatically generated by depgen.sed, do not edit it.\
#\
# Parameters used to generate this instance:\
#\
# thisdir = \2\
# srcdir = \3\
# BUILDTOP = \4\
+# libgcc file name = \5\
#\
\
# First, remove redundant leading "//" and "./" ...\
s;///*;/;g\
-s; \\./; ;g\
+s; \\./; ;g|p
+x
+
+h
+s|^[^ ]* [^ ]* [^ ]* [^ ]* ||
+s|libgcc\.[^ ]*$|include|
+s|\.|\\.|g
+s|\([^ ][^ ]*\)|\
+# Remove gcc's include files resulting from "fixincludes";\
+# they're essentially system include files.\
+s;\1/[^ ]* ;;g\
+s;\1/[^ ]*$;;g\
\
# Recognize $(SRCTOP) and make it a variable reference.\
# (Is this step needed, given the substitutions below?)|p
x
+# Drop the last (possibly empty?) word, gcc's prefix. Then save four words.
+s, [^ ]*$,,
+
h
s/ .*$//
s,\.,\\.,g