diff options
author | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-08-07 14:00:58 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-08-11 16:00:36 +0300 |
commit | 4450e0a0e9f6ac7f63e6b30b94f456386e07011b (patch) | |
tree | df3f0ed028be838857d2d326cb184325964ece29 /platform/linux-generic/m4/odp_openssl.m4 | |
parent | a2d4eb703033ba73d8ac0ac2368ce40ab1f44bab (diff) |
linux-generic: move openssl checks inside linux-generic
openssl is not requirement for other platform.
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Nicolas Morey-Chaisemartin <morey@kalray.eu>
Reviewed-by: Anders Roxell <anders.roxell@linaro.org>
Diffstat (limited to 'platform/linux-generic/m4/odp_openssl.m4')
-rw-r--r-- | platform/linux-generic/m4/odp_openssl.m4 | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/platform/linux-generic/m4/odp_openssl.m4 b/platform/linux-generic/m4/odp_openssl.m4 new file mode 100644 index 000000000..2344914b7 --- /dev/null +++ b/platform/linux-generic/m4/odp_openssl.m4 @@ -0,0 +1,32 @@ +########################################################################## +# Set optional OpenSSL path +########################################################################## +AC_ARG_WITH([openssl-path], +AC_HELP_STRING([--with-openssl-path=DIR path to openssl libs and headers], + [(or in the default path if not specified).]), + [OPENSSL_PATH=$withval + AM_CPPFLAGS="$AM_CPPFLAGS -I$OPENSSL_PATH/include" + AM_LDFLAGS="$AM_LDFLAGS -L$OPENSSL_PATH/lib" + ],[]) + +########################################################################## +# Save and set temporary compilation flags +########################################################################## +OLD_LDFLAGS=$LDFLAGS +OLD_CPPFLAGS=$CPPFLAGS +LDFLAGS="$AM_LDFLAGS $LDFLAGS" +CPPFLAGS="$AM_CPPFLAGS $CPPFLAGS" + +########################################################################## +# Check for OpenSSL availability +########################################################################## +AC_CHECK_LIB([crypto], [EVP_EncryptInit], [], + [AC_MSG_FAILURE([OpenSSL libraries required])]) +AC_CHECK_HEADERS([openssl/des.h openssl/rand.h openssl/hmac.h openssl/evp.h], [], + [AC_MSG_ERROR([OpenSSL headers required])]) + +########################################################################## +# Restore old saved variables +########################################################################## +LDFLAGS=$OLD_LDFLAGS +CPPFLAGS=$OLD_CPPFLAGS |