nmh-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nmh-commits] nmh configure.in


From: Peter Maydell
Subject: [Nmh-commits] nmh configure.in
Date: Sun, 29 Apr 2007 19:36:14 +0000

CVSROOT:        /cvsroot/nmh
Module name:    nmh
Changes by:     Peter Maydell <pm215>   07/04/29 19:36:14

Modified files:
        .              : configure.in 

Log message:
        For gcc, make the default CFLAGS include -Wno-pointer-sign if the 
compiler
        recognises it. gcc 4 now by default produces a large volume of these
        warnings, which I believe are probably spurious and definitely a lot of
        work to go through and fix. So we suppress them for now so that the 
other
        warnings are more easily visible.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/nmh/configure.in?cvsroot=nmh&r1=1.79&r2=1.80

Patches:
Index: configure.in
===================================================================
RCS file: /cvsroot/nmh/nmh/configure.in,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -b -r1.79 -r1.80
--- configure.in        21 Mar 2007 00:18:19 -0000      1.79
+++ configure.in        29 Apr 2007 19:36:14 -0000      1.80
@@ -1,7 +1,7 @@
 dnl
 dnl configure.in -- autoconf template for nmh
 dnl
-dnl $Id: configure.in,v 1.79 2007/03/21 00:18:19 pm215 Exp $
+dnl $Id: configure.in,v 1.80 2007/04/29 19:36:14 pm215 Exp $
 dnl
 
 dnl 2.13 definitely chokes; 2.53 is the earliest version I've tested.
@@ -221,14 +221,29 @@
 
 AC_PROG_CC
 
+AC_CACHE_CHECK(whether compiler supports -Wno-pointer-sign, 
nmh_cv_has_noptrsign,
+[nmh_saved_cflags="$CFLAGS"
+ CFLAGS="$CFLAGS -Wno-pointer-sign"
+ AC_TRY_COMPILE([],[],nmh_cv_has_noptrsign=yes,nmh_cv_has_noptrsign=no)
+ CFLAGS="$nmh_saved_cflags"])
+
 dnl if the user hasn't specified CFLAGS, then
 dnl   if compiler is gcc, then
 dnl     use -O2 and some warning flags
 dnl   else use -O
+dnl We use -Wall; if the compiler supports it we also use -Wno-pointer-sign,
+dnl because gcc 4 now produces a lot of new warnings which are probably mostly
+dnl spurious and which in any case we don't want to deal with now.
+if test "$nmh_cv_has_noptrsign" = "yes"; then
+        nmh_gcc_warnflags="-Wall -Wno-pointer-sign"
+else
+        nmh_gcc_warnflags="-Wall"
+fi
+
 if test -n "$auto_cflags"; then
   if test x"$enable_debug" = x"yes"; then
     if test -n "$GCC"; then
-      test -z "$CFLAGS" && CFLAGS="-Wall -g" || CFLAGS="$CFLAGS -Wall -g"
+      test -z "$CFLAGS" && CFLAGS="$nmh_gcc_warnflags -g" || CFLAGS="$CFLAGS 
$nmh_gcc_warnflags -g"
     else
       test -z "$CFLAGS" && CFLAGS=-g || CFLAGS="$CFLAGS -g"
     fi
@@ -244,7 +259,7 @@
       esac
     fi
     if test -n "$GCC"; then
-      test -z "$CFLAGS" && CFLAGS="-Wall -O2" || CFLAGS="$CFLAGS -Wall -O2"
+      test -z "$CFLAGS" && CFLAGS="$nmh_gcc_warnflags -O2" || CFLAGS="$CFLAGS 
$nmh_gcc_warnflags -O2"
     else
       test -z "$CFLAGS" && CFLAGS=-O  || CFLAGS="$CFLAGS -O"
     fi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]