summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2016-08-13 02:39:33 +0300
committerTobias Klauser <tklauser@distanz.ch>2016-08-17 09:27:44 +0200
commit857126daf5b96292be0fd924e8462b76177af025 (patch)
treee8c0e11a93403646145b8ae18b0f68ce27efd8da
parentee3f53306b1ceb5235ac587c2e0a605c13922d78 (diff)
build: configure: Add option to enable debug symbols
Add '--enable-debug' option to enable debugging symbols, the reason is to simplify it by ./configure it once and do not execute 'make DEBUG=1' each time for a long debug session. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--Makefile6
-rwxr-xr-xconfigure6
2 files changed, 11 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 83454e2..ad1c1fc 100644
--- a/Makefile
+++ b/Makefile
@@ -49,7 +49,11 @@ MAKEFLAGS += --jobs=$(shell grep "^processor" /proc/cpuinfo | wc -l)
ifeq ("$(origin DEBUG)", "command line")
DEBUG := 1
else
- DEBUG := 0
+ ifeq ($(CONFIG_DEBUG), 1)
+ DEBUG := 1
+ else
+ DEBUG := 0
+ endif
endif
# Compiler detection
diff --git a/configure b/configure
index 399733f..4a5b7e3 100755
--- a/configure
+++ b/configure
@@ -22,6 +22,7 @@ HAVE_TPACKET3=0
DISABLE_LIBNL=0
DISABLE_GEOIP=0
DISABLE_ZLIB=0
+ENABLE_DEBUG=0
usage()
{
@@ -33,6 +34,7 @@ usage()
echo " --disable-libnl Disable libnl support"
echo " --disable-geoip Disable geoip support"
echo " --disable-zlib Disable zlib support"
+ echo " --enable-debug Enable debug mode (default disabled)"
echo ""
echo "Some influential environment variables:"
echo " CC C compiler command"
@@ -55,6 +57,9 @@ while [ $# -gt 0 ] ; do
--disable-zlib)
DISABLE_ZLIB=1
;;
+ --enable-debug)
+ ENABLE_DEBUG=1
+ ;;
*)
echo "[!] Unrecognized option: '$1'. Try './configure --help' for more information"
exit 1
@@ -789,6 +794,7 @@ else
echo "CONFIG_GEOIP=0" >> Config
fi
+echo "CONFIG_DEBUG=$ENABLE_DEBUG" >> Config
echo "CONFIG_TOOLS=$TOOLS" >> Config
echo "CONFIG_OK=1" >> Config