Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,13 @@ SQUID_CHECK_LIB_WORKS(gss,[

SQUID_AUTO_LIB(ldap,[LDAP],[LIBLDAP])
SQUID_CHECK_LIB_WORKS(ldap,[
SQUID_STATE_SAVE(squid_ldap_state)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

State preservation is done by the *_LIB_WORKS macro.

Suggested change
SQUID_STATE_SAVE(squid_ldap_state)

PKG_CHECK_MODULES([LIBLDAP],[ldap],[:],[:])
AS_IF([test "x$LIBLDAP_LIBS" = "x"],[
dnl hack for detecting OpenLDAP older than 2.5
AC_CHECK_LIB(lber, ber_init, [LIBLBER="-llber"])
AC_CHECK_LIB(ldap, ldap_init, [LIBLDAP_LIBS="-lldap $LIBLBER"])
Copy link
Contributor

@rousskov rousskov Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At #2267 (comment): Are you wanting me to just close this and use --with-ldap=/usr/lib64 or something similar?

I am opening a new thread for this important question to avoid hijacking an unrelated change request where that question was asked. My earlier questions were not answered directly, but I assume that #2267 (comment) implies that the following statements are true:

  1. In your build environment, there are no LDAP pkg-config files installed.
  2. In your build environment, using --with-ldap=/usr/lib64 (or similar) works.

If the above statements are true, and there are no known problems with existing pkg-config-based code in Squid, then I believe that the correct answer to your question is "Yes, please close this PR: We do not want to restore or add detection code for libraries that provide working pkg-config files (in some environments) and can be correctly handled using custom ./configure options (in other environments). We need to avoid long-term maintenance overheads associated with such detection code. Wiki pull requests documenting workarounds for older environments are welcome."

Copy link
Contributor

@pdvSNnz pdvSNnz Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. For Dists <EL9, there is no LDAP pkg-config (openldap < 2.6)
  2. --with-ldap=/usr/lib64 didn't change anything

Copy link
Contributor

@rousskov rousskov Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. For Dists <EL9, there is no LDAP pkg-config (openldap < 2.6)

Noted.

  1. --with-ldap=/usr/lib64 didn't change anything

IMO, we need to focus on addressing that problem (instead of re-affirming that it is possible to hard-code exceptional code that fixes build in a specific environment like EL7 or EL8). "Addressing that problem" may result in fixing --with-ldap=X support (for all/many environments!) or adjusting those workaround instructions for a specific environment like EL7 or EL8. More at #2267 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will admit that it was premature to drop the AC_CHECK_LIB earlier. Adding them back in a way that works with the new design is fine.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. For Dists <EL9, there is no LDAP pkg-config (openldap < 2.6)

Noted.

  1. --with-ldap=/usr/lib64 didn't change anything

IMO, we need to focus on addressing that problem

The reason for that is that is the placement of the fallback logic within the PKG_CHECK_MODULES macro parameters. Precisely the failure/bug case my change request was about.

With the current PR patch:

  • --with-ldap should work
  • --with-ldap=/usr/lib64 should work

])
AS_IF([test "$squid_host_os" = "mingw" -a "x$LIBLDAP_LIBS" = "x"],[
dnl On MinGW OpenLDAP is not available, try Windows LDAP libraries
dnl TODO: use AC_CHECK_LIB
Expand All @@ -1213,6 +1219,7 @@ SQUID_CHECK_LIB_WORKS(ldap,[
AC_CHECK_HEADERS(ldap.h lber.h)
AC_CHECK_HEADERS(mozldap/ldap.h)
SQUID_CHECK_LDAP_API
SQUID_STATE_ROLLBACK(squid_ldap_state)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

State preservation is done by the *_LIB_WORKS macro.

Suggested change
SQUID_STATE_ROLLBACK(squid_ldap_state)

])

SQUID_AUTO_LIB(sasl,[Cyrus SASL],[LIBSASL])
Expand Down