diff -Naur monit-5.0-beta1.orig/configure.ac monit-5.0-beta1/configure.ac --- monit-5.0-beta1.orig/configure.ac 2008-04-15 02:49:08 +0400 +++ monit-5.0-beta1/configure.ac 2008-04-19 12:12:25 +0400 @@ -536,7 +536,7 @@ # Check for ssl includes (take from the stunnel project) checksslincldir() { : if test -f "$1/openssl/ssl.h"; then - sslincldir="$1" + libssl_CFLAGS="-I$1" return 0 fi return 1 @@ -546,7 +546,7 @@ checkssllibdir() { : if test "(" -f "$1/libcrypto.so" -o -f "$1/libcrypto.a" -o -f "$1/libcrypto.dylib" ")" -a \ "(" -f "$1/libssl.so" -o -f "$1/libssl.a" -o -f "$1/libssl.dylib" ")" ; then - ssllibdir="$1" + libssl_LIBS="-L$1 -lssl -lcrypto" return 0 fi return 1 @@ -598,7 +598,7 @@ checksslincldir "$withval" ], [ - if test -z "$sslincldir"; then + if test -z "$libssl_CFLAGS"; then dnl Search default locations of SSL includes for maindir in /usr /usr/local /usr/lib /usr/pkg /var /opt /usr/sfw; do for dir in "$maindir/include"\ @@ -612,7 +612,7 @@ ] ) - if test -z "$sslincldir"; then + if test -z "$libssl_CFLAGS"; then AC_MSG_RESULT([Not found]) echo echo "Couldn't find your SSL header files." @@ -622,7 +622,7 @@ exit 1 fi - AC_MSG_RESULT([$sslincldir]) + AC_MSG_RESULT([$libssl_CFLAGS]) AC_MSG_CHECKING([for SSL library directory]) @@ -633,7 +633,7 @@ checkssllibdir "$withval" ], [ - if test -z "$ssllibdir"; then + if test -z "$libssl_LIBS"; then dnl Search default locations of SSL libraries for maindir in /usr \ /usr/local \ @@ -662,17 +662,19 @@ ] ) - if test -z "$ssllibdir"; then + if test -z "$libssl_LIBS"; then AC_MSG_RESULT([Not found]) + PKG_CHECK_MODULES([libssl], [openssl], [], [ echo echo "Couldn't find your SSL library files." echo "Use --with-ssl-lib-dir option to fix this problem or disable the" echo "SSL support with --without-ssl" echo exit 1 + ]) fi - AC_MSG_RESULT([$ssllibdir]) + AC_MSG_RESULT([$libssl_LIBS]) AC_DEFINE([HAVE_OPENSSL], 1, [Define to 1 if you have openssl.]) AC_SUBST(sslincldir) @@ -680,18 +682,18 @@ fi # Add SSL includes and libraries -if test "$sslincldir" -a "$ssllibdir" +if test "$libssl_CFLAGS" -a "$libssl_LIBS" then if test "x$ARCH" = "xDARWIN"; then # Darwin already knows about ssldirs LIBS="$LIBS -lssl -lcrypto" elif test -f "/usr/kerberos/include/krb5.h"; then # Redhat 9 compilation fix: - CFLAGS="$CFLAGS -I$sslincldir -I/usr/kerberos/include" - LIBS="$LIBS -L$ssllibdir -lssl -lcrypto" + CFLAGS="$CFLAGS $libssl_CFLAGS -I/usr/kerberos/include" + LIBS="$LIBS $libssl_LIBS" else - CFLAGS="$CFLAGS -I$sslincldir" - LIBS="$LIBS -L$ssllibdir -lssl -lcrypto" + CFLAGS="$CFLAGS $libssl_CFLAGS" + LIBS="$LIBS $libssl_LIBS" fi fi