summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2021-02-04 14:45:37 (GMT)
committerGitHub <noreply@github.com>2021-02-04 14:45:37 (GMT)
commit197751c5af9692f5d18af723251247c97050b93d (patch)
tree811463bffc0a49746ba2158b9c0b831161d61f2c /configure.ac
parent8cfcf0e3949c2de67f6fb29dd52d5bc57b76ba0d (diff)
downloadhdf5-197751c5af9692f5d18af723251247c97050b93d.zip
hdf5-197751c5af9692f5d18af723251247c97050b93d.tar.gz
hdf5-197751c5af9692f5d18af723251247c97050b93d.tar.bz2
Warnings merge 110 (#300)
* HDFFV-10865 - merge from dev, HDFArray perf fix. * Remove duplicate setting * Whitespace changes after clang format * Undo version 11 clang format changes * Merge CMake changes from develop * Merge dev warnings refactor from develop
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 e91f06f..9296080 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])