[Patch] Improve diags for "OpenSSL headers match library" configure test

Darren Tucker dtucker at zip.com.au
Sat Aug 3 21:42:10 EST 2002


Ben Lindstrom wrote:
> Suggestion.  Can we seperate the tests?
> 
> OpenSSL header version you have is...<version number>
> OpenSSL library version you have is..<version number>
> Error: Header and Library conflict, please check for multiple version
> installed.
> 
> Or something like that.

How's this? It's based on the --with-default-path handling as suggested
by Tim.

Because the header test returns the text description string too, I kept
the original library/header test. Example output:

checking OpenSSL header version... 90604f (OpenSSL 0.9.6d 9 May 2002)
checking OpenSSL library version... 90604f (OpenSSL 0.9.6d 9 May 2002)
checking whether OpenSSL's headers match the library... yes

checking OpenSSL header version... 90604f (OpenSSL 0.9.6d 9 May 2002)
checking OpenSSL library version... 90602f (OpenSSL 0.9.6b [engine] 9
Jul 2001)
checking whether OpenSSL's headers match the library... no
configure: error: Your OpenSSL headers do not match your library

-- 
Darren Tucker (dtucker at zip.com.au)
GPG Fingerprint D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
-------------- next part --------------
Index: configure.ac
===================================================================
RCS file: /cvs/openssh/configure.ac,v
retrieving revision 1.84
diff -u -r1.84 configure.ac
--- configure.ac	23 Jul 2002 00:00:06 -0000	1.84
+++ configure.ac	3 Aug 2002 11:39:13 -0000
@@ -764,6 +764,70 @@
 	]
 )
 
+# Determine OpenSSL header version
+AC_MSG_CHECKING([OpenSSL header version])
+AC_TRY_RUN(
+	[
+#include <stdio.h>
+#include <string.h>
+#include <openssl/opensslv.h>
+#define DATA "conftest.sslincver"
+int main(void) {
+        FILE *fd;
+        int rc;
+
+        fd = fopen(DATA,"w");
+        if(fd == NULL)
+                exit(1);
+
+	if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
+		exit(1);
+
+	exit(0);
+}
+	],
+	[
+		ssl_header_ver=`cat conftest.sslincver`
+		AC_MSG_RESULT($ssl_header_ver)
+	],
+	[
+		AC_MSG_RESULT(not found)
+		AC_MSG_ERROR(OpenSSL version header not found.)
+	]
+)
+
+# Determine OpenSSL header version
+AC_MSG_CHECKING([OpenSSL library version])
+AC_TRY_RUN(
+	[
+#include <stdio.h>
+#include <string.h>
+#include <openssl/opensslv.h>
+#include <openssl/crypto.h>
+#define DATA "conftest.ssllibver"
+int main(void) {
+        FILE *fd;
+        int rc;
+
+        fd = fopen(DATA,"w");
+        if(fd == NULL)
+                exit(1);
+
+	if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
+		exit(1);
+
+	exit(0);
+}
+	],
+	[
+		ssl_library_ver=`cat conftest.ssllibver`
+		AC_MSG_RESULT($ssl_library_ver)
+	],
+	[
+		AC_MSG_RESULT(not found)
+		AC_MSG_ERROR(OpenSSL library not found.)
+	]
+)
 
 # Sanity check OpenSSL headers
 AC_MSG_CHECKING([whether OpenSSL's headers match the library])


More information about the openssh-unix-dev mailing list