X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fgl-openssl.m4;h=c8f9dd95e6894484eca90cf2a7264f459a2d9f66;hb=43593319b31e6b0175b8eec4433bac744959822d;hp=85bf85f8ad97c4a55f5de92adc6f7b4924c809a5;hpb=8209e72bf20d2b582384e91fde65df4f848a3a04;p=gnulib.git diff --git a/m4/gl-openssl.m4 b/m4/gl-openssl.m4 index 85bf85f8a..c8f9dd95e 100644 --- a/m4/gl-openssl.m4 +++ b/m4/gl-openssl.m4 @@ -1,17 +1,27 @@ -# gl-openssl.m4 serial 1 +# gl-openssl.m4 serial 3 dnl Copyright (C) 2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +AC_DEFUN([gl_SET_CRYPTO_CHECK_DEFAULT], +[ + m4_define([gl_CRYPTO_CHECK_DEFAULT], [$1]) +]) +gl_SET_CRYPTO_CHECK_DEFAULT([no]) + AC_DEFUN([gl_CRYPTO_CHECK], [ + m4_divert_once([DEFAULTS], [with_openssl_default='gl_CRYPTO_CHECK_DEFAULT']) + AC_ARG_WITH([openssl], [AS_HELP_STRING([--with-openssl], [use libcrypto hash routines. Valid ARGs are: - 'yes', 'no', 'optional' => use if available])], + 'yes', 'no', 'auto' => use if available, + 'optional' => use if available and warn if not available; + default is ']gl_CRYPTO_CHECK_DEFAULT['])], [], - [with_openssl=no]) + [with_openssl=$with_openssl_default]) if test "x$1" = xMD5; then ALG_header=md5.h @@ -24,13 +34,13 @@ AC_DEFUN([gl_CRYPTO_CHECK], if test "x$with_openssl" != xno; then AC_CHECK_LIB([crypto], [$1], [AC_CHECK_HEADERS([openssl/$ALG_header], - [LIB_CRYPTO='-lcrypto' - AC_DEFINE([HAVE_OPENSSL_$1],[1], - [Define to 1 if libcrypto is used for $1])])]) + [LIB_CRYPTO=-lcrypto + AC_DEFINE([HAVE_OPENSSL_$1], [1], + [Define to 1 if libcrypto is used for $1.])])]) if test "x$LIB_CRYPTO" = x; then if test "x$with_openssl" = xyes; then AC_MSG_ERROR([openssl development library not found for $1]) - else + elif test "x$with_openssl" = xoptional; then AC_MSG_WARN([openssl development library not found for $1]) fi fi