summaryrefslogtreecommitdiff
path: root/build_posix/aclocal
diff options
context:
space:
mode:
Diffstat (limited to 'build_posix/aclocal')
-rw-r--r--build_posix/aclocal/options.m410
-rw-r--r--build_posix/aclocal/strict.m474
2 files changed, 84 insertions, 0 deletions
diff --git a/build_posix/aclocal/options.m4 b/build_posix/aclocal/options.m4
index 0fb49dbf1df..5f9b8748df2 100644
--- a/build_posix/aclocal/options.m4
+++ b/build_posix/aclocal/options.m4
@@ -215,6 +215,16 @@ pthread_adaptive|pthreads_adaptive)
esac
AC_MSG_RESULT($with_spinlock)
+AC_MSG_CHECKING(if --enable-strict option specified)
+AC_ARG_ENABLE(strict,
+ [AS_HELP_STRING([--enable-strict],
+ [Enable strict compiler checking.])], r=$enableval, r=no)
+case "$r" in
+no) wt_cv_enable_strict=no;;
+*) wt_cv_enable_strict=yes;;
+esac
+AC_MSG_RESULT($wt_cv_enable_strict)
+
AH_TEMPLATE(HAVE_VERBOSE, [Enable verbose message configuration.])
AC_MSG_CHECKING(if --enable-verbose option specified)
AC_ARG_ENABLE(verbose,
diff --git a/build_posix/aclocal/strict.m4 b/build_posix/aclocal/strict.m4
new file mode 100644
index 00000000000..b59f09fe584
--- /dev/null
+++ b/build_posix/aclocal/strict.m4
@@ -0,0 +1,74 @@
+# AM_STRICT
+# Per compiler-version flags used when compiling in strict mode.
+
+# GCC warnings.
+AC_DEFUN([AM_GCC_WARNINGS], [
+ w="$w -Wall -Wextra -Werror"
+
+ w="$w -Waggregate-return"
+ w="$w -Wbad-function-cast"
+ w="$w -Wcast-align"
+ w="$w -Wdeclaration-after-statement"
+ w="$w -Wdouble-promotion"
+ w="$w -Wfloat-equal"
+ w="$w -Wformat-nonliteral"
+ w="$w -Wformat-security"
+ w="$w -Wformat=2"
+ w="$w -Winit-self"
+ w="$w -Wjump-misses-init"
+ w="$w -Wmissing-declarations"
+ w="$w -Wmissing-field-initializers"
+ w="$w -Wmissing-parameter-type"
+ w="$w -Wmissing-prototypes"
+ w="$w -Wnested-externs"
+ w="$w -Wold-style-definition"
+ w="$w -Wpacked"
+ w="$w -Wpointer-arith"
+ w="$w -Wpointer-sign"
+ w="$w -Wredundant-decls"
+ w="$w -Wshadow"
+ w="$w -Wsign-conversion"
+ w="$w -Wstrict-prototypes"
+ w="$w -Wswitch-enum"
+ w="$w -Wundef"
+ w="$w -Wunreachable-code"
+ w="$w -Wunsafe-loop-optimizations"
+ w="$w -Wunused"
+ w="$w -Wwrite-strings"
+
+ # Non-fatal informational warnings.
+ w="$w -Wno-error=inline"
+ w="$w -Wno-error=unsafe-loop-optimizations"
+
+ wt_cv_strict_warnings="$w"
+])
+
+# Clang warnings.
+AC_DEFUN([AM_CLANG_WARNINGS], [
+ w="-Weverything -Werror"
+
+ w="$w -Wno-cast-align"
+ w="$w -Wno-documentation-unknown-command"
+ w="$w -Wno-format-nonliteral"
+ w="$w -Wno-packed"
+ w="$w -Wno-padded"
+ w="$w -Wno-reserved-id-macro"
+ w="$w -Wno-zero-length-array"
+
+ # We should turn on cast-qual, but not as a fatal error: see WT-2690.
+ # For now, turn it off.
+ # w="$w -Wno-error=cast-qual"
+ w="$w -Wno-cast-qual"
+
+ # Older OS X releases need some special love; these flags should be
+ # removed in the not-too-distant future.
+ # Apple clang version 4.1
+ # (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
+ w="$w -Wno-pedantic"
+ w="$w -Wno-unused-command-line-argument"
+
+ # Ignore unrecognized options.
+ w="$w -Wno-unknown-warning-option"
+
+ wt_cv_strict_warnings="$w"
+])