X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=blobdiff_plain;f=ac%2Fopenssl.m4;h=f38419e14169267a0bbe344a983b81b31f3662c8;hp=e50b399bd9d7a79c7c75da2591fd614324d93f9a;hb=70ff69729ba9dfb554205d623bf54eb0f680dd15;hpb=91e8ab0aafe43dc73219521aad8fe636428eb704 diff --git a/ac/openssl.m4 b/ac/openssl.m4 index e50b399bd..f38419e14 100644 --- a/ac/openssl.m4 +++ b/ac/openssl.m4 @@ -2,12 +2,14 @@ dnl ****************************** dnl OpenSSL dnl ****************************** -AC_DEFUN(AM_PATH_OPENSSL, +AC_DEFUN([AM_PATH_OPENSSL], [dnl + USE_OPENSSL=0 + AC_ARG_ENABLE(openssl, [ --enable-openssl Attempt to use OpenSSL for SSL support.], [ac_cv_enable_openssl=$enableval], [ac_cv_enable_openssl=no]) - dnl delect OpenSSL + dnl detect OpenSSL if test "x${ac_cv_enable_openssl}" != "xno"; then AC_ARG_WITH(openssl-includes, [ --with-openssl-includes=PREFIX Location of OpenSSL includes.], with_openssl_includes="$withval", with_openssl_includes="/usr/include") @@ -36,8 +38,6 @@ AC_DEFUN(AM_PATH_OPENSSL, AC_ARG_WITH(openssl-libs, [ --with-openssl-libs=PREFIX Location of OpenSSL libs.], with_openssl_libs="$withval") if test "x${with_openssl_libs}" != "xno" -a "x${have_openssl_includes}" != "xno"; then - LIBS_save="$LIBS" - case $with_openssl_libs in ""|-L*) ;; *) with_openssl_libs="-L$with_openssl_libs" ;; @@ -46,12 +46,14 @@ AC_DEFUN(AM_PATH_OPENSSL, AC_CHECK_LIB(dl, dlopen, DL_LIBS="-ldl", DL_LIBS="") AC_CACHE_CHECK([for OpenSSL libraries], openssl_libs, [ + LIBS_save="$LIBS" LIBS="$LIBS $with_openssl_libs -lssl -lcrypto $DL_LIBS" AC_TRY_LINK_FUNC(SSL_read, openssl_libs="yes", openssl_libs="no") LIBS="$LIBS_save" ]) if test "x${openssl_libs}" != "xno"; then AC_DEFINE(USE_OPENSSL, 1, [Define if you use OpenSSL to support SSL]) + USE_OPENSSL=1 msg_ssl="yes (OpenSSL)" OPENSSL_LIBS="$with_openssl_libs -lssl -lcrypto $DL_LIBS" else @@ -70,4 +72,4 @@ AC_DEFUN(AM_PATH_OPENSSL, AC_SUBST(OPENSSL_CFLAGS) AC_SUBST(OPENSSL_LIBS) -]) \ No newline at end of file +])