]> arthur.barton.de Git - netatalk.git/blob - macros/ssl-check.m4
Minor cleanups.
[netatalk.git] / macros / ssl-check.m4
1 dnl $Id: ssl-check.m4,v 1.4 2001-12-01 15:17:33 srittau Exp $
2 dnl Autoconf macro to check for SSL or OpenSSL
3
4 AC_DEFUN([AC_PATH_SSL], [
5         AC_ARG_WITH(ssl-dir, [  --with-ssl-dir=PATH     specify path to OpenSSL installation (must contain
6                           lib and include dirs)],
7                 [
8                         if test "x$withval" = "xno"; then
9                                 tryssl=no
10                         else
11                                 tryssldir="$withval"
12                         fi
13                 ], [tryssl=yes]
14         )
15
16         SSL_CFLAGS=""
17         SSL_LIBS=""
18         compile_ssl=no
19
20         if test "$tryssl" = "yes"; then
21                 AC_MSG_CHECKING([for SSL])
22                 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
23                         if test -f "$ssldir/include/openssl/cast.h" ; then
24                                 SSL_CFLAGS="$SSL_CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
25                                 SSL_LIBS="$SSL_LIBS -L$ssldir/lib -L$ssldir -lcrypto"
26                                 if test "x$need_dash_r" = "xyes"; then
27                                         SSL_LIBS="$SSL_LIBS -R$ssldir/lib -R$ssldir"
28                                 fi
29                                 AC_MSG_RESULT([$ssldir (enabling RANDNUM and DHX support)])
30
31 dnl FIXME: The following looks crude and probably doesn't work properly.
32                                 dnl Check for the crypto library:
33                                 AC_CHECK_LIB(crypto, main)
34                                 dnl Check for "DES" library (for SSLeay, not openssl):
35                                 AC_CHECK_LIB(des, main)
36
37                                 AC_DEFINE(OPENSSL_DHX,  1)
38                                 AC_DEFINE(UAM_DHX,      1)
39                                 compile_ssl=yes
40                                 break
41                         fi
42                 done
43                 if test "x$compile_ssl" = "xno"; then
44                         AC_MSG_RESULT([no])
45                 fi
46         fi
47         AC_SUBST(SSL_CFLAGS)
48         AC_SUBST(SSL_LIBS)
49 ])