Patchwork [2/2,pr32193] libgomp: add a --enable-werror configure flag

login
register
mail settings
Submitter Mike Frysinger
Date Dec. 23, 2012, 11:30 p.m.
Message ID <1356305421-13533-2-git-send-email-vapier@gentoo.org>
Download mbox | patch
Permalink /patch/207994/
State New
Headers show

Comments

Mike Frysinger - Dec. 23, 2012, 11:30 p.m.
URL: http://gcc.gnu.org/PR32193
Signed-off-by: Mike Frysinger <vapier@gentoo.org>

2012-12-23  Mike Frysinger  <vapier@gentoo.org>

	PR libgomp/32193
	* configure.ac: Call AC_ARG_ENABLE(werror).
	(XCFLAGS): Add -Werror when enable_werror is not no.
	* configure: Regenerated.
---
 libgomp/configure    | 16 +++++++++++++---
 libgomp/configure.ac |  7 ++++++-
 2 files changed, 19 insertions(+), 4 deletions(-)

Patch

diff --git a/libgomp/configure b/libgomp/configure
index 238b1af..3add57f 100755
--- a/libgomp/configure
+++ b/libgomp/configure
@@ -760,6 +760,7 @@  enable_version_specific_runtime_libs
 enable_generated_files_in_srcdir
 enable_multilib
 enable_dependency_tracking
+enable_werror
 enable_shared
 enable_static
 with_pic
@@ -1410,6 +1411,7 @@  Optional Features:
   --enable-multilib       build many library versions (default)
   --disable-dependency-tracking  speeds up one-time build
   --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-werror         turns on -Werror [default=yes]
   --enable-shared[=PKGS]  build shared libraries [default=yes]
   --enable-static[=PKGS]  build static libraries [default=yes]
   --enable-fast-install[=PKGS]
@@ -4280,9 +4282,17 @@  fi
 # in both places for now and restore CFLAGS at the end of config.
 save_CFLAGS="$CFLAGS"
 
+# Check whether --enable-werror was given.
+if test "${enable_werror+set}" = set; then :
+  enableval=$enable_werror;
+fi
+
 # Add -Wall -Werror if we are using GCC.
 if test "x$GCC" = "xyes"; then
-  XCFLAGS="$XCFLAGS -Wall -Werror"
+  XCFLAGS="$XCFLAGS -Wall"
+  if test "x$enable_werror" != "xno"; then
+    XCFLAGS="$XCFLAGS -Werror"
+  fi
 fi
 
 # Find other programs we need.
@@ -11088,7 +11098,7 @@  else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11091 "configure"
+#line 11101 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11194,7 +11204,7 @@  else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11197 "configure"
+#line 11207 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libgomp/configure.ac b/libgomp/configure.ac
index d87ed29..3b9cd4b 100644
--- a/libgomp/configure.ac
+++ b/libgomp/configure.ac
@@ -113,9 +113,14 @@  AC_SUBST(CFLAGS)
 # in both places for now and restore CFLAGS at the end of config.
 save_CFLAGS="$CFLAGS"
 
+AC_ARG_ENABLE(werror, [AS_HELP_STRING([--enable-werror],
+                                      [turns on -Werror @<:@default=yes@:>@])])
 # Add -Wall -Werror if we are using GCC.
 if test "x$GCC" = "xyes"; then
-  XCFLAGS="$XCFLAGS -Wall -Werror"
+  XCFLAGS="$XCFLAGS -Wall"
+  if test "x$enable_werror" != "xno"; then
+    XCFLAGS="$XCFLAGS -Werror"
+  fi
 fi
 
 # Find other programs we need.