Browse Source

Bug: 210947
Description: parameterizing the hardcoded paths (phase 3. installed binaries, change log, setup)
Fix Description: RHEL4 64 is not able to find ldapsearch because the ldapsdk_bindir is hardcoded
to /usr/lib/mozldap6. We should get ldapsdk_bindir from pkg-config or just simply use
$libdir/mozldap6.
Added -o -z "$ldapsdk_bindir" check suggested by nhosoi
Reviewed by: nhosoi (Thanks!)

Rich Megginson 19 years ago
parent
commit
d8b1c393b1
2 changed files with 10 additions and 4 deletions
  1. 5 2
      configure
  2. 5 2
      m4/mozldap.m4

+ 5 - 2
configure

@@ -23312,7 +23312,7 @@ fi;
 # if LDAPSDK is not found yet, try pkg-config
 
 # last resort
-if test -z "$ldapsdk_inc" -o -z "$ldapsdk_lib" -o -z "$ldapsdk_libdir"; then
+if test -z "$ldapsdk_inc" -o -z "$ldapsdk_lib" -o -z "$ldapsdk_libdir" -o -z "$ldapsdk_bindir"; then
   echo "$as_me:$LINENO: checking for mozldap with pkg-config" >&5
 echo $ECHO_N "checking for mozldap with pkg-config... $ECHO_C" >&6
   # Extract the first word of "pkg-config", so it can be a program name with args.
@@ -23359,6 +23359,7 @@ fi
       ldapsdk_inc=`$PKG_CONFIG --cflags-only-I mozldap6`
       ldapsdk_lib=`$PKG_CONFIG --libs-only-L mozldap6`
       ldapsdk_libdir=`$PKG_CONFIG --libs-only-L mozldap6 | sed -e s/-L// | sed -e s/\ *$//`
+      ldapsdk_bindir=`$PKG_CONFIG --variable=bindir mozldap6`
       echo "$as_me:$LINENO: result: using system mozldap6" >&5
 echo "${ECHO_T}using system mozldap6" >&6
     else
@@ -23373,7 +23374,9 @@ if test -z "$ldapsdk_inc" -o -z "$ldapsdk_lib"; then
 echo "$as_me: error: LDAPSDK not found, specify with --with-ldapsdk-inc|-lib." >&2;}
    { (exit 1); exit 1; }; }
 fi
-ldapsdk_bindir=/usr/lib/mozldap6
+if test -z "$ldapsdk_bindir" ; then
+  ldapsdk_bindir=$libdir/mozldap6
+fi
 
 save_cppflags="$CPPFLAGS"
 CPPFLAGS="$ldapsdk_inc $nss_inc $nspr_inc"

+ 5 - 2
m4/mozldap.m4

@@ -72,7 +72,7 @@ AC_MSG_RESULT(no))
 # if LDAPSDK is not found yet, try pkg-config
 
 # last resort
-if test -z "$ldapsdk_inc" -o -z "$ldapsdk_lib" -o -z "$ldapsdk_libdir"; then
+if test -z "$ldapsdk_inc" -o -z "$ldapsdk_lib" -o -z "$ldapsdk_libdir" -o -z "$ldapsdk_bindir"; then
   AC_MSG_CHECKING(for mozldap with pkg-config)
   AC_PATH_PROG(PKG_CONFIG, pkg-config)
   if test -n "$PKG_CONFIG"; then
@@ -80,6 +80,7 @@ if test -z "$ldapsdk_inc" -o -z "$ldapsdk_lib" -o -z "$ldapsdk_libdir"; then
       ldapsdk_inc=`$PKG_CONFIG --cflags-only-I mozldap6`
       ldapsdk_lib=`$PKG_CONFIG --libs-only-L mozldap6`
       ldapsdk_libdir=`$PKG_CONFIG --libs-only-L mozldap6 | sed -e s/-L// | sed -e s/\ *$//`
+      ldapsdk_bindir=`$PKG_CONFIG --variable=bindir mozldap6`
       AC_MSG_RESULT([using system mozldap6])
     else
       AC_MSG_ERROR([LDAPSDK not found, specify with --with-ldapsdk[-inc|-lib].])
@@ -90,7 +91,9 @@ if test -z "$ldapsdk_inc" -o -z "$ldapsdk_lib"; then
   AC_MSG_ERROR([LDAPSDK not found, specify with --with-ldapsdk[-inc|-lib].])
 fi
 dnl default path for the ldap c sdk tools (see [210947] for more details)
-ldapsdk_bindir=/usr/lib/mozldap6
+if test -z "$ldapsdk_bindir" ; then
+  ldapsdk_bindir=$libdir/mozldap6
+fi
 
 dnl make sure the ldap sdk version is 6 or greater - we do not support
 dnl the old 5.x or prior versions - the ldap server code expects the new