} | 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 3<conftest.all
+ while read x <&3; do
+ AS_VAR_APPEND([POFILES], ["${POFILES:+ }po/$x.po"])
+ done
if test x"$USE_NLS" = x"yes"; then
- set x $LINGUAS; shift
- case ${#} in
- 0) ;;
- *) MOFILES=`printf "po/%s.mo\n" "${@}"` ;;
- esac
+ join conftest.ena conftest.all >conftest.out
+ exec 3<conftest.out
+ while read x <&3; do
+ AS_VAR_APPEND([MOFILES], ["${MOFILES:+ }po/$x.mo"])
+ done
fi
- rm -f conftest.all conftest.ena
+ exec 3<&-
+ rm -f conftest.all conftest.ena conftest.out
fi
AC_SUBST([POFILES])
]])
AT_CLEANUP
+
+AT_SETUP([DX_LINGUAS default install all])
+AT_KEYWORDS([DX_LINGUAS macro])
+
+AS_UNSET([LINGUAS])
+AT_SKIP_IF([test ${LINGUAS+y}])
+
+echo : >config.rpath
+chmod +x config.rpath
+
+mkdir po
+AT_DATA([po/LINGUAS], [[en ja # a comment ko
+zh
+]])
+
+AT_DATA([test.in], [[POFILES = @POFILES@
+MOFILES = @MOFILES@
+]])
+
+TEST_CONFIGURE_AC(
+[[m4@&t@_traceoff([AM_GNU_GETTEXT])
+AM_GNU_GETTEXT([external])
+DX_LINGUAS
+AC_CONFIG_FILES([test])
+]])
+
+TEST_AUTORECONF
+TEST_CONFIGURE
+
+AT_CHECK([cat test], [0],
+[[POFILES = po/en.po po/ja.po po/zh.po
+MOFILES = po/en.mo po/ja.mo po/zh.mo
+]])
+
+AT_CLEANUP