mtr_SOURCES += ui/gtk.c
endif
+if WITH_LIBASAN
+ASAN_CFLAGS = -fno-omit-frame-pointer
+ASAN_CFLAGS += -fsanitize=undefined
+ASAN_CFLAGS += -fsanitize=address
+endif
+
mtr_INCLUDES = $(GLIB_CFLAGS) -I$(top_builddir) -I$(top_srcdir)
-mtr_CFLAGS = $(GTK_CFLAGS) $(NCURSES_CFLAGS)
+mtr_CFLAGS = $(GTK_CFLAGS) $(NCURSES_CFLAGS) $(ASAN_CFLAGS)
mtr_LDADD = $(GTK_LIBS) $(NCURSES_LIBS) $(RESOLV_LIBS)
AC_CHECK_LIB([m], [floor], [], [AC_MSG_ERROR([No math library found])])
+# libasan
+AC_ARG_WITH([libasan],
+ [AS_HELP_STRING([--with-libasan], [Build with AddressSanitizer])],
+ [with_libasan=yes], [])
+AM_CONDITIONAL([WITH_LIBASAN], [test "x$with_libasan" = "xyes"])
+
# Find GTK
AC_ARG_WITH([gtk],
[AS_HELP_STRING([--without-gtk], [Build without the GTK+ interface])],
AM_CONDITIONAL([BUILD_BASH_COMPLETION], [test "x$enable_bash_completion" = xyes])
echo "build options:"
echo "--------------"
+echo "libasan :$with_libasan"
echo "ipv6 :$USES_IPV6"
echo "ipinfo :$with_ipinfo"
echo "ncurses :$with_ncurses"