diff options
author | Max <msuraev@sysmocom.de> | 2018-02-12 13:04:32 +0100 |
---|---|---|
committer | Max <msuraev@sysmocom.de> | 2018-02-12 13:04:32 +0100 |
commit | 725e0038ee7400efa2d99b203b6d43f8ee6fe92e (patch) | |
tree | 26a5b5b20076566a485da50339de337b108ccf6d | |
parent | a70b22376c49e8dcc122361c6618d2665062c377 (diff) |
Add --enable-sanitize configure option
Change-Id: Ibb26e5fc73843f3951dbc534653ee7d88e4c80e7
-rw-r--r-- | configure.ac | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 180e380..018c479 100644 --- a/configure.ac +++ b/configure.ac @@ -61,6 +61,15 @@ AC_SUBST(LTLDFLAGS_OSMOGAPK) # Checks for programs. AC_PROG_CC +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 + # Checks for libraries. # libosmocore (codec module) PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.2) |