diff --git a/NEWS b/NEWS index dbafac7e..dd28745a 100644 --- a/NEWS +++ b/NEWS @@ -78,6 +78,15 @@ ELinks 0.12pre3.GIT now: To be released as 0.12pre4, 0.12rc1, or even 0.12.0. This branch also includes the changes listed under ``ELinks 0.11.6.GIT now'' below. +Incompatibilities: + +* Debian build bug 529821: Use ``pkg-config gnutls'' instead of + ``libgnutls-config'', which is not included in GNUTLS 2.7.x. + You can no longer specify the location of GNUTLS using + ``configure --with-gnutls=DIR''. + +Other changes: + * critical bug 1071: Fix crash in get_dom_node_child. * Debian build bug 526349: Include asciidoc.py from AsciiDoc 7.1.2, to remove all dependencies on the installed version. diff --git a/config/m4/features.m4 b/config/m4/features.m4 index df87a70a..8fd4f20b 100644 --- a/config/m4/features.m4 +++ b/config/m4/features.m4 @@ -12,6 +12,8 @@ AC_DEFUN([EL_CONFIG], [ AC_DEFINE($1, 1, [Define if you want: $2 support])]) dnl EL_LOG_CONFIG(define, description, value) +dnl The first parameter (define) will not be expanded by m4, +dnl and it must be a valid name for a shell variable. AC_DEFUN([EL_LOG_CONFIG], [ about="$2" @@ -29,7 +31,7 @@ AC_DEFUN([EL_LOG_CONFIG], fi if test -z "$value"; then - value="[$]$1" + value="$[$1]" fi echo "$about $dots $value" >> features.log diff --git a/configure.in b/configure.in index 39133902..7b6433b3 100644 --- a/configure.in +++ b/configure.in @@ -6,9 +6,10 @@ dnl discards them. Other comments begin with "#", and they get copied dnl to the configure script, hopefully making it easier to read. dnl Autoconf 2.13 generates an incomplete config.h.in; see ELinks bug 936. -dnl Autoconf 2.59 is installed in the computer that generates our nightly -dnl snapshots, so we need to be compatible with that. -AC_PREREQ(2.59) +dnl Autoconf 2.61 is installed in the computer that generates our nightly +dnl snapshots, so we need to be compatible with that. (Also, some files +dnl in Autoconf 2.62 and 2.63 sources are not GPLv2 compatible.) +AC_PREREQ(2.61) AC_INIT AC_CONFIG_SRCDIR([src/main/main.c]) AC_CONFIG_AUX_DIR(config) @@ -218,9 +219,9 @@ AC_SUBST(CONFIG_INTERLINK) AC_STRUCT_TM AC_C_CONST AC_C_INLINE -AC_MSG_CHECKING([[C99-conforming inline]]) +AC_MSG_CHECKING([[for C99-conforming inline]]) AC_COMPILE_IFELSE([[ - int add(int x); + int add(int change); static int sum; @@ -1003,31 +1004,47 @@ AC_SUBST(CONFIG_SCRIPTING) # For wiping SSL hooks.. #ifdef CONFIG_SSL -disable_openssl="" -disable_gnutls="" -enable_gnutls="" +chosen_ssl_library="" -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[=DIR] enable GNUTLS SSL support]], - [if test "$with_gnutls" != no; then enable_gnutls=yes; fi]) -gnutls_withval="$withval" +AC_ARG_WITH(gnutls, [[ --without-gnutls disable GNUTLS SSL support]]) +AC_ARG_WITH(gnutls, [[ --with-gnutls enable GNUTLS SSL support]], + [case "$with_gnutls" in + "no") : ;; + "yes") chosen_ssl_library="GNUTLS" ;; + *) chosen_ssl_library="GNUTLS" + AC_MSG_WARN([[Support for --with-gnutls=DIR has been removed. +You may have to set the PKG_CONFIG_PATH environment variable instead.]]) ;; + esac]) -if test "$enable_gnutls" = yes; then - disable_openssl=yes; - with_nss_compat_ossl=no; -fi - -AC_ARG_WITH(openssl, [ --without-openssl disable OpenSSL support], - [if test "$with_openssl" = no; then disable_openssl=yes; fi]) -AC_ARG_WITH(openssl, [[ --with-openssl[=DIR] enable OpenSSL support (default)]]) -openssl_withval="$withval" +AC_ARG_WITH(openssl, [[ --without-openssl disable OpenSSL support]]) +AC_ARG_WITH(openssl, [[ --with-openssl[=DIR] enable OpenSSL support (default)]], + [case "$with_openssl" in + "no") : ;; + *) chosen_ssl_library="OpenSSL" ;; + esac]) AC_ARG_WITH(nss_compat_ossl, [[ --with-nss_compat_ossl[=DIR] - NSS compatibility SSL libraries/include files]]) + NSS compatibility SSL libraries/include files]], + [case "$with_nss_compat_ossl" in + "no") : ;; + *) chosen_ssl_library="nss_compat_ossl" ;; + esac]) -# nss_compat_ossl -if test -n "$with_nss_compat_ossl" && test "$with_nss_compat_ossl" != "no"; then +# ---- nss_compat_ossl + +if test "$with_nss_compat_ossl" = no; then + # explicitly disabled + : +elif test -n "$chosen_ssl_library" && test "$chosen_ssl_library" != "nss_compat_ossl"; then + # not used, because $chosen_ssl_library was chosen + : +elif test -z "${with_nss_compat_ossl+set}"; then + # SSL_library_init() in nss_compat_ossl 0.9.2 calls exit(1) + # with no error message if there is no certificate database. + # https://bugzilla.redhat.com/show_bug.cgi?id=463437 + # So ELinks uses nss_compat_ossl only if explicitly requested. + : +else EL_SAVE_FLAGS if test "$with_nss_compat_ossl" = yes; then if pkg-config nss; then @@ -1049,8 +1066,7 @@ if test -n "$with_nss_compat_ossl" && test "$with_nss_compat_ossl" != "no"; then else LIBS="$LIBS -lnss_compat_ossl" EL_CONFIG(CONFIG_NSS_COMPAT_OSSL, [nss_compat_ossl]) - disable_openssl="yes" - disable_gnutls="yes" + chosen_ssl_library="nss_compat_ossl" fi fi @@ -1059,12 +1075,16 @@ fi AC_MSG_CHECKING([for OpenSSL]) EL_SAVE_FLAGS -cf_result="no" -if test "$disable_openssl" = yes; then - cf_result="not used" +if test "$with_openssl" = no; then + cf_result="explicitly disabled" + +elif test -n "$chosen_ssl_library" && test "$chosen_ssl_library" != "OpenSSL"; then + cf_result="not used, because $chosen_ssl_library was chosen" + else - for ssldir in "$openssl_withval" "" /usr /usr/local/openssl \ + cf_result=no + for ssldir in "$with_openssl" "" /usr /usr/local/openssl \ /usr/lib/openssl /usr/local/ssl \ /usr/local/www /usr/lib/ssl /usr/local \ /usr/pkg /opt /opt/openssl; do @@ -1090,12 +1110,13 @@ else done if test "$cf_result" != yes; then - if test -n "$openssl_withval" && test "x$openssl_withval" != xno; then + if test "${with_openssl-no}" != "no"; then AC_MSG_ERROR([OpenSSL not found]) fi EL_RESTORE_FLAGS else EL_CONFIG(CONFIG_OPENSSL, [OpenSSL]) + chosen_ssl_library="OpenSSL" CFLAGS="$CFLAGS_X" AC_SUBST(OPENSSL_CFLAGS) @@ -1104,70 +1125,59 @@ fi AC_MSG_RESULT($cf_result) -CONFIG_GNUTLS_OPENSSL_COMPAT=no # ---- 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 - cf_result="not used" +# 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 + +if test "$with_gnutls" = no; then + AC_MSG_CHECKING([[for GNUTLS]]) + AC_MSG_RESULT([[explicitly disabled]]) + +elif test -n "$chosen_ssl_library" && test "$chosen_ssl_library" != "GNUTLS"; then + AC_MSG_CHECKING([[for GNUTLS]]) + AC_MSG_RESULT([[not used, because $chosen_ssl_library was chosen]]) 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 - # Sure, we maybe _could_ use their macro, but how to ensure - # that the ./configure script won't fail if the macro won't be - # found..? :( --pasky + # 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_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_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]) + chosen_ssl_library="GNUTLS" - if test -d "$gnutls_withval"; then - GNUTLS_PATH="$gnutls_withval:$GNUTLS_PATH" - fi + LIBS="$GNUTLS_LIBS $LIBS" + AC_SUBST(GNUTLS_CFLAGS) - AC_PATH_PROG(LIBGNUTLS_CONFIG, libgnutls-config, no, $GNUTLS_PATH) - - if test "$LIBGNUTLS_CONFIG" = "no" ; then - cf_result=no - else - GNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG --cflags` - 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_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 + elif test "${with_gnutls-no}" != "no"; then + AC_MSG_ERROR([[GNUTLS (1.2 or later) not found. ELinks no longer supports GNUTLS 1.1.]]) fi fi -AC_MSG_CHECKING([for GNU TLS (1.2 or later)]) -AC_MSG_RESULT($cf_result) - # Final SSL setup EL_CONFIG_DEPENDS(CONFIG_SSL, [CONFIG_OPENSSL CONFIG_GNUTLS CONFIG_NSS_COMPAT_OSSL], [SSL]) @@ -1480,7 +1490,7 @@ else fi AC_SUBST(TRE_CFLAGS) AC_SUBST(TRE_LIBS) -EL_LOG_CONFIG([[CONFIG_TRE]], [[Regexp searching]], [[$tre_log]]) +EL_LOG_CONFIG([CONFIG_TRE], [[Regexp searching]], [[$tre_log]]) # =================================================================== diff --git a/doc/installation.txt b/doc/installation.txt index 4c034f55..9f5526f5 100644 --- a/doc/installation.txt +++ b/doc/installation.txt @@ -50,6 +50,8 @@ LZMA Utils |Likewise, for LZMA compressed documents. \ Version 4.32.5 should work. XZ Utils does not work. OpenSSL, GNU TLS, or nss_compat_ossl \ |For handling secure HTTP browsing. +pkg-config |Needed for locating some libraries (at least \ + GNU TLS and TRE) GPM |'General Purpose Mouse' for mouse support. expat |'XML Parser Toolkit' needed for XBEL support. http://laurikari.net/tre/[TRE] \