Milan Crha 5ef0ac
diff -up evolution-data-server-2.27.91/m4/evo_ldap_check.m4.fix-64bit-acinclude evolution-data-server-2.27.91/m4/evo_ldap_check.m4
Milan Crha 5ef0ac
--- evolution-data-server-2.27.91/m4/evo_ldap_check.m4.fix-64bit-acinclude	2009-08-24 12:45:52.000000000 +0200
Milan Crha 5ef0ac
+++ evolution-data-server-2.27.91/m4/evo_ldap_check.m4	2009-08-24 12:48:08.000000000 +0200
Milan Crha 5ef0ac
@@ -14,6 +14,18 @@ AC_DEFUN([EVO_LDAP_CHECK],[
Milan Crha 7a93c6
 		[AS_HELP_STRING([--with-static-ldap],
Milan Crha 7a93c6
 		[Link LDAP support statically into evolution])])
Milan Crha 7a93c6
 	AC_CACHE_CHECK([for OpenLDAP], [ac_cv_with_openldap], [ac_cv_with_openldap="${with_openldap:=$default}"])
Matthew Barnes 1c8c13
+
Matthew Barnes 1c8c13
+	AC_MSG_CHECKING(for multilib subdirectory)
Matthew Barnes 1c8c13
+	if test "$GCC" = "yes" ; then
Matthew Barnes 1c8c13
+		multilibsubdir=`$CC -print-multi-os-directory 2> /dev/null`
Matthew Barnes 1c8c13
+	fi
Matthew Barnes 1c8c13
+	multilibsubdir=${multilibsubdir:-.}
Matthew Barnes 1c8c13
+	AC_MSG_RESULT($multilibsubdir)
Matthew Barnes 1c8c13
+	AC_MSG_CHECKING(for lib subdirectory)
Matthew Barnes 1c8c13
+	libsubdir=`echo lib/${multilibsubdir} | sed -re 's,lib/../([[^/]]*),\1,g'`
Matthew Barnes 1c8c13
+	libsubdir=${libsubdir:-lib}
Matthew Barnes 1c8c13
+	AC_MSG_RESULT($libsubdir)
Matthew Barnes 1c8c13
+
Matthew Barnes 1c8c13
 	case $ac_cv_with_openldap in
Matthew Barnes 1c8c13
 	no|"")
Matthew Barnes 1c8c13
 		with_openldap=no
Milan Crha 5ef0ac
@@ -24,7 +36,7 @@ AC_DEFUN([EVO_LDAP_CHECK],[
Matthew Barnes 1c8c13
 	*)
Matthew Barnes 1c8c13
 		with_openldap=$ac_cv_with_openldap
Matthew Barnes 1c8c13
 		LDAP_CFLAGS="-I$ac_cv_with_openldap/include"
Matthew Barnes 1c8c13
-		LDAP_LDFLAGS="-L$ac_cv_with_openldap/lib"
Matthew Barnes 1c8c13
+		LDAP_LDFLAGS="-L$ac_cv_with_openldap/$libsubdir"
Matthew Barnes 1c8c13
 		;;
Matthew Barnes 1c8c13
 	esac
Matthew Barnes 1c8c13
 
Milan Crha 5ef0ac
@@ -60,20 +72,20 @@ AC_DEFUN([EVO_LDAP_CHECK],[
Milan Crha 7a93c6
 		AC_CHECK_LIB(nsl, gethostbyaddr, [LDAP_LIBS="$LDAP_LIBS -lnsl"])
Matthew Barnes 1c8c13
 		AC_CHECK_LIB(lber, ber_get_tag, [
Matthew Barnes 1c8c13
 			if test "$with_static_ldap" = "yes"; then
Matthew Barnes 1c8c13
-				LDAP_LIBS="$with_openldap/lib/liblber.a $LDAP_LIBS"
Matthew Barnes 1c8c13
+				LDAP_LIBS="$with_openldap/$libsubdir/liblber.a $LDAP_LIBS"
Matthew Barnes 1c8c13
 
Matthew Barnes 1c8c13
 				# libldap might depend on OpenSSL... We need to pull
Matthew Barnes 1c8c13
 				# in the dependency libs explicitly here since we're
Matthew Barnes 1c8c13
 				# not using libtool for the configure test.
Matthew Barnes 1c8c13
-				if test -f $with_openldap/lib/libldap.la; then
Matthew Barnes 1c8c13
-					LDAP_LIBS="`. $with_openldap/lib/libldap.la; echo $dependency_libs` $LDAP_LIBS"
Matthew Barnes 1c8c13
+				if test -f $with_openldap/$libsubdir/libldap.la; then
Matthew Barnes 1c8c13
+					LDAP_LIBS="`. $with_openldap/$libsubdir/libldap.la; echo $dependency_libs` $LDAP_LIBS"
Matthew Barnes 1c8c13
 				fi
Matthew Barnes 1c8c13
 			else
Matthew Barnes 1c8c13
 				LDAP_LIBS="-llber $LDAP_LIBS"
Matthew Barnes 1c8c13
 			fi
Matthew Barnes 1c8c13
 			AC_CHECK_LIB(ldap, ldap_open, [
Matthew Barnes 1c8c13
 					if test $with_static_ldap = "yes"; then
Matthew Barnes 1c8c13
-						LDAP_LIBS="$with_openldap/lib/libldap.a $LDAP_LIBS"
Matthew Barnes 1c8c13
+						LDAP_LIBS="$with_openldap/$libsubdir/libldap.a $LDAP_LIBS"
Matthew Barnes 1c8c13
 					else
Matthew Barnes 1c8c13
 						LDAP_LIBS="-lldap $LDAP_LIBS"
Matthew Barnes 1c8c13
 					fi],