# -Wunreachable-code -> fails with ntoh*
if DISABLE_EXTRA_FLAGS
-AM_CFLAGS =
+AM_CFLAGS =
else
AM_CFLAGS = -std=gnu99 \
-Wall \
-g -ggdb -gdwarf-2 -g3
endif
+if ENABLE_DEBUG
+AM_CFLAGS += -DIPSET_DEBUG
+endif
+
if ! ENABLE_VERBOSE
+AM_LIBTOOL_SILENT = --silent
AM_VERBOSE_CC = @echo " CC " $@;
AM_VERBOSE_CCLD = @echo " CCLD " $@;
endif
AM_CONDITIONAL([ENABLE_VERBOSE], [test "x$enable_verbose" = xyes])
+dnl Enable debugging
+AC_ARG_ENABLE([debug],
+ AS_HELP_STRING([--enable-debug],
+ [Enable compiling with debug support.]),
+ [case "${enableval}" in
+ yes) enable_verbose=yes ;;
+ no) enable_verbose=no ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
+ esac], [enable_debug=no])
+
+AM_CONDITIONAL([ENABLE_DEBUG], [test "x$enable_debug" = xyes])
+
dnl Disable extra warn flags
AC_ARG_ENABLE([extra-flags],
AS_HELP_STRING([--disable-extra-flags],
#include <libipset/utils.h> /* string utilities */
#include <libipset/parse.h> /* prototypes */
+#ifndef ULLONG_MAX
+#define ULLONG_MAX 18446744073709551615ULL
+#endif
+
/* Parse input data */
#define cidr_separator(str) ipset_strchr(str, IPSET_CIDR_SEPARATOR)
break;
}
}
+#ifdef IPSET_DEBUG
if (type == IPSET_ATTR_TYPENAME)
D("nla typename %s", (char *) d);
+#endif
ret = ipset_data_set(data, attr->opt, d);
+#ifdef IPSET_DEBUG
if (type == IPSET_ATTR_TYPENAME)
D("nla typename %s",
(char *) ipset_data_get(data, IPSET_OPT_TYPENAME));
-
+#endif
return ret;
}