1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-28 03:06:20 -04:00

Debian bug 529821: Use pkg-config, not libgnutls-config

The configure script used to run libgnutls-config in order to find the
compiler and linker options needed for using GNUTLS, but GNUTLS 2.7
apparently doesn't ship that script any more.  Use pkg-config instead.
GNUTLS 1.2.0 is the oldest version supported by ELinks, and that already
installs the gnutls.pc file required by pkg-config.

This commit also removes support for configure --with-gnutls=DIR.
The configure script used to look for libgnutls-config in DIR.
DIR thus had to be a directory where executable programs were installed,
and it's unlikely that gnutls.pc would be found there.  So, any callers
that used this feature would have to be changed anyway, and they can as
well be changed to set the PKG_CONFIG_PATH environment variable instead.
This commit is contained in:
Kalle Olavi Niemitalo 2009-05-21 22:52:57 +03:00 committed by Kalle Olavi Niemitalo
parent feb640f29c
commit f8bbf1a227
2 changed files with 49 additions and 61 deletions

2
NEWS
View File

@ -14,6 +14,8 @@ includes the changes listed under ``ELinks 0.11.6.GIT now'' below.
* critical bug 1071: Fix crash in get_dom_node_child. * critical bug 1071: Fix crash in get_dom_node_child.
* Debian build bug 526349: Include asciidoc.py from AsciiDoc 7.1.2, * Debian build bug 526349: Include asciidoc.py from AsciiDoc 7.1.2,
to remove all dependencies on the installed version. to remove all dependencies on the installed version.
* Debian build bug 529821: Use ``pkg-config gnutls'' instead of
``libgnutls-config'', which is not included in GNUTLS 2.7.x.
* build enhancement: Recognize ``configure --without-tre''. * build enhancement: Recognize ``configure --without-tre''.
ELinks 0.12pre3: ELinks 0.12pre3:

View File

@ -1005,15 +1005,14 @@ disable_openssl=""
disable_gnutls="" disable_gnutls=""
enable_gnutls="" enable_gnutls=""
AC_ARG_WITH(gnutls, [ --without-gnutls disable GNUTLS SSL support], AC_ARG_WITH(gnutls, [[ --without-gnutls disable GNUTLS SSL support]])
[if test "$with_gnutls" = no; then disable_gnutls=yes; fi]) AC_ARG_WITH(gnutls, [[ --with-gnutls enable GNUTLS SSL support]],
AC_ARG_WITH(gnutls, [[ --with-gnutls[=DIR] enable GNUTLS SSL support]], [case "$with_gnutls" in
[if test "$with_gnutls" != no; then enable_gnutls=yes; fi]) "no") disable_gnutls=yes;;
gnutls_withval="$withval" "yes") enable_gnutls=yes; disable_openssl=yes;;
*) AC_MSG_WARN([[Support for --with-gnutls=DIR has been removed.
if test "$enable_gnutls" = yes; then You may have to set the PKG_CONFIG_PATH environment variable instead.]]);;
disable_openssl=yes; esac])
fi
AC_ARG_WITH(openssl, [ --without-openssl disable OpenSSL support], AC_ARG_WITH(openssl, [ --without-openssl disable OpenSSL support],
[if test "$with_openssl" = no; then disable_openssl=yes; fi]) [if test "$with_openssl" = no; then disable_openssl=yes; fi])
@ -1072,68 +1071,55 @@ AC_MSG_RESULT($cf_result)
CONFIG_GNUTLS_OPENSSL_COMPAT=no CONFIG_GNUTLS_OPENSSL_COMPAT=no
# ---- GNU TLS # ---- GNU TLS
dnl We can't have AC_MSG_CHECKING here, because AC_PATH_PROG prints its own and
dnl it looks ugly then.
if test "$cf_result" = yes; then if test "$cf_result" = yes; then
cf_result="not used" AC_MSG_CHECKING([[for GNUTLS]])
AC_MSG_RESULT([[not used, because OpenSSL was chosen]])
elif test -n "$disable_gnutls"; then
AC_MSG_CHECKING([[for GNUTLS]])
AC_MSG_RESULT([[explicitly disabled]])
else else
EL_SAVE_FLAGS cf_result=no
cf_result="no" AC_MSG_CHECKING([[for GNUTLS (1.2 or later) in pkg-config]])
if pkg-config --atleast-version=1.2 gnutls; then
GNUTLS_CFLAGS=`pkg-config --cflags gnutls`
GNUTLS_LIBS=`pkg-config --libs gnutls`
AC_MSG_RESULT([[yes: $GNUTLS_CFLAGS $GNUTLS_LIBS]])
if test -z "$disable_gnutls"; then # Verify if it's really usable. gnutls_session was
# Sure, we maybe _could_ use their macro, but how to ensure # renamed to gnutls_session_t before GNU TLS 1.2.0
# that the ./configure script won't fail if the macro won't be # (on 2004-06-13); ELinks now requires this.
# found..? :( --pasky AC_MSG_CHECKING([[whether GNUTLS can be linked with]])
EL_SAVE_FLAGS
LIBS="$GNUTLS_LIBS $LIBS"
CFLAGS="$CFLAGS $GNUTLS_CFLAGS"
CPPFLAGS="$CPPFLAGS $GNUTLS_CFLAGS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gnutls/gnutls.h>]],
[[gnutls_session_t dummy;
gnutls_check_version(NULL)]])],
[cf_result=yes],
[cf_result=no])
EL_RESTORE_FLAGS
fi
# This can match either AC_MSG_CHECKING above. A bit hacky...
AC_MSG_RESULT([[$cf_result]])
GNUTLS_PATH="$PATH:/usr/local/gnutls:/opt:/opt/gnutls" if test "$cf_result" = yes; then
EL_CONFIG(CONFIG_GNUTLS, [GNUTLS])
if test -d "$gnutls_withval"; then LIBS="$GNUTLS_LIBS $LIBS"
GNUTLS_PATH="$gnutls_withval:$GNUTLS_PATH" AC_SUBST(GNUTLS_CFLAGS)
fi
AC_PATH_PROG(LIBGNUTLS_CONFIG, libgnutls-config, no, $GNUTLS_PATH) # GnuTLS 2.2.0 changed libgnutls-openssl from GPLv2+
# to GPLv3+. Don't link that with the GPLv2 ELinks.
if test "$LIBGNUTLS_CONFIG" = "no" ; then # ELinks will use its internal MD5 code instead.
cf_result=no CONFIG_GNUTLS_OPENSSL_COMPAT=no
else elif test "${with_gnutls-no}" != "no"; then
GNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG --cflags` AC_MSG_ERROR([[GNUTLS (1.2 or later) not found. ELinks no longer supports GNUTLS 1.1.]])
GNUTLS_LIBS=`$LIBGNUTLS_CONFIG --libs`
LIBS="$GNUTLS_LIBS $LIBS_X"
CFLAGS="$CFLAGS_X $GNUTLS_CFLAGS"
CPPFLAGS="$CPPFLAGS_X $GNUTLS_CFLAGS"
# Verify if it's really usable. gnutls_session was
# renamed to gnutls_session_t before GNU TLS 1.2.0
# (on 2004-06-13); ELinks now requires this.
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gnutls/gnutls.h>]], [[gnutls_session_t dummy;
gnutls_check_version(NULL)]])],[cf_result=yes],[cf_result=no])
fi
if test "$cf_result" = yes; then
EL_CONFIG(CONFIG_GNUTLS, [GNUTLS])
CFLAGS="$CFLAGS_X"
AC_SUBST(GNUTLS_CFLAGS)
# GnuTLS 2.2.0 changed libgnutls-openssl from GPLv2+
# to GPLv3+. Don't link that with the GPLv2 ELinks.
# ELinks will use its internal MD5 code instead.
CONFIG_GNUTLS_OPENSSL_COMPAT=no
else
if test -n "$gnutls_withval" && test "x$gnutls_withval" != xno; then
AC_MSG_ERROR([GNUTLS (1.2 or later) not found. ELinks no longer supports GNUTLS 1.1.])
fi
EL_RESTORE_FLAGS
fi
fi fi
fi fi
AC_MSG_CHECKING([for GNU TLS (1.2 or later)])
AC_MSG_RESULT($cf_result)
# Final SSL setup # Final SSL setup
EL_CONFIG_DEPENDS(CONFIG_SSL, [CONFIG_OPENSSL CONFIG_GNUTLS], [SSL]) EL_CONFIG_DEPENDS(CONFIG_SSL, [CONFIG_OPENSSL CONFIG_GNUTLS], [SSL])