2 dnl macros for configure.in to detect openssl
3 dnl $Id: openssl.m4,v 1.11 2006/05/17 18:30:19 murch Exp $
6 AC_DEFUN([CMU_HAVE_OPENSSL], [
7 AC_REQUIRE([CMU_FIND_LIB_SUBDIR])
8 AC_ARG_WITH(openssl,[ --with-openssl=PATH use OpenSSL from PATH],
9 with_openssl=$withval, with_openssl="yes")
11 save_CPPFLAGS=$CPPFLAGS
14 if test -d $with_openssl; then
15 CPPFLAGS="${CPPFLAGS} -I${with_openssl}/include"
16 CMU_ADD_LIBPATH(${with_openssl}/$CMU_LIB_SUBDIR)
19 case "$with_openssl" in
23 dnl if openssl has been compiled with the rsaref2 libraries,
24 dnl we need to include the rsaref libraries in the crypto check
26 AC_CHECK_LIB(rsaref, RSAPublicEncrypt,
28 [AC_CHECK_LIB(RSAglue, RSAPublicEncrypt,
29 LIB_RSAREF="-lRSAglue -lrsaref",
30 LIB_RSAREF="-lrsaref")],
33 AC_CHECK_HEADER(openssl/evp.h, [
34 AC_CHECK_LIB(crypto, EVP_DigestInit,
36 with_openssl="no", $LIB_RSAREF)],
41 if test "$with_openssl" != "no"; then
42 AC_DEFINE(HAVE_OPENSSL,[],[Do we have OpenSSL?])
44 CPPFLAGS=$save_CPPFLAGS