From: Ezra Peisach Date: Wed, 11 Apr 2001 21:01:09 +0000 (+0000) Subject: * aclocal.m4 (WITH_CC): Reorganize test: Do not use cache variable X-Git-Tag: krb5-1.3-alpha1~1573 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a37df686067e01183688657053a4ec2953fd5ab1;p=krb5.git * aclocal.m4 (WITH_CC): Reorganize test: Do not use cache variable that conflicts with an autoconf internal variable (prefix with krb5_ instead of ac_). Ensure that the first time AC_PROG_CC is invoked, is not within a conditional cache block. Autoconf 2.49 only include the compiler test code once in the configure script instead of everytime it is seen. aclocal now works with autoconf-2.49d... (as well as earlier versions) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13173 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/ChangeLog b/src/ChangeLog index d4f2dd891..5b60eb906 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2001-04-11 Ezra Peisach + + * aclocal.m4 (WITH_CC): Reorganize test: Do not use cache variable + that conflicts with an autoconf internal variable (prefix with + krb5_ instead of ac_). Ensure that the first time AC_PROG_CC is + invoked, is not within a conditional cache block. Autoconf 2.49 + only include the compiler test code once in the configure script + instead of everytime it is seen. + Fri Feb 16 16:23:25 2001 Ezra Peisach * Makefile.in: Add $(datadir) to INSTALLMKDIRS for util/et. diff --git a/src/aclocal.m4 b/src/aclocal.m4 index cf775b7cf..012b01e57 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -372,23 +372,24 @@ define(WITH_CC,[ AC_ARG_WITH([cc], [ --with-cc=COMPILER select compiler to use]) AC_MSG_CHECKING(for C compiler) +dnl Default assumed compiler +test -z "$CC" && CC=cc if test "$with_cc" != ""; then - if test "$ac_cv_prog_cc" != "" && test "$ac_cv_prog_cc" != "$with_cc"; then + if test "$krb5_cv_prog_cc" != "" && test "$krb5_cv_prog_cc" != "$with_cc"; then AC_MSG_ERROR(Specified compiler doesn't match cached compiler name; remove cache and try again.) else CC="$with_cc" fi fi -AC_CACHE_VAL(ac_cv_prog_cc,[dnl - test -z "$CC" && CC=cc +AC_MSG_RESULT($CC) +AC_PROG_CC +dnl Test compiler once. Newer versions of autoconf already does a similar test. +AC_CACHE_VAL(krb5_cv_prog_cc,[dnl AC_TRY_LINK([#include ],[printf("hi\n");], , AC_MSG_ERROR(Can't find a working compiler.)) - ac_cv_prog_cc="$CC" + krb5_cv_prog_cc="$CC" ]) -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 -Wcast-qual \ -Wcast-align -Wconversion -Wshadow -pedantic"