## Automake base setup ##
## ##
-AM_INIT_AUTOMAKE([1.12 foreign dist-bzip2 no-dist-gzip tar-ustar nostdinc -Wall -Wno-portability -Werror])
+AM_INIT_AUTOMAKE([1.13 foreign dist-bzip2 no-dist-gzip tar-ustar nostdinc -Wall -Wno-portability -Werror])
AM_MAINTAINER_MODE([enable])
# Enable silent rules by default
# When given, build with AddressSanitizer.
AE_FEATURE_DEFAULT_DISABLE
AE_FEATURE([asan],[Build with AddressSanitizer.])
+AE_FEATURE([ubsan],[Build with UndefinedBehaviorSanitizer.])
## ##
## Check for conflicting features selection ##
ASAN_LDFLAGS="-fsanitize=address"
])
-
+# If --enable-ubsan is used...
+AE_IF_FEATURE_ENABLED([ubsan], [
+ # ... add -fsanitize=undefined to the *FLAGS variables.
+ UBSAN_CFLAGS="-fsanitize=undefined"
+ UBSAN_CXXFLAGS="-fsanitize=undefined"
+ UBSAN_LDFLAGS="-fsanitize=undefined"
+])
# CFLAGS from libraries (the glib ones are needed for the following sizeof
# test).
-AM_CFLAGS="-fvisibility=hidden ${PTHREAD_CFLAGS} ${GLIB_CFLAGS} ${ASAN_CFLAGS}"
-AM_CXXFLAGS="-fvisibility=hidden -fvisibility-inlines-hidden ${PTHREAD_CFLAGS} ${GLIB_CFLAGS} ${ASAN_CXXFLAGS}"
-AM_LDFLAGS="${ASAN_LDFLAGS}"
+AM_CFLAGS="-fvisibility=hidden ${PTHREAD_CFLAGS} ${GLIB_CFLAGS} ${ASAN_CFLAGS} ${UBSAN_CFLAGS}"
+AM_CXXFLAGS="-fvisibility=hidden -fvisibility-inlines-hidden ${PTHREAD_CFLAGS} ${GLIB_CFLAGS} ${ASAN_CXXFLAGS} ${UBSAN_CFLAGS}"
+AM_LDFLAGS="${ASAN_LDFLAGS} ${UBSAN_CFLAGS}"
# Check that the current size_t matches the size that glib thinks it should
# be. This catches problems on multi-arch where people try to do a 32-bit
tests/lib/Makefile
tests/lib/test-plugin-plugins/Makefile
tests/lib/conds/Makefile
+ tests/lib/utils/Makefile
tests/Makefile
tests/param-validation/Makefile
tests/plugins/Makefile