X-Git-Url: http://git.draconx.ca/gitweb/dxcommon.git/blobdiff_plain/c6f9cd97c0399d9bd827ac823c9f59aefa6e456c..0a296c1808200072deea6285f3e9992fca6095dd:/m4/linguas.m4 diff --git a/m4/linguas.m4 b/m4/linguas.m4 index 61613b6..fce4e0c 100644 --- a/m4/linguas.m4 +++ b/m4/linguas.m4 @@ -1,4 +1,4 @@ -dnl Copyright © 2011, 2021 Nick Bowler +dnl Copyright © 2011, 2021-2022 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, @@ -12,6 +12,7 @@ dnl There is NO WARRANTY, to the extent permitted by law. AC_DEFUN([DX_LINGUAS], [AC_REQUIRE([AM_GNU_GETTEXT])dnl +AC_REQUIRE([DX_PROG_JOIN])dnl POFILES= MOFILES= @@ -21,7 +22,7 @@ if test -f "$srcdir/po/LINGUAS"; then for (i = 1; i <= NF; i++) { print $(i) } - }' "$srcdir/po/LINGUAS" | sort -u >conftest.all + }' "$srcdir/po/LINGUAS" | LC_ALL=C sort -u >conftest.all : "${LINGUAS=all}" if test x"$LINGUAS" = x"all"; then @@ -32,31 +33,32 @@ if test -f "$srcdir/po/LINGUAS"; then # Ensure that if "la_CC"-style code is requested then so is plain "la". printf '%s\n' "$arg" case $arg in - *_*) printf '%s\n' "${arg%%_*}" ;; + *_*) + save_IFS=$IFS; IFS=_ + set x $arg + IFS=$save_IFS + AS_ECHO(["${2}"]) + ;; esac done - } | sort -u >conftest.ena + } | LC_ALL=C sort -u >conftest.ena fi - ALL_LINGUAS=`cat conftest.all` - LINGUAS=`join conftest.ena conftest.all` - - # Note: $srcdir is not used here because these variables are for make. - set x $ALL_LINGUAS; shift - case ${#} in - 0) ;; - *) POFILES=`printf "po/%s.po\n" "${@}"` ;; - esac + exec 3conftest.out + exec 3