From 45c35320f36a66655fb8cd816830bc6ae77469b8 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 27 Apr 2001 22:51:51 +0000 Subject: [PATCH] * aclocal.m4 (DECLARE_SYS_ERRLIST): Check for sys_nerr with an expression that can't be optimized away. (KRB5_INIT_CCOPTS): New macro. (WITH_CC): Add gcc warning flags to CCOPTS instead of CC. Add option -Wno-comment to stop gcc from complaining about SunOS system header files. Call AC_REQUIRE on KRB5_INIT_CCOPTS. (WITH_CCOPTS): Add to CCOPTS instead of simply assigning to it. Call AC_REQUIRE on KRB5_INIT_CCOPTS. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13215 dc483132-0cff-0310-8789-dd5450dbe970 --- src/ChangeLog | 11 +++++++++++ src/aclocal.m4 | 17 +++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 0d7bc8294..10d4dc9a0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2001-04-27 Ken Raeburn + + * aclocal.m4 (DECLARE_SYS_ERRLIST): Check for sys_nerr with an + expression that can't be optimized away. + (KRB5_INIT_CCOPTS): New macro. + (WITH_CC): Add gcc warning flags to CCOPTS instead of CC. Add + option -Wno-comment to stop gcc from complaining about SunOS + system header files. Call AC_REQUIRE on KRB5_INIT_CCOPTS. + (WITH_CCOPTS): Add to CCOPTS instead of simply assigning to it. + Call AC_REQUIRE on KRB5_INIT_CCOPTS. + 2001-04-26 Ken Raeburn * acconfig.h (KRB5_NO_PROTOTYPES, KRB5_PROVIDE_PROTOTYPES, diff --git a/src/aclocal.m4 b/src/aclocal.m4 index ae0776977..c8f60c125 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -100,7 +100,7 @@ else # This means that sys_errlist is not declared in errno.h, but may still # be in libc. AC_CACHE_CHECK([for sys_errlist in libc], krb5_cv_var_sys_errlist, - [AC_TRY_LINK([extern int sys_nerr;], [1+sys_nerr;], + [AC_TRY_LINK([extern int sys_nerr;], [if (1+sys_nerr < 0) return 1;], krb5_cv_var_sys_errlist=yes, krb5_cv_var_sys_errlist=no;)]) if test $krb5_cv_var_sys_errlist = yes; then AC_DEFINE(HAVE_SYS_ERRLIST) @@ -368,7 +368,10 @@ AC_SUBST(DES425_LIB) dnl dnl set $(CC) from --with-cc=value dnl +AC_DEFUN(KRB5_INIT_CCOPTS,[CCOPTS= +]) define(WITH_CC,[ +AC_REQUIRE([KRB5_INIT_CCOPTS]) AC_ARG_WITH([cc], [ --with-cc=COMPILER select compiler to use]) AC_MSG_CHECKING(for C compiler) @@ -391,11 +394,12 @@ AC_CACHE_VAL(krb5_cv_prog_cc,[dnl krb5_cv_prog_cc="$CC" ]) # 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 \ - -Wcast-align -Wconversion -Wshadow -pedantic" + -Wcast-align -Wconversion -Wshadow -Wno-comment -pedantic" if test "$GCC" = yes ; then AC_MSG_RESULT(adding extra warning flags for gcc) - CC="$CC $extra_gcc_warn_opts" + CCOPTS="$CCOPTS $extra_gcc_warn_opts" fi ])dnl dnl @@ -413,12 +417,13 @@ dnl dnl set $(CCOPTS) from --with-ccopts=value dnl define(WITH_CCOPTS,[ +AC_REQUIRE([KRB5_INIT_CCOPTS]) AC_ARG_WITH([ccopts], [ --with-ccopts=CCOPTS select compiler command line options], AC_MSG_RESULT(CCOPTS is $withval) -CCOPTS=$withval -CFLAGS="$CFLAGS $withval", -CCOPTS=)dnl +dnl WITH_CC may have already put something in CCOPTS +CCOPTS="$CCOPTS $withval" +CFLAGS="$CFLAGS $withval")dnl AC_SUBST(CCOPTS)])dnl dnl dnl set $(LDFLAGS) from --with-ldopts=value -- 2.26.2