Skip to content

Use AC_SEARCH_LIBS for socketpair, gethostname and gethostbyaddr #14116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -356,16 +356,17 @@ test -d /usr/ucblib && PHP_ADD_LIBPATH(/usr/ucblib)
dnl First, library checks.
dnl ----------------------------------------------------------------------------

dnl Some systems (OpenServer 5) dislike -lsocket -lnsl, so we try to avoid -lnsl
dnl checks, if we already have the functions which are usually in libnsl. Also,
dnl uClibc will bark at linking with glibc's libnsl.

AC_SEARCH_LIBS([socket], [socket network])
PHP_CHECK_FUNC(socketpair, socket, network)
PHP_CHECK_FUNC(gethostname, nsl, network)
PHP_CHECK_FUNC(gethostbyaddr, nsl, network)

AC_CHECK_FUNCS([socketpair],,
[AC_SEARCH_LIBS([socketpair], [socket network],
[AC_DEFINE([HAVE_SOCKETPAIR], [1])])])

AC_SEARCH_LIBS([gethostbyaddr], [nsl network])

AC_SEARCH_LIBS([dlopen], [dl],
[AC_DEFINE([HAVE_LIBDL], [1], [Define to 1 if the dl library is available.])])

AC_SEARCH_LIBS([sin], [m])

case $host_alias in
Expand Down Expand Up @@ -588,6 +589,7 @@ ftok \
funopen \
gai_strerror \
getcwd \
gethostname \
getloadavg \
getlogin \
getprotobyname \
Expand Down
Loading