- SSL_CFLAGS="-I$openssl/include -I$openssl/include/openssl"
- SSL_LIBS="-L$openssl/lib"
- CFLAGS="$SSL_CFLAGS $CFLAGS"
- LIBS="$SSL_LIBS $LIBS"
+ if $openssl/bin/pkg-config --exists openssl; then
+ SSL_CFLAGS=`$openssl/bin/pkg-config --cflags openssl`
+ SSL_LIBS=`$openssl/bin/pkg-config --libs openssl`
+ sslver=`$openssl/bin/pkg-config --modversion openssl`
+ else
+ SSL_CFLAGS="-I$openssl/include -I$openssl/include/openssl"
+ SSL_LIBS="-L$openssl/lib"
+ CFLAGS="$SSL_CFLAGS $CFLAGS"
+ LIBS="$SSL_LIBS $LIBS"
+ fi
+ else
+ if $pkgconfig --exists openssl; then
+ SSL_CFLAGS=`$pkgconfig --cflags openssl`
+ SSL_LIBS=`$pkgconfig --libs openssl`
+ sslver=`$pkgconfig --modversion openssl`
+ fi
+ fi
+ if test "$sslver" = "no"; then
+ AC_CHECK_LIB(crypto, main,[SSL_LIBS="$SSL_LIBS -lcrypto"])
+ LIBS="$LIBS $SSL_LIBS"
+ AC_CHECK_LIB(ssl, SSL_new)
+ if test "$ac_cv_lib_ssl_SSL_new" = "yes"; then
+ AC_CHECK_HEADER(openssl/ssl.h,[sslver=yes])
+ fi
+ if test "$sslver" = "yes"; then
+ SSL_LIBS="-lssl $SSL_LIBS"
+ fi