X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=m4%2Fopenssl.m4;h=32e41de76db75c55ecab6c75f862ac739f8c9761;hp=d933b23bb59b505c84f3c47fb6d5675ff74f5a24;hb=4370b98bb1dfa9eb1e400549cb6fcb6711aa1b29;hpb=9ddb37cee0f754ef88a55f692a508010fe18c782 diff --git a/m4/openssl.m4 b/m4/openssl.m4 index d933b23b..32e41de7 100644 --- a/m4/openssl.m4 +++ b/m4/openssl.m4 @@ -1,81 +1,66 @@ dnl Check to find the OpenSSL headers/libraries - AC_DEFUN(tinc_OPENSSL, [ + tinc_ac_save_CPPFLAGS="$CPPFLAGS" + AC_ARG_WITH(openssl, - [ --with-openssl=DIR OpenSSL library and headers prefix], - [openssl_lib="$withval/lib" - openssl_include="$withval/include"] + AC_HELP_STRING([--with-openssl=DIR], [OpenSSL base directory, or:]), + [openssl="$withval" + CFLAGS="$CFLAGS -I$withval/include" + CPPFLAGS="$CPPFLAGS -I$withval/include" + LIBS="$LIBS -L$withval/lib"] ) - AC_CACHE_CHECK([for openssl headers], tinc_cv_openssl_include, - [ - AC_ARG_WITH(openssl-include, - [ --with-openssl-include=DIR OpenSSL headers directory], - [tinc_cv_openssl_include="$withval"], - [if test "x$openssl_include" = "x" ; then - tinc_cv_openssl_include="none given" - else - tinc_cv_openssl_include=$openssl_include - fi] - ) - ]) - AC_CACHE_CHECK([for openssl libraries], tinc_cv_openssl_lib, - [ - AC_ARG_WITH(openssl-lib, - [ --with-openssl-lib=DIR OpenSSL library directory], - [tinc_cv_openssl_lib="$withval"], - [if test "x$openssl_lib" = "x" ; then - tinc_cv_openssl_lib="none given" - else - tinc_cv_openssl_lib=$openssl_lib - fi] - ) - ]) - -if test "$openssl_lib" != "none given" ; then - LIBS="$LIBS -L$tinc_cv_openssl_lib" -fi -if test "$openssl_include" != "none given" ; then - INCLUDES="$INCLUDES -I$tinc_cv_openssl_include" -fi - -osi=none -AC_CHECK_HEADERS(evp.h rsa.h, -[osi=found - break]) - -if test "$osi" = "none" ; then - AC_CHECK_HEADERS(openssl/evp.h openssl/rsa.h, - [osi=found - break]) -fi - -libcrypto=none + AC_ARG_WITH(openssl-include, + AC_HELP_STRING([--with-openssl-include=DIR], [OpenSSL headers directory (without trailing /openssl)]), + [openssl_include="$withval" + CFLAGS="$CFLAGS -I$withval" + CPPFLAGS="$CPPFLAGS -I$withval"] + ) -if test "$osi" = "found" ; then - AC_CHECK_LIB(crypto, SHA1_version, [ - libcrypto=yes - ]) -fi + AC_ARG_WITH(openssl-lib, + AC_HELP_STRING([--with-openssl-lib=DIR], [OpenSSL library directory]), + [openssl_lib="$withval" + LIBS="$LIBS -L$withval"] + ) -if test $libcrypto = none; then -cat <] + ) ])