From 81e3adea05a88e0f537e190b2bdee850d33bc2fa Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 1 Jul 2025 22:12:13 +0200 Subject: [PATCH] autopoint: Don't fail if no gettext version is specified, part 2. * gettext-tools/misc/autopoint.in (func_trace_sed): Recognize also macro calls without arguments. * gettext-tools/tests/autopoint-1: Remove unneeded parentheses in macro call. --- gettext-tools/misc/autopoint.in | 8 ++++++-- gettext-tools/tests/autopoint-1 | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gettext-tools/misc/autopoint.in b/gettext-tools/misc/autopoint.in index 61348bed6..f32b1930b 100644 --- a/gettext-tools/misc/autopoint.in +++ b/gettext-tools/misc/autopoint.in @@ -159,11 +159,13 @@ m4_pushdef([m4_esyscmd]) # func_trace_sed macro configure.ac # traces an Autoconf macro call and outputs the arguments to stdout, -# using sed. +# using sed. For a macro call without arguments, print just a blank line. func_trace_sed () { sed_extract_arguments=' -s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,; +s,#.*$,, +s,^dnl .*$,, +s, dnl .*$,, /'"$1"'(/ { ta :a @@ -175,6 +177,8 @@ s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,; :b s,^.*'"$1"'([[ ]*\([^]"$`\\)]*\).*$,\1,p } +/'"$1"'[^A-Za-z0-9_(]/ s,^.*$,,p +/'"$1"'$/ s,^.*$,,p d' sed -e "$sed_extract_arguments" "$2" } diff --git a/gettext-tools/tests/autopoint-1 b/gettext-tools/tests/autopoint-1 index 7dd8255a6..19b01c530 100755 --- a/gettext-tools/tests/autopoint-1 +++ b/gettext-tools/tests/autopoint-1 @@ -53,7 +53,7 @@ AC_INIT AC_CONFIG_SRCDIR(hello.c) AC_PROG_CC -AM_GNU_GETTEXT() +AM_GNU_GETTEXT AC_CONFIG_FILES([Makefile]) AC_OUTPUT -- 2.47.3