AM_CPPFLAGS = $(kinclude_CFLAGS) $(all_includes) -I$(top_srcdir)/include \
-I/usr/local/include
-AM_CFLAGS = -std=gnu99 -Wall
+AM_CFLAGS = -std=gnu99
if ENABLE_DEBUG
-AM_CFLAGS += -g -ggdb -gdwarf-2 -g3 -DIPSET_DEBUG
+AM_CFLAGS += -g -g3 -ggdb -gdwarf-2 -DIPSET_DEBUG -Wall -Werror
+else
+AM_CFLAGS += -O2 -DNDEBUG
endif
if ! ENABLE_VERBOSE
AC_CANONICAL_HOST
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADER([config.h])
-AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
+AM_INIT_AUTOMAKE([foreign subdir-objects])
dnl Shortcut: Linux supported alone
case "$host" in
AM_CONDITIONAL([ENABLE_DEBUG], [test "x$enable_debug" = xyes])
dnl Checks for programs
+: ${CFLAGS=""}
+
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_LIBTOOL
dnl -Wconversion -> we need it
dnl -Wunreachable-code -> fails with ntoh*
dnl -Wpointer-arith -> limbnl uses it
+if test "x$enable_debug" = "xyes"
+then
AX_CFLAGS_GCC_OPTION(-Waggregate-return)
AX_CFLAGS_GCC_OPTION(-Wbad-function-cast)
AX_CFLAGS_GCC_OPTION(-Wcast-align)
AX_CFLAGS_GCC_OPTION(-Wundef)
AX_CFLAGS_GCC_OPTION(-Wunused)
AX_CFLAGS_GCC_OPTION(-Wwrite-strings)
-
+fi
dnl Checks for library functions.
dnl Generate output