Enable -Werror by default
[deliverable/binutils-gdb.git] / binutils / configure.in
index 8bb7031cc353005646fa320de0cbbed1ea2ebc25..7f615f7533a5f41ace10b441de72e79491d7ddff 100644 (file)
@@ -30,6 +30,22 @@ AC_ARG_ENABLE(commonbfdlib,
 esac])dnl
 
 build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
+
+AC_ARG_ENABLE(error-on-warning,
+  [  --enable-error-on-warning    treat compile warnings as errors],
+  [case "${enableval}" in
+     yes | y) ERROR_ON_WARNING="yes" ;;
+     no | n)  ERROR_ON_WARNING="no" ;;
+     *) AC_MSG_ERROR(bad value ${enableval} for --enable-error-on-warning) ;;
+   esac])
+
+# Enable -Werror by default, suppressing it only for --disable-error-on-warning
+# or --disable-build-warnings.
+if test "${ERROR_ON_WARNING}" != no
+then
+  build_warnings="$build_warnings -Werror"
+fi
+                  
 AC_ARG_ENABLE(build-warnings,
 [  --enable-build-warnings Enable build-time compiler warnings if gcc is used],
 [case "${enableval}" in
This page took 0.027852 seconds and 4 git commands to generate.