From c4ac8bed13913807fb4755c2789f4fb5dbcfd0cf Mon Sep 17 00:00:00 2001
From: Noriko Hosoi <nhosoi@redhat.com>
Date: Thu, 4 Sep 2014 13:53:52 -0700
Subject: [PATCH] Ticket #47875 - dirsrv not running with old openldap

Description: To check libldif, -lldap$ol_libver needs to be added
to LDFLAGS to compile test conftest.c.
---
 configure      | 3 +--
 m4/openldap.m4 | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index ec58a1b..8eb5892 100755
--- a/configure
+++ b/configure
@@ -19407,7 +19407,7 @@ $as_echo "#define HAVE_LDAP_URL_PARSE_EXT 1" >>confdefs.h
 fi
 
       ldap_lib_ldif=""
-  LDFLAGS="$LDFLAGS"
+  LDFLAGS="$LDFLAGS -lldap$ol_libver"
   as_ac_Lib=`$as_echo "ac_cv_lib_ldif$ol_libver''__init" | $as_tr_sh`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _init in -lldif$ol_libver" >&5
 $as_echo_n "checking for _init in -lldif$ol_libver... " >&6; }
@@ -21376,7 +21376,6 @@ fi
 
 
 
-
 # AC_DEFINE([USE_OLD_UNHASHED], [], [Use old unhashed code])
 
 $as_echo "#define LDAP_DEBUG 1" >>confdefs.h
diff --git a/m4/openldap.m4 b/m4/openldap.m4
index 1e297c4..70312c7 100644
--- a/m4/openldap.m4
+++ b/m4/openldap.m4
@@ -145,7 +145,7 @@ if test "$with_openldap" = yes ; then
   dnl look for separate libldif - newer versions of openldap have moved the
   dnl ldif functionality into libldap
   ldap_lib_ldif=""
-  LDFLAGS="$LDFLAGS"
+  LDFLAGS="$LDFLAGS -lldap$ol_libver"
   AC_CHECK_LIB([ldif$ol_libver], [_init], [ldap_lib_ldif=-lldif$ol_libver],
     [ldap_lib_ldif=])
   if test -z "$ldap_lib_ldif" ; then
-- 
1.8.3.1

