From a48ed12ea9d3d59d307c77131092cff13acee2d0 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Thu, 29 Feb 2024 22:04:13 +0100 Subject: [PATCH] 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. --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 411b822ca20..c6aa8b400b1 100644 --- a/configure.ac +++ b/configure.ac @@ -375,6 +375,9 @@ esac dnl Solaris/Illumos for process mapping. AC_SEARCH_LIBS([Pgrab], [proc]) +dnl Haiku does not have network api in libc. +AC_SEARCH_LIBS([setsockopt], [network]) + dnl Then headers. dnl ---------------------------------------------------------------------------- @@ -644,9 +647,6 @@ dnl Some systems (Solaris 10) do not have nanosleep in libc. AC_CHECK_FUNCS([nanosleep],, [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 getaddrinfo. AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,