[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ‘libunistring’ module errors
From: |
Bruno Haible |
Subject: |
Re: ‘libunistring’ module errors |
Date: |
Thu, 3 Jun 2010 14:01:29 +0200 |
User-agent: |
KMail/1.9.9 |
Hi Ludo,
> There’s something wrong for me after the Gnulib update:
>
> --8<---------------cut here---------------start------------->8---
> $ rm aclocal.m4
>
> $ autoreconf -vfi
> autoreconf: Entering directory `.'
> autoreconf: configure.ac: not using Gettext
> autoreconf: running: aclocal --force -I m4
> autoreconf: configure.ac: tracing
> autoreconf: configure.ac: AM_GNU_GETTEXT is used, but not
> AM_GNU_GETTEXT_VERSION
> autoreconf: running: libtoolize --copy --force
> libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
> libtoolize: copying file `build-aux/ltmain.sh'
> libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
> libtoolize: copying file `m4/libtool.m4'
> libtoolize: copying file `m4/ltoptions.m4'
> libtoolize: copying file `m4/ltsugar.m4'
> libtoolize: copying file `m4/ltversion.m4'
> libtoolize: copying file `m4/lt~obsolete.m4'
> autoreconf: running:
> /nix/store/shf97wvs8437hzj02rgridqbqcpz18sx-autoconf-2.65/bin/autoconf --force
> configure:14603: error: possibly undefined macro: gl_LIBUNISTRING
With the snapshot that you previously mentioned, I could reproduce this.
The reason is that 'aclocal' has generated an aclocal.m4 file that does not
include m4/libunistring.m4. I thought that 'aclocal' was using autom4te with
--trace options, implying that any AC_DEFUN or AC_DEFUN_ONCE invocation that
is correct from an m4 point of view is also seen by 'aclocal'. But this is
not the case: 'aclocal' actually has a first pass that scans the files using
'grep', rather than autom4te. This pass fails to notice the AC_DEFUN or
AC_DEFUN_ONCE invocation if it is written in this way:
m4_version_prereq([2.64],[AC_DEFUN_ONCE],[AC_DEFUN])([gl_LIBUNISTRING], ...)
This patch adds a workaround by using a syntax that is both m4-correct _and_
matches the undocumented(!) syntax that 'aclocal' expects.
2010-06-03 Bruno Haible <address@hidden>
Choose among AC_DEFUN_ONCE, AC_DEFUN in a way that aclocal understands.
* m4/iconv.m4 (gl_iconv_AC_DEFUN): New macro.
(AM_ICONV): Define it through gl_iconv_AC_DEFUN.
* m4/libunistring.m4 (gl_libunistring_AC_DEFUN): New macro.
(gl_LIBUNISTRING): Define it through gl_libunistring_AC_DEFUN.
Reported by Ludovic Courtès <address@hidden>.
--- m4/iconv.m4.orig Thu Jun 3 13:51:51 2010
+++ m4/iconv.m4 Thu Jun 3 13:45:14 2010
@@ -1,4 +1,4 @@
-# iconv.m4 serial 10 (gettext-0.18.1)
+# iconv.m4 serial 11 (gettext-0.18.1)
dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -173,7 +173,19 @@
dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
dnl avoid warnings like
dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
-m4_version_prereq([2.64],[AC_DEFUN_ONCE],[AC_DEFUN])([AM_ICONV],
+dnl This is tricky because of the way 'aclocal' is implemented:
+dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
+dnl Otherwise aclocal's initial scan pass would miss the macro definition.
+dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN
expansions.
+dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
+dnl warnings.
+m4_define([gl_iconv_AC_DEFUN],
+ m4_version_prereq([2.64],
+ [[AC_DEFUN_ONCE(
+ [$1], [$2])]],
+ [[AC_DEFUN(
+ [$1], [$2])]]))
+gl_iconv_AC_DEFUN([AM_ICONV],
[
AM_ICONV_LINK
if test "$am_cv_func_iconv" = yes; then
--- m4/libunistring.m4.orig Thu Jun 3 13:51:51 2010
+++ m4/libunistring.m4 Thu Jun 3 13:44:00 2010
@@ -1,4 +1,4 @@
-# libunistring.m4 serial 7
+# libunistring.m4 serial 8
dnl Copyright (C) 2009-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,19 @@
dnl Define gl_LIBUNISTRING using AC_DEFUN_ONCE for Autoconf >= 2.64, in order
dnl to avoid warnings like
dnl "warning: AC_REQUIRE: `gl_LIBUNISTRING' was expanded before it was
required".
-m4_version_prereq([2.64],[AC_DEFUN_ONCE],[AC_DEFUN])([gl_LIBUNISTRING],
+dnl This is tricky because of the way 'aclocal' is implemented:
+dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
+dnl Otherwise aclocal's initial scan pass would miss the macro definition.
+dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN
expansions.
+dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
+dnl warnings.
+m4_define([gl_libunistring_AC_DEFUN],
+ m4_version_prereq([2.64],
+ [[AC_DEFUN_ONCE(
+ [$1], [$2])]],
+ [[AC_DEFUN(
+ [$1], [$2])]]))
+gl_libunistring_AC_DEFUN([gl_LIBUNISTRING],
[
AC_BEFORE([$0], [gl_LIBUNISTRING_LIBSOURCE])
AC_BEFORE([$0], [gl_LIBUNISTRING_LIBHEADER])