summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-09-17 22:23:05 +0200
committercgzones <cgzones@googlemail.com>2020-10-03 19:04:27 +0200
commitb7f63292e5394ca7eee2dc5d14d0d1244db61c17 (patch)
tree88693175132779069aec2ec1361eb40513f30a57
parente5184599814a3210497035e9942f154945f2b02f (diff)
Add --enable-debug configure option to enable asserts
asserts are still disabled by default.
-rw-r--r--Makefile.am1
-rw-r--r--configure.ac6
2 files changed, 6 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index ea9a2e42..1ef92364 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,7 +12,6 @@ pixmap_DATA = htop.png
AM_CFLAGS += -pedantic -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"$(sysconfdir)\" -I"$(top_srcdir)/$(my_htop_platform)"
AM_LDFLAGS =
-AM_CPPFLAGS = -DNDEBUG
myhtopsources = AvailableMetersPanel.c CategoriesPanel.c CheckItem.c \
ClockMeter.c ColorsPanel.c ColumnsPanel.c CPUMeter.c CRT.c DiskIOMeter.c DiskIOMeter.h \
diff --git a/configure.ac b/configure.ac
index d06c598f..6104a1f3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -293,8 +293,14 @@ AM_CFLAGS="\
AC_ARG_ENABLE([werror], [AS_HELP_STRING([--enable-werror], [Treat warnings as errors (default: warnings are not errors)])], [enable_werror="$enableval"], [enable_werror=no])
AS_IF([test "x$enable_werror" = "xyes"], [AM_CFLAGS="$AM_CFLAGS -Werror"])
+
AC_SUBST([AM_CFLAGS])
+AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], [Enable asserts (default: asserts are disabled)])], [enable_debug="$enableval"], [enable_debug=no])
+AS_IF([test "x$enable_debug" = "xyes"], , [AM_CPPFLAGS="$AM_CPPFLAGS -DNDEBUG"])
+
+AC_SUBST([AM_CPPFLAGS])
+
# Bail out on errors.
# ----------------------------------------------------------------------
if test ! -z "$missing_libraries"; then

© 2014-2024 Faster IT GmbH | imprint | privacy policy