1
0
mirror of https://github.com/moparisthebest/curl synced 2024-10-31 15:45:12 -04:00

- Suppressed side effect of OpenSSL configure checks, which prevented NSS from

being properly detected under certain circumstances. It had been caused by
  strange behavior of pkg-config when handling PKG_CONFIG_LIBDIR. pkg-config
  distinguishes among empty and non-existent environment variable in that case.
This commit is contained in:
Kamil Dudka 2010-01-14 01:37:55 +00:00
parent 8c8df3966b
commit 383bf1e476
3 changed files with 40 additions and 16 deletions

View File

@ -6,6 +6,12 @@
Changelog Changelog
Kamil Dudka (14 Jan 2010)
- Suppressed side effect of OpenSSL configure checks, which prevented NSS from
being properly detected under certain circumstances. It had been caused by
strange behavior of pkg-config when handling PKG_CONFIG_LIBDIR. pkg-config
distinguishes among empty and non-existent environment variable in that case.
Daniel Stenberg (12 Jan 2010) Daniel Stenberg (12 Jan 2010)
- Gil Weber reported a peculiar flaw with the multi interface when doing SFTP - Gil Weber reported a peculiar flaw with the multi interface when doing SFTP
transfers: curl_multi_fdset() would return -1 and not set and file transfers: curl_multi_fdset() would return -1 and not set and file

View File

@ -3190,7 +3190,22 @@ AC_DEFUN([CURL_CHECK_WIN32_LARGEFILE], [
esac esac
]) ])
dnl CURL_CHECK_PKGCONFIG ($module) dnl CURL_EXPORT_PCDIR ($pcdir)
dnl ------------------------
dnl if $pcdir is not empty, set PKG_CONFIG_LIBDIR to $pcdir and export
dnl
dnl we need this macro since pkg-config distinguishes among empty and unset
dnl variable while checking PKG_CONFIG_LIBDIR
dnl
AC_DEFUN([CURL_EXPORT_PCDIR], [
if test -n "$1"; then
PKG_CONFIG_LIBDIR="$1"
export PKG_CONFIG_LIBDIR
fi
])
dnl CURL_CHECK_PKGCONFIG ($module, [$pcdir])
dnl ------------------------ dnl ------------------------
dnl search for the pkg-config tool (if not cross-compiling). Set the PKGCONFIG dnl search for the pkg-config tool (if not cross-compiling). Set the PKGCONFIG
dnl variable to hold the path to it, or 'no' if not found/present. dnl variable to hold the path to it, or 'no' if not found/present.
@ -3198,6 +3213,8 @@ dnl
dnl If pkg-config is present, check that it has info about the $module or dnl If pkg-config is present, check that it has info about the $module or
dnl return "no" anyway! dnl return "no" anyway!
dnl dnl
dnl Optionally PKG_CONFIG_LIBDIR may be given as $pcdir.
dnl
AC_DEFUN([CURL_CHECK_PKGCONFIG], [ AC_DEFUN([CURL_CHECK_PKGCONFIG], [
@ -3216,8 +3233,10 @@ AC_DEFUN([CURL_CHECK_PKGCONFIG], [
if test x$PKGCONFIG != xno; then if test x$PKGCONFIG != xno; then
AC_MSG_CHECKING([for $1 options with pkg-config]) AC_MSG_CHECKING([for $1 options with pkg-config])
dnl ask pkg-config about $1 dnl ask pkg-config about $1
$PKGCONFIG --exists $1 itexists=`CURL_EXPORT_PCDIR([$2]) dnl
if test "$?" -ne "0"; then $PKGCONFIG --exists $1 >/dev/null 2>&1 && echo 1`
if test -z "$itexists"; then
dnl pkg-config does not have info about the given module! set the dnl pkg-config does not have info about the given module! set the
dnl variable to 'no' dnl variable to 'no'
PKGCONFIG="no" PKGCONFIG="no"

View File

@ -1205,7 +1205,6 @@ if test X"$OPT_SSL" != Xno; then
CLEANLDFLAGS="$LDFLAGS" CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS" CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS" CLEANLIBS="$LIBS"
SAVE_PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR"
case "$OPT_SSL" in case "$OPT_SSL" in
yes) yes)
@ -1233,10 +1232,9 @@ if test X"$OPT_SSL" != Xno; then
dnl Try pkg-config even when cross-compiling. Since we dnl Try pkg-config even when cross-compiling. Since we
dnl specify PKG_CONFIG_LIBDIR we're only looking where dnl specify PKG_CONFIG_LIBDIR we're only looking where
dnl the user told us to look dnl the user told us to look
PKG_CONFIG_LIBDIR=$OPT_SSL/lib/pkgconfig OPENSSL_PCDIR="$OPT_SSL/lib/pkgconfig"
export PKG_CONFIG_LIBDIR AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$OPENSSL_PCDIR"])
AC_MSG_NOTICE([set PKG_CONFIG_LIBDIR to "$PKG_CONFIG_LIBDIR"]) if test -e "$OPENSSL_PCDIR/openssl.pc"; then
if test -e "$PKG_CONFIG_LIBDIR/openssl.pc"; then
PKGTEST="yes" PKGTEST="yes"
fi fi
@ -1253,12 +1251,17 @@ if test X"$OPT_SSL" != Xno; then
if test "$PKGTEST" = "yes"; then if test "$PKGTEST" = "yes"; then
CURL_CHECK_PKGCONFIG(openssl) CURL_CHECK_PKGCONFIG(openssl, [$OPENSSL_PCDIR])
if test "$PKGCONFIG" != "no" ; then if test "$PKGCONFIG" != "no" ; then
SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null` SSL_LIBS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null` $PKGCONFIG --libs-only-l openssl 2>/dev/null`
SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
SSL_LDFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
$PKGCONFIG --libs-only-L openssl 2>/dev/null`
SSL_CPPFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"]) AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"])
AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"]) AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"])
@ -1276,10 +1279,6 @@ if test X"$OPT_SSL" != Xno; then
fi fi
fi fi
dnl we're done using pkg-config for openssl
PKG_CONFIG_LIBDIR="$SAVE_PKG_CONFIG_LIBDIR"
export PKG_CONFIG_LIBDIR
dnl finally, set flags to use SSL dnl finally, set flags to use SSL
CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS" CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
LDFLAGS="$LDFLAGS $SSL_LDFLAGS" LDFLAGS="$LDFLAGS $SSL_LDFLAGS"