1 dnl $Id: ssl-check.m4,v 1.9 2003-06-08 16:04:49 srittau Exp $
2 dnl Autoconf macro to check for SSL or OpenSSL
4 AC_DEFUN([AC_PATH_GCRYPT], [
12 AC_ARG_ENABLE(libgcrypt, [ --disable-gcrypt disable compilation with libgcrypt], [
13 if test "x$enableval" != "xdisable"; 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`"
34 AC_SUBST(GCRYPT_CFLAGS)
36 AM_CONDITIONAL(HAVE_GCRYPT, test -n "$GCRYPT_CONFIG")
39 AC_DEFUN([AC_PATH_SSL], [
40 AC_ARG_WITH(ssl-dir, [ --with-ssl-dir=PATH specify path to OpenSSL installation (must contain
41 lib and include dirs)],
43 if test "x$withval" = "xno"; then
45 elif test "x$withval" = "xyes"; then
49 dnl FIXME: should only try in $withval
60 if test "$tryssl" = "yes"; then
61 AC_MSG_CHECKING([for SSL])
62 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
63 if test -f "$ssldir/include/openssl/cast.h" ; then
64 SSL_CFLAGS="$SSL_CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
65 SSL_LIBS="$SSL_LIBS -L$ssldir/lib -L$ssldir -lcrypto"
66 if test "x$need_dash_r" = "xyes"; then
67 SSL_LIBS="$SSL_LIBS -R$ssldir/lib -R$ssldir"
69 AC_MSG_RESULT([$ssldir (enabling RANDNUM and DHX support)])
71 dnl FIXME: The following looks crude and probably doesn't work properly.
72 dnl Check for the crypto library:
73 AC_CHECK_LIB(crypto, main)
74 dnl Check for "DES" library (for SSLeay, not openssl):
75 AC_CHECK_LIB(des, main)
77 AC_DEFINE(OPENSSL_DHX, 1, [Define if the OpenSSL DHX modules should be built])
78 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
83 if test "x$compile_ssl" = "xno"; then