Initial Import
[profile/ivi/json-glib.git] / build / autotools / as-linguas.m4
1 # Set ALL_ALL_LINGUAS based on the .po files present. Optional argument is the
2 # name of the po directory. $podir/LINGUAS.ignore can be used to ignore a
3 # subset of the po files.
4
5 AC_DEFUN([AS_ALL_LINGUAS],
6 [
7  AC_MSG_CHECKING([for linguas])
8  podir="m4_default([$1],[$srcdir/po])"
9  linguas=`cd $podir && ls *.po 2>/dev/null | awk 'BEGIN { FS="."; ORS=" " } { print $[]1 }'`
10  if test -f "$podir/LINGUAS.ignore"; then
11    ALL_LINGUAS="";
12    ignore_linguas=`sed -n -e 's/^\s\+\|\s\+$//g' -e '/^#/b' -e '/\S/!b' \
13                        -e 's/\s\+/\n/g' -e p "$podir/LINGUAS.ignore"`;
14    for lang in $linguas; do
15      if ! echo "$ignore_linguas" | grep -q "^${lang}$"; then
16        ALL_LINGUAS="$ALL_LINGUAS $lang";
17      fi;
18    done;
19  else
20    ALL_LINGUAS="$linguas";
21  fi;
22  AC_SUBST([ALL_LINGUAS])
23  AC_MSG_RESULT($ALL_LINGUAS)
24 ])