1 dnl Check to find the OpenSSL headers/libraries
5 tinc_ac_save_CPPFLAGS="$CPPFLAGS"
7 AC_ARG_WITH(openssl-include,
8 [ --with-openssl-include=DIR OpenSSL headers directory (without trailing /openssl)],
9 [openssl_include="$withval"
10 CFLAGS="$CFLAGS -I$withval"
11 CPPFLAGS="$CPPFLAGS -I$withval"]
14 AC_ARG_WITH(openssl-lib,
15 [ --with-openssl-lib=DIR OpenSSL library directory],
16 [openssl_lib="$withval"
17 LIBS="$LIBS -L$withval"]
20 AC_CHECK_HEADERS(openssl/evp.h openssl/rsa.h openssl/rand.h openssl/err.h openssl/sha.h openssl/pem.h,
22 [AC_MSG_ERROR("OpenSSL header files not found."); break]
25 CPPFLAGS="$tinc_ac_save_CPPFLAGS"
27 AC_CHECK_LIB(crypto, SHA1_version,
28 [LIBS="$LIBS -lcrypto"],
29 [AC_MSG_ERROR("OpenSSL libraries not found.")]
32 AC_CHECK_FUNCS(RAND_pseudo_bytes)
36 AC_CHECK_LIB(dl, dlopen,
38 [AC_MSG_ERROR("OpenSSL depends on libdl.")]