Forward port of 2.5 patch with addition of MinGW support.
dnl
dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
dnl
-dnl $Id: configure.in,v 1.370 2005/02/07 22:30:15 serassio Exp $
+dnl $Id: configure.in,v 1.371 2005/03/19 15:24:07 serassio Exp $
dnl
dnl
dnl
AC_CONFIG_AUX_DIR(cfgaux)
AM_INIT_AUTOMAKE(squid, 3.0-PRE3-CVS)
AM_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.370 $)dnl
+AC_REVISION($Revision: 1.371 $)dnl
AC_PREFIX_DEFAULT(/usr/local/squid)
AM_MAINTAINER_MODE
;;
esac
+dnl On MinGW OpenLDAP is not available, so LDAP helpers can be linked
+dnl only with Windows LDAP libraries using -lwldap32
+case "$host_os" in
+mingw|mingw32)
+ LIB_LDAP="-lwldap32"
+ LIB_LBER=""
+ ;;
+*)
+ LIB_LDAP="-lldap"
+ dnl LDAP helpers need to know if -llber is needed or not
+ AC_CHECK_LIB(lber, main, [LIB_LBER="-llber"])
+ ;;
+esac
+AC_SUBST(LIB_LDAP)
+AC_SUBST(LIB_LBER)
+
dnl System-specific library modifications
dnl
case "$host" in
#
# Makefile for the Squid LDAP authentication helper
#
-# $Id: Makefile.am,v 1.5 2003/01/23 00:35:21 robertc Exp $
+# $Id: Makefile.am,v 1.6 2005/03/19 15:24:07 serassio Exp $
#
# Uncomment and customize the following to suit your needs:
#
EXTRA_DIST = squid_ldap_auth.8
squid_ldap_auth_SOURCES = squid_ldap_auth.c
-LDADD = -L$(top_builddir)/lib -lmiscutil -lldap -llber $(XTRA_LIBS)
+LDADD = -L$(top_builddir)/lib -lmiscutil $(LIB_LDAP) $(LIB_LBER) $(XTRA_LIBS)
INCLUDES = -I$(top_srcdir)/include
#define LDAPAPI __cdecl
#endif
#ifdef LDAP_VERSION3
-#define LDAP_OPT_SUCCESS LDAP_SUCCESS
+#ifndef LDAP_OPT_X_TLS
+#define LDAP_OPT_X_TLS 0x6000
+#endif
/* Some tricks to allow dynamic bind with ldap_start_tls_s entry point at
run time.
*/
version = LDAP_VERSION2;
}
if (ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &version)
- != LDAP_OPT_SUCCESS) {
+ != LDAP_SUCCESS) {
fprintf(stderr, "Could not set LDAP_OPT_PROTOCOL_VERSION %d\n",
version);
exit(1);
}
- if (use_tls && (version == LDAP_VERSION3) && (ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS)) {
- fprintf(stderr, "Could not Activate TLS connection\n");
+ if (use_tls) {
+#ifdef LDAP_OPT_X_TLS
+ if (version == LDAP_VERSION3 && ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS) {
+ fprintf(stderr, "Could not Activate TLS connection\n");
+ exit(1);
+ } else {
+ fprintf(stderr, "TLS requires LDAP version 3\n");
+ exit(1);
+ }
+#else
+ fprintf(stderr, "TLS not supported with your LDAP library\n");
exit(1);
+#endif
}
#endif
squid_ldap_set_timelimit(ld, timelimit);
#
# Makefile for the Squid LDAP authentication helper
#
-# $Id: Makefile.am,v 1.5 2004/08/14 22:54:53 hno Exp $
+# $Id: Makefile.am,v 1.6 2005/03/19 15:24:07 serassio Exp $
#
# Uncomment and customize the following to suit your needs:
#
EXTRA_DIST = squid_ldap_group.8
squid_ldap_group_SOURCES = squid_ldap_group.c
-LDADD = -L$(top_builddir)/lib -lmiscutil -lldap -llber @XTRA_LIBS@
+LDADD = -L$(top_builddir)/lib -lmiscutil $(LIB_LDAP) $(LIB_LBER) @XTRA_LIBS@
INCLUDES = -I. -I$(top_builddir)/include -I$(top_srcdir)/include
#define LDAPAPI __cdecl
#endif
#ifdef LDAP_VERSION3
-#define LDAP_OPT_SUCCESS LDAP_SUCCESS
+#ifndef LDAP_OPT_X_TLS
+#define LDAP_OPT_X_TLS 0x6000
+#endif
/* Some tricks to allow dynamic bind with ldap_start_tls_s entry point at
run time.
*/
if (version == -1) {
version = LDAP_VERSION2;
}
- if (ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &version)
- != LDAP_OPT_SUCCESS) {
+ if (ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &version) != LDAP_SUCCESS) {
fprintf(stderr, "Could not set LDAP_OPT_PROTOCOL_VERSION %d\n",
version);
ldap_unbind(ld);
ld = NULL;
break;
}
- if (use_tls && (version == LDAP_VERSION3) && (ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS)) {
- fprintf(stderr, "Could not Activate TLS connection\n");
- ldap_unbind(ld);
- ld = NULL;
- break;
+ if (use_tls) {
+#ifdef LDAP_OPT_X_TLS
+ if (version == LDAP_VERSION3 && ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS) {
+ fprintf(stderr, "Could not Activate TLS connection\n");
+ ldap_unbind(ld);
+ ld = NULL;
+ break;
+ } else {
+ fprintf(stderr, "TLS requires LDAP version 3\n");
+ exit(1);
+ }
+#else
+ fprintf(stderr, "TLS not supported with your LDAP library\n");
+ exit(1);
+#endif
}
#endif
squid_ldap_set_timelimit(ld, timelimit);