From: Jozsef Kadlecsik Date: Wed, 16 Jun 2010 20:49:16 +0000 (+0200) Subject: configure/Makefile and debug fixes X-Git-Tag: v5.0-pre3~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97a12ba3f184a76c406eb5622ec21a4d4d6fc8bf;p=thirdparty%2Fipset.git configure/Makefile and debug fixes --- diff --git a/Make_global.am b/Make_global.am index ac9a2ca8..857d0de2 100644 --- a/Make_global.am +++ b/Make_global.am @@ -13,7 +13,7 @@ AM_CPPFLAGS = $(kinclude_CFLAGS) $(all_includes) -I$(top_srcdir)/include \ # -Wunreachable-code -> fails with ntoh* if DISABLE_EXTRA_FLAGS -AM_CFLAGS = +AM_CFLAGS = else AM_CFLAGS = -std=gnu99 \ -Wall \ @@ -42,7 +42,12 @@ AM_CFLAGS = -std=gnu99 \ -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 diff --git a/configure.ac b/configure.ac index cfffa998..658d5f0a 100644 --- a/configure.ac +++ b/configure.ac @@ -39,6 +39,18 @@ AC_ARG_ENABLE([verbose], 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], diff --git a/include/libipset/debug.h b/include/libipset/debug.h index 1e32ce22..b0f4dfdc 100644 --- a/include/libipset/debug.h +++ b/include/libipset/debug.h @@ -7,8 +7,6 @@ #ifndef LIBIPSET_DEBUG_H #define LIBIPSET_DEBUG_H -#define IPSET_DEBUG - #ifdef IPSET_DEBUG #include #include diff --git a/lib/parse.c b/lib/parse.c index e347c693..a07168d2 100644 --- a/lib/parse.c +++ b/lib/parse.c @@ -21,6 +21,10 @@ #include /* string utilities */ #include /* prototypes */ +#ifndef ULLONG_MAX +#define ULLONG_MAX 18446744073709551615ULL +#endif + /* Parse input data */ #define cidr_separator(str) ipset_strchr(str, IPSET_CIDR_SEPARATOR) diff --git a/lib/session.c b/lib/session.c index 64d5c4ae..36716f09 100644 --- a/lib/session.c +++ b/lib/session.c @@ -488,13 +488,16 @@ attr2data(struct ipset_session *session, struct nlattr *nla[], 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; }