summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2000-05-06 23:26:41 +0000
committerSascha Schumann <sas@php.net>2000-05-06 23:26:41 +0000
commitec9612aa44f10fd04e74c760e7104e9621c46a9c (patch)
treec59712ffb5302a17950d9e48efa5f455dd19908f /configure.in
parent54fa1a77d7c68d196eb3fc83dec33bbf583b19d2 (diff)
downloadphp-git-ec9612aa44f10fd04e74c760e7104e9621c46a9c.tar.gz
This change addresses an issue on systems which cannot link against libnsl
and libsocket, resulting in segfaults. If yp_get_default_domain is available after checking for libsocket, we assume we do not need libnsl anymore.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in24
1 files changed, 19 insertions, 5 deletions
diff --git a/configure.in b/configure.in
index e01b71ef8e..031af16da7 100644
--- a/configure.in
+++ b/configure.in
@@ -184,9 +184,6 @@ fi
INCLUDES="$INCLUDES -I\$(top_builddir)/Zend -I\$(top_srcdir)"
-AC_CHECK_LIB(nsl, gethostname, [
- AC_ADD_LIBRARY(nsl)
- AC_DEFINE(HAVE_LIBNSL) ], [])
AC_CHECK_LIB(socket, socket, [
AC_ADD_LIBRARY(socket)
@@ -195,9 +192,26 @@ AC_CHECK_LIB(socket, socket, [
AC_ADD_LIBRARY(socket)
])])
-AC_CHECK_LIB(nsl, gethostbyaddr, [
+dnl Some systems (OpenServer 5) dislike -lsocket -lnsl, so we try
+dnl to avoid -lnsl checks, if we already have the functions which
+dnl are usually in libnsl
+
+unset ac_cv_func_yp_get_default_domain
+AC_CHECK_FUNC(yp_get_default_domain,
+ [php_no_nsl_checks=yes],[ ])
+unset ac_cv_func_yp_get_default_domain
+
+if test "$php_no_nsl_checks" != "yes"; then
+
+AC_CHECK_LIB(nsl, gethostname, [
AC_ADD_LIBRARY(nsl)
- AC_DEFINE(HAVE_LIBNSL) ], [])
+ AC_DEFINE(HAVE_LIBNSL) ],[
+ AC_CHECK_LIB(nsl, gethostbyaddr, [
+ AC_ADD_LIBRARY(nsl)
+ AC_DEFINE(HAVE_LIBNSL) ], [])
+])
+
+fi
AC_CHECK_LIB(crypt, crypt, [
AC_ADD_LIBRARY(crypt)