From 5b9b10591b50278dd450589226256ea29ba08e2a Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Mon, 5 Oct 2020 16:45:11 +0200 Subject: build: fix the debug parameter to properly handle --disable-debug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Matt Turner --- configure.ac | 7 +++++-- 1 file 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"]) -- cgit v1.2.1