From 81d8eda2419e7a23088a98cdfc52a305c9ceac0d Mon Sep 17 00:00:00 2001 From: Martin Ebourne Date: Wed, 7 Dec 2005 16:34:47 +0000 Subject: Merged martin/autoconf at r35 to trunk --- infrastructure/m4/ax_check_ssl.m4 | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 infrastructure/m4/ax_check_ssl.m4 (limited to 'infrastructure/m4/ax_check_ssl.m4') diff --git a/infrastructure/m4/ax_check_ssl.m4 b/infrastructure/m4/ax_check_ssl.m4 new file mode 100644 index 00000000..039c8398 --- /dev/null +++ b/infrastructure/m4/ax_check_ssl.m4 @@ -0,0 +1,37 @@ +dnl @synopsis AX_CHECK_SSL([ACTION-IF-TRUE], [ACTION-IF-FALSE]) +dnl +dnl This macro will check for OpenSSL in the standard path, allowing the user +dnl to specify a directory if it is not found. The user uses +dnl '--with-ssl-headers=/path/to/headers' or +dnl '--with-ssl-lib=/path/to/lib' as arguments to configure. +dnl +dnl If OpenSSL is found the include directory gets added to CPPFLAGS, +dnl '-lcrypto', '-lssl', and the libraries directory are added to LDFLAGS. +dnl Also HAVE_SSL is defined to 1, and ACTION-IF-TRUE and ACTION-IF-FALSE are +dnl run as appropriate +dnl +dnl @category InstalledPackages +dnl @author Martin Ebourne +dnl @version 2005/07/01 +dnl @license AllPermissive + +AC_DEFUN([AX_CHECK_SSL], [ + AC_ARG_WITH( + [ssl-headers], + [AC_HELP_STRING([--with-ssl-headers=DIR], [SSL include files location])], + [CPPFLAGS="$CPPFLAGS -I$withval"]) + AC_ARG_WITH( + [ssl-lib], + [AC_HELP_STRING([--with-ssl-lib=DIR], [SSL library location])], + [LDFLAGS="$LDFLAGS -L$withval"]) + + ax_check_ssl_found=yes + AC_CHECK_HEADERS([openssl/ssl.h],, [ax_check_ssl_found=no]) + AC_CHECK_LIB([ssl], [SSL_read],, [ax_check_ssl_found=no]) + + if test "x$ax_check_ssl_found" = "xyes"; then + AC_DEFINE([HAVE_SSL], 1, [Define to 1 if SSL is available]) + m4_ifvaln([$1],[$1],[:])dnl + m4_ifvaln([$2],[else $2])dnl + fi + ])dnl -- cgit v1.2.3