2000-11-13 22:01:27 +00:00
|
|
|
dnl Check to find the OpenSSL headers/libraries
|
|
|
|
|
|
|
|
|
|
|
|
AC_DEFUN(tinc_OPENSSL,
|
|
|
|
[
|
2000-11-14 22:57:19 +00:00
|
|
|
AC_ARG_WITH(openssl,
|
|
|
|
[ --with-openssl=DIR OpenSSL library and headers prefix],
|
|
|
|
[openssl_lib="$withval/lib"
|
|
|
|
openssl_include="$withval/include"]
|
|
|
|
)
|
|
|
|
AC_CACHE_CHECK([for openssl headers], tinc_cv_openssl_include,
|
2000-11-13 22:01:27 +00:00
|
|
|
[
|
|
|
|
AC_ARG_WITH(openssl-include,
|
|
|
|
[ --with-openssl-include=DIR OpenSSL headers directory],
|
2000-11-14 22:57:19 +00:00
|
|
|
[tinc_cv_openssl_include="$withval"],
|
|
|
|
[if test "x$openssl_include" = "x" ; then
|
|
|
|
tinc_cv_openssl_include="none given"
|
|
|
|
else
|
|
|
|
tinc_cv_openssl_include=$openssl_include
|
|
|
|
fi]
|
2000-11-13 22:01:27 +00:00
|
|
|
)
|
2000-11-14 22:57:19 +00:00
|
|
|
])
|
|
|
|
AC_CACHE_CHECK([for openssl libraries], tinc_cv_openssl_lib,
|
|
|
|
[
|
2000-11-13 22:01:27 +00:00
|
|
|
AC_ARG_WITH(openssl-lib,
|
|
|
|
[ --with-openssl-lib=DIR OpenSSL library directory],
|
2000-11-14 22:57:19 +00:00
|
|
|
[tinc_cv_openssl_lib="$withval"],
|
|
|
|
[if test "x$openssl_lib" = "x" ; then
|
|
|
|
tinc_cv_openssl_lib="none given"
|
|
|
|
else
|
|
|
|
tinc_cv_openssl_lib=$openssl_lib
|
|
|
|
fi]
|
2000-11-13 22:01:27 +00:00
|
|
|
)
|
2000-11-14 22:57:19 +00:00
|
|
|
])
|
2000-11-13 22:01:27 +00:00
|
|
|
|
2000-11-14 23:02:08 +00:00
|
|
|
if test "$tinc_cv_openssl_lib" != "none given" ; then
|
2000-11-14 22:57:19 +00:00
|
|
|
LIBS="$LIBS -L$tinc_cv_openssl_lib"
|
2000-11-13 22:01:27 +00:00
|
|
|
fi
|
2000-11-14 23:02:08 +00:00
|
|
|
if test "$tinc_cv_openssl_include" != "none given" ; then
|
2000-11-24 14:12:31 +00:00
|
|
|
CFLAGS="$CFLAGS -I$tinc_cv_openssl_include"
|
2000-11-14 22:57:19 +00:00
|
|
|
fi
|
|
|
|
|
2000-11-15 00:57:26 +00:00
|
|
|
osi=found
|
2000-11-28 23:12:57 +00:00
|
|
|
AC_CHECK_HEADERS(evp.h rsa.h rand.h err.h sha.h pem.h,
|
2000-11-15 00:57:26 +00:00
|
|
|
[], [osi=none; break])
|
2000-11-14 22:57:19 +00:00
|
|
|
|
|
|
|
if test "$osi" = "none" ; then
|
2000-11-15 00:57:26 +00:00
|
|
|
osi=found
|
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,
|
2000-11-15 00:57:26 +00:00
|
|
|
[], [osi=none; break])
|
2000-11-13 22:01:27 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
libcrypto=none
|
2000-11-14 22:57:19 +00:00
|
|
|
|
|
|
|
if test "$osi" = "found" ; then
|
|
|
|
AC_CHECK_LIB(crypto, SHA1_version, [
|
|
|
|
libcrypto=yes
|
|
|
|
])
|
|
|
|
fi
|
2000-11-13 22:01:27 +00:00
|
|
|
|
|
|
|
if test $libcrypto = none; then
|
2000-11-14 22:57:19 +00:00
|
|
|
cat <<EOF
|
|
|
|
|
|
|
|
It seems like OpenSSL is not installed on this system. But perhaps
|
2000-11-13 22:01:27 +00:00
|
|
|
you need to supply the exact location of the headers and libraries.
|
|
|
|
You can try running configure with the --with-openssl=/DIRECTORY
|
|
|
|
parameter. If you installed the headers and libraries in a different
|
|
|
|
location you can use --with-openssl-include=/DIR and
|
2000-11-14 22:57:19 +00:00
|
|
|
--with-openssl-lib=/DIR.
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
AC_MSG_ERROR(OpenSSL not found.)
|
2000-11-13 22:01:27 +00:00
|
|
|
|
|
|
|
else
|
|
|
|
LIBS="$LIBS -lcrypto"
|
|
|
|
fi
|
|
|
|
|
|
|
|
])
|