1 |
dnl |
2 |
dnl macros for configure.in to detect openssl |
3 |
dnl $Id: openssl.m4,v 1.6 2003/02/13 16:55:54 rjs3 Exp $ |
4 |
dnl |
5 |
|
6 |
AC_DEFUN(CMU_HAVE_OPENSSL, [ |
7 |
AC_ARG_WITH(openssl,[ --with-openssl=PATH use OpenSSL from PATH], |
8 |
with_openssl=$withval, with_openssl="yes") |
9 |
|
10 |
save_CPPFLAGS=$CPPFLAGS |
11 |
save_LDFLAGS=$LDFLAGS |
12 |
|
13 |
if test -d $with_openssl; then |
14 |
CPPFLAGS="${CPPFLAGS} -I${with_openssl}/include" |
15 |
LDFLAGS="${LDFLAGS} -L${with_openssl}/lib" |
16 |
fi |
17 |
|
18 |
case "$with_openssl" in |
19 |
no) |
20 |
with_openssl="no";; |
21 |
*) |
22 |
dnl if openssl has been compiled with the rsaref2 libraries, |
23 |
dnl we need to include the rsaref libraries in the crypto check |
24 |
LIB_RSAREF="" |
25 |
AC_CHECK_LIB(rsaref, RSAPublicEncrypt, |
26 |
LIB_RSAREF="-lRSAglue -lrsaref"; cmu_have_rsaref=yes, |
27 |
cmu_have_rsaref=no) |
28 |
|
29 |
AC_CHECK_HEADER(openssl/evp.h, [ |
30 |
AC_CHECK_LIB(crypto, EVP_DigestInit, |
31 |
with_openssl="yes", |
32 |
with_openssl="no", $LIB_RSAREF)], |
33 |
with_openssl=no) |
34 |
;; |
35 |
esac |
36 |
|
37 |
if test "$with_openssl" != "no"; then |
38 |
AC_DEFINE(HAVE_OPENSSL) |
39 |
else |
40 |
CPPFLAGS=$save_CPPFLAGS |
41 |
LDFLAGS=$save_LDFLAGS |
42 |
fi |
43 |
]) |