1 dnl $Id: ssl-check.m4,v 1.12 2004-01-14 16:10:29 bfernhomberg Exp $
2 dnl Autoconf macro to check for SSL or OpenSSL
4 AC_DEFUN([AC_PATH_GCRYPT], [
12 AC_ARG_ENABLE(gcrypt, [ --disable-gcrypt disable compilation with libgcrypt], [
13 if test "x$enableval" != "xno"; then
21 if test "x$search" == "xyes"; then
22 AC_PATH_PROG([GCRYPT_CONFIG], [libgcrypt-config], [no])
24 if test "x$GCRYPT_CONFIG" == "xno"; then
25 if test "x$errifnotfound" == "xyes"; then
26 AC_MSG_ERROR([libgcrypt-config not found])
29 GCRYPT_CFLAGS="`$GCRYPT_CONFIG --cflags`"
30 GCRYPT_LIBS="`$GCRYPT_CONFIG --libs`"
31 AC_DEFINE(HAVE_GCRYPT, 1, [Define if libgcrypt is available])
35 AC_SUBST(GCRYPT_CFLAGS)
37 AM_CONDITIONAL(HAVE_GCRYPT, test "x$GCRYPT_CONFIG" != "xno")
40 AC_DEFUN([AC_PATH_SSL], [
41 AC_ARG_WITH(ssl-dir, [ --with-ssl-dir=PATH specify path to OpenSSL installation (must contain
42 lib and include dirs)],
44 if test "x$withval" = "xno"; then
46 elif test "x$withval" = "xyes"; then
50 dnl FIXME: should only try in $withval
61 if test "$tryssl" = "yes"; then
62 AC_MSG_CHECKING([for SSL])
63 for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl /usr/local/ssl ; do
64 if test -f "$ssldir/include/openssl/cast.h" ; then
65 SSL_CFLAGS="$SSL_CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
66 SSL_LIBS="$SSL_LIBS -L$ssldir/lib -L$ssldir -lcrypto"
67 if test "x$need_dash_r" = "xyes"; then
68 SSL_LIBS="$SSL_LIBS -R$ssldir/lib -R$ssldir"
70 AC_MSG_RESULT([$ssldir (enabling RANDNUM and DHX support)])
72 AC_DEFINE(OPENSSL_DHX, 1, [Define if the OpenSSL DHX modules should be built])
73 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
78 if test "x$compile_ssl" = "xno"; then