diff -ur openca-0.9/configure.in openca-0.9-conf-patched/configure.in
--- openca-0.9/configure.in	Fri Aug  5 14:50:33 2005
+++ openca-0.9-conf-patched/configure.in	Thu Dec 29 15:25:48 2005
@@ -441,7 +441,7 @@
 	dnl Now see if the user specified openssl_prefix
 	if [[ x${openssl_prefix} != x ]]; then
 	   openssl_cflags=[-I${openssl_prefix}/include]
-	   openssl_libs=["-L${openssl_prefix}/lib -L${openssl_prefix} -lcrypto -lssl"]
+	   openssl_libs=["-Wl,-rpath,${openssl_prefix}/lib -L${openssl_prefix}/lib -L${openssl_prefix} -lcrypto -lssl"]
 	   openssl_setup=yes
 	   AC_MSG_RESULT( [User specified --with-openssl-prefix])
 		  dnl Check if the developer has the pkg-config macros
diff -ur openca-0.9/src/musclecard-engine/configure.in openca-0.9-conf-patched/src/musclecard-engine/configure.in
--- openca-0.9/src/musclecard-engine/configure.in	Tue Jan 27 15:58:36 2004
+++ openca-0.9-conf-patched/src/musclecard-engine/configure.in	Thu Dec 29 15:27:32 2005
@@ -135,7 +135,7 @@
 	dnl Now see if the user specified openssl_prefix
 	if [[ x${openssl_prefix} != x ]]; then
 	   openssl_cflags=[-I${openssl_prefix}/include]
-	   openssl_libs=["-L${openssl_prefix}/lib -L${openssl_prefix} -lcrypto -lssl"]
+	   openssl_libs=["-Wl,-rpath,${openssl_prefix}/lib -L${openssl_prefix}/lib -L${openssl_prefix} -lcrypto -lssl"]
 	   openssl_setup=yes
 	   AC_MSG_RESULT( [User specified --with-openssl-prefix])
 	   dnl Check if the developer has the pkg-config macros
diff -ur openca-0.9/src/ocspd/configure.in openca-0.9-conf-patched/src/ocspd/configure.in
--- openca-0.9/src/ocspd/configure.in	Wed Sep 15 19:04:22 2004
+++ openca-0.9-conf-patched/src/ocspd/configure.in	Thu Dec 29 15:30:00 2005
@@ -132,7 +132,7 @@
 	dnl Now see if the user specified openssl_prefix
 	if [[ x${openssl_prefix} != x ]]; then
 	   openssl_cflags=[-I${openssl_prefix}/include]
-	   openssl_libs=["-L${openssl_prefix}/lib -L${openssl_prefix} -lcrypto -lssl"]
+	   openssl_libs=["-Wl,-rpath,${openssl_prefix}/lib -L${openssl_prefix}/lib -L${openssl_prefix} -lcrypto -lssl"]
 	   openssl_setup=yes
 	  dnl AC_MSG_RESULT( [User specified --with-openssl-prefix])
 	  dnl Check if the developer has the pkg-config macros
diff -ur openca-0.9/src/openca-sv/configure.in openca-0.9-conf-patched/src/openca-sv/configure.in
--- openca-0.9/src/openca-sv/configure.in	Mon Aug  9 13:12:08 2004
+++ openca-0.9-conf-patched/src/openca-sv/configure.in	Thu Dec 29 16:31:56 2005
@@ -85,6 +85,12 @@
 AC_PATH_PROG( POD2MAN, pod2man,pod2man,
                 $PATH:/sbin:/usr/sbin:/usr/local/sbin)
 
+dnl OpenSSL prefix
+AC_ARG_WITH( openssl-prefix,
+        AC_HELP_STRING( [--with-openssl-prefix=DIR], [openssl prefix]),
+        openssl_prefix=$withval, openssl_prefix= )
+AC_SUBST( openssl_prefix)
+
 openssl_path=$PATH:/sbin:/usr/sbin:/usr/local/ssl/bin
 if [[ x$openssl_prefix != x ]]; then
 	openssl_path=$openssl_prefix/bin:openssl_path
@@ -92,12 +98,6 @@
 AC_PATH_PROG( OPENSSL, openssl, openssl,
 	$openssl_path)
 
-dnl OpenSSL prefix
-AC_ARG_WITH( openssl-prefix,
-	AC_HELP_STRING( [--with-openssl-prefix=DIR], [openssl prefix]),
-	openssl_prefix=$withval, openssl_prefix= )
-AC_SUBST( openssl_prefix)
-
 AC_ARG_WITH( openca-prefix,
 	AC_HELP_STRING( [--with-openca-prefix=OPENCAPREFIX], [sets OpenCA install prefix (default is EPREFIX/OpenCA)]),
 	openca_prefix=$withval, openca_prefix=${exec_prefix}/OpenCA)
@@ -127,7 +127,7 @@
 	dnl Now see if the user specified openssl_prefix
 	if [[ x${openssl_prefix} != x ]]; then
 	   openssl_cflags=[-I${openssl_prefix}/include]
-	   openssl_libs=["-L${openssl_prefix}/lib -L${openssl_prefix} -lcrypto -lssl"]
+	   openssl_libs=["-Wl,-rpath,${openssl_prefix}/lib -L${openssl_prefix}/lib -L${openssl_prefix} -lcrypto -lssl"]
 	   openssl_setup=yes
 	   AC_MSG_RESULT( [User specified --with-openssl-prefix])
 	   dnl Check if the developer has the pkg-config macros
diff -ur openca-0.9/src/scep/configure.in openca-0.9-conf-patched/src/scep/configure.in
--- openca-0.9/src/scep/configure.in	Fri Jan 30 19:13:29 2004
+++ openca-0.9-conf-patched/src/scep/configure.in	Thu Dec 29 15:28:28 2005
@@ -133,7 +133,7 @@
 	dnl Now see if the user specified openssl_prefix
 	if [[ x${openssl_prefix} != x ]]; then
 	   openssl_cflags=[-I${openssl_prefix}/include]
-	   openssl_libs=["-L${openssl_prefix}/lib -L${openssl_prefix} -lcrypto -lssl"]
+	   openssl_libs=["-Wl,-rpath,${openssl_prefix}/lib -L${openssl_prefix}/lib -L${openssl_prefix} -lcrypto -lssl"]
 	   openssl_setup=yes
 	   AC_MSG_RESULT( [User specified --with-openssl-prefix])
 		  dnl Check if the developer has the pkg-config macros
