summaryrefslogtreecommitdiffstats
path: root/SoftHSMv2/m4/acx_openssl.m4
diff options
context:
space:
mode:
authorPramod Raghavendra Jayathirth <pramod.raghavendra.jayathirth@intel.com>2019-01-02 09:59:48 -0800
committerPramod Raghavendra Jayathirth <pramod.raghavendra.jayathirth@intel.com>2019-03-29 09:59:04 -0700
commit7626b75b3c71173ba62c2f92d22bab8f4291e44a (patch)
tree7308a2628a014fef0f245ef4f00408cf92d15e60 /SoftHSMv2/m4/acx_openssl.m4
parentf2ff7a136a152b36b3aa4d0d574796e6edbef24a (diff)
Update SoftHSM v2.0 to the latest version
Change-Id: Ib3ec2c297f897c82776a66fe2ad55b18984c0337 Issue-ID: AAF-687 Signed-off-by: Pramod Raghavendra Jayathirth <pramod.raghavendra.jayathirth@intel.com>
Diffstat (limited to 'SoftHSMv2/m4/acx_openssl.m4')
-rw-r--r--SoftHSMv2/m4/acx_openssl.m457
1 files changed, 31 insertions, 26 deletions
diff --git a/SoftHSMv2/m4/acx_openssl.m4 b/SoftHSMv2/m4/acx_openssl.m4
index e90c78f..2f1adad 100644
--- a/SoftHSMv2/m4/acx_openssl.m4
+++ b/SoftHSMv2/m4/acx_openssl.m4
@@ -2,18 +2,19 @@ AC_DEFUN([ACX_OPENSSL],[
AC_ARG_WITH(openssl,
AC_HELP_STRING([--with-openssl=PATH],[Specify prefix of path of OpenSSL]),
[
- OPENSSL_PATH="$withval"
+ OPENSSL_INCLUDES="-I$withval/include"
+ OPENSSL_LIBDIRS="-L$withval/lib"
],
[
- OPENSSL_PATH="/usr/local"
+ OPENSSL_INCLUDES=""
+ OPENSSL_LIBDIRS=""
])
AC_MSG_CHECKING(what are the OpenSSL includes)
- OPENSSL_INCLUDES="-I$OPENSSL_PATH/include"
AC_MSG_RESULT($OPENSSL_INCLUDES)
AC_MSG_CHECKING(what are the OpenSSL libs)
- OPENSSL_LIBS="-L$OPENSSL_PATH/lib -lcrypto"
+ OPENSSL_LIBS="$OPENSSL_LIBDIRS -lcrypto"
AC_MSG_RESULT($OPENSSL_LIBS)
tmp_CPPFLAGS=$CPPFLAGS
@@ -28,28 +29,32 @@ AC_DEFUN([ACX_OPENSSL],[
AC_MSG_CHECKING([for OpenSSL version])
CHECK_OPENSSL_VERSION=m4_format(0x%02x%02x%02x000L, $1, $2, $3)
AC_LANG_PUSH([C])
- AC_RUN_IFELSE([
- AC_LANG_SOURCE([[
- #include <openssl/ssl.h>
- #include <openssl/opensslv.h>
- int main()
- {
- #ifndef OPENSSL_VERSION_NUMBER
- return -1;
- #endif
- #if OPENSSL_VERSION_NUMBER >= $CHECK_OPENSSL_VERSION
- return 0;
- #else
- return 1;
- #endif
- }
- ]])
- ],[
- AC_MSG_RESULT([>= $1.$2.$3])
- ],[
- AC_MSG_RESULT([< $1.$2.$3])
- AC_MSG_ERROR([OpenSSL library too old ($1.$2.$3 or later required)])
- ],[])
+ AC_CACHE_VAL([acx_cv_lib_openssl_sufficient],[
+ acx_cv_lib_openssl_sufficient=no
+ AC_COMPILE_IFELSE([
+ AC_LANG_SOURCE([[
+ #include <openssl/ssl.h>
+ #include <openssl/opensslv.h>
+ int main()
+ {
+ #ifndef OPENSSL_VERSION_NUMBER
+ #error "OpenSSL version undefined"
+ #endif
+ #if OPENSSL_VERSION_NUMBER >= $CHECK_OPENSSL_VERSION
+ return 0;
+ #else
+ #error "OpenSSL too old"
+ #endif
+ }
+ ]])
+ ],[
+ AC_MSG_RESULT([>= $1.$2.$3])
+ acx_cv_lib_openssl_sufficient=yes
+ ],[
+ AC_MSG_RESULT([< $1.$2.$3])
+ AC_MSG_ERROR([OpenSSL library too old ($1.$2.$3 or later required)])
+ ])
+ ])
AC_LANG_POP([C])
CPPFLAGS=$tmp_CPPFLAGS