osmith has uploaded this change for review.

View Change

configure: add --enable-werror, --enable-sanitize

Change-Id: I089b72068c095b9c88eb72970a9e691da3673ddf
---
M configure.ac
1 file changed, 26 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-asn1-tcap refs/changes/25/41025/1
diff --git a/configure.ac b/configure.ac
index 31a4db1..5e57145 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,6 +33,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.

Gerrit-MessageType: newchange
Gerrit-Project: libosmo-asn1-tcap
Gerrit-Branch: master
Gerrit-Change-Id: I089b72068c095b9c88eb72970a9e691da3673ddf
Gerrit-Change-Number: 41025
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>