diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2017-01-10 18:49:49 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2017-01-10 18:49:49 (GMT) |
commit | e6a12a3feaa3a111510d899102af77f61950b8bf (patch) | |
tree | 7e33178bfe791b9046a15ebcaa7fe07c6c6b3283 /configure.ac | |
parent | 969288e459f5db34c88853595c16824e25bf5e86 (diff) | |
download | hdf5-e6a12a3feaa3a111510d899102af77f61950b8bf.zip hdf5-e6a12a3feaa3a111510d899102af77f61950b8bf.tar.gz hdf5-e6a12a3feaa3a111510d899102af77f61950b8bf.tar.bz2 |
Added an --enable-developer-warnings option to configure so
users can ignore -Wsuggest-attribute warnings and other
noise that doesn't indicate poor code quality.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 82ad020..9f84b0f 100644 --- a/configure.ac +++ b/configure.ac @@ -2055,6 +2055,48 @@ case "X-$ASSERTS" in esac ## ---------------------------------------------------------------------- +## Check if developer warnings should be turned on +## These are warnings that provide suggestions like gcc's -Wsuggest-attribute. +## They do not indicate code problems. +## +## Note that developers don't need to build with these regularly. They +## are just handy to check once in a while (before releases, etc.). +## +AC_MSG_CHECKING([enable developer warnings]) +AC_ARG_ENABLE([developer-warnings], + [AS_HELP_STRING([--enable-developer-warnings], + [Determines whether developer warnings will be + emitted. These are usually performance suggestions + (e.g. -Wsuggest-attribute) and do not flag poor code + quality. + [default=no] + ])], + [DEV_WARNINGS=$enableval]) + +## Set default +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" + AC_MSG_RESULT([yes]) + ;; + X-no) + H5_CFLAGS="$H5_CFLAGS $NO_DEVELOPER_WARNING_CFLAGS" + AC_MSG_RESULT([no]) + ;; + *) + AC_MSG_ERROR([Unrecognized value: $DEV_WARNINGS]) + ;; +esac + +## ---------------------------------------------------------------------- ## Check if the compiler should use profiling flags/settings ## AC_MSG_CHECKING([profiling]) |