diff options
author | Darren Tucker <dtucker@dtucker.net> | 2018-10-27 16:45:59 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2018-10-27 16:45:59 +1100 |
commit | 262d81a259d4aa1507c709ec9d5caa21c7740722 (patch) | |
tree | c7b8258f4a5f2713d026d679a3f618677c9db7ff /configure.ac | |
parent | 406a24b25d6a2bdd70cacd16de7e899dcb2a8829 (diff) |
Check for the existence of openssl version funcs.
Check for the existence of openssl version functions and use the ones
detected instead of trying to guess based on the int32 version
identifier. Fixes builds with LibreSSL.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index a4109effc..10696513f 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -2585,6 +2585,9 @@ if test "x$openssl" = "xyes" ; then | |||
2585 | ] | 2585 | ] |
2586 | ) | 2586 | ) |
2587 | 2587 | ||
2588 | # Determining OpenSSL library version is version dependent. | ||
2589 | AC_CHECK_FUNCS([OpenSSL_version OpenSSL_version_num]) | ||
2590 | |||
2588 | # Determine OpenSSL library version | 2591 | # Determine OpenSSL library version |
2589 | AC_MSG_CHECKING([OpenSSL library version]) | 2592 | AC_MSG_CHECKING([OpenSSL library version]) |
2590 | AC_RUN_IFELSE( | 2593 | AC_RUN_IFELSE( |
@@ -2601,10 +2604,14 @@ if test "x$openssl" = "xyes" ; then | |||
2601 | fd = fopen(DATA,"w"); | 2604 | fd = fopen(DATA,"w"); |
2602 | if(fd == NULL) | 2605 | if(fd == NULL) |
2603 | exit(1); | 2606 | exit(1); |
2604 | #if OPENSSL_VERSION_NUMBER < 0x10100000L | 2607 | #ifndef OPENSSL_VERSION |
2605 | # define OpenSSL_version_num SSLeay | 2608 | # define OPENSSL_VERSION SSLEAY_VERSION |
2609 | #endif | ||
2610 | #ifndef HAVE_OPENSSL_VERSION | ||
2606 | # define OpenSSL_version SSLeay_version | 2611 | # define OpenSSL_version SSLeay_version |
2607 | # define OPENSSL_VERSION SSLEAY_VERSION | 2612 | #endif |
2613 | #ifndef HAVE_OPENSSL_VERSION_NUM | ||
2614 | # define OpenSSL_version_num SSLeay | ||
2608 | #endif | 2615 | #endif |
2609 | if ((rc = fprintf(fd, "%08lx (%s)\n", | 2616 | if ((rc = fprintf(fd, "%08lx (%s)\n", |
2610 | (unsigned long)OpenSSL_version_num(), | 2617 | (unsigned long)OpenSSL_version_num(), |
@@ -2650,8 +2657,8 @@ if test "x$openssl" = "xyes" ; then | |||
2650 | #include <openssl/opensslv.h> | 2657 | #include <openssl/opensslv.h> |
2651 | #include <openssl/crypto.h> | 2658 | #include <openssl/crypto.h> |
2652 | ]], [[ | 2659 | ]], [[ |
2653 | #if OPENSSL_VERSION_NUMBER < 0x10100000L | 2660 | #ifndef HAVE_OPENSSL_VERSION_NUM |
2654 | # define OpenSSL_version_num SSLeay | 2661 | # define OpenSSL_version_num SSLeay |
2655 | #endif | 2662 | #endif |
2656 | exit(OpenSSL_version_num() == OPENSSL_VERSION_NUMBER ? 0 : 1); | 2663 | exit(OpenSSL_version_num() == OPENSSL_VERSION_NUMBER ? 0 : 1); |
2657 | ]])], | 2664 | ]])], |