Skip to content

Commit 3eb1d46

Browse files
committed
Autotools: Refactor dmalloc check
- AC_SEARCH_LIBS automatically appends the library to the LIBS - AS_VAR_APPEND used for enabling Dmalloc check-funcs token - CS synced
1 parent a5b7850 commit 3eb1d46

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

configure.ac

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,15 +1002,11 @@ PHP_ARG_ENABLE([dmalloc],
10021002
[no],
10031003
[no])
10041004

1005-
if test "$PHP_DMALLOC" = "yes"; then
1006-
AC_CHECK_LIB(dmalloc, dmalloc_error, [
1007-
PHP_ADD_LIBRARY(dmalloc)
1008-
AC_DEFINE(HAVE_DMALLOC,1,[Whether you have dmalloc])
1009-
CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK"
1010-
], [
1011-
AC_MSG_ERROR([Problem with enabling dmalloc. Please check config.log for details.])
1012-
])
1013-
fi
1005+
AS_VAR_IF([PHP_DMALLOC], [yes],
1006+
[AC_SEARCH_LIBS([dmalloc_error], [dmalloc],
1007+
[AC_DEFINE([HAVE_DMALLOC], [1], [Define to 1 if you have dmalloc.])
1008+
AS_VAR_APPEND([CPPFLAGS], [" -DDMALLOC_FUNC_CHECK"])],
1009+
[AC_MSG_ERROR([Problem with enabling dmalloc. Please, check config.log for details.])])])
10141010

10151011
PHP_ARG_ENABLE([ipv6],
10161012
[whether to enable IPv6 support],

0 commit comments

Comments
 (0)