when --with-gnutls is used, we assume a bin/libgnutls-config file in the

given prefix. Building something with gnutls without it just is too error-
prone.
This commit is contained in:
Daniel Stenberg 2005-04-19 22:12:34 +00:00
Родитель 21337f4776
Коммит 313f1a1e83
1 изменённых файлов: 22 добавлений и 18 удалений

Просмотреть файл

@ -1006,46 +1006,50 @@ if test "$OPENSSL_ENABLED" != "1"; then
gtlsprefix=`libgnutls-config --prefix` gtlsprefix=`libgnutls-config --prefix`
fi fi
else else
addlib="-L$OPT_GNUTLS/lib -lgnutls" addlib=`$OPT_GNUTLS/bin/libgnutls-config --libs`
addcflags="-I$OPT_GNUTLS/include" addcflags=`$OPT_GNUTLS/bin/libgnutls-config --cflags`
version=`$OPT_GNUTLS/bin/libgnutls-config --version 2>/dev/null` version=`$OPT_GNUTLS/bin/libgnutls-config --version 2>/dev/null`
gtlsprefix=$OPT_GNUTLS gtlsprefix=$OPT_GNUTLS
if test -z "$version"; then if test -z "$version"; then
version="unknown" version="unknown"
fi fi
fi fi
if test -n "$addlib"; then
CLEANLDFLAGS="$LDFLAGS" CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS" CLEANCPPFLAGS="$CPPFLAGS"
LDFLAGS="$LDFLAGS $addlib" LDFLAGS="$LDFLAGS $addlib"
if test "$addcflags" != "-I/usr/include"; then if test "$addcflags" != "-I/usr/include"; then
CPPFLAGS="$CPPFLAGS $addcflags" CPPFLAGS="$CPPFLAGS $addcflags"
fi fi
AC_CHECK_LIB(gnutls, gnutls_check_version, AC_CHECK_LIB(gnutls, gnutls_check_version,
[ [
AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled]) AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled])
AC_SUBST(USE_GNUTLS, [1]) AC_SUBST(USE_GNUTLS, [1])
USE_GNUTLS="yes" USE_GNUTLS="yes"
curl_ssl_msg="enabled (GnuTLS)" curl_ssl_msg="enabled (GnuTLS)"
], ],
[ [
LDFLAGS="$CLEANLDFLAGS" LDFLAGS="$CLEANLDFLAGS"
CPPFLAGS="$CLEANCPPFLAGS" CPPFLAGS="$CLEANCPPFLAGS"
]) ])
if test "x$USE_GNUTLS" = "xyes"; then if test "x$USE_GNUTLS" = "xyes"; then
AC_MSG_NOTICE([detected GnuTLS version $version]) AC_MSG_NOTICE([detected GnuTLS version $version])
dnl when shared libs were found in a path that the run-time dnl when shared libs were found in a path that the run-time
dnl linker doesn't search through, we need to add it to dnl linker doesn't search through, we need to add it to
dnl LD_LIBRARY_PATH to prevent further configure tests to fail dnl LD_LIBRARY_PATH to prevent further configure tests to fail
dnl due to this dnl due to this
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlsprefix/lib$libsuff"
export LD_LIBRARY_PATH
fi
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlsprefix/lib$libsuff"
export LD_LIBRARY_PATH
fi fi
fi dnl GNUTLS not disabled fi dnl GNUTLS not disabled
if test X"$USE_GNUTLS" != "Xyes"; then if test X"$USE_GNUTLS" != "Xyes"; then