From: warlord Date: Tue, 18 Nov 2003 02:30:43 +0000 (+0000) Subject: Check for pkg-config and use that for openssl libraries, if it's available X-Git-Tag: 2.4~2126 X-Git-Url: http://www.project-moonshot.org/gitweb/?a=commitdiff_plain;h=f5bf6f3fd3eba10aa4ffdce25af08a5c0b30f2ac;hp=33feb35780b4fa205b1752beec7b444b15ece591;p=shibboleth%2Fsp.git Check for pkg-config and use that for openssl libraries, if it's available git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@737 cb58f699-b61c-0410-a6fe-9272a202ed29 --- diff --git a/configure.ac b/configure.ac index 64b17c4..fea2833 100644 --- a/configure.ac +++ b/configure.ac @@ -80,12 +80,24 @@ AC_ARG_WITH(xerces, fi]) -AC_ARG_WITH(openssl, +AC_PATH_PROG(PKG_CONFIG, pkg-config) +if test "x$PKG_CONFIG" = x || test "x$PKG_CONFIG" = "xno" ; then + AC_ARG_WITH(openssl, AC_HELP_STRING([--with-openssl=PATH], [where openssl is installed]), [if test x_$with_openssl != x_/usr; then - LDFLAGS="-L${with_openssl}/lib $LDFLAGS" - CPPFLAGS="-I${with_openssl}/include $CPPFLAGS" + SSLLIBS="-L${with_openssl}/lib" + SSLFLAGS="-I${with_openssl}/include" fi]) +else + SSLLIBS="`$PKG_CONFIG --libs openssl`" + SSLFLAGS="`$PKG_CONFIG --cflags openssl`" +fi +AC_MSG_CHECKING(for OpenSSL libraries) +AC_MSG_RESULT($SSLLIBS) +LDFLAGS="$SSLLIBS $LDFLAGS" +AC_MSG_CHECKING(for OpenSSL cflags) +AC_MSG_RESULT($SSLFLAGS) +CPPFLAGS="$SSLFLAGS $CPPFLAGS" AC_ARG_WITH(log4cpp, AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp is installed]), @@ -122,10 +134,19 @@ AC_TRY_LINK( AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR([unable to find openssl header files])) -AC_CHECK_LIB([crypto], [ERR_load_CRYPTO_strings],, +AC_MSG_CHECKING(for ERR_load_CRYPTO_string) +AC_TRY_LINK_FUNC([ERR_load_CRYPTO_strings],, AC_MSG_ERROR([unable to link with openssl libraries])) -AC_CHECK_LIB([ssl], [SSL_library_init],, +AC_MSG_RESULT(yes) +AC_MSG_CHECKING(for SSL_library_init) +AC_TRY_LINK_FUNC([SSL_library_init],, AC_MSG_ERROR([unable to link with openssl libraries])) +AC_MSG_RESULT(yes) + +#AC_CHECK_LIB([crypto], [ERR_load_CRYPTO_strings],, +# AC_MSG_ERROR([unable to link with openssl libraries])) +#AC_CHECK_LIB([ssl], [SSL_library_init],, +# AC_MSG_ERROR([unable to link with openssl libraries])) AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],, AC_MSG_ERROR([unable to find xsec header files]))