Shared module support for LDAP extension

@ Shared module support for LDAP extension (Troels Arvin)
This commit is contained in:
Rasmus Lerdorf 2000-07-14 13:13:25 +00:00
parent 99b85d1919
commit c78d180231
2 changed files with 42 additions and 57 deletions

View File

@ -1,5 +1,7 @@
LTLIBRARY_NAME = libldap.la
LTLIBRARY_SOURCES = ldap.c
LTLIBRARY_SHARED_NAME = ldap.la
LTLIBRARY_SHARED_LIBADD = $(LDAP_SHARED_LIBADD)
include $(top_srcdir)/build/dynlib.mk

View File

@ -1,41 +1,32 @@
dnl $Id$
AC_MSG_CHECKING(for LDAP support)
AC_ARG_WITH(ldap,
PHP_ARG_WITH(ldap,whether to include LDAP support,
[ --with-ldap[=DIR] Include LDAP support. DIR is the LDAP base
install directory, defaults to /usr/local/ldap],
[
if test "$withval" != "no"; then
if test "$withval" = "yes"; then
if test -f /usr/include/ldap.h; then
LDAP_INCDIR=/usr/include
LDAP_LIBDIR=/usr/lib
elif test -f /usr/local/include/ldap.h; then
LDAP_INCDIR=/usr/local/include
LDAP_LIBDIR=/usr/local/lib
elif test -f /usr/local/ldap/include/ldap.h; then
LDAP_INCDIR=/usr/local/ldap/include
LDAP_LIBDIR=/usr/local/ldap/lib
elif test -f /usr/include/umich-ldap/ldap.h; then
LDAP_INCDIR=/usr/include/umich-ldap
LDAP_LIBDIR=/usr/lib
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(Unable to find ldap.h)
fi
else
if test -f $withval/include/ldap.h; then
LDAP_INCDIR=$withval/include
LDAP_LIBDIR=$withval/lib
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(Unable to find $withval/include/ldap.h)
fi
fi
install directory.])
dnl The Linux version of the SDK need -lpthread
dnl I have tested Solaris, and it doesn't, but others may. Add
dnl these here if necessary. -RL
if test "$PHP_LDAP" != "no"; then
PHP_EXTENSION(ldap,$ext_shared)
for i in /usr/local /usr $PHP_LDAP; do
if test -f $i/include/ldap.h; then
LDAP_DIR=$i
LDAP_INCDIR=$i/include
LDAP_LIBDIR=$i/lib
elif test -f $i/include/umich-ldap/ldap.h; then
LDAP_DIR=$i
LDAP_INCDIR=$i/include/umich-ldap
LDAP_LIBDIR=$i/lib
fi
done
if test -z "$LDAP_DIR"; then
AC_MSG_ERROR(Cannot find ldap.h)
fi
dnl The Linux version of the SDK need -lpthread
dnl I have tested Solaris, and it doesn't, but others may. Add
dnl these here if necessary. -RL
dnl Is this really necessary? -Troels Arvin
if test `uname` = "Linux"; then
LDAP_PTHREAD="pthread"
@ -43,39 +34,31 @@ dnl these here if necessary. -RL
LDAP_PTHREAD=
fi
PHP_SUBST(LDAP_SHARED_LIBADD)
if test -f $LDAP_LIBDIR/liblber.a; then
LDAP_LIBS="-lldap -llber"
AC_ADD_LIBRARY(ldap)
AC_ADD_LIBRARY(lber,1)
AC_ADD_LIBRARY_WITH_PATH(ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
AC_ADD_LIBRARY_WITH_PATH(lber, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
elif test -f $LDAP_LIBDIR/libldapssl30.so; then
AC_ADD_LIBRARY(ldapssl30)
AC_ADD_LIBRARY($LDAP_PTHREAD)
AC_ADD_LIBRARY($LDAP_PTHREAD)
AC_ADD_LIBRARY_WITH_PATH(ldapssl30, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
AC_DEFINE(HAVE_NSLDAP,1,[ ])
elif test -f $LDAP_LIBDIR/libldapssl30.sl; then
AC_ADD_LIBRARY(ldapssl30)
AC_ADD_LIBRARY_WITH_PATH(ldapssl30, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
AC_DEFINE(HAVE_NSLDAP,1,[ ])
elif test -f $LDAP_LIBDIR/libldap30.so; then
AC_ADD_LIBRARY(ldap30)
AC_ADD_LIBRARY($LDAP_PTHREAD)
AC_ADD_LIBRARY($LDAP_PTHREAD)
AC_ADD_LIBRARY_WITH_PATH(ldap30, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
AC_DEFINE(HAVE_NSLDAP,1,[ ])
elif test -f $LDAP_LIBDIR/libldap30.sl; then
AC_ADD_LIBRARY(ldap30)
AC_ADD_LIBRARY_WITH_PATH(ldap30, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
AC_DEFINE(HAVE_NSLDAP,1,[ ])
elif test -f $LDAP_LIBDIR/libumich_ldap.so; then
AC_ADD_LIBRARY(umich_ldap)
AC_ADD_LIBRARY(umich_lber,1)
AC_ADD_LIBRARY_WITH_PATH(umich_ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
AC_ADD_LIBRARY_WITH_PATH(umich_lber, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
fi
AC_ADD_INCLUDE($LDAP_INCDIR)
AC_ADD_LIBPATH($LDAP_LIBDIR)
AC_ADD_INCLUDE($LDAP_INCDIR)
AC_DEFINE(HAVE_LDAP,1,[ ])
AC_DEFINE(HAVE_LDAP,1,[ ])
AC_MSG_RESULT(yes)
PHP_EXTENSION(ldap)
else
AC_MSG_RESULT(no)
fi
],[
AC_MSG_RESULT(no)
])
fi