From ca1d540a4176eb8d99c0a7d4ebb3106f9fc93606 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Fri, 22 May 2009 22:18:54 +0300 Subject: [PATCH 1/7] configure: Fix "not a valid shell variable" with Autoconf 2.63 Fix this error: configure.in:1430: error: AC_SUBST: `[CONFIG_TRE]' is not a valid shell variable name acinclude.m4:31: EL_LOG_CONFIG is expanded from... configure.in:1430: the top level autom4te: /usr/bin/m4 failed with exit status: 1 Reported by witekfl. --- config/m4/features.m4 | 4 +++- configure.in | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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 46cbb9ad..f67afb7d 100644 --- a/configure.in +++ b/configure.in @@ -1441,7 +1441,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]]) # =================================================================== From 284ac21486f445be1c70b7a485db265b82786b72 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Fri, 22 May 2009 22:51:18 +0300 Subject: [PATCH 2/7] configure: Require Autoconf 2.61 or later Autoconf 2.61 has been installed on elinks.cz. I don't know when. --- configure.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index f67afb7d..f851b248 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) From feb640f29c79a16da8c60e23a50dfa9aa9b5fc1b Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Fri, 22 May 2009 22:11:11 +0300 Subject: [PATCH 3/7] configure: Cosmetic changes in C99 inline check --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index f851b248..29bfdcb4 100644 --- a/configure.in +++ b/configure.in @@ -219,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; From f8bbf1a2279fa8be90fdb8babe0fbec46002fb0e Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Thu, 21 May 2009 22:52:57 +0300 Subject: [PATCH 4/7] 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. --- NEWS | 2 + configure.in | 108 ++++++++++++++++++++++----------------------------- 2 files changed, 49 insertions(+), 61 deletions(-) diff --git a/NEWS b/NEWS index 7a7ecc5e..4b7a8944 100644 --- a/NEWS +++ b/NEWS @@ -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. * Debian build bug 526349: Include asciidoc.py from AsciiDoc 7.1.2, 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''. ELinks 0.12pre3: diff --git a/configure.in b/configure.in index 29bfdcb4..1d056a52 100644 --- a/configure.in +++ b/configure.in @@ -1005,15 +1005,14 @@ disable_openssl="" disable_gnutls="" enable_gnutls="" -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" - -if test "$enable_gnutls" = yes; then - disable_openssl=yes; -fi +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") disable_gnutls=yes;; + "yes") enable_gnutls=yes; disable_openssl=yes;; + *) AC_MSG_WARN([[Support for --with-gnutls=DIR has been removed. +You may have to set the PKG_CONFIG_PATH environment variable instead.]]);; + esac]) AC_ARG_WITH(openssl, [ --without-openssl disable OpenSSL support], [if test "$with_openssl" = no; then disable_openssl=yes; fi]) @@ -1072,68 +1071,55 @@ 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" + 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 - 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]) - 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 + # 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 + 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], [SSL]) From bd87e0915e9d125abb61b6953e3ef149515b15b8 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Fri, 22 May 2009 22:29:55 +0300 Subject: [PATCH 5/7] Mention pkg-config dependency in doc/installation.txt --- doc/installation.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/installation.txt b/doc/installation.txt index 5d405195..674ad8f9 100644 --- a/doc/installation.txt +++ b/doc/installation.txt @@ -49,6 +49,8 @@ bzip2 |Likewise, for bzip2 compressed documents. LZMA Utils |Likewise, for LZMA compressed documents. \ Version 4.32.5 should work. XZ Utils does not work. OpenSSL or GNU TLS |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] \ From a7fe06be06abc1927f01b176b993b5bbc0c0927f Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Sat, 23 May 2009 10:47:02 +0300 Subject: [PATCH 6/7] Debian bug 529821: Mention loss of --with-gnutls=DIR in NEWS --- NEWS | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 4b7a8944..cb15f3b2 100644 --- a/NEWS +++ b/NEWS @@ -11,11 +11,18 @@ 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. -* 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''. ELinks 0.12pre3: From 3d4919507a075a4ff7996a2f82400ce3baf8a7f3 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Sat, 23 May 2009 01:57:23 +0300 Subject: [PATCH 7/7] configure: More extensible choice of SSL library In 0.13.GIT, the configure script sets disable_gnutls=yes if it decides to use nss_compat_ossl. In recent elinks-0.12, the script logs "explicitly disabled" if $disable_gnutls is set. Thus, merging those together could have caused an incorrect claim to be logged. Rearrange the logic to make it easier to extend to multiple libraries. Code that deals with one library no longer needs to worry about each alternative library separately. Instead just test and set the one shared chosen_ssl_library variable. While at it, get rid of openssl_withval, which merely mirrored the with_openssl variable provided by Autoconf. --- configure.in | 58 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/configure.in b/configure.in index 1d056a52..f1b2574b 100644 --- a/configure.in +++ b/configure.in @@ -1001,35 +1001,40 @@ 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]]) AC_ARG_WITH(gnutls, [[ --with-gnutls enable GNUTLS SSL support]], [case "$with_gnutls" in - "no") disable_gnutls=yes;; - "yes") enable_gnutls=yes; disable_openssl=yes;; - *) AC_MSG_WARN([[Support for --with-gnutls=DIR has been removed. -You may have to set the PKG_CONFIG_PATH environment variable instead.]]);; + "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]) -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]) # ---- OpenSSL 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 @@ -1055,12 +1060,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) @@ -1069,16 +1075,21 @@ fi AC_MSG_RESULT($cf_result) -CONFIG_GNUTLS_OPENSSL_COMPAT=no # ---- GNU TLS -if test "$cf_result" = yes; then - AC_MSG_CHECKING([[for GNUTLS]]) - AC_MSG_RESULT([[not used, because OpenSSL was chosen]]) -elif test -n "$disable_gnutls"; then +# 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 cf_result=no AC_MSG_CHECKING([[for GNUTLS (1.2 or later) in pkg-config]]) @@ -1107,14 +1118,11 @@ else if test "$cf_result" = yes; then EL_CONFIG(CONFIG_GNUTLS, [GNUTLS]) + chosen_ssl_library="GNUTLS" LIBS="$GNUTLS_LIBS $LIBS" 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 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