Anyone building from git can be assumed to have a new enough gcc
to make warnings by default worthwhile.  Tarballs still default to
no warnings, and if a developer has an issue with the default, they
can still use ./configure --disable-gcc-warnings.

* configure.ac (gl_gcc_warnings): Alter default based on environment.

Signed-off-by: Eric Blake <ebl...@redhat.com>
---

Based on a similar patch to coreutils.

 ChangeLog    | 5 +++++
 configure.ac | 6 +++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index c13a831..f06d5f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-09-06  Eric Blake  <ebl...@redhat.com>
+
+       maint: enable gcc warnings during git development
+       * configure.ac (gl_gcc_warnings): Alter default based on environment.
+
 2012-09-05  Stefanno Lattarini  <stefano.lattar...@gmail.com>  (tiny change)

        maint: convert the last hand-written Makefile to automake
diff --git a/configure.ac b/configure.ac
index 6886273..e986de2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,7 +50,11 @@ AC_ARG_ENABLE([gcc-warnings],
      *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
    esac
    gl_gcc_warnings=$enableval],
-  [gl_gcc_warnings=no]
+  [if test -d "$srcdir"/.git; then
+     gl_gcc_warnings=yes
+   else
+     gl_gcc_warnings=no
+   fi]
 )

 if test "$gl_gcc_warnings" = yes; then
-- 
1.7.11.4


_______________________________________________
M4-patches mailing list
M4-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/m4-patches

Reply via email to