summaryrefslogtreecommitdiff
path: root/config/programs.m4
diff options
context:
space:
mode:
authorNoah Misch2014-07-25 22:51:35 +0000
committerNoah Misch2014-07-25 22:51:35 +0000
commite565ff7553e60b3d13dde410ef96f5256c5525eb (patch)
tree94451ff216128a1998cc6e8b0730044701423cae /config/programs.m4
parent1144ea3421e4bcc24dd7402a1f21ba94638d591b (diff)
Move PGAC_LDAP_SAFE to config/programs.m4.
This restores the style of keeping configure.in free of AC_DEFUN. Per gripe from Tom Lane.
Diffstat (limited to 'config/programs.m4')
-rw-r--r--config/programs.m428
1 files changed, 28 insertions, 0 deletions
diff --git a/config/programs.m4 b/config/programs.m4
index 76c0158973a..ed6711df167 100644
--- a/config/programs.m4
+++ b/config/programs.m4
@@ -116,6 +116,34 @@ AC_SUBST(FLEXFLAGS)
+# PGAC_LDAP_SAFE
+# --------------
+# PostgreSQL sometimes loads libldap_r and plain libldap into the same
+# process. Check for OpenLDAP versions known not to tolerate doing so; assume
+# non-OpenLDAP implementations are safe. The dblink test suite exercises the
+# hazardous interaction directly.
+
+AC_DEFUN([PGAC_LDAP_SAFE],
+[AC_CACHE_CHECK([for compatible LDAP implementation], [pgac_cv_ldap_safe],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[#include <ldap.h>
+#if !defined(LDAP_VENDOR_VERSION) || \
+ (defined(LDAP_API_FEATURE_X_OPENLDAP) && \
+ LDAP_VENDOR_VERSION >= 20424 && LDAP_VENDOR_VERSION <= 20431)
+choke me
+#endif], [])],
+[pgac_cv_ldap_safe=yes],
+[pgac_cv_ldap_safe=no])])
+
+if test "$pgac_cv_ldap_safe" != yes; then
+ AC_MSG_WARN([
+*** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
+*** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
+*** also uses LDAP will crash on exit.])
+fi])
+
+
+
# PGAC_CHECK_READLINE
# -------------------
# Check for the readline library and dependent libraries, either