This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]