Skip to content

Commit a681320

Browse files
committed
Maintenance: Rework SASL detection
1 parent 2a849db commit a681320

File tree

6 files changed

+19
-33
lines changed

6 files changed

+19
-33
lines changed

acinclude/squid-util.m4

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -332,30 +332,3 @@ AS_IF([test "$ac_res" != no],[
332332
$3],[$4])
333333
AS_VAR_POPDEF([ac_Search])dnl
334334
])
335-
336-
dnl Check for Cyrus SASL
337-
AC_DEFUN([SQUID_CHECK_SASL],[
338-
squid_cv_check_sasl="auto"
339-
AC_CHECK_HEADERS([sasl/sasl.h sasl.h])
340-
AC_CHECK_LIB(sasl2,sasl_errstring,[LIBSASL="-lsasl2"],[
341-
AC_CHECK_LIB(sasl,sasl_errstring,[LIBSASL="-lsasl"], [
342-
squid_cv_check_sasl="no"
343-
])
344-
])
345-
AS_IF([test "$squid_host_os" = "darwin"],[
346-
AS_IF([test "$ac_cv_lib_sasl2_sasl_errstring" = "yes"],[
347-
AC_DEFINE(HAVE_SASL_DARWIN,1,[Define to 1 if Mac Darwin without sasl.h])
348-
echo "checking for MAC Darwin without sasl.h ... yes"
349-
squid_cv_check_sasl="yes"
350-
],[
351-
echo "checking for MAC Darwin without sasl.h ... no"
352-
squid_cv_check_sasl="no"
353-
])
354-
])
355-
AS_IF([test "x$squid_cv_check_sasl" = "xno"],[
356-
AC_MSG_WARN([Neither SASL nor SASL2 found])
357-
],[
358-
squid_cv_check_sasl="yes"
359-
])
360-
AC_SUBST(LIBSASL)
361-
])

configure.ac

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,13 +1200,24 @@ SQUID_CHECK_LIB_WORKS(ldap,[
12001200
dnl TODO: use AC_CHECK_LIB
12011201
LIBLDAP_LIBS="-lwldap32"
12021202
AC_CHECK_HEADERS(winldap.h)
1203+
CXXFLAGS="${squid_arg_wno_deprecated_declarations} $CXXFLAGS"
12031204
])
12041205
AC_CHECK_HEADERS(ldap.h lber.h)
12051206
AC_CHECK_HEADERS(mozldap/ldap.h)
12061207
SQUID_CHECK_LDAP_API
12071208
SQUID_STATE_ROLLBACK(squid_ldap_state)
12081209
])
12091210

1211+
SQUID_AUTO_LIB(sasl,[LIBSASL],[libsasl2])
1212+
SQUID_CHECK_LIB_WORKS([sasl],[
1213+
SQUID_STATE_SAVE(sasl_state)
1214+
PKG_CHECK_MODULES([LIBSASL],[libsasl2],[:],[:])
1215+
CPPFLAGS="$LIBSASL_CFLAGS $CPPFLAGS"
1216+
LIBS="$LIBSASL_LIBS $LIBS"
1217+
AC_CHECK_HEADERS([sasl/sasl.h sasl.h])
1218+
SQUID_STATE_ROLLBACK(sasl_state)
1219+
])
1220+
12101221
SQUID_AUTO_LIB(systemd,[systemd API for start-up notification],[LIBSYSTEMD])
12111222
SQUID_CHECK_LIB_WORKS(systemd,[
12121223
SQUID_STATE_SAVE(squid_systemd_state)

src/acl/external/kerberos_ldap_group/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ ext_kerberos_ldap_group_acl_LDADD = \
4040
$(LIBHEIMDAL_KRB5_LIBS) \
4141
$(LIBLDAP_LIBS) \
4242
$(LIBMIT_KRB5_LIBS) \
43-
$(LIBSASL) \
43+
$(LIBSASL_LIBS) \
4444
$(XTRA_LIBS)

src/acl/external/kerberos_ldap_group/required.m4

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
##
77

88
AS_IF([test "x$LIBMIT_KRB5_LIBS" != "x" -o "x$LIBHEIMDAL_KRB5_LIBS" != "x" -o "x$LIBGSS_LIBS" != "x"],[
9-
SQUID_CHECK_SASL
10-
AS_IF([test "x$LIBLDAP_LIBS" != "x"],[BUILD_HELPER="kerberos_ldap_group"])
9+
AS_IF([test "x$LIBSASL_LIBS" != "x"],[
10+
BUILD_HELPER="kerberos_ldap_group"
11+
])
1112
])

src/auth/basic/SASL/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ basic_sasl_auth_SOURCES = \
1515
basic_sasl_auth_LDADD= \
1616
$(top_builddir)/lib/libmiscencoding.la \
1717
$(COMPAT_LIB) \
18-
$(LIBSASL) \
18+
$(LIBSASL_LIBS) \
1919
$(XTRA_LIBS)
2020

2121
EXTRA_DIST= \

src/auth/basic/SASL/required.m4

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
## Please see the COPYING and CONTRIBUTORS files for details.
66
##
77

8-
SQUID_CHECK_SASL
9-
AS_IF([test "x$squid_cv_check_sasl" = "xyes"],[BUILD_HELPER="SASL"])
8+
AS_IF([test "x$LIBSASL_LIBS" != "x"],[
9+
BUILD_HELPER="SASL"
10+
])

0 commit comments

Comments
 (0)