1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Find and link network library as needed with AC_SEARCH_LIBS (#13553)

This prepends -lnetwork as needed (Haiku) whether linker sees the
setsockopt function and avoids defining redundant symbols, such as
HAVE_LIBNETWORK and HAVE_SETSOCKOPT.
This commit is contained in:
Peter Kokot
2024-02-29 22:04:13 +01:00
committed by GitHub
parent 6b6e33ddbe
commit a48ed12ea9

View File

@@ -375,6 +375,9 @@ esac
dnl Solaris/Illumos for process mapping. dnl Solaris/Illumos for process mapping.
AC_SEARCH_LIBS([Pgrab], [proc]) AC_SEARCH_LIBS([Pgrab], [proc])
dnl Haiku does not have network api in libc.
AC_SEARCH_LIBS([setsockopt], [network])
dnl Then headers. dnl Then headers.
dnl ---------------------------------------------------------------------------- dnl ----------------------------------------------------------------------------
@@ -644,9 +647,6 @@ dnl Some systems (Solaris 10) do not have nanosleep in libc.
AC_CHECK_FUNCS([nanosleep],, AC_CHECK_FUNCS([nanosleep],,
[AC_SEARCH_LIBS([nanosleep], [rt], [AC_DEFINE([HAVE_NANOSLEEP], [1])])]) [AC_SEARCH_LIBS([nanosleep], [rt], [AC_DEFINE([HAVE_NANOSLEEP], [1])])])
dnl Haiku does not have network api in libc.
PHP_CHECK_FUNC_LIB(setsockopt, network)
dnl Check for getaddrinfo, should be a better way, but... Also check for working dnl Check for getaddrinfo, should be a better way, but... Also check for working
dnl getaddrinfo. dnl getaddrinfo.
AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo, AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,