From fef55bc8e4f2bb7ef4101a6e359d2c15a299e35e Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Tue, 27 Aug 2024 00:00:20 +0200 Subject: [PATCH] Autotools: Fix tidy library checks (#15576) When configuring with tidy library installed in non-standard paths, the library adding macro must be done before the PHP_CHECK_LIBRARY to be able to detect it. This fixes these edge cases. For example: ./configure --with-tidy=/path/to/custom-tidy-installation --- ext/tidy/config.m4 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ext/tidy/config.m4 b/ext/tidy/config.m4 index 164440fb5b2c7..8c3ceb38dafd7 100644 --- a/ext/tidy/config.m4 +++ b/ext/tidy/config.m4 @@ -46,11 +46,16 @@ if test "$PHP_TIDY" != "no"; then [Define to 1 if Tidy library has the 'tidyOptGetDoc' function.])], [PHP_CHECK_LIBRARY([tidy5], [tidyOptGetDoc], [TIDY_LIB_NAME=tidy5 - AC_DEFINE([HAVE_TIDYOPTGETDOC], [1])])]) + AC_DEFINE([HAVE_TIDYOPTGETDOC], [1])], + [], + [-L$TIDY_LIBDIR])], + [-L$TIDY_LIBDIR]) PHP_CHECK_LIBRARY([$TIDY_LIB_NAME], [tidyReleaseDate], [AC_DEFINE([HAVE_TIDYRELEASEDATE], [1], - [Define to 1 if Tidy library has the 'tidyReleaseDate' function.])]) + [Define to 1 if Tidy library has the 'tidyReleaseDate' function.])], + [], + [-L$TIDY_LIBDIR]) PHP_ADD_LIBRARY_WITH_PATH([$TIDY_LIB_NAME], [$TIDY_LIBDIR],