[PATCH 3/6] build: add debug configure flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Eric Leblond <eric@xxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux