osmith submitted this change.
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
configure: add --enable-werror, --enable-sanitize
Change-Id: I089b72068c095b9c88eb72970a9e691da3673ddf
---
M configure.ac
1 file changed, 26 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index fc359c2..f6db329 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,6 +27,32 @@
CFLAGS="$saved_CFLAGS"
AC_SUBST(SYMBOL_VISIBILITY)
+AC_ARG_ENABLE(sanitize,
+ [AS_HELP_STRING(
+ [--enable-sanitize],
+ [Compile with address sanitizer enabled],
+ )],
+ [sanitize=$enableval], [sanitize="no"])
+if test x"$sanitize" = x"yes"
+then
+ CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined"
+ CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
+fi
+
+AC_ARG_ENABLE(werror,
+ [AS_HELP_STRING(
+ [--enable-werror],
+ [Turn all compiler warnings into errors]
+ )],
+ [werror=$enableval], [werror="no"])
+if test x"$werror" = x"yes"
+then
+ WERROR_FLAGS="-Werror"
+ WERROR_FLAGS+=" -Werror=implicit-int -Werror=int-conversion -Werror=old-style-definition"
+ CFLAGS="$CFLAGS $WERROR_FLAGS"
+ CPPFLAGS="$CPPFLAGS $WERROR_FLAGS"
+fi
+
AC_OUTPUT(
libosmo-asn1-tcap.pc
src/Makefile
To view, visit change 41025. To unsubscribe, or for help writing mail filters, visit settings.