bc5dde
diff -up bind-9.9.0/contrib/dlz/config.dlz.in.64bit bind-9.9.0/contrib/dlz/config.dlz.in
bc5dde
--- bind-9.9.0/contrib/dlz/config.dlz.in.64bit	2011-11-05 06:14:28.000000000 +0100
bc5dde
+++ bind-9.9.0/contrib/dlz/config.dlz.in	2012-04-24 14:52:08.398511143 +0200
bc5dde
@@ -17,6 +17,13 @@
bc5dde
 #
bc5dde
 dlzdir='${DLZ_DRIVER_DIR}'
bc5dde
 
bc5dde
+AC_MSG_CHECKING([for target libdir])
bc5dde
+AC_RUN_IFELSE([int main(void) {exit((sizeof(void *) == 8) ? 0 : 1);}],
bc5dde
+	[target_lib=lib64],
bc5dde
+	[target_lib=lib],
bc5dde
+)
bc5dde
+AC_MSG_RESULT(["$target_lib"])
bc5dde
+
bc5dde
 #
bc5dde
 # Private autoconf macro to simplify configuring drivers:
bc5dde
 #
bc5dde
@@ -135,9 +142,9 @@ then
bc5dde
 		then
bc5dde
 			use_dlz_mysql=$d
bc5dde
 			mysql_include=$d/include/mysql
bc5dde
-			if test -d $d/lib/mysql
bc5dde
+			if test -d $d/${target_lib}/mysql
bc5dde
 			then
bc5dde
-				mysql_lib=$d/lib/mysql
bc5dde
+				mysql_lib=$d/${target_lib}/mysql
bc5dde
 			else
bc5dde
 				mysql_lib=$d/lib
bc5dde
 			fi
bc5dde
@@ -274,11 +281,11 @@ case "$use_dlz_bdb" in
bc5dde
 			bdb_libnames="db48 db-4.8 db47 db-4.7 db46 db-4.6 db45 db-4.5 db44 db-4.4 db43 db-4.3 db42 db-4.2 db41 db-4.1 db"
bc5dde
 			for d in $bdb_libnames
bc5dde
 			do
bc5dde
-				if test -f "$dd/lib/lib${d}.so"
bc5dde
+				if test -f "$dd/${target_lib}/lib${d}.so"
bc5dde
 				then
bc5dde
 					if test "$dd" != "/usr"
bc5dde
 					then
bc5dde
-						dlz_bdb_libs="-L${dd}/lib "
bc5dde
+						dlz_bdb_libs="-L${dd}/${target_lib} "
bc5dde
 					else
bc5dde
 						dlz_bdb_libs=""
bc5dde
 					fi
bc5dde
@@ -383,7 +390,7 @@ case "$use_dlz_ldap" in
bc5dde
 	*)
bc5dde
 		DLZ_ADD_DRIVER(LDAP, dlz_ldap_driver,
bc5dde
 				[-I$use_dlz_ldap/include],
bc5dde
-				[-L$use_dlz_ldap/lib -lldap -llber])
bc5dde
+				[-L$use_dlz_ldap/${target_lib} -lldap -llber])
bc5dde
 
bc5dde
 		AC_MSG_RESULT(
bc5dde
 [using LDAP from $use_dlz_ldap/lib and $use_dlz_ldap/include])
bc5dde
@@ -407,7 +414,7 @@ then
bc5dde
 	odbcdirs="/usr /usr/local /usr/pkg"
bc5dde
 	for d in $odbcdirs
bc5dde
 	do
bc5dde
-		if test -f $d/include/sql.h -a -f $d/lib/libodbc.a
bc5dde
+		if test -f $d/include/sql.h -a -f $d/${target_lib}/libodbc.a
bc5dde
 		then
bc5dde
 			use_dlz_odbc=$d
bc5dde
 			break
bc5dde
@@ -427,7 +434,7 @@ case "$use_dlz_odbc" in
bc5dde
 	*)
bc5dde
 		DLZ_ADD_DRIVER(ODBC, dlz_odbc_driver,
bc5dde
 				[-I$use_dlz_odbc/include],
bc5dde
-				[-L$use_dlz_odbc/lib -lodbc])
bc5dde
+				[-L$use_dlz_odbc/${target_lib} -lodbc])
bc5dde
 
bc5dde
 		AC_MSG_RESULT([using ODBC from $use_dlz_odbc])
bc5dde
 		;;