From 2f0bb9293c58de26c7e36eb55b51e0c873851582 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Mon, 22 Jul 2024 17:19:55 +0200 Subject: [PATCH] Autotools: Append rt library to FPM_EXTRA_LIBS (#15059) This appends the possible rt library as needed on Solaris <= 10 to FPM_EXTRA_LIBS instead of the global LIBS variable for all SAPIs to have cleaner build. The possible required rt library for other SAPIs is also checked in the configure.ac. --- sapi/fpm/config.m4 | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sapi/fpm/config.m4 b/sapi/fpm/config.m4 index 86e017b32d9..bbd13ed7376 100644 --- a/sapi/fpm/config.m4 +++ b/sapi/fpm/config.m4 @@ -6,11 +6,17 @@ PHP_ARG_ENABLE([fpm], [no]) dnl Configure checks. -AC_DEFUN([PHP_FPM_CLOCK], -[AC_CHECK_FUNCS([clock_gettime],, - [AC_SEARCH_LIBS([clock_gettime], [rt], - [ac_cv_func_clock_gettime=yes - AC_DEFINE([HAVE_CLOCK_GETTIME], [1])])]) +AC_DEFUN([PHP_FPM_CLOCK], [ +AC_CHECK_FUNCS([clock_gettime],, [ + LIBS_save=$LIBS + AC_SEARCH_LIBS([clock_gettime], [rt], [ + ac_cv_func_clock_gettime=yes + AC_DEFINE([HAVE_CLOCK_GETTIME], [1]) + AS_VAR_IF([ac_cv_search_clock_gettime], ["none required"],, + [AS_VAR_APPEND([FPM_EXTRA_LIBS], [" $ac_cv_search_clock_gettime"])]) + ]) + LIBS=$LIBS_save +]) AS_VAR_IF([ac_cv_func_clock_gettime], [no], [AC_CACHE_CHECK([for clock_get_time], [php_cv_func_clock_get_time],