@@ -95,6 +95,13 @@ AC_ARG_ENABLE(generic-architecture,
9595 [ fs2_generic_architecture=no] ,
9696)
9797
98+ AC_ARG_ENABLE ( asan ,
99+ AC_HELP_STRING ( [ --enable-asan] ,
100+ [ Attempt to link against AddressSanitizer library (https://github.com/google/sanitizers/wiki/AddressSanitizer)] ) ,
101+ [ fs2_asan=$enableval] ,
102+ [ fs2_asan=no] ,
103+ )
104+
98105AC_ARG_WITH ( static-ogg ,
99106 AC_HELP_STRING ( [ --with-static-ogg=DIR] ,
100107 [ Link staticly with OGG, Vorbis and Theora libs from this directory] ) ,
@@ -249,6 +256,11 @@ if test "$fs2_fred" = "yes" ; then
249256 FS2_LIBS="$FS2_LIBS $WX_LIBS"
250257fi
251258
259+ if test "$fs2_asan" = "yes" ; then
260+ D_CFLAGS="$D_CFLAGS -fsanitize=address -fno-omit-frame-pointer"
261+ D_LDFLAGS="$D_LDFLAGS -fsanitize=address"
262+ fi
263+
252264if test "$fs2_debug" = "yes" ; then
253265 AC_DEFINE ( [ _DEBUG] )
254266 D_CFLAGS="$D_CFLAGS -O0 -g -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -Wno-write-strings -Wshadow -funroll-loops"
@@ -549,4 +561,7 @@ echo NoWarn Allowed ......... : $fs2_nowarn
549561echo Debug build ............ : $fs2_debug
550562echo GProf support .......... : $fs2_gprof
551563echo Fatal warnings ......... : $fs2_fatal_warnings
564+ echo Generic build .......... : $fs2_generic_architecture
565+ echo ASan enabled ........... : $fs2_asan
566+ echo Building wxFred2 ....... : $fs2_fred
552567echo
0 commit comments