]> granicus.if.org Git - libatomic_ops/commitdiff
New configure option (--enable-werror) to treat warnings as compiler errors
authorIvan Maidanski <ivmai@mail.ru>
Sun, 17 May 2015 18:16:29 +0000 (21:16 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 17 May 2015 18:46:57 +0000 (21:46 +0300)
* configure.ac (werror): Test --enable-werror option to add -Werror
to CFLAGS.

configure.ac

index 0908ef30e7ce576afe88d2f81f0fb7aa3ea02094..e11b9c7ce0b7cafa3dfde71e47789a19329d8c53 100644 (file)
@@ -56,6 +56,12 @@ if test "$GCC" = yes; then
   AC_MSG_RESULT($ac_cv_cc_wextra)
   AS_IF([test "$ac_cv_cc_wextra" = yes], [WEXTRA="-Wextra"], [WEXTRA="-W"])
   CFLAGS="-Wall $WEXTRA $CFLAGS"
+
+  AC_ARG_ENABLE(werror, [AC_HELP_STRING([--enable-werror],
+                            [Pass -Werror to the C compiler])])
+  if test "$enable_werror" = yes; then
+    CFLAGS="-Werror $CFLAGS"
+  fi
 else
   case "$host" in
     *-*-hpux*)