[Pvfs2-cvs] commit by pw in pvfs2: Makefile.in configure.in configure

CVS commit program cvs at parl.clemson.edu
Sun Jul 22 11:48:53 EDT 2007


Update of /projects/cvsroot/pvfs2
In directory parlweb1:/tmp/cvs-serv17793

Modified Files:
	Makefile.in configure.in configure 
Log Message:
Move gcc options for --enable-strict from configure to Makefile, so they
are near the other build flags and so non-GCC compilers can be handled
differently.  Also redefine --enable-strict to apply only warning options,
not to turn on -g too.  And the option works with CFLAGS= override on the
command line too, unlike --enable-fast.  Finally, set default CFLAGS to
"-g -O2", adding the -g in hopes we will get better tracebacks on errors.
This will increase code size somewhat.  Builds that use --enable-fast or
custom CFLAGS are not affected.


Index: Makefile.in
===================================================================
RCS file: /projects/cvsroot/pvfs2/Makefile.in,v
diff -u -p -p -u -r1.252 -r1.253
--- Makefile.in	20 Jul 2007 19:21:10 -0000	1.252
+++ Makefile.in	22 Jul 2007 15:48:51 -0000	1.253
@@ -162,6 +162,7 @@ MMAP_RA_CACHE = @MMAP_RA_CACHE@
 TRUSTED_CONNECTIONS = @TRUSTED_CONNECTIONS@
 REDHAT_RELEASE = @REDHAT_RELEASE@
 NPTL_WORKAROUND = @NPTL_WORKAROUND@
+STRICT_CFLAGS = @STRICT_CFLAGS@
 # for Solaris:
 # LIBS += -lsocket -lnsl
 
@@ -180,6 +181,22 @@ CFLAGS += $(patsubst %,-I$(srcdir)/%,$(I
   # add package version information
 CFLAGS += -DPVFS2_VERSION="\"@PVFS2_VERSION@\""
 
+# always want these gcc flags
+GCC_CFLAGS := -pipe -Wall -Wstrict-prototypes
+
+ifneq (,$(STRICT_CFLAGS))
+    GCC_CFLAGS += -Wcast-align -Wbad-function-cast
+    GCC_CFLAGS += -Wmissing-prototypes -Wmissing-declarations
+    GCC_CFLAGS += -Wundef -Wpointer-arith
+    GCC_CFLAGS += -Wnested-externs
+    GCC_CFLAGS += -Wredundant-decls
+    # These are very noisy, and probably too strict.
+    #GCC_CFLAGS += -W -Wno-unused -Wno-sign-compare
+    #GCC_CFLAGS += -Wcast-qual
+    #GCC_CFLAGS += -Wshadow
+    #GCC_CFLAGS += -Wwrite-strings
+endif
+
 # Intel cc options, enable all warnings, then disable some
 INTEL_CFLAGS := -Wall
 # #279: controlling expression is constant
@@ -187,40 +204,30 @@ INTEL_CFLAGS := -Wall
 INTEL_CFLAGS += -wd279
 # #424: extra ";" ignored e.g. in endecode_fields_2(); usage
 INTEL_CFLAGS += -wd424
-# #1419: external declaration in primary source file; would be good
-# to get rid of these someday
-INTEL_CFLAGS += -wd1419
-# #1419: external definition with no prior declaration; most of these
-# want to be static
-INTEL_CFLAGS += -wd1418
-# #181: argument is incompatible with corresponding format string
-# conversion; investigate someday.
-INTEL_CFLAGS += -wd181
 # #188: enumerated type mixed with another type, like flag |= ENUM_VALUE;
 # bogus compiler warning
 INTEL_CFLAGS += -wd188
-# #869: parameter .. was never referenced, like -Wunused
-INTEL_CFLAGS += -wd869
-# #810: conversion from .. to .. may lose significant bits; investigate
-# but probably harmless
-INTEL_CFLAGS += -wd810
 # #981: operands are evaluated in unspecified order, like printf that
 # uses functions to get some values; unimportant.
 INTEL_CFLAGS += -wd981
 
-# gcc options
-GCC_CFLAGS := -pipe -Wall -Wstrict-prototypes
-# These are quite nice to enable, but will raise some warnings.
-#GCC_CFLAGS += -Wcast-align -Wbad-function-cast
-#GCC_CFLAGS += -Wmissing-prototypes -Wmissing-declarations
-#GCC_CFLAGS += -Wundef -Wpointer-arith
-#GCC_CFLAGS += -Wnested-externs
-#GCC_CFLAGS += -Wredundant-decls
-# These are very noisy.
-#GCC_CFLAGS += -W -Wno-unused -Wno-sign-compare
-#GCC_CFLAGS += -Wcast-qual
-#GCC_CFLAGS += -Wshadow
-#GCC_CFLAGS += -Wwrite-strings
+# do not disable these if strict, i.e. enable some more warnings
+ifeq (,$(STRICT_CFLAGS))
+    # #1419: external declaration in primary source file; would be good
+    # to get rid of these someday
+    INTEL_CFLAGS += -wd1419
+    # #1419: external definition with no prior declaration; most of these
+    # want to be static
+    INTEL_CFLAGS += -wd1418
+    # #181: argument is incompatible with corresponding format string
+    # conversion; investigate someday.
+    INTEL_CFLAGS += -wd181
+    # #869: parameter .. was never referenced, like -Wunused
+    INTEL_CFLAGS += -wd869
+    # #810: conversion from .. to .. may lose significant bits; investigate
+    # but probably harmless
+    INTEL_CFLAGS += -wd810
+endif
 
 ################################################################
 # Setup component specific flags

Index: configure.in
===================================================================
RCS file: /projects/cvsroot/pvfs2/configure.in,v
diff -u -p -p -u -r1.324 -r1.325
--- configure.in	20 Jul 2007 19:12:35 -0000	1.324
+++ configure.in	22 Jul 2007 15:48:51 -0000	1.325
@@ -528,7 +528,7 @@ AC_SUBST(BUILD_ABSOLUTE_TOP)
 AC_SUBST(SRC_RELATIVE_TOP)
 AC_SUBST(SRC_ABSOLUTE_TOP)
 
-dnl More options
+dnl Optimized code, but never override CFLAGS from command line or environment.
 AC_ARG_ENABLE(fast,
 [  --enable-fast           Disable optional debugging, enable optimizations.],
 [
@@ -537,6 +537,11 @@ if test "x$USR_CFLAGS_SET" = "xno"; then
 fi
 ])
 
+# default CFLAGS is -g -O2, unless user set CFLAGS or asked for --enable-fast
+if test "x$USR_CFLAGS_SET" = "xno" && test "x$enable_fast" != "xyes"; then
+    CFLAGS="$CFLAGS -g -O2"
+fi
+
 dnl Options that are not yet working
 dnl --------------------------------
 dnl AC_ARG_ENABLE(profiling,
@@ -552,18 +557,11 @@ dnl )
 
 AC_SUBST(ENABLE_COVERAGE)
 
+STRICT_CFLAGS=
 AC_ARG_ENABLE(strict,
-[  --enable-strict         Turn on strict debugging with gcc],
-[
-if test "x$USR_CFLAGS_SET" = "xno"; then
-    CFLAGS="$CFLAGS -g -Wall -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wpointer-arith -Wbad-function-cast"
-fi
-],
-[
-if test "x$USR_CFLAGS_SET" = "xno" && test "x$enable_fast" != "xyes"; then
-    CFLAGS="$CFLAGS -O2"
-fi
-])
+[  --enable-strict         Turn on strict compiler warnings],
+    STRICT_CFLAGS=1)
+AC_SUBST(STRICT_CFLAGS)
 
 dnl Check if user actually wants to see all our build output (compiles, links, etc.).
 AC_ARG_ENABLE(verbose-build,

Index: configure
===================================================================
RCS file: /projects/cvsroot/pvfs2/configure,v
diff -u -p -p -u -r1.348 -r1.349
--- configure	20 Jul 2007 19:38:18 -0000	1.348
+++ configure	22 Jul 2007 15:48:51 -0000	1.349
@@ -699,6 +699,7 @@ BUILD_ABSOLUTE_TOP
 SRC_RELATIVE_TOP
 SRC_ABSOLUTE_TOP
 ENABLE_COVERAGE
+STRICT_CFLAGS
 QUIET_COMPILE
 BUILD_EPOLL
 build_shared
@@ -1327,7 +1328,7 @@ Optional Features:
   --disable-kernel-aio    Forcibly disable kernel aio
   --enable-kernel-sendfile    Forcibly enable kernel sendfile
   --enable-fast           Disable optional debugging, enable optimizations.
-  --enable-strict         Turn on strict debugging with gcc
+  --enable-strict         Turn on strict compiler warnings
   --enable-verbose-build  Enables full output during build process
   --enable-epoll          Enable use of epoll for TCP/IP polling
                           (epoll is enabled by default, this option
@@ -11164,23 +11165,20 @@ fi
 fi
 
 
+# default CFLAGS is -g -O2, unless user set CFLAGS or asked for --enable-fast
+if test "x$USR_CFLAGS_SET" = "xno" && test "x$enable_fast" != "xyes"; then
+    CFLAGS="$CFLAGS -g -O2"
+fi
+
 
 
 
+STRICT_CFLAGS=
 # Check whether --enable-strict was given.
 if test "${enable_strict+set}" = set; then
-  enableval=$enable_strict;
-if test "x$USR_CFLAGS_SET" = "xno"; then
-    CFLAGS="$CFLAGS -g -Wall -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wpointer-arith -Wbad-function-cast"
-fi
-
-else
-
-if test "x$USR_CFLAGS_SET" = "xno" && test "x$enable_fast" != "xyes"; then
-    CFLAGS="$CFLAGS -O2"
+  enableval=$enable_strict; STRICT_CFLAGS=1
 fi
 
-fi
 
 
 # Check whether --enable-verbose-build was given.
@@ -14670,7 +14668,7 @@ rm -f core conftest.err conftest.$ac_obj
 fi
 
 
-                                                                        use_portals=no
+                                                                        use_portals=
     home=
     incs=
     libs=
@@ -17700,6 +17698,7 @@ BUILD_ABSOLUTE_TOP!$BUILD_ABSOLUTE_TOP$a
 SRC_RELATIVE_TOP!$SRC_RELATIVE_TOP$ac_delim
 SRC_ABSOLUTE_TOP!$SRC_ABSOLUTE_TOP$ac_delim
 ENABLE_COVERAGE!$ENABLE_COVERAGE$ac_delim
+STRICT_CFLAGS!$STRICT_CFLAGS$ac_delim
 QUIET_COMPILE!$QUIET_COMPILE$ac_delim
 BUILD_EPOLL!$BUILD_EPOLL$ac_delim
 build_shared!$build_shared$ac_delim
@@ -17710,7 +17709,6 @@ DB_LIB!$DB_LIB$ac_delim
 NEEDS_LIBRT!$NEEDS_LIBRT$ac_delim
 TARGET_OS_DARWIN!$TARGET_OS_DARWIN$ac_delim
 TARGET_OS_LINUX!$TARGET_OS_LINUX$ac_delim
-BUILD_BMI_TCP!$BUILD_BMI_TCP$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -17752,6 +17750,7 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+BUILD_BMI_TCP!$BUILD_BMI_TCP$ac_delim
 GM_HOME!$GM_HOME$ac_delim
 BUILD_GM!$BUILD_GM$ac_delim
 MX_HOME!$MX_HOME$ac_delim
@@ -17773,7 +17772,7 @@ LIBOBJS!$LIBOBJS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 19; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 20; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5



More information about the Pvfs2-cvs mailing list