2000-11-13 22:01:27 +00:00
|
|
|
dnl Check to find the OpenSSL headers/libraries
|
|
|
|
|
|
|
|
AC_DEFUN(tinc_OPENSSL,
|
|
|
|
[
|
2001-06-07 07:51:04 +00:00
|
|
|
tinc_ac_save_CPPFLAGS="$CPPFLAGS"
|
2000-11-13 22:01:27 +00:00
|
|
|
|
2001-06-07 07:51:04 +00:00
|
|
|
AC_ARG_WITH(openssl-include,
|
|
|
|
[ --with-openssl-include=DIR OpenSSL headers directory (without trailing /openssl)],
|
|
|
|
[openssl_include="$withval"
|
|
|
|
CFLAGS="$CFLAGS -I$withval"
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$withval"]
|
|
|
|
)
|
2000-11-14 22:57:19 +00:00
|
|
|
|
2001-06-07 07:51:04 +00:00
|
|
|
AC_ARG_WITH(openssl-lib,
|
|
|
|
[ --with-openssl-lib=DIR OpenSSL library directory],
|
|
|
|
[openssl_lib="$withval"
|
|
|
|
LIBS="$LIBS -L$withval"]
|
|
|
|
)
|
2000-11-14 22:57:19 +00:00
|
|
|
|
2000-11-28 23:12:57 +00:00
|
|
|
AC_CHECK_HEADERS(openssl/evp.h openssl/rsa.h openssl/rand.h openssl/err.h openssl/sha.h openssl/pem.h,
|
2001-06-07 07:51:04 +00:00
|
|
|
[],
|
2002-06-11 11:03:17 +00:00
|
|
|
[AC_MSG_ERROR([OpenSSL header files not found.]); break]
|
2001-06-07 07:51:04 +00:00
|
|
|
)
|
2000-11-13 22:01:27 +00:00
|
|
|
|
2001-06-07 07:51:04 +00:00
|
|
|
CPPFLAGS="$tinc_ac_save_CPPFLAGS"
|
2000-11-13 22:01:27 +00:00
|
|
|
|
2001-06-07 07:51:04 +00:00
|
|
|
AC_CHECK_LIB(crypto, SHA1_version,
|
|
|
|
[LIBS="$LIBS -lcrypto"],
|
2002-06-11 11:03:17 +00:00
|
|
|
[AC_MSG_ERROR([OpenSSL libraries not found.])]
|
2001-06-07 07:51:04 +00:00
|
|
|
)
|
2001-06-21 16:37:05 +00:00
|
|
|
|
2001-07-04 08:41:36 +00:00
|
|
|
AC_CHECK_FUNCS(RAND_pseudo_bytes)
|
|
|
|
|
2002-02-10 21:57:54 +00:00
|
|
|
AC_CHECK_FUNC(OpenSSL_add_all_algorithms,
|
|
|
|
[],
|
2002-06-11 11:03:17 +00:00
|
|
|
[AC_CHECK_FUNC(SSLeay_add_all_algorithms,
|
|
|
|
[AC_DEFINE(HAVE_SSLEAY_ADD_ALL_ALGORITHMS, 1, [Defined if this function should be used instead of OpenSLL_add_all_algorithms])],
|
|
|
|
[AC_MSG_ERROR([Missing required OpenSSL functionality!])]
|
|
|
|
)]
|
2002-02-10 21:57:54 +00:00
|
|
|
)
|
|
|
|
|
2001-06-29 14:15:46 +00:00
|
|
|
AC_CHECK_FUNC(dlopen,
|
|
|
|
[],
|
2002-06-11 11:03:17 +00:00
|
|
|
[AC_CHECK_LIB(dl, dlopen,
|
2001-06-29 14:15:46 +00:00
|
|
|
[LIBS="$LIBS -ldl"],
|
2002-06-11 11:03:17 +00:00
|
|
|
[AC_MSG_ERROR([OpenSSL depends on libdl.])]
|
|
|
|
)]
|
2001-06-21 16:37:05 +00:00
|
|
|
)
|
2000-11-13 22:01:27 +00:00
|
|
|
])
|