Skip to content

Commit 2f0bb92

Browse files
authored
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.
1 parent 82479e8 commit 2f0bb92

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

sapi/fpm/config.m4

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@ PHP_ARG_ENABLE([fpm],
66
[no])
77

88
dnl Configure checks.
9-
AC_DEFUN([PHP_FPM_CLOCK],
10-
[AC_CHECK_FUNCS([clock_gettime],,
11-
[AC_SEARCH_LIBS([clock_gettime], [rt],
12-
[ac_cv_func_clock_gettime=yes
13-
AC_DEFINE([HAVE_CLOCK_GETTIME], [1])])])
9+
AC_DEFUN([PHP_FPM_CLOCK], [
10+
AC_CHECK_FUNCS([clock_gettime],, [
11+
LIBS_save=$LIBS
12+
AC_SEARCH_LIBS([clock_gettime], [rt], [
13+
ac_cv_func_clock_gettime=yes
14+
AC_DEFINE([HAVE_CLOCK_GETTIME], [1])
15+
AS_VAR_IF([ac_cv_search_clock_gettime], ["none required"],,
16+
[AS_VAR_APPEND([FPM_EXTRA_LIBS], [" $ac_cv_search_clock_gettime"])])
17+
])
18+
LIBS=$LIBS_save
19+
])
1420
1521
AS_VAR_IF([ac_cv_func_clock_gettime], [no],
1622
[AC_CACHE_CHECK([for clock_get_time], [php_cv_func_clock_get_time],

0 commit comments

Comments
 (0)