2006-12-21 01:30:28 -05:00
|
|
|
dnl ======================================================================
|
|
|
|
dnl SAC_OPENSSL
|
|
|
|
dnl ======================================================================
|
|
|
|
AC_DEFUN([SAC_OPENSSL], [
|
|
|
|
|
|
|
|
AC_ARG_WITH(openssl,
|
2007-04-14 22:03:41 -04:00
|
|
|
[ --with-openssl use OpenSSL [[enabled]]],, with_openssl=pkg-config)
|
2006-12-21 01:30:28 -05:00
|
|
|
|
|
|
|
dnl SOSXXX:SAC_ASSERT_DEF([openssl libraries])
|
|
|
|
|
|
|
|
|
2007-04-14 22:03:41 -04:00
|
|
|
if test "$with_openssl" = no ;then
|
|
|
|
: # No openssl
|
|
|
|
else
|
|
|
|
|
2008-12-16 13:05:22 -05:00
|
|
|
if test "$with_openssl" = "pkg-config" ; then
|
2007-04-14 22:03:41 -04:00
|
|
|
PKG_CHECK_MODULES(openssl, openssl,
|
|
|
|
[HAVE_TLS=1 HAVE_OPENSSL=1 LIBS="$openssl_LIBS $LIBS"],
|
|
|
|
[HAVE_OPENSSL=0])
|
|
|
|
fi
|
|
|
|
|
2008-12-16 14:40:34 -05:00
|
|
|
if test x$HAVE_OPENSSL = x1 ; then
|
2007-04-14 22:03:41 -04:00
|
|
|
AC_DEFINE([HAVE_LIBCRYPTO], 1, [Define to 1 if you have the `crypto' library (-lcrypto).])
|
|
|
|
AC_DEFINE([HAVE_LIBSSL], 1, [Define to 1 if you have the `ssl' library (-lssl).])
|
|
|
|
else
|
|
|
|
AC_CHECK_HEADERS([openssl/tls1.h], [
|
|
|
|
HAVE_OPENSSL=1 HAVE_TLS=1
|
|
|
|
|
2008-12-16 13:05:22 -05:00
|
|
|
AC_CHECK_LIB(crypto, BIO_new,,
|
2007-04-14 22:03:41 -04:00
|
|
|
HAVE_OPENSSL=0
|
|
|
|
AC_MSG_WARN(OpenSSL crypto library was not found))
|
|
|
|
|
2008-12-16 13:05:22 -05:00
|
|
|
AC_CHECK_LIB(ssl, TLSv1_method,,
|
2007-04-14 22:03:41 -04:00
|
|
|
HAVE_TLS=0
|
|
|
|
AC_MSG_WARN(OpenSSL protocol library was not found))
|
|
|
|
],[AC_MSG_WARN(OpenSSL include files were not found)])
|
|
|
|
fi
|
2008-12-16 13:05:22 -05:00
|
|
|
|
2007-04-14 22:03:41 -04:00
|
|
|
if test x$HAVE_OPENSSL = x1; then
|
|
|
|
AC_DEFINE([HAVE_OPENSSL], 1, [Define to 1 if you have OpenSSL])
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test x$HAVE_TLS = x1; then
|
|
|
|
AC_DEFINE([HAVE_TLS], 1, [Define to 1 if you have TLS])
|
|
|
|
fi
|
2006-12-21 01:30:28 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL(HAVE_TLS, test x$HAVE_TLS = x1)
|
|
|
|
])
|