From: Ken Raeburn Date: Sat, 14 Sep 2002 02:45:50 +0000 (+0000) Subject: Work out pathname for gcc fixincludes headers via "-print-libgcc-file-name" and X-Git-Tag: krb5-1.3-alpha1~390 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=40201aadec103327acfec591aee25a43f5531ed6;p=krb5.git Work out pathname for gcc fixincludes headers via "-print-libgcc-file-name" and substitutions in depgen.sed at "make depend" time, and emit patterns into depfix2.sed to strip them out of dependencies, instead of hard-coding pathnames for Athena gcc installations we know about in depfix.sed. Verify that gcc is being used, before trying to rebuild dependencies. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14861 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/ChangeLog b/src/ChangeLog index df8d38198..d83e8428c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2002-09-13 Ken Raeburn + * 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. diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 3ccec6b62..af8865eac 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -444,6 +444,12 @@ AC_REQUIRE([KRB5_AC_CHECK_FOR_CFLAGS]) 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 extra_gcc_warn_opts="-Wall -Wmissing-prototypes -Wcast-qual \ diff --git a/src/config/ChangeLog b/src/config/ChangeLog index b7d51e164..098c75bc0 100644 --- a/src/config/ChangeLog +++ b/src/config/ChangeLog @@ -24,6 +24,10 @@ 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. diff --git a/src/config/post.in b/src/config/post.in index 901d6c852..6817ceabd 100644 --- a/src/config/post.in +++ b/src/config/post.in @@ -27,6 +27,12 @@ depend-verify-db-k5: 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 \ @@ -39,8 +45,9 @@ depend-verify-db-sys: # 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 &;' diff --git a/src/configure.in b/src/configure.in index 45f1bd5bd..3802ad340 100644 --- a/src/configure.in +++ b/src/configure.in @@ -14,22 +14,8 @@ eval `sed 's/#define \([A-Z0-9_]*\)[ \t]*\(.*\)/\1=\2/' < $srcdir/patchlevel.h` 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 @@ -69,13 +55,6 @@ KRB5_BUILD_LIBOBJS 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 diff --git a/src/util/ChangeLog b/src/util/ChangeLog index 5eb494bdf..cd604d5ef 100644 --- a/src/util/ChangeLog +++ b/src/util/ChangeLog @@ -1,5 +1,10 @@ 2002-09-13 Ken Raeburn + * 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. diff --git a/src/util/depfix.sed b/src/util/depfix.sed index 6e8d4a4ae..3c5c0815b 100644 --- a/src/util/depfix.sed +++ b/src/util/depfix.sed @@ -32,8 +32,6 @@ s;^\([a-zA-Z0-9_\-]*\).o:;$(OUTPRE)\1.$(OBJEXT):; # 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 diff --git a/src/util/depgen.sed b/src/util/depgen.sed index 86ed7edc6..8547d7c1d 100644 --- a/src/util/depgen.sed +++ b/src/util/depgen.sed @@ -1,4 +1,4 @@ -# 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, @@ -13,7 +13,7 @@ # 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:\ #\ @@ -21,16 +21,31 @@ s|^\([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\)$|# This file is automatically generat # 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