Added mimimal version number verification for OpenSSL in configure
authorHugo Villeneuve <hugo@hugovil.com>
Sun, 19 Feb 2006 20:23:55 +0000 (20:23 +0000)
committerHugo Villeneuve <hugo@hugovil.com>
Sat, 25 May 2013 23:07:37 +0000 (19:07 -0400)
configure.in

index 15b67ff..59e705b 100644 (file)
@@ -68,29 +68,21 @@ else
        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)