bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ‘libunistring’ module errors


From: Ludovic Courtès
Subject: Re: ‘libunistring’ module errors
Date: Mon, 31 May 2010 11:07:58 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Hi Bruno,

Bruno Haible <address@hidden> writes:

>> With the current ‘libunistring’ Gnulib module, I’m observing [0] this
>> [0] http://hydra.nixos.org/build/429165/
>
> Huh? Under that URL, I don't see a 'configure' failure,

See the output of the ‘configure’ script, at the beginning of the log
(the script itself doesn’t actually fail but emits these “unary operator
expected” messages.)

If you want to examine the faulty ‘configure’, you can get it from the
tarball at <http://hydra.nixos.org/build/429132>.

>> during the ‘configure’ run:
>> 
>> --8<---------------cut here---------------start------------->8---
>> ./configure: line 20186: test: -lt: unary operator expected
>> ./configure: line 20187: test: -eq: unary operator expected
>> ./configure: line 20223: test: -lt: unary operator expected
>> ./configure: line 20224: test: -eq: unary operator expected
>> 
>> [...]
>> 
>> --8<---------------cut here---------------end--------------->8---
>> 
>> stemming from these lines:
>> 
>> --8<---------------cut here---------------start------------->8---
>>             test $LIBUNISTRING_VERSION_MAJOR -lt 0 \
>>             || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \
>>                  && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \
>>                       || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \
>>                            && test $LIBUNISTRING_VERSION_SUBMINOR -lt 2
>>                          }
>>                     }
>>                }
>> --8<---------------cut here---------------end--------------->8---
>
> These error messages would indicate that LIBUNISTRING_VERSION_MAJOR and
> LIBUNISTRING_VERSION_MINOR are either unset or empty. Can you verify
> that the 'configure' file contains the statements to set these variables
> before they are used?

Yes it does, but see below.

> An AC_REQUIRE should ensure this ordering, but who knows what went
> wrong.
>
>>   1. The tests above are underquoted, they should read:
>> 
>>        test "$LIBUNISTRING_VERSION_MAJOR" -lt 0 \
>>           ...
>
> No, they are correctly quoted. $LIBUNISTRING_VERSION_MAJOR is supposed
> to be a non-empty sequence of digits. The purpose of not writing
>   "$LIBUNISTRING_VERSION_MAJOR"
> is to get you to report this problem.

Heh, fair enough.

>>   2. The version-extraction sed scripts appear to be broken:
>> 
>> --8<---------------cut here---------------start------------->8---
>> $ 
>> gl_libunistring_sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;}
>> > i\
>> > 0
>> > q
>> > '
>> 
>> $ echo 0.9.3 | sed -n -e "$gl_libunistring_sed_extract_major"
>> 
>> $ sed --version
>> GNU sed version 4.1.5
>
> Unfortunately I cannot reproduce this:

Oops, it was me using the wrong variable...

What happens is that these lines:

--8<---------------cut here---------------start------------->8---
  if test "$HAVE_LIBUNISTRING" = yes; then
    LIBUNISTRING_VERSION_MAJOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e 
"$gl_libunistring_sed_extract_major"`
    LIBUNISTRING_VERSION_MINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e 
"$gl_libunistring_sed_extract_minor"`
    LIBUNISTRING_VERSION_SUBMINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e 
"$gl_libunistring_sed_extract_subminor"`
  fi
--8<---------------cut here---------------end--------------->8---

... are executed before $HAVE_LIBUNISTRING has been set, leaving
$LIBUNISTRING_VERSION_* undefined.

It looks like a problem of ordering among the libunistring macros.
A patch like this:

--- a/m4/libunistring-base.m4
+++ b/m4/libunistring-base.m4
@@ -67,6 +67,7 @@ dnl Miscellaneous preparations/initializations.
 AC_DEFUN([gl_LIBUNISTRING_LIB_PREPARE],
 [
   AC_REQUIRE([AC_PROG_AWK])
+  AC_REQUIRE([gl_LIBUNISTRING_CORE])
 
 dnl Sed expressions to extract the parts of a version number.
 changequote(,)
... doesn’t work, though:

--8<---------------cut here---------------start------------->8---
configure.ac:67: warning: AC_REQUIRE: `gl_LIBUNISTRING_CORE' was expanded 
before it was required
m4/libunistring-base.m4:67: gl_LIBUNISTRING_LIB_PREPARE is expanded from...
m4/libunistring-base.m4:51: gl_LIBUNISTRING_LIBHEADER is expanded from...
m4/gnulib-comp.m4:148: gl_INIT is expanded from...
configure.ac:67: the top level
configure.ac:67: warning: AC_REQUIRE: `AM_ICONV' was expanded before it was 
required
m4/libunistring.m4:50: gl_LIBUNISTRING_CORE is expanded from...
--8<---------------cut here---------------end--------------->8---

Ideas?

Thanks,
Ludo’.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]