The awk script used internally by this macro does not work on traditional
awk, such as old Solaris /bin/awk. Use $AWK to get a better awk.
To avoid similar problems in the future, arrange for tests to be run
with a busted "awk" command in PATH, so only $AWK will work at all.
-dnl Copyright © 2011, 2021-2022 Nick Bowler
+dnl Copyright © 2011, 2021-2023 Nick Bowler
dnl
dnl Computes the set of .po and .mo files based on the LINGUAS environment
dnl variable. The variable POFILES is set to the complete list of .po files,
dnl
dnl Computes the set of .po and .mo files based on the LINGUAS environment
dnl variable. The variable POFILES is set to the complete list of .po files,
AC_DEFUN([DX_LINGUAS],
[AC_REQUIRE([AM_GNU_GETTEXT])dnl
AC_REQUIRE([DX_PROG_JOIN])dnl
AC_DEFUN([DX_LINGUAS],
[AC_REQUIRE([AM_GNU_GETTEXT])dnl
AC_REQUIRE([DX_PROG_JOIN])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
POFILES=
MOFILES=
if test -f "$srcdir/po/LINGUAS"; then
POFILES=
MOFILES=
if test -f "$srcdir/po/LINGUAS"; then
+ $AWK '{ sub(/#.*$/, "")
for (i = 1; i <= NF; i++) {
print $(i)
}
for (i = 1; i <= NF; i++) {
print $(i)
}
--- /dev/null
+#!/bin/sh
+
+echo 'dummy dysfunctional awk' 1>&2
+false
m4_define([TEST_CONFIGURE_AC], [AT_KEYWORDS([autoconf m4])dnl
AT_DATA([configure.ac],
[[AC_INIT([test], [0])
m4_define([TEST_CONFIGURE_AC], [AT_KEYWORDS([autoconf m4])dnl
AT_DATA([configure.ac],
[[AC_INIT([test], [0])
+
+# Install t/bork into the path, which contains a non-functional
+# dummy "awk" command to catch direct "awk" usage (as opposed to
+# using AC_PROG_AWK and $AWK). Then work around direct awk usage
+# in LT_INIT to avoid the dummy.
+test_orig_PATH=$PATH
+PATH=$at_srcdir/t/bork:$PATH
+m4@&t@_ifdef([LT_INIT], [m4@&t@_define([LT_INIT],
+[m4@&t@_pushdef([awk], [$AWK])]m4@&t@_defn([LT_INIT])[m4@&t@_popdef([awk])])])
+
m4_define([TEST_CONFIGURE], [AT_KEYWORDS([configure])dnl
AT_CHECK([export CC
CONFIG_SHELL=$TEST_SHELL $TEST_SHELL m4_default([$2],
m4_define([TEST_CONFIGURE], [AT_KEYWORDS([configure])dnl
AT_CHECK([export CC
CONFIG_SHELL=$TEST_SHELL $TEST_SHELL m4_default([$2],
-[./configure]) --quiet CONFIG_SHELL=$TEST_SHELL $1])])
+[./configure]) --quiet CONFIG_SHELL="$TEST_SHELL" \
+ at_srcdir="$srcdir" AWK="$AWK" $1])])
m4_include([tests/macros.at])
m4_include([tests/snippets.at])
m4_include([tests/macros.at])
m4_include([tests/snippets.at])