2 AM_INIT_AUTOMAKE([foreign])
5 AC_CONFIG_MACRO_DIRS([m4])
7 AC_USE_SYSTEM_EXTENSIONS
9 # Depend on glib just for the tests.
10 PKG_CHECK_MODULES([GLIB], [glib-2.0])
12 # When given, add -Werror to WARN_CFLAGS and WARN_CXXFLAGS.
14 AE_FEATURE_DEFAULT_DISABLE
15 AE_FEATURE([Werror],[Treat compiler warnings as errors.])
17 # Detect warning flags supported by the C compiler and append them to
20 m4_define([WARN_FLAGS_LIST], [ dnl
23 -Wmissing-prototypes dnl
24 -Wmissing-declarations dnl
25 -Wnull-dereference dnl
29 -Wjump-misses-init dnl
30 -Wsuggest-attribute=format dnl
31 -Wtautological-constant-out-of-range-compare dnl
36 -Wmissing-noreturn dnl
39 -Wduplicated-branches dnl
43 AX_APPEND_COMPILE_FLAGS([WARN_FLAGS_LIST], [WARN_CFLAGS], [-Werror])
44 AE_IF_FEATURE_ENABLED([Werror], [WARN_CFLAGS="${WARN_CFLAGS} -Werror"])
45 AM_CFLAGS="${AM_CFLAGS} ${WARN_CFLAGS}"