| 1 | AC_INIT([argpar], [0.1.0]) |
| 2 | AM_INIT_AUTOMAKE([foreign]) |
| 3 | LT_INIT |
| 4 | |
| 5 | AC_CONFIG_MACRO_DIRS([m4]) |
| 6 | |
| 7 | AC_USE_SYSTEM_EXTENSIONS |
| 8 | |
| 9 | # Depend on glib just for the tests. |
| 10 | PKG_CHECK_MODULES([GLIB], [glib-2.0]) |
| 11 | |
| 12 | # When given, add -Werror to WARN_CFLAGS and WARN_CXXFLAGS. |
| 13 | # Disabled by default |
| 14 | AE_FEATURE_DEFAULT_DISABLE |
| 15 | AE_FEATURE([Werror],[Treat compiler warnings as errors.]) |
| 16 | |
| 17 | # Detect warning flags supported by the C compiler and append them to |
| 18 | # WARN_CFLAGS. |
| 19 | # |
| 20 | m4_define([WARN_FLAGS_LIST], [ dnl |
| 21 | -Wall dnl |
| 22 | -Wextra dnl |
| 23 | -Wmissing-prototypes dnl |
| 24 | -Wmissing-declarations dnl |
| 25 | -Wnull-dereference dnl |
| 26 | -Wundef dnl |
| 27 | -Wredundant-decls dnl |
| 28 | -Wshadow dnl |
| 29 | -Wjump-misses-init dnl |
| 30 | -Wsuggest-attribute=format dnl |
| 31 | -Wtautological-constant-out-of-range-compare dnl |
| 32 | -Wnested-externs dnl |
| 33 | -Wwrite-strings dnl |
| 34 | -Wformat=2 dnl |
| 35 | -Wstrict-aliasing dnl |
| 36 | -Wmissing-noreturn dnl |
| 37 | -Winit-self dnl |
| 38 | -Wduplicated-cond dnl |
| 39 | -Wduplicated-branches dnl |
| 40 | -Wlogical-op dnl |
| 41 | ]) |
| 42 | |
| 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}" |
| 46 | |
| 47 | AC_SUBST(AM_CFLAGS) |
| 48 | |
| 49 | AC_CONFIG_FILES([ |
| 50 | Doxyfile |
| 51 | Makefile |
| 52 | argpar/Makefile |
| 53 | tests/Makefile |
| 54 | tests/tap/Makefile |
| 55 | ]) |
| 56 | |
| 57 | AC_OUTPUT |