]> granicus.if.org Git - ipset/commitdiff
configure/Makefile and debug fixes
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Wed, 16 Jun 2010 20:49:16 +0000 (22:49 +0200)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Wed, 16 Jun 2010 20:49:16 +0000 (22:49 +0200)
Make_global.am
configure.ac
include/libipset/debug.h
lib/parse.c
lib/session.c

index ac9a2ca8c4a01a8a9558c8290b39279a4556790f..857d0de2b55545162efdd32e13df93cf699bdca8 100644 (file)
@@ -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
index cfffa99842fb7146c3fafadbd4b8ec8e936f2304..658d5f0a92f8b270f95cdcccec34e6ff9893942b 100644 (file)
@@ -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],
index 1e32ce22598090140b6150a04d073da2d2624101..b0f4dfdc1f1ade10b4d0ee437b21af6790c0027b 100644 (file)
@@ -7,8 +7,6 @@
 #ifndef LIBIPSET_DEBUG_H
 #define LIBIPSET_DEBUG_H
 
-#define IPSET_DEBUG
-
 #ifdef IPSET_DEBUG
 #include <stdio.h>
 #include <sys/socket.h>
index e347c69356e22612a2e587ce7e99cfdcbc99f1ed..a07168d2cdfcbb22217eda67cb143b42b59e02d9 100644 (file)
 #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)
index 64d5c4ae4680f94a598f739ec810b070ffefb731..36716f094173b5f0810a1d00ee93c9067454ff03 100644 (file)
@@ -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;
 }