Matthew Barnes 1c8c13
--- evolution-data-server-1.11.5/acinclude.m4.fix-64bit-acinclude	2007-07-17 10:45:02.000000000 -0400
Matthew Barnes 1c8c13
+++ evolution-data-server-1.11.5/acinclude.m4	2007-07-17 10:45:15.000000000 -0400
Matthew Barnes 1c8c13
@@ -34,6 +34,18 @@ AC_DEFUN([EVO_LDAP_CHECK], [
Matthew Barnes 1c8c13
 	AC_ARG_WITH(openldap,     [  --with-openldap=[no/yes/PREFIX]      Enable LDAP support in evolution])
Matthew Barnes 1c8c13
 	AC_ARG_WITH(static-ldap,  [  --with-static-ldap=[no/yes]          Link LDAP support statically into evolution ])
Matthew Barnes 1c8c13
 	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
Matthew Barnes 1c8c13
@@ -44,7 +56,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
 
Matthew Barnes 1c8c13
@@ -80,20 +92,20 @@ AC_DEFUN([EVO_LDAP_CHECK], [
Matthew Barnes 1c8c13
 		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],