netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Leblond <eric@inl.fr>
To: netfilter-devel@vger.kernel.org
Cc: Eric Leblond <eric@inl.fr>
Subject: [PATCH 3/6] build: add debug configure flag
Date: Wed, 22 Sep 2010 02:47:19 +0200	[thread overview]
Message-ID: <1285116442-32490-4-git-send-email-eric@inl.fr> (raw)
In-Reply-To: <1285116442-32490-1-git-send-email-eric@inl.fr>

This patch adds a debug option for configure which do some set
compile option useful for debugging.

Signed-off-by: Eric Leblond <eric@inl.fr>
---
 configure.ac    |   11 +++++++++--
 src/Makefile.am |    4 ++++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index af14f36..0819a17 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,8 +31,6 @@ dnl Checks for library functions.
 AC_FUNC_VPRINTF
 AC_CHECK_FUNCS(socket strerror)
 
-CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter"
-
 dnl Check for the right nfnetlink version
 LIBNFNETLINK_REQUIRED=0.0.39
 LIBNETFILTER_CONNTRACK_REQUIRED=0.0.95
@@ -55,6 +53,8 @@ if test "${build_nflog}" = "yes"; then
 fi
 
 
+AC_ARG_ENABLE(debug,   [AC_HELP_STRING(--enable-debug, Do build ulogd in debug mode)],build_debug=$enableval, build_debug="no")
+
 CT_CHECK_POSTGRES_DB()
 AM_CONDITIONAL(HAVE_PGSQL, test "x$PQLIBPATH" != "x")
 
@@ -73,6 +73,13 @@ AM_CONDITIONAL(HAVE_PCAP, test "x$PCAP_LIB" != "x")
 AM_CONDITIONAL(HAVE_NFCT, test "x$build_nfct" != "xno")
 AM_CONDITIONAL(HAVE_NFLOG, test "x$build_nflog" != "xno")
 
+AM_CONDITIONAL(HAVE_DEBUG, test "x$build_debug" != "xno")
+
+if test "${build_debug}" = "yes" ; then
+	CFLAGS="$CFLAGS -O0 -Wall -Wextra -Wno-unused-parameter"
+else
+	CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter"
+fi
 
 dnl AC_SUBST(DATABASE_DIR)
 dnl AC_SUBST(DATABASE_LIB)
diff --git a/src/Makefile.am b/src/Makefile.am
index aa9a3fa..26e0e53 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,4 +6,8 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include \
 sbin_PROGRAMS = ulogd
 
 ulogd_SOURCES = ulogd.c select.c timer.c rbtree.c conffile.c hash.c
+if HAVE_DEBUG
+ulogd_LDFLAGS = -lpthread -export-dynamic
+else
 ulogd_LDFLAGS = -export-dynamic
+endif
-- 
1.6.1


  parent reply	other threads:[~2010-09-22  1:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-22  0:47 [ULOGD PATCH 0/6] misc improvements and code cleaning Eric Leblond
2010-09-22  0:47 ` [PATCH 1/6] build: nfct and nflog can be disabled via configure option Eric Leblond
2010-09-30  9:58   ` Pablo Neira Ayuso
2010-09-22  0:47 ` [PATCH 2/6] ulogd.conf: Comment library dependant plugins Eric Leblond
2010-09-30  9:51   ` Pablo Neira Ayuso
2010-09-30 21:23     ` Eric Leblond
2010-09-22  0:47 ` Eric Leblond [this message]
2010-09-30  9:50   ` [PATCH 3/6] build: add debug configure flag Pablo Neira Ayuso
2010-09-30 21:22     ` Eric Leblond
2010-10-01 22:22       ` Jan Engelhardt
2010-10-03 10:15         ` Pablo Neira Ayuso
2010-09-22  0:47 ` [PATCH 4/6] ulogd.conf: add a complex but useful stack example Eric Leblond
2010-09-22  0:47 ` [PATCH 5/6] filter_MARK: code factorization Eric Leblond
2010-09-22  0:47 ` [PATCH 6/6] ulogd: use snprintf instead of sprintf in printpkt Eric Leblond
2010-09-30  9:48   ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1285116442-32490-4-git-send-email-eric@inl.fr \
    --to=eric@inl.fr \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).