]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
configure: Properly handle MM_DEBUG
authorGlenn Washburn <development@efficientek.com>
Tue, 15 Feb 2022 18:36:41 +0000 (12:36 -0600)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 7 Mar 2022 14:11:26 +0000 (15:11 +0100)
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>
config.h.in
configure.ac

index 9e8f9911b183d8bb45af3ce8e1d3e46e241f2fed..c1323a88e3f474302379705b7a25b230874d5a73 100644 (file)
@@ -9,6 +9,10 @@
 #define GCRYPT_NO_DEPRECATED 1
 #define HAVE_MEMMOVE 1
 
+#if @MM_DEBUG@
+#define MM_DEBUG @MM_DEBUG@
+#endif
+
 /* Define to 1 to enable disk cache statistics.  */
 #define DISK_CACHE_STATS @DISK_CACHE_STATS@
 #define BOOT_TIME_STATS @BOOT_TIME_STATS@
index d1eaafee15f7da27adf741bc81db1943d10e61eb..50f7bc6a029df4a1d0f295936ff76eaac30b33b6 100644 (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],