- ALL_LINGUAS=`sed 's/#.*$//' "$srcdir/po/LINGUAS"`
-
- : ${LINGUAS=all}
- if test x"$LINGUAS" != x"all"; then
- # Replicate la_CC-style codes as la.
- LINGUAS=`printf '%s\n' "$LINGUAS" \
- | [sed 's/\([^_[:space:]]*\)_[^[:space:]]*/& \1/g']`
-
- printf '%s\n' $ALL_LINGUAS | sort > conftest.LINGUAS
- LINGUAS=`printf '%s\n' $LINGUAS | sort \
- | join - conftest.LINGUAS`
- else
- LINGUAS=$ALL_LINGUAS
- fi
-
- # 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
-
- if test x"$USE_NLS" = x"yes"; then
- set x $LINGUAS; shift
- case ${#} in
- 0) ;;
- *) MOFILES=`printf "po/%s.mo\n" "${@}"` ;;
- esac
- fi
+ awk '{ sub(/#.*$/, "")
+ for (i = 1; i <= NF; i++) {
+ print $(i)
+ }
+ }' "$srcdir/po/LINGUAS" | sort -u >conftest.all
+
+ : "${LINGUAS=all}"
+ if test x"$LINGUAS" = x"all"; then
+ cp conftest.all conftest.ena
+ else
+ :; {
+ for arg in $LINGUAS; do
+ # 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%%_*}" ;;
+ esac
+ done
+ } | 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
+
+ if test x"$USE_NLS" = x"yes"; then
+ set x $LINGUAS; shift
+ case ${#} in
+ 0) ;;
+ *) MOFILES=`printf "po/%s.mo\n" "${@}"` ;;
+ esac
+ fi
+
+ rm -f conftest.all conftest.ena