[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gettext] autopoint and m4_ifndef
From: |
Daiki Ueno |
Subject: |
Re: [bug-gettext] autopoint and m4_ifndef |
Date: |
Mon, 22 Jul 2013 12:18:33 +0900 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Hi Sami,
Sami Kerola <address@hidden> writes:
> My archlinux got gettext update to version 0.18.3 which made
> util-linux compilation to break. The util-linux fails at ./autogen.sh
> at line 'autopoint --force' which finds the following, and m4_fatal
> failure occurs.
>
> m4_ifndef([PKG_PROG_PKG_CONFIG],
> [m4_fatal([Could not locate the pkg-config autoconf
> macros. These are usually located in /usr/share/aclocal/pkg.m4.
> If your macros are in a different location, try setting the
> environment variable AL_OPTS="-I/other/macro/dir" before running
> ./autogen.sh or autoreconf again.])])
[...]
> commit 989529926b0e34126c50f128f4049361c2541eec
> Author: Daiki Ueno <address@hidden>
> Date: Mon Mar 4 18:19:02 2013 +0900
>
> autopoint: extract macro directories from configure.ac
Thanks for the report. After this commit we've started using:
autom4te --language=Autoconf-without-aclocal-m4 --trace
to capture AC_CONFIG_MACRO_DIR* calls more reliably. Unfortunately, in
practical cases (like above), it may cause errors in M4 level. I plan
to revert it not to use autom4te (patch attached), but maybe someone has
better ideas. Pavel?
Regards,
--
Daiki Ueno
>From 1bd3b81cd22b0c806e31bd1105625804341cba5e Mon Sep 17 00:00:00 2001
From: Daiki Ueno <address@hidden>
Date: Mon, 22 Jul 2013 12:13:18 +0900
Subject: [PATCH] autopoint: don't use autom4te to trace macro calls
autom4te --trace cannot be used in autopoint since autopoint is called
before aclocal, and configure.ac may have static checks depending on
aclocal.m4. Reported by Sami Kerola in
<https://lists.gnu.org/archive/html/bug-gettext/2013-07/msg00002.html>.
---
gettext-tools/misc/autopoint.in | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/gettext-tools/misc/autopoint.in b/gettext-tools/misc/autopoint.in
index 1ea960a..28e4a1c 100644
--- a/gettext-tools/misc/autopoint.in
+++ b/gettext-tools/misc/autopoint.in
@@ -140,16 +140,11 @@ fi
# traces an Autoconf macro call and outputs the arguments to stdout.
func_trace ()
{
- case "$1" in
- AC_*)
- # For Autoconf standard macros, autom4te --trace can be used.
- autom4te --no-cache --language=Autoconf-without-aclocal-m4
--trace="$1":\$% "$configure_in"
- ;;
- *)
- # Otherwise, manually extract macro calls in configure.ac with
- # sed. This is less reliable than the above way and does not
- # support multiple calls.
- sed_extract_arguments='
+ # We can't use autom4te --trace here, because:
+ # 1. 'autopoint' shall be called before 'aclocal'.
+ # 2. 'configure.ac' may have M4-level static error checks depending on
+ # macros put into aclocal.m4.
+ sed_extract_arguments='
s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,;
/'"$1"'(/ {
ta
@@ -163,9 +158,7 @@ s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,;
s,^.*'"$1"'([[ ]*\([^]"$`\\)]*\).*$,\1,p
}
d'
- sed -e "$sed_extract_arguments" "$configure_in"
- ;;
- esac
+ sed -e "$sed_extract_arguments" "$configure_in"
}
# func_usage
@@ -332,7 +325,7 @@ if test -n "$auxdir"; then
fi
# Check in which directory the *.m4 macros belong.
-macrodirs=`func_trace AC_CONFIG_MACRO_DIR_TRACE`
+macrodirs=`func_trace AC_CONFIG_MACRO_DIRS`
if test -z "$macrodirs"; then
macrodirs=`func_trace AC_CONFIG_MACRO_DIR`
fi
--
1.8.3.1