I noticed that compiling with --enable-mm-debug didn't cause the functions in #ifdef MM_DEBUG to be compiled in. Somehow the variable wasn't actually being substituted into anything that was built.
Change configure.ac to do AC_SUBST(), and put a substitution into config.h.in. This makes MM_DEBUG available to any file which includes config.h. Signed-off-by: Daniel Axtens <d...@axtens.net> --- config.h.in | 3 +++ configure.ac | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/config.h.in b/config.h.in index 9e8f9911b183..8cf62616cad7 100644 --- a/config.h.in +++ b/config.h.in @@ -13,6 +13,9 @@ #define DISK_CACHE_STATS @DISK_CACHE_STATS@ #define BOOT_TIME_STATS @BOOT_TIME_STATS@ +/* Define to 1 to enable mm debugging */ +#define MM_DEBUG @MM_DEBUG@ + /* We don't need those. */ #define MINILZO_CFG_SKIP_LZO_PTR 1 #define MINILZO_CFG_SKIP_LZO_UTIL 1 diff --git a/configure.ac b/configure.ac index 8d1c81a7316e..889d07b3c1d0 100644 --- a/configure.ac +++ b/configure.ac @@ -1511,9 +1511,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], -- 2.30.2 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel