Skip to content

Commit

Permalink
Autotools: Refactor dmalloc check
Browse files Browse the repository at this point in the history
- AC_SEARCH_LIBS automatically appends the library to the LIBS
- AS_VAR_APPEND used for enabling Dmalloc check-funcs token
- CS synced
  • Loading branch information
petk committed Jun 29, 2024
1 parent a5b7850 commit 3eb1d46
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1002,15 +1002,11 @@ 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_SEARCH_LIBS([dmalloc_error], [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],
Expand Down

0 comments on commit 3eb1d46

Please sign in to comment.