--- contrib/dlz/config.dlz.in.orig	2009-01-29 14:42:22.000000000 -0800
+++ contrib/dlz/config.dlz.in	2009-01-29 14:42:34.000000000 -0800
@@ -155,6 +155,14 @@
 			break
 		fi
 	done
+elif test -f `$use_dlz_mysql --include | awk '{print substr($1,3)}'`/mysql.h
+then
+	mysql_include=`$use_dlz_mysql --include | awk '{print substr($1,3)}'`
+	if test -d `$use_dlz_mysql --libs | awk '{print substr($2,3)}'`
+	then
+		mysql_lib=`$use_dlz_mysql --libs | awk '{print substr($2,3)}'`
+	fi
+elif test "$use_dlz_mysql" != "no"
 elif test "$use_dlz_mysql" != "no"
 then
 	d=$use_dlz_mysql
@@ -193,7 +201,7 @@
 	*)
 		DLZ_ADD_DRIVER(MYSQL, dlz_mysql_driver,
 				[-I${mysql_include}],
-				[-L${mysql_lib} -lmysqlclient -lz -lcrypt -lm])
+				[-L${mysql_lib} -lmysqlclient -lz -lm])
 
 		AC_MSG_RESULT(
 [using mysql from ${mysql_lib} and ${mysql_include}])
