GNOME Bugzilla – Bug 585629
autoconf test for finding gnutls broken
Last modified: 2009-06-15 17:25:07 UTC
Please describe the problem: configure.in contains: PKG_CHECK_MODULES(GNUTLS, libgnutls >= $GNUTLS_NEW_MIN_VERSION, [GNUTLS_FOUND=yes], [GNUTLS_FOUND=no]) if test "z$GNUTLS_FOUND" = "zno" ; then PKG_CHECK_MODULES(GNUTLS, libgnutls >= $GNUTLS_MIN_VERSION, However the pc file shipped with gnutls is called "gnutls.pc" instead of "libgnutls.pc". Since gnutls 2.8.x has stopped shipping the fallback libgnutls-config this makes it impossible to build xmlsec with gnutls support. Fixing this is trivial, just change both instances of the PKG_CHECK_MODULES test from "PKG_CHECK_MODULES(GNUTLS, libgnutls [...]" to "PKG_CHECK_MODULES(GNUTLS, gnutls [...]". Thanks, cu andreas Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
Switching the checks to gnutls will break old systems and I don't want that :) Also, the second check is for the really old gnutls and I don't think we need to change that. Anyway, I think the following patch will do it: diff --git a/configure.in b/configure.in index bfc6bdf..33eb0f6 100644 --- a/configure.in +++ b/configure.in @@ -748,9 +748,14 @@ if test "z$with_gnutls" = "zno" ; then AC_MSG_RESULT(no) GNUTLS_FOUND="without" elif test "z$with_gnutls" = "z" -a "z$PKG_CONFIG_ENABLED" = "zyes" ; then - PKG_CHECK_MODULES(GNUTLS, libgnutls >= $GNUTLS_NEW_MIN_VERSION, + PKG_CHECK_MODULES(GNUTLS, gnutls >= $GNUTLS_NEW_MIN_VERSION, [GNUTLS_FOUND=yes], [GNUTLS_FOUND=no]) + if test "z$GNUTLS_FOUND" = "zno" ; then + PKG_CHECK_MODULES(GNUTLS, libgnutls >= $GNUTLS_NEW_MIN_VERSION, + [GNUTLS_FOUND=yes], + [GNUTLS_FOUND=no]) + fi if test "z$GNUTLS_FOUND" = "zno" ; then PKG_CHECK_MODULES(GNUTLS, libgnutls >= $GNUTLS_MIN_VERSION, Commited.
[...] + PKG_CHECK_MODULES(GNUTLS, libgnutls >= $GNUTLS_NEW_MIN_VERSION, [...] PKG_CHECK_MODULES(GNUTLS, libgnutls >= $GNUTLS_MIN_VERSION, Your proposed patch fixes one instance of "PKG_CHECK_MODULES(GNUTLS, libgnutls" but leaves the second one unfixed and introduces a third one. These tests will never succeed and have never succeeded. There never has been a libgnutls.pc file. When the file was added in 1.0.22 it was already named gnutls.pc. http://git.savannah.gnu.org/cgit/gnutls.git/log/lib/gnutls.pc.in?h=gnutls_1_0_0_patches cu andreas
I think this is missing on top of git HEAD: --- a/configure.in +++ b/configure.in @@ -752,13 +752,7 @@ elif test "z$with_gnutls" = "z" -a "z$PKG_CONFIG_ENABLED" = "zyes" ; then [GNUTLS_FOUND=yes], [GNUTLS_FOUND=no]) if test "z$GNUTLS_FOUND" = "zno" ; then - PKG_CHECK_MODULES(GNUTLS, libgnutls >= $GNUTLS_NEW_MIN_VERSION, - [GNUTLS_FOUND=yes], - [GNUTLS_FOUND=no]) - fi - - if test "z$GNUTLS_FOUND" = "zno" ; then - PKG_CHECK_MODULES(GNUTLS, libgnutls >= $GNUTLS_MIN_VERSION, + PKG_CHECK_MODULES(GNUTLS, gnutls >= $GNUTLS_MIN_VERSION, [GNUTLS_FOUND=yes], [GNUTLS_FOUND=no]) if test "z$GNUTLS_FOUND" = "zyes" ; then i.e. if we have pkg-config then: a) check for GNUTLS_NEW_MIN_VERSION, and if this does not suceed check if we have at least GNUTLS_MIN_VERSION. cu andreas
Any chance you can try my patch on your system?
Hello, what happens is not very interesting: ------ configure:17875: checking for GNUTLS configure:17883: $PKG_CONFIG --exists --print-errors "gnutls >= $GNUTLS_NEW_MIN_VERSION" configure:17886: $? = 0 configure:17901: $PKG_CONFIG --exists --print-errors "gnutls >= $GNUTLS_NEW_MIN_VERSION" configure:17904: $? = 0 configure:17940: result: yes configure:18173: checking for mscrypto libraries configure:18175: result: none ------ This was when running against gnutls 2.6.6, therefore the very first test [ 6] succeeded. [ 1] if test "z$with_gnutls" = "zno" ; then [ 2] AC_MSG_CHECKING(for gnutls libraries >= $GNUTLS_MIN_VERSION) [ 3] AC_MSG_RESULT(no) [ 4] GNUTLS_FOUND="without" [ 5] elif test "z$with_gnutls" = "z" -a "z$PKG_CONFIG_ENABLED" = "zyes" ; then [ 6] PKG_CHECK_MODULES(GNUTLS, gnutls >= $GNUTLS_NEW_MIN_VERSION, [ 7] [GNUTLS_FOUND=yes], [ 8] [GNUTLS_FOUND=no]) [ 9] if test "z$GNUTLS_FOUND" = "zno" ; then [10] PKG_CHECK_MODULES(GNUTLS, libgnutls >= $GNUTLS_NEW_MIN_VERSION, [11] [GNUTLS_FOUND=yes], [12] [GNUTLS_FOUND=no]) [13] fi [14] [15] if test "z$GNUTLS_FOUND" = "zno" ; then [16] PKG_CHECK_MODULES(GNUTLS, libgnutls >= $GNUTLS_MIN_VERSION, [17] [GNUTLS_FOUND=yes], [18] [GNUTLS_FOUND=no]) [19] if test "z$GNUTLS_FOUND" = "zyes" ; then [20] GNUTLS_CFLAGS="$GNUTLS_CFLAGS -DXMLSEC_GNUTLS_OLD=1" [21] fi [22] fi [23] fi OTOH if I manipulate the pkg-config file to mimick version 0.9.9 [16] does not succeed, since tzhere is no file named libgnutls.pc. ---------------------------------------------- configure:17901: $PKG_CONFIG --exists --print-errors "gnutls >= $GNUTLS_NEW_MIN_VERSION" Requested 'gnutls >= 1.0.0' but version of GnuTLS is 0.9.9 configure:17904: $? = 1 Requested 'gnutls >= 1.0.0' but version of GnuTLS is 0.9.9 configure:17932: result: no configure:17947: checking for GNUTLS configure:17955: $PKG_CONFIG --exists --print-errors "libgnutls >= $GNUTLS_NEW_MIN_VERSION" Package libgnutls was not found in the pkg-config search path. Perhaps you should add the directory containing `libgnutls.pc' to the PKG_CONFIG_PATH environment variable No package 'libgnutls' found configure:17958: $? = 1 configure:17973: $PKG_CONFIG --exists --print-errors "libgnutls >= $GNUTLS_NEW_MIN_VERSION" Package libgnutls was not found in the pkg-config search path. Perhaps you should add the directory containing `libgnutls.pc' to the PKG_CONFIG_PATH environment variable No package 'libgnutls' found configure:17976: $? = 1 No package 'libgnutls' found configure:18004: result: no configure:18021: checking for GNUTLS configure:18029: $PKG_CONFIG --exists --print-errors "libgnutls >= $GNUTLS_MIN_VERSION" Package libgnutls was not found in the pkg-config search path. Perhaps you should add the directory containing `libgnutls.pc' to the PKG_CONFIG_PATH environment variable No package 'libgnutls' found configure:18032: $? = 1 configure:18047: $PKG_CONFIG --exists --print-errors "libgnutls >= $GNUTLS_MIN_VERSION" Package libgnutls was not found in the pkg-config search path. Perhaps you should add the directory containing `libgnutls.pc' to the PKG_CONFIG_PATH environment variable No package 'libgnutls' found configure:18050: $? = 1 No package 'libgnutls' found configure:18078: result: no configure:18097: checking for gnutls libraries >= 0.8.1 configure:18123: result: yes ------------------------------------- The last two lines is then later (non-pkg-config) tests (for libgnutls-config succeeding. For reference with the current value of GNUTLS_MIN_VERSION the pkg-config test for GNUTLS_MIN_VERSION is not useful anyway, gnutls added pkg-config support only a lot later in 1.0.22. cu andreas
Well, I believe it works when :) It works for you against 2.6.6 and it still works for me against the old (very old) gnutls I use/have.
You wrote: "Well, I believe it works when :)" Yes. Doesn't it pain you at all that ./configure.in contains stuff that is absolutely useless? Why do you insist on adding another test that serves noi purpose since it never matches? I am just wondering, it is no big deal. Was my reasoning not 100% understandable or is there anything I am missing? Perhaps you do know of a reason for adding this. tia for the enlightenment, cu andreas
(In reply to comment #7) Old rule: it works - don't touch! :) Seriously, I don't really care if the script performs an extra check. On the other hand, I do care a lot about not breaking something that works.