summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2020-10-05 16:45:11 +0200
committerLucas Stach <l.stach@pengutronix.de>2020-10-08 10:13:20 +0200
commit5b9b10591b50278dd450589226256ea29ba08e2a (patch)
tree32c1fd422cf3d4f1368f732599a3e51e3222703c
parentdd4e18eb7557a31a3c8318d6612801329877c745 (diff)
build: fix the debug parameter to properly handle --disable-debug
Right now the the enableval isn't checked, so the debug options are added for --enable-debug and --disable-debug, which is quite surprising for a user. Fix this to properly handle the disable case. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
-rw-r--r--configure.ac7
1 files changed, 5 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 6d9b04b..f1bb7b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,8 +42,11 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],
[Enable debugging information]),
- [CFLAGS="$CFLAGS -g -O0 -DDEBUG"
- CXXFLAGS="$CXXFLAGS -g -O0 -DDEBUG"],
+ [if test x$enableval = xyes; then
+ CFLAGS="$CFLAGS -g -O0 -DDEBUG"
+ CXXFLAGS="$CXXFLAGS -g -O0 -DDEBUG"; else
+ CFLAGS="$CFLAGS -DNDEBUG"
+ CXXFLAGS="$CXXFLAGS -DNDEBUG"; fi],
[CFLAGS="$CFLAGS -DNDEBUG"
CXXFLAGS="$CXXFLAGS -DNDEBUG"])