From ed67c37dd3a12e4fe53479e128a1c00abb86ed12 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Fri, 23 Feb 2024 15:07:29 +0100 Subject: [PATCH] Find and link math library as needed with AC_SEARCH_LIBS On some systems (Haiku) the math library is part of the C library and it doesn't need to be explicitly prepended to LIBS. The redundant HAVE_LIBM symbol defined by the AC_CHECK_LIB has been removed. --- UPGRADING.INTERNALS | 1 + configure.ac | 2 +- win32/build/config.w32.h.in | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 5aca4f5e23e74..eab5bf581917c 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -68,6 +68,7 @@ PHP 8.4 INTERNALS UPGRADE NOTES - Symbol HAVE_BSD_ICONV has been removed. - Symbol ZEND_FIBER_ASM has been removed. - Symbols HAVE_DLOPEN and HAVE_DLSYM have been removed. + - Symbol HAVE_LIBM has been removed. - M4 macro PHP_DEFINE (atomic includes) removed (use AC_DEFINE and config.h). - M4 macro PHP_WITH_SHARED has been removed (use PHP_ARG_WITH). - M4 macro PHP_STRUCT_FLOCK has been removed (use AC_CHECK_TYPES). diff --git a/configure.ac b/configure.ac index 91ba63f5ad395..2dbdb12291da3 100644 --- a/configure.ac +++ b/configure.ac @@ -364,7 +364,7 @@ PHP_CHECK_FUNC(gethostname, nsl, network) PHP_CHECK_FUNC(gethostbyaddr, nsl, network) AC_SEARCH_LIBS([dlopen], [dl], [AC_DEFINE([HAVE_LIBDL], [1], [Define to 1 if the dl library is available.])]) -AC_CHECK_LIB(m, sin) +AC_SEARCH_LIBS([sin], [m]) case $host_alias in riscv64*) diff --git a/win32/build/config.w32.h.in b/win32/build/config.w32.h.in index 166817a673bce..981b77916f601 100644 --- a/win32/build/config.w32.h.in +++ b/win32/build/config.w32.h.in @@ -86,7 +86,6 @@ #undef HAVE_ALLOCA_H #undef HAVE_KILL #define HAVE_GETPID 1 -#define HAVE_LIBM 1 #undef HAVE_RINT /* int and long are still 32bit in 64bit compiles */ #define SIZEOF_INT 4