summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac47
1 files changed, 39 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 6182034..64a3df3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -104,14 +104,10 @@ AC_SUBST([AR_FLAGS])
## H5_CFLAGS (and company) are for CFLAGS that should be used on HDF5, but
## not exported to h5cc (or h5fc, etc.)
##
-## H5_ECFLAGS (and company) are for warnings that should be treated as errors.
-##
AC_SUBST([H5_CFLAGS])
-AC_SUBST([H5_ECFLAGS])
AC_SUBST([H5_CPPFLAGS])
AC_SUBST([H5_FCFLAGS])
AC_SUBST([H5_CXXFLAGS])
-AC_SUBST([H5_ECXXFLAGS])
AC_SUBST([H5_JNIFLAGS])
AC_SUBST([H5_JAVACFLAGS])
AC_SUBST([H5_JAVAFLAGS])
@@ -2248,10 +2244,6 @@ if test "X-$DEV_WARNINGS" = X- ; then
DEV_WARNINGS=no
fi
-## Allow this variable to be substituted in
-## other files (src/libhdf5.settings.in, etc.)
-AC_SUBST([DEV_WARNINGS])
-
case "X-$DEV_WARNINGS" in
X-yes)
H5_CFLAGS="$H5_CFLAGS $DEVELOPER_WARNING_CFLAGS"
@@ -2267,6 +2259,45 @@ case "X-$DEV_WARNINGS" in
esac
## ----------------------------------------------------------------------
+## Check if we should consider certain compiler warnings as errors
+##
+## These should NOT be on by default as the risk of breakage is high
+## when compiling HDF5 on new (or new versions) of platforms and
+## compilers. It can also cause failures when header files we have no
+## control over (e.g. MPI, HDFS) raise warnings.
+##
+AC_MSG_CHECKING([enable warnings as errors])
+AC_ARG_ENABLE([warnings-as-errors],
+ [AS_HELP_STRING([--enable-warnings-as-errors],
+ [Determines whether certain warnings will be
+ considered errors. This is mainly for use
+ by HDF5 library developers.
+ [default=no]
+ ])],
+ [WARNINGS_AS_ERRORS=$enableval])
+
+## Set default
+if test "X-$WARNINGS_AS_ERRORS" = X- ; then
+ WARNINGS_AS_ERRORS=no
+fi
+
+case "X-$WARNINGS_AS_ERRORS" in
+ X-yes)
+ H5_CFLAGS="$H5_CFLAGS $H5_ECFLAGS"
+ H5_CXXFLAGS="$H5_CXXFLAGS $H5_ECXXFLAGS"
+ AC_MSG_RESULT([yes])
+ ;;
+ X-no)
+ H5_CFLAGS="$H5_CFLAGS $H5_NECFLAGS"
+ H5_CXXFLAGS="$H5_CXXFLAGS $H5_NECXXFLAGS"
+ AC_MSG_RESULT([no])
+ ;;
+ *)
+ AC_MSG_ERROR([Unrecognized value: $WARNINGS_AS_ERRORS])
+ ;;
+esac
+
+## ----------------------------------------------------------------------
## Check if the compiler should use profiling flags/settings
##
AC_MSG_CHECKING([profiling])