]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Check that every required ldap header file is available
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Wed, 6 Nov 2013 07:12:29 +0000 (08:12 +0100)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Wed, 6 Nov 2013 07:12:29 +0000 (08:12 +0100)
LDAP support is only enabled if every required header file is detected on
the target system.

configure.in

index 61f1dd4ac7935a98344ccc692f3dcd3b4199bc0b..4352d5f4cba0443051ec23be54dbbf9fe0ad7d90 100644 (file)
@@ -106,8 +106,10 @@ AC_ARG_WITH([ldap],
 AS_HELP_STRING([--with-ldap],[Compile with LDAP support]),
 [],[with_ldap=check])
 if ( test "x$with_ldap" != "xno" ) ; then
-       AC_CHECK_HEADERS(ldap.h)
-       AC_CHECK_LIB(ldap, ldap_init,LIBS="-lldap ${LIBS}"; HAVE_LDAP="yes", HAVE_LDAP="")
+       AC_CHECK_HEADERS([ldap_cdefs.h] [ldap_features.h] [ldap.h],,break)
+       if ( test "x$ac_cv_header_ldap_h" = "xyes" ) ; then
+               AC_CHECK_LIB(ldap, ldap_init,LIBS="-lldap ${LIBS}"; HAVE_LDAP="yes", HAVE_LDAP="")
+       fi
 else
        AC_MSG_NOTICE([Not building with LDAP support as requested on the configuration command line])
 fi