1 dnl $Id: ssl-check.m4,v 1.8.6.3 2004-04-21 00:56:59 bfernhomberg Exp $
2 dnl Autoconf macro to check for SSL or OpenSSL
10 AC_CHECK_HEADERS(crypt.h)
11 AC_CHECK_LIB(crypt, main)
20 AC_DEFUN([AC_PATH_SSL], [
21 AC_ARG_WITH(ssl-dir, [ --with-ssl-dir=PATH specify path to OpenSSL installation (must contain
22 lib and include dirs)],
24 if test "x$withval" = "xno"; then
26 elif test "x$withval" = "xyes"; then
30 dnl FIXME: should only try in $withval
42 dnl make sure atalk_libname is defined beforehand
43 [[ -n "$atalk_libname" ]] || AC_MSG_ERROR([internal error, atalk_libname undefined])
45 if test "$tryssl" = "yes"; then
46 AC_MSG_CHECKING([for SSL])
47 for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/$atalk_libname/openssl /usr/local/ssl /usr/$atalk_libname/ssl /usr/local /usr/pkg /opt /opt/openssl /usr/local/ssl ; do
48 if test -f "$ssldir/include/openssl/cast.h" ; then
49 SSL_CFLAGS="$SSL_CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
50 SSL_LIBS="$SSL_LIBS -L$ssldir/$atalk_libname -L$ssldir -lcrypto"
51 if test "x$need_dash_r" = "xyes"; then
52 SSL_LIBS="$SSL_LIBS -R$ssldir/$atalk_libname -R$ssldir"
54 AC_MSG_RESULT([$ssldir (enabling RANDNUM and DHX support)])
56 dnl FIXME: The following looks crude and probably doesn't work properly.
57 dnl Check for the crypto library:
58 AC_CHECK_LIB(crypto, main)
59 dnl Check for "DES" library (for SSLeay, not openssl):
60 AC_CHECK_LIB(des, main)
62 AC_DEFINE(OPENSSL_DHX, 1, [Define if the OpenSSL DHX modules should be built])
63 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
68 if test "x$compile_ssl" = "xno"; then
72 CFLAGS_REMOVE_USR_INCLUDE(SSL_CFLAGS)
73 LIB_REMOVE_USR_LIB(SSL_LIBS)