Skip to content

Commit 03fc042

Browse files
committed
Fix busted test for ldap_initialize.
Sigh ... I was expecting AC_CHECK_LIB to do something it didn't, namely update LIBS. This led to not finding ldap_initialize. Fix by moving the probe for ldap_initialize. In some sense this is more correct anyway, since (at least for now) we care about whether ldap_initialize exists in libldap not libldap_r. Per buildfarm member elver and local testing. Discussion: https://postgr.es/m/17083-a19190d9591946a7@postgresql.org
1 parent 357b66e commit 03fc042

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

configure

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12509,6 +12509,18 @@ else
1250912509
fi
1251012510

1251112511
LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
12512+
# This test is carried out against libldap.
12513+
for ac_func in ldap_initialize
12514+
do :
12515+
ac_fn_c_check_func "$LINENO" "ldap_initialize" "ac_cv_func_ldap_initialize"
12516+
if test "x$ac_cv_func_ldap_initialize" = xyes; then :
12517+
cat >>confdefs.h <<_ACEOF
12518+
#define HAVE_LDAP_INITIALIZE 1
12519+
_ACEOF
12520+
12521+
fi
12522+
done
12523+
1251212524
if test "$enable_thread_safety" = yes; then
1251312525
# Use ldap_r for FE if available, else assume ldap is thread-safe.
1251412526
# On some platforms ldap_r fails to link without PTHREAD_LIBS.
@@ -12558,17 +12570,6 @@ fi
1255812570
else
1255912571
LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
1256012572
fi
12561-
for ac_func in ldap_initialize
12562-
do :
12563-
ac_fn_c_check_func "$LINENO" "ldap_initialize" "ac_cv_func_ldap_initialize"
12564-
if test "x$ac_cv_func_ldap_initialize" = xyes; then :
12565-
cat >>confdefs.h <<_ACEOF
12566-
#define HAVE_LDAP_INITIALIZE 1
12567-
_ACEOF
12568-
12569-
fi
12570-
done
12571-
1257212573
else
1257312574
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_bind in -lwldap32" >&5
1257412575
$as_echo_n "checking for ldap_bind in -lwldap32... " >&6; }

configure.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1275,6 +1275,8 @@ if test "$with_ldap" = yes ; then
12751275
[AC_MSG_ERROR([library 'ldap' is required for LDAP])],
12761276
[$EXTRA_LDAP_LIBS])
12771277
LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
1278+
# This test is carried out against libldap.
1279+
AC_CHECK_FUNCS([ldap_initialize])
12781280
if test "$enable_thread_safety" = yes; then
12791281
# Use ldap_r for FE if available, else assume ldap is thread-safe.
12801282
# On some platforms ldap_r fails to link without PTHREAD_LIBS.
@@ -1286,7 +1288,6 @@ if test "$with_ldap" = yes ; then
12861288
else
12871289
LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
12881290
fi
1289-
AC_CHECK_FUNCS([ldap_initialize])
12901291
else
12911292
AC_CHECK_LIB(wldap32, ldap_bind, [], [AC_MSG_ERROR([library 'wldap32' is required for LDAP])])
12921293
LDAP_LIBS_FE="-lwldap32"

0 commit comments

Comments
 (0)