This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[toplevel/libiberty] Reject configure files which warn (*BSD malloc.h bootstrap fix)
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gcc-patches at sources dot redhat dot com
- Cc: Gerald Pfeifer <gerald at pfeifer dot com>,Loren James Rittle <rittle at labs dot mot dot com>,binutils at sources dot redhat dot com, gdb-patches at sources dot redhat dot com
- Date: Wed, 24 Sep 2003 12:37:39 -0400
- Subject: [toplevel/libiberty] Reject configure files which warn (*BSD malloc.h bootstrap fix)
What are your thoughts on this patch? The basic idea is to reject (as
autoconf 2.13 did) headers which cause the preprocessor to generate
warnings.
The basis of AC_PROG_CPP_WERROR is in the autoconf CVS. The bit to use
_AC_CHECK_HEADER_OLD isn't, of course. It occured to me while I was running
this through final testing that this patch won't solve the problem forever;
eventually autoconf will check for headers in preference using $CC rather
than $CPP. At that point we'll need something like AC_PROG_CC_WERROR also
to reject C fragments which warn. I'm still talking to Paul about that...
Gerald or Loren, could you make sure this fixes your boostrap troubles on
FreeBSD? You'll need autoconf 2.57 to regenerate configure.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2003-09-24 Daniel Jacobowitz <drow@mvista.com>
* acx.m4 (AC_PROG_CPP_WERROR): New.
2003-09-24 Daniel Jacobowitz <drow@mvista.com>
* configure.in: Use AC_PROG_CPP_WERROR.
* configure: Regenerated.
Index: libiberty/configure.in
===================================================================
RCS file: /big/fsf/rsync/gcc-cvs/gcc/libiberty/configure.in,v
retrieving revision 1.71
diff -u -p -r1.71 configure.in
--- libiberty/configure.in 27 Aug 2003 21:14:28 -0000 1.71
+++ libiberty/configure.in 24 Sep 2003 16:10:23 -0000
@@ -101,6 +101,7 @@ AC_CHECK_TOOL(RANLIB, ranlib, :)
GCC_NO_EXECUTABLES
AC_PROG_CC
+AC_PROG_CPP_WERROR
if test x$GCC = xyes; then
ac_libiberty_warn_cflags='-W -Wall -Wtraditional -pedantic'
Index: config/acx.m4
===================================================================
RCS file: /big/fsf/rsync/gcc-cvs/gcc/config/acx.m4,v
retrieving revision 1.3
diff -u -p -r1.3 acx.m4
--- config/acx.m4 18 May 2003 15:43:43 -0000 1.3
+++ config/acx.m4 24 Sep 2003 16:27:31 -0000
@@ -140,3 +140,18 @@ else
$1="$ac_cv_prog_$1"
fi
]) []dnl # NCN_STRICT_CHECK_TARGET_TOOL
+
+###
+# AC_PROG_CPP_WERROR
+# Used for autoconf 2.5x to force AC_PREPROC_IFELSE to reject code which
+# triggers warnings from the preprocessor. Will be in autoconf 2.58.
+# For now, using this also overrides header checks to use only the
+# preprocessor (matches 2.13 behavior; matching 2.58's behavior is a
+# bit harder from here).
+# Eventually autoconf will default to checking headers with the compiler
+# instead, and we'll have to do this differently.
+
+AC_DEFUN([AC_PROG_CPP_WERROR],
+[AC_REQUIRE([AC_PROG_CPP])dnl
+m4_define([AC_CHECK_HEADER],m4_defn([_AC_CHECK_HEADER_OLD]))
+ac_c_preproc_warn_flag=yes])# AC_PROG_CPP_WERROR