1 dnl Autoconf macro to check for SSL or OpenSSL
3 AC_DEFUN([AC_NETATALK_CRYPT], [
9 AC_CHECK_HEADERS(crypt.h)
10 AC_CHECK_LIB(crypt, main)
19 AC_DEFUN([AC_NETATALK_PATH_SSL], [
20 AC_ARG_WITH(ssl-dir, [ --with-ssl-dir=PATH specify path to OpenSSL installation (must contain
21 lib and include dirs)],
23 if test "x$withval" = "xno"; then
25 elif test "x$withval" = "xyes"; then
29 dnl FIXME: should only try in $withval
40 neta_cv_have_openssl=no
43 dnl make sure atalk_libname is defined beforehand
44 [[ -n "$atalk_libname" ]] || AC_MSG_ERROR([internal error, atalk_libname undefined])
46 if test "$tryssl" = "yes"; then
47 AC_MSG_CHECKING([for SSL])
48 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
49 if test -f "$ssldir/include/openssl/cast.h" ; then
50 SSL_CFLAGS="$SSL_CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
51 SSL_LIBS="$SSL_LIBS -L$ssldir/$atalk_libname -L$ssldir -lcrypto"
52 if test "x$need_dash_r" = "xyes"; then
53 SSL_LIBS="$SSL_LIBS -R$ssldir/$atalk_libname -R$ssldir"
55 AC_MSG_RESULT([$ssldir (enabling RANDNUM and DHX support)])
56 CFLAGS="$CFLAGS $SSL_CFLAGS"
57 LIBS="$LIBS $SSL_LIBS"
59 dnl FIXME: The following looks crude and probably doesn't work properly.
60 dnl Check for the crypto library:
61 AC_CHECK_LIB(crypto, main)
62 dnl Check for "DES" library (for SSLeay, not openssl):
63 AC_CHECK_LIB(des, main)
65 AC_DEFINE(OPENSSL_DHX, 1, [Define if the OpenSSL DHX modules should be built])
66 AC_DEFINE(UAM_DHX, 1, [Define if the DHX UAM modules should be compiled])
67 neta_cv_have_openssl=yes
68 neta_cv_compile_dhx=yes
74 if test "x$neta_cv_have_openssl" = "xno"; then
78 CFLAGS_REMOVE_USR_INCLUDE(SSL_CFLAGS)
79 LIB_REMOVE_USR_LIB(SSL_LIBS)