--- configure.in.orig	2008-11-10 23:02:36.000000000 +0100
+++ configure.in	2008-11-11 00:27:27.000000000 +0100
@@ -142,8 +142,8 @@
 dnl =========================== Include and lib prefixes ===============
 AC_ARG_WITH( lib-prefix,
 	AC_HELP_STRING( [--with-lib-prefix=LIBPREFIX],
-			[sets library prefix (default is PREFIX/lib)]),
-			lib_prefix=$withval, lib_prefix=${prefix}/lib)
+			[sets library prefix (default is PREFIX/lib64)]),
+			lib_prefix=$withval, lib_prefix=${prefix}/lib64)
 AC_SUBST( lib_prefix)
 
 dnl databases, tmp, crypto, mails
@@ -239,12 +239,12 @@
    fi
 
    if ! [[ x$ldap_prefix = x ]]; then
-        ldap_path=$ldap_prefix/lib
+        ldap_path=$ldap_prefix/lib64
    fi
 
    if ! [[ "x${ldap_prefix}" = "x" ]]; then
       ldap_cflags=[-I${openldap_prefix}/include]
-      ldap_libs="-L${ldap_prefix}/lib -L${ldap_prefix}"
+      ldap_libs="-L${ldap_prefix}/lib64 -L${ldap_prefix}"
    else
       ldap_cflags=
       ldap_libs=
@@ -298,7 +298,7 @@
 
    	AC_SUBST(xml2_prefix)
 	if ! [[ x$xml2_prefix = x ]]; then
-		xml2_path=$xml2_prefix/lib
+		xml2_path=$xml2_prefix/lib64
 	fi
 
 	if ! [[ x$xml2_config = x ]] ; then
@@ -307,7 +307,7 @@
 	   	XML2_LIBTOOL_LIBS=`$xml2_config --libtool-libs`
 	else
 		xml2_cflags=-I$xml2_prefix/include
-		xml2_libs=-L$xml2_prefix/lib
+		xml2_libs=-L$xml2_prefix/lib64
 		XML2_LIBTOOL_LIBS=
 	fi
 
@@ -332,7 +332,7 @@
    	mysql_cflags=-I/usr/include/mysql
    	mysql_prefix=/usr
 	mysql_prefix_SPECIFIED=
-   	mysql_libs="-L/usr/lib/mysql -lmysqlclient "
+   	mysql_libs="-L/usr/lib64/mysql -lmysqlclient "
 
 	enablemysql=yes
 
@@ -370,7 +370,7 @@
    		mysql_libs=`$mysql_config --libs`
 	else
 		mysql_cflags="-I$mysql_prefix/include"
-		mysql_libs="-L$mysql_prefix/lib -lmysqlclient"
+		mysql_libs="-L$mysql_prefix/lib64 -lmysqlclient"
 	fi
 
 
@@ -426,7 +426,7 @@
    	pg_cflags=
    	pg_prefix=/usr
 	pg_prefix_SPECIFIED=
-   	pg_libs="-L/usr/lib -lpq "
+   	pg_libs="-L/usr/lib64 -lpq "
 
 	enablepg=yes
 	pg_libs=
@@ -465,7 +465,7 @@
 	
 	else
 		pg_cflags="-I${pg_prefix}/include"
-		pg_libs="-L${pg_prefix}/lib -lpq"
+		pg_libs="-L${pg_prefix}/lib64 -lpq"
 	fi
 
 	OLD_CFLAGS="$CFLAGS"
@@ -564,7 +564,7 @@
    		p11_libs=`$p11_config --libs`
 	else
 		p11_cflags="-I$p11_prefix/include"
-		p11_libs="-L$p11_prefix/lib -lp11"
+		p11_libs="-L$p11_prefix/lib64 -lp11"
 	fi
 
 
@@ -591,7 +591,7 @@
 		p11_libs="$p11_libs"
 
 		if ! [[ -z "$need_dash_r" ]] ; then
-			p11_libs="-R${libp11_prefix}/lib ${libp11_libs}"
+			p11_libs="-R${libp11_prefix}/lib64 ${libp11_libs}"
 		fi
 	
 		enablep11=yes
@@ -640,7 +640,7 @@
 
    	AC_SUBST(XMLSEC_PREFIX)
 	if ! [[ x$XMLSEC_PREFIX = x ]]; then
-		xmlsec_path=$XMLSEC_PREFIX/lib
+		xmlsec_path=$XMLSEC_PREFIX/lib64
 		AC_MSG_RESULT([xmlsec lib dir          : $xmlsec_path])
 	else
 		AC_MSG_RESULT(
@@ -744,7 +744,7 @@
    AC_MSG_RESULT([with openssl-prefix     : $openssl_prefix ])
 
    if ! [[ "x${openssl_prefix}" = "x" ]]; then
-        openssl_path=$openssl_prefix/lib
+        openssl_path=$openssl_prefix/lib64
         AC_MSG_RESULT([openssl lib dir         : $openssl_path])
    else
         AC_MSG_RESULT([openssl lib dir         : $openssl_path (default)])
@@ -788,7 +788,7 @@
 	fi    dnl End of prefix block
 	
 	dnl NEW Check function
-	dirs="/lib /usr/lib /usr/local/lib /usr/local/ssl/lib /usr/local/openssl /opt/csw/lib"
+	dirs="/lib /lib64 /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64 /usr/local/ssl/lib /usr/local/ssl/lib64 /usr/local/openssl /opt/csw/lib /opt/csw/lib64"
 	library_cflags=
 	library_ldflags=
 	library_ldpath=
@@ -809,7 +809,7 @@
 	# openssl_static_libs="${library_ldflags}"
 
 	if test ! -z "$need_dash_r" ; then
-        	openssl_libs="-R${openssl_prefix}/lib ${openssl_libs}"
+        	openssl_libs="-R${openssl_prefix}/lib64 ${openssl_libs}"
         fi
 	
 	if [[ "${enable_shared}" = "yes" ]] ; then
@@ -830,7 +830,7 @@
 
 	AC_SEARCH_LIBS(BIO_new, "crypto", [ ] ,
 		AC_MSG_ERROR([**** ERROR::OpenSSL Lib Not Configured ! ****]),
-		[-L $openssl_prefix/lib ] )
+		[-L $openssl_prefix/lib64 ] )
 
 
 	dnl ECDSA support cecks
@@ -953,7 +953,7 @@
 ldlibs="${openssl_libs} ${xml2_libs} ${XMLSEC_LIBS} ${ldap_libs} ${sys_ldlibs} ${kmf_libs} ${p11_libs} ${mysql_libs} ${pg_libs} ${sys_ldlibs}"
 testlibs="${sys_ldlibs}"
 else
-ldlibs="-static -L${openssl_prefix}/lib ${openssl_libs} ${xml2_libs} ${XMLSEC_LIBS} ${kmf_libs} ${p11_libs} ${mysql_libs} ${pg_libs} ${ldap_libs}"
+ldlibs="-static -L${openssl_prefix}/lib64 ${openssl_libs} ${xml2_libs} ${XMLSEC_LIBS} ${kmf_libs} ${p11_libs} ${mysql_libs} ${pg_libs} ${ldap_libs}"
 testlibs="-static ${ldlibs} src/.libs/libpki.a"
 fi
 
@@ -970,7 +970,7 @@
 include_dir=${prefix}/include
 AC_SUBST(include_dir)
 
-conf_dir=file://${prefix}/etc
+conf_dir=file://etc
 AC_SUBST(conf_dir)
 
 dnl ==================================================================
