configure: Properly handle MM_DEBUG

Define MM_DEBUG in config.h when --enable-mm-debug is passed to configure.
It was being defined in config-util.h which only gets used when building
GRUB utilities for the host side. The enabling of debugging for memory
management in include/grub/mm.h explicitly does not happen when compiling
for the GRUB utilities. So this debugging code effectively could never be
enabled. Note, that MM_DEBUG is defined in an #if directive because the
enabling of debugging checks if MM_DEBUG is defined, not what its value is.
So even if MM_DEBUG were defined to nothing, the debugging code would
still be enabled.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Glenn Washburn authored and Daniel Kiper committed 2022-03-07 15:11:26 +01:00
1 parent b16257b51b
commit 563dca1a5e
2 files changed
+8 -2

No files matched your search

+4 -2
View File
@@ -1519,9 +1519,11 @@ AC_ARG_ENABLE([mm-debug],
AS_HELP_STRING([--enable-mm-debug],
[include memory manager debugging]))
if test x$enable_mm_debug = xyes; then
AC_DEFINE([MM_DEBUG], [1],
[Define to 1 if you enable memory manager debugging.])
MM_DEBUG=1
else
MM_DEBUG=0
fi
AC_SUBST([MM_DEBUG])
AC_ARG_ENABLE([cache-stats],
AS_HELP_STRING([--enable-cache-stats],