OpenSSH 2.5.0p1

mouring at etoh.eviladmin.org mouring at etoh.eviladmin.org
Sun Feb 18 18:01:18 EST 2001


On Sat, 17 Feb 2001, Gert Doering wrote:

> Hi,
> 
> On Sat, Feb 17, 2001 at 11:17:05AM -0600, mouring at etoh.eviladmin.org wrote:
> > However I know there was a reason for us -L$ssldir and -L$ssldir/lib.  And
> > I would rather see a solution that keeps both tests in place if possible. 
> 
> The double "-L" breaks the linker on SCO 3.0 (too many -L).
> 
> Why not really *check* the -L path for "$ssldir/(lib/)?libcrypto.a", and
> use only the directory where it can be found?
> 
I was hoping someone else with this problem would provide the
patch.. However.  If this is acceptable to all parties... 

Grant I refuse to claim it's clean, pretty, what not.. It's almost 1am my
time and I'm going to bed.  I can state it works under Linux Redhat 7.0
and I've done no other other testing.

If someone could tell my how to get AC_CACHE_CHECK to set two variables
instead of one.  I'd be much happier.  I hate cheap awk tricks.

- Ben

--- configure.in	Sun Feb 18 00:57:27 2001
+++ ../ossh/configure.in	Sun Feb 18 00:54:15 2001
@@ -592,25 +592,27 @@
 if test "x$prefix" != "xNONE" ; then
 	tryssldir="$tryssldir $prefix"
 fi
-AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
+AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssl, [
 
-	for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
-		if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
-			LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
-			CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
-			if test ! -z "$need_dash_r" ; then
-				LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
+	for sslinc in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
+		for ssldir in $sslinc "$sslinc/lib"; do
+			if test ! -z "$sslinc" -a "x$sslinc" != "x/usr"; then
+				LDFLAGS="$saved_LDFLAGS -L$ssldir"
+				CPPFLAGS="$saved_CPPFLAGS -I$sslinc/include"
+				if test ! -z "$need_dash_r" ; then
+					LDFLAGS="$LDFLAGS -R$ssldir/lib"
+				fi
+			else
+				LDFLAGS="$saved_LDFLAGS"
 			fi
-		else
-			LDFLAGS="$saved_LDFLAGS"
-		fi
 
-		LIBS="$saved_LIBS -lcrypto"
+			LIBS="$saved_LIBS -lcrypto"
 
-		# Basic test to check for compatible version and correct linking
-		# *does not* test for RSA - that comes later.
-		AC_TRY_RUN(
-			[
+			# Basic test to check for compatible version and 
+			# correct linking *does not* test for RSA - that 
+			# comes later.
+			AC_TRY_RUN(
+				[
 #include <string.h>
 #include <openssl/rand.h>
 int main(void) 
@@ -620,16 +622,17 @@
 	RAND_add(a, sizeof(a), sizeof(a));
 	return(RAND_status() <= 0);
 }
-			],
-			[
-				found_crypto=1
-				break;
-			], []
-		)
+				],
+				[
+					found_crypto=1
+					break;
+				], []
+			)
 
-		if test ! -z "$found_crypto" ; then
-			break;
-		fi
+			if test ! -z "$found_crypto" ; then
+				break;
+			fi
+		done
 	done
 
 	if test -z "$found_crypto" ; then
@@ -639,22 +642,24 @@
 		ssldir="(system)"
 	fi
 
-	ac_cv_openssldir=$ssldir
+	ac_cv_openssl="$ssldir:$sslinc"
 ])
 
 if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
 	AC_DEFINE(HAVE_OPENSSL)
-	dnl Need to recover ssldir - test above runs in subshell
-	ssldir=$ac_cv_openssldir
+	dnl Need to recover ssldir and sslinc - test above runs in subshell
+	ssldir=`echo $ac_cv_openssl | awk -F: '{ print $1 }'`
+	sslinc=`echo $ac_ac_openssl | awk -F: '{ print $2 }'`
 
+	# Do we need to test for $sslinc ??
 	if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
-		CPPFLAGS="$saved_CPPFLAGS -I$ssldir/include"
-		LDFLAGS="$saved_LDFLAGS -L$ssldir/lib -L$ssldir"
+		CPPFLAGS="$saved_CPPFLAGS -I$sslinc/include"
+		LDFLAGS="$saved_LDFLAGS -L$ssldir/lib"
 		if test ! -z "$need_dash_r" ; then
-			LDFLAGS="$LDFLAGS -R$ssldir/lib -R$ssldir"
+			LDFLAGS="$LDFLAGS -R$ssldir/lib"
 		fi
 		if test ! -z "$blibpath" ; then
-			blibpath="$blibpath:$ssldir:$ssldir/lib"
+			blibpath="$blibpath:$ssldir"
 		fi
 	fi
 fi






More information about the openssh-unix-dev mailing list