From c2e78df4410b5c59e774b1cf3857d7865eb114a5 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Mon, 1 Jul 2024 12:53:17 +0200 Subject: [PATCH] Autotools: Refactor dmalloc check - AS_VAR_APPEND used for enabling Dmalloc check-funcs token - CS synced --- configure.ac | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 3a58c7b6f0af..d1e428d05748 100644 --- a/configure.ac +++ b/configure.ac @@ -995,15 +995,12 @@ PHP_ARG_ENABLE([dmalloc], [no], [no]) -if test "$PHP_DMALLOC" = "yes"; then - AC_CHECK_LIB(dmalloc, dmalloc_error, [ - PHP_ADD_LIBRARY(dmalloc) - AC_DEFINE(HAVE_DMALLOC,1,[Whether you have dmalloc]) - CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK" - ], [ - AC_MSG_ERROR([Problem with enabling dmalloc. Please check config.log for details.]) - ]) -fi +AS_VAR_IF([PHP_DMALLOC], [yes], + [AC_CHECK_LIB([dmalloc], [dmalloc_error], + [PHP_ADD_LIBRARY([dmalloc]) + AC_DEFINE([HAVE_DMALLOC], [1], [Define to 1 if you have dmalloc.]) + AS_VAR_APPEND([CPPFLAGS], [" -DDMALLOC_FUNC_CHECK"])], + [AC_MSG_ERROR([Problem with enabling dmalloc. Please, check config.log for details.])])]) PHP_ARG_ENABLE([ipv6], [whether to enable IPv6 support],