build: default to --enable-gcc-warnings in a git tree
authorEric Blake <eblake@redhat.com>
Tue, 23 Oct 2012 09:06:11 +0000 (11:06 +0200)
committerJim Meyering <jim@meyering.net>
Tue, 23 Oct 2012 14:15:53 +0000 (16:15 +0200)
Anyone building from cloned sources can be assumed to have a new
enough environment, such that enabling gcc warnings by default will
be useful.  Tarballs still default to no warnings, and the default
can still be overridden with --disable-gcc-warnings.
* configure.ac (gl_gcc_warnings): Set default based on environment.

configure.ac

index ecb362bc8bfb2e2d85d3cf30e4646459b248846f..64112da8dba54d6ea0b4c42b63f329a5f848c903 100644 (file)
@@ -51,7 +51,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