AC_MSG_RESULT(no)
fi
-dnl Check for OpenSSL
+dnl Checks for OpenSSL
AC_ARG_ENABLE(ssl,
[ --enable-ssl Enable SSL support using OpenSSL (default=yes)],
[ac_cv_enable_ssl=$enableval], [ac_cv_enable_ssl=yes])
AC_MSG_CHECKING([whether to use OpenSSL])
if test $ac_cv_enable_ssl = yes; then
AC_MSG_RESULT(yes)
- AC_MSG_CHECKING([if openssl is available])
- LIBS="$LIBS -lssl -lcrypto"
- AC_TRY_LINK([
-#include <openssl/opensslv.h>
-], [ return OPENSSL_VERSION_NUMBER; ],
- [ AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_SSL, 1, Define if you use OpenSSL to support SSL.) ],
- [ AC_MSG_RESULT(no)
- LIBS="$ac_save_LIBS"
- ac_cv_enable_ssl=no ])
+ PKG_CHECK_MODULES(OPENSSL, openssl >= 0.9.8,dnl
+ AC_DEFINE([HAVE_SSL],1,[Set to 1 to enable OpenSSL support.])dnl
+ CFLAGS="${CFLAGS} ${OPENSSL_CFLAGS}"dnl
+ LIBS="${LIBS} ${OPENSSL_LIBS}", ac_cv_enable_ssl=no)
else
AC_MSG_RESULT(no)
fi
-
-
AC_SUBST(CFLAGS)
AC_SUBST(LIBS)
AC_SUBST(ac_aux_dir)