aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYunchih Chen <yunchih.cat@gmail.com>2018-03-18 20:15:23 +0800
committerYunchih Chen <yunchih.cat@gmail.com>2018-03-18 20:15:23 +0800
commit2db7b99431ab899686f52a8f20f7c74333cf1fa4 (patch)
treef6a4d69f4846c1fd1d5cfe23c7c1166e7122c913
parent7f43f3ee5075b784ce458427c44ae1c78e0019f2 (diff)
downloadnfcollect-2db7b99431ab899686f52a8f20f7c74333cf1fa4.tar
nfcollect-2db7b99431ab899686f52a8f20f7c74333cf1fa4.tar.gz
nfcollect-2db7b99431ab899686f52a8f20f7c74333cf1fa4.tar.bz2
nfcollect-2db7b99431ab899686f52a8f20f7c74333cf1fa4.tar.lz
nfcollect-2db7b99431ab899686f52a8f20f7c74333cf1fa4.tar.xz
nfcollect-2db7b99431ab899686f52a8f20f7c74333cf1fa4.tar.zst
nfcollect-2db7b99431ab899686f52a8f20f7c74333cf1fa4.zip
autotools: Add debug target
-rw-r--r--README.md12
-rw-r--r--configure.ac12
2 files changed, 22 insertions, 2 deletions
diff --git a/README.md b/README.md
index 4a835d1..63ad1f7 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,16 @@
# nfcollect
-Collect NFLOG log entries and commit them to stable storage in binary (compressed) format
+Collect Netfilter NFLOG log entries and commit them to stable storage in binary (compressed) format.
+
+## Build
+
+```bash
+./bootstrap.sh
+./configure
+make
+```
+
+Run `./configure --enable-debug` to enable debug output.
### References
diff --git a/configure.ac b/configure.ac
index 79e8c11..66497f4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,7 +17,17 @@ AC_CONFIG_SRCDIR([bin/nfcollect.c])
AC_PROG_CC([clang])
-AC_DEFINE([DEBUG], [1], [Enable debug])
+# AC_DEFINE([DEBUG], [1], [Enable debug])
+AC_ARG_ENABLE(debug,
+AC_HELP_STRING([--enable-debug],[Enable debug mode (default is NO)]),
+[case "${enableval}" in
+ yes) debug=true ;;
+ no) debug=false ;;
+ *) AC_MSG_ERROR(bad_value ${enableval} for --enable-debug) ;;
+esac],[debug=false])
+if test x"$debug" = x"true"; then
+ AC_DEFINE(DEBUG, 1, [debug])
+fi
AC_CHECK_HEADERS(libnetfilter_log/libnetfilter_log.h)
AC_SEARCH_LIBS(nflog_open, netfilter_log)