sac-openssl.m4 996 Bytes
Newer Older
Pekka Pessi's avatar
Pekka Pessi committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
dnl ======================================================================
dnl SAC_OPENSSL
dnl ======================================================================
AC_DEFUN([SAC_OPENSSL], [

AC_ARG_WITH(openssl,
[  --with-openssl          use OpenSSL (enabled)],, with_openssl=yes)

dnl SOSXXX:SAC_ASSERT_DEF([openssl libraries])

if test "$with_openssl" != no  ;then
  AC_CHECK_HEADERS(openssl/tls1.h, [

    HAVE_OPENSSL=1 HAVE_TLS=1

    AC_CHECK_LIB(crypto, BIO_new,, 
    	HAVE_OPENSSL=0
    	AC_MSG_WARN(OpenSSL crypto library was not found))

    AC_CHECK_LIB(ssl, TLSv1_method,, 
    	HAVE_TLS=0
    	AC_MSG_WARN(OpenSSL protocol library was not found))

    if test x$HAVE_OPENSSL = x1; then
25
      AC_DEFINE([HAVE_OPENSSL], 1, [Define to 1 if you have OpenSSL])
Pekka Pessi's avatar
Pekka Pessi committed
26 27 28
    fi

    if test x$HAVE_TLS = x1; then
29
      AC_DEFINE([HAVE_TLS], 1, [Define to 1 if you have TLS])
Pekka Pessi's avatar
Pekka Pessi committed
30 31 32 33 34 35 36
    fi
  ],
  AC_MSG_WARN(OpenSSL include files were not found))
fi

AM_CONDITIONAL(HAVE_TLS, test x$HAVE_TLS = x1)
])