2008-02-15 10:58:01 +01:00
|
|
|
# po.m4 serial 15 (gettext-0.17)
|
|
|
|
dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
|
2006-11-21 12:00:14 +01:00
|
|
|
dnl This file is free software; the Free Software Foundation
|
|
|
|
dnl gives unlimited permission to copy and/or distribute it,
|
|
|
|
dnl with or without modifications, as long as this notice is preserved.
|
2003-10-25 18:27:24 +02:00
|
|
|
dnl
|
2017-02-20 22:19:50 +01:00
|
|
|
dnl This file can be used in projects which are not available under
|
2003-10-25 18:27:24 +02:00
|
|
|
dnl the GNU General Public License or the GNU Library General Public
|
|
|
|
dnl License but which still want to provide support for the GNU gettext
|
|
|
|
dnl functionality.
|
|
|
|
dnl Please note that the actual code of the GNU gettext library is covered
|
|
|
|
dnl by the GNU Library General Public License, and the rest of the GNU
|
2017-02-20 22:19:50 +01:00
|
|
|
dnl gettext package is covered by the GNU General Public License.
|
2003-10-25 18:27:24 +02:00
|
|
|
dnl They are *not* in the public domain.
|
|
|
|
|
|
|
|
dnl Authors:
|
|
|
|
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
|
|
|
|
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
|
|
|
|
|
2006-11-21 12:00:14 +01:00
|
|
|
AC_PREREQ(2.50)
|
|
|
|
|
2003-10-25 18:27:24 +02:00
|
|
|
dnl Checks for all prerequisites of the po subdirectory.
|
|
|
|
AC_DEFUN([AM_PO_SUBDIRS],
|
|
|
|
[
|
|
|
|
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
|
|
|
AC_REQUIRE([AC_PROG_INSTALL])dnl
|
2014-12-11 15:14:44 +01:00
|
|
|
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
|
2003-10-25 18:27:24 +02:00
|
|
|
AC_REQUIRE([AM_NLS])dnl
|
|
|
|
|
2008-02-15 10:58:01 +01:00
|
|
|
dnl Release version of the gettext macros. This is used to ensure that
|
|
|
|
dnl the gettext macros and po/Makefile.in.in are in sync.
|
|
|
|
AC_SUBST([GETTEXT_MACRO_VERSION], [0.17])
|
|
|
|
|
2003-10-25 18:27:24 +02:00
|
|
|
dnl Perform the following tests also if --disable-nls has been given,
|
|
|
|
dnl because they are needed for "make dist" to work.
|
|
|
|
|
|
|
|
dnl Search for GNU msgfmt in the PATH.
|
|
|
|
dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
|
|
|
|
dnl The second test excludes FreeBSD msgfmt.
|
|
|
|
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
|
2006-11-21 12:00:14 +01:00
|
|
|
[$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
|
2003-10-25 18:27:24 +02:00
|
|
|
(if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
|
|
|
|
:)
|
|
|
|
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
|
|
|
|
|
2006-11-21 12:00:14 +01:00
|
|
|
dnl Test whether it is GNU msgfmt >= 0.15.
|
|
|
|
changequote(,)dnl
|
|
|
|
case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
|
|
|
|
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
|
|
|
|
*) MSGFMT_015=$MSGFMT ;;
|
|
|
|
esac
|
|
|
|
changequote([,])dnl
|
|
|
|
AC_SUBST([MSGFMT_015])
|
|
|
|
changequote(,)dnl
|
|
|
|
case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
|
|
|
|
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
|
|
|
|
*) GMSGFMT_015=$GMSGFMT ;;
|
|
|
|
esac
|
|
|
|
changequote([,])dnl
|
|
|
|
AC_SUBST([GMSGFMT_015])
|
|
|
|
|
2003-10-25 18:27:24 +02:00
|
|
|
dnl Search for GNU xgettext 0.12 or newer in the PATH.
|
|
|
|
dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
|
|
|
|
dnl The second test excludes FreeBSD xgettext.
|
|
|
|
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
2006-11-21 12:00:14 +01:00
|
|
|
[$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
|
2003-10-25 18:27:24 +02:00
|
|
|
(if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
|
|
|
|
:)
|
|
|
|
dnl Remove leftover from FreeBSD xgettext call.
|
|
|
|
rm -f messages.po
|
|
|
|
|
2006-11-21 12:00:14 +01:00
|
|
|
dnl Test whether it is GNU xgettext >= 0.15.
|
|
|
|
changequote(,)dnl
|
|
|
|
case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
|
|
|
|
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
|
|
|
|
*) XGETTEXT_015=$XGETTEXT ;;
|
|
|
|
esac
|
|
|
|
changequote([,])dnl
|
|
|
|
AC_SUBST([XGETTEXT_015])
|
|
|
|
|
2003-10-25 18:27:24 +02:00
|
|
|
dnl Search for GNU msgmerge 0.11 or newer in the PATH.
|
|
|
|
AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
|
2006-11-21 12:00:14 +01:00
|
|
|
[$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
|
2003-10-25 18:27:24 +02:00
|
|
|
|
2006-11-21 12:00:14 +01:00
|
|
|
dnl Installation directories.
|
|
|
|
dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
|
|
|
|
dnl have to define it here, so that it can be used in po/Makefile.
|
|
|
|
test -n "$localedir" || localedir='${datadir}/locale'
|
|
|
|
AC_SUBST([localedir])
|
2003-10-25 18:27:24 +02:00
|
|
|
|
2008-02-15 10:58:01 +01:00
|
|
|
dnl Support for AM_XGETTEXT_OPTION.
|
|
|
|
test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
|
|
|
|
AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
|
|
|
|
|
2006-11-21 12:00:14 +01:00
|
|
|
AC_CONFIG_COMMANDS([po-directories], [[
|
2003-10-25 18:27:24 +02:00
|
|
|
for ac_file in $CONFIG_FILES; do
|
|
|
|
# Support "outfile[:infile[:infile...]]"
|
|
|
|
case "$ac_file" in
|
|
|
|
*:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
|
|
|
|
esac
|
|
|
|
# PO directories have a Makefile.in generated from Makefile.in.in.
|
|
|
|
case "$ac_file" in */Makefile.in)
|
|
|
|
# Adjust a relative srcdir.
|
|
|
|
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
|
|
|
|
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
|
|
|
|
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
|
|
|
|
# In autoconf-2.13 it is called $ac_given_srcdir.
|
|
|
|
# In autoconf-2.50 it is called $srcdir.
|
|
|
|
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
|
|
|
|
case "$ac_given_srcdir" in
|
|
|
|
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
|
|
|
|
/*) top_srcdir="$ac_given_srcdir" ;;
|
|
|
|
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
|
|
|
|
esac
|
2006-11-21 12:00:14 +01:00
|
|
|
# Treat a directory as a PO directory if and only if it has a
|
|
|
|
# POTFILES.in file. This allows packages to have multiple PO
|
|
|
|
# directories under different names or in different locations.
|
2003-10-25 18:27:24 +02:00
|
|
|
if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
|
|
|
|
rm -f "$ac_dir/POTFILES"
|
|
|
|
test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
|
|
|
|
cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
|
|
|
|
POMAKEFILEDEPS="POTFILES.in"
|
2004-07-27 17:12:00 +02:00
|
|
|
# ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
|
2003-10-25 18:27:24 +02:00
|
|
|
# on $ac_dir but don't depend on user-specified configuration
|
|
|
|
# parameters.
|
|
|
|
if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
|
|
|
|
# The LINGUAS file contains the set of available languages.
|
|
|
|
if test -n "$OBSOLETE_ALL_LINGUAS"; then
|
|
|
|
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
|
|
|
|
fi
|
2006-11-21 12:00:14 +01:00
|
|
|
ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
|
2017-04-28 03:06:33 +02:00
|
|
|
# Hide the ALL_LINGUAS assignment from automake < 1.5.
|
2003-10-25 18:27:24 +02:00
|
|
|
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
|
|
|
|
POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
|
|
|
|
else
|
|
|
|
# The set of available languages was given in configure.in.
|
2017-04-28 03:06:33 +02:00
|
|
|
# Hide the ALL_LINGUAS assignment from automake < 1.5.
|
2003-10-25 18:27:24 +02:00
|
|
|
eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
|
|
|
|
fi
|
2004-07-27 17:12:00 +02:00
|
|
|
# Compute POFILES
|
|
|
|
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
|
|
|
|
# Compute UPDATEPOFILES
|
|
|
|
# as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
|
|
|
|
# Compute DUMMYPOFILES
|
|
|
|
# as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
|
|
|
|
# Compute GMOFILES
|
|
|
|
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
|
2003-10-25 18:27:24 +02:00
|
|
|
case "$ac_given_srcdir" in
|
|
|
|
.) srcdirpre= ;;
|
|
|
|
*) srcdirpre='$(srcdir)/' ;;
|
|
|
|
esac
|
|
|
|
POFILES=
|
|
|
|
UPDATEPOFILES=
|
|
|
|
DUMMYPOFILES=
|
2004-07-27 17:12:00 +02:00
|
|
|
GMOFILES=
|
2003-10-25 18:27:24 +02:00
|
|
|
for lang in $ALL_LINGUAS; do
|
|
|
|
POFILES="$POFILES $srcdirpre$lang.po"
|
|
|
|
UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
|
|
|
|
DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
|
2004-07-27 17:12:00 +02:00
|
|
|
GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
|
2003-10-25 18:27:24 +02:00
|
|
|
done
|
|
|
|
# CATALOGS depends on both $ac_dir and the user's LINGUAS
|
|
|
|
# environment variable.
|
|
|
|
INST_LINGUAS=
|
|
|
|
if test -n "$ALL_LINGUAS"; then
|
|
|
|
for presentlang in $ALL_LINGUAS; do
|
|
|
|
useit=no
|
|
|
|
if test "%UNSET%" != "$LINGUAS"; then
|
|
|
|
desiredlanguages="$LINGUAS"
|
|
|
|
else
|
|
|
|
desiredlanguages="$ALL_LINGUAS"
|
|
|
|
fi
|
|
|
|
for desiredlang in $desiredlanguages; do
|
|
|
|
# Use the presentlang catalog if desiredlang is
|
|
|
|
# a. equal to presentlang, or
|
|
|
|
# b. a variant of presentlang (because in this case,
|
|
|
|
# presentlang can be used as a fallback for messages
|
|
|
|
# which are not translated in the desiredlang catalog).
|
|
|
|
case "$desiredlang" in
|
|
|
|
"$presentlang"*) useit=yes;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
if test $useit = yes; then
|
|
|
|
INST_LINGUAS="$INST_LINGUAS $presentlang"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
CATALOGS=
|
|
|
|
if test -n "$INST_LINGUAS"; then
|
|
|
|
for lang in $INST_LINGUAS; do
|
|
|
|
CATALOGS="$CATALOGS $lang.gmo"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
|
2004-07-27 17:12:00 +02:00
|
|
|
sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
|
2003-10-25 18:27:24 +02:00
|
|
|
for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
|
|
|
|
if test -f "$f"; then
|
|
|
|
case "$f" in
|
|
|
|
*.orig | *.bak | *~) ;;
|
|
|
|
*) cat "$f" >> "$ac_dir/Makefile" ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
2006-11-21 12:00:14 +01:00
|
|
|
done]],
|
2003-10-25 18:27:24 +02:00
|
|
|
[# Capture the value of obsolete ALL_LINGUAS because we need it to compute
|
2004-07-27 17:12:00 +02:00
|
|
|
# POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
|
2006-11-21 12:00:14 +01:00
|
|
|
# from automake < 1.5.
|
2003-10-25 18:27:24 +02:00
|
|
|
eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
|
|
|
|
# Capture the value of LINGUAS because we need it to compute CATALOGS.
|
|
|
|
LINGUAS="${LINGUAS-%UNSET%}"
|
|
|
|
])
|
|
|
|
])
|
2004-07-27 17:12:00 +02:00
|
|
|
|
|
|
|
dnl Postprocesses a Makefile in a directory containing PO files.
|
|
|
|
AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
|
|
|
|
[
|
|
|
|
# When this code is run, in config.status, two variables have already been
|
|
|
|
# set:
|
|
|
|
# - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
|
|
|
|
# - LINGUAS is the value of the environment variable LINGUAS at configure
|
|
|
|
# time.
|
|
|
|
|
|
|
|
changequote(,)dnl
|
|
|
|
# Adjust a relative srcdir.
|
|
|
|
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
|
|
|
|
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
|
|
|
|
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
|
|
|
|
# In autoconf-2.13 it is called $ac_given_srcdir.
|
|
|
|
# In autoconf-2.50 it is called $srcdir.
|
|
|
|
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
|
|
|
|
case "$ac_given_srcdir" in
|
|
|
|
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
|
|
|
|
/*) top_srcdir="$ac_given_srcdir" ;;
|
|
|
|
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Find a way to echo strings without interpreting backslash.
|
|
|
|
if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
|
|
|
|
gt_echo='echo'
|
|
|
|
else
|
|
|
|
if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
|
|
|
|
gt_echo='printf %s\n'
|
|
|
|
else
|
|
|
|
echo_func () {
|
|
|
|
cat <<EOT
|
|
|
|
$*
|
|
|
|
EOT
|
|
|
|
}
|
|
|
|
gt_echo='echo_func'
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# A sed script that extracts the value of VARIABLE from a Makefile.
|
|
|
|
sed_x_variable='
|
|
|
|
# Test if the hold space is empty.
|
|
|
|
x
|
|
|
|
s/P/P/
|
|
|
|
x
|
|
|
|
ta
|
|
|
|
# Yes it was empty. Look if we have the expected variable definition.
|
|
|
|
/^[ ]*VARIABLE[ ]*=/{
|
|
|
|
# Seen the first line of the variable definition.
|
|
|
|
s/^[ ]*VARIABLE[ ]*=//
|
|
|
|
ba
|
|
|
|
}
|
|
|
|
bd
|
|
|
|
:a
|
|
|
|
# Here we are processing a line from the variable definition.
|
|
|
|
# Remove comment, more precisely replace it with a space.
|
|
|
|
s/#.*$/ /
|
|
|
|
# See if the line ends in a backslash.
|
|
|
|
tb
|
|
|
|
:b
|
|
|
|
s/\\$//
|
|
|
|
# Print the line, without the trailing backslash.
|
|
|
|
p
|
|
|
|
tc
|
|
|
|
# There was no trailing backslash. The end of the variable definition is
|
|
|
|
# reached. Clear the hold space.
|
|
|
|
s/^.*$//
|
|
|
|
x
|
|
|
|
bd
|
|
|
|
:c
|
|
|
|
# A trailing backslash means that the variable definition continues in the
|
|
|
|
# next line. Put a nonempty string into the hold space to indicate this.
|
|
|
|
s/^.*$/P/
|
|
|
|
x
|
|
|
|
:d
|
|
|
|
'
|
|
|
|
changequote([,])dnl
|
|
|
|
|
|
|
|
# Set POTFILES to the value of the Makefile variable POTFILES.
|
2006-11-21 12:00:14 +01:00
|
|
|
sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
|
2004-07-27 17:12:00 +02:00
|
|
|
POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
|
|
|
|
# Compute POTFILES_DEPS as
|
|
|
|
# $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
|
|
|
|
POTFILES_DEPS=
|
|
|
|
for file in $POTFILES; do
|
|
|
|
POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
|
|
|
|
done
|
|
|
|
POMAKEFILEDEPS=""
|
|
|
|
|
|
|
|
if test -n "$OBSOLETE_ALL_LINGUAS"; then
|
|
|
|
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
|
|
|
|
fi
|
|
|
|
if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
|
|
|
|
# The LINGUAS file contains the set of available languages.
|
2006-11-21 12:00:14 +01:00
|
|
|
ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
|
2004-07-27 17:12:00 +02:00
|
|
|
POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
|
|
|
|
else
|
|
|
|
# Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
|
2006-11-21 12:00:14 +01:00
|
|
|
sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
|
2004-07-27 17:12:00 +02:00
|
|
|
ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
|
|
|
|
fi
|
2017-04-28 03:06:33 +02:00
|
|
|
# Hide the ALL_LINGUAS assignment from automake < 1.5.
|
2004-07-27 17:12:00 +02:00
|
|
|
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
|
|
|
|
# Compute POFILES
|
|
|
|
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
|
|
|
|
# Compute UPDATEPOFILES
|
|
|
|
# as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
|
|
|
|
# Compute DUMMYPOFILES
|
|
|
|
# as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
|
|
|
|
# Compute GMOFILES
|
|
|
|
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
|
|
|
|
# Compute PROPERTIESFILES
|
|
|
|
# as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
|
|
|
|
# Compute CLASSFILES
|
|
|
|
# as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
|
|
|
|
# Compute QMFILES
|
|
|
|
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
|
|
|
|
# Compute MSGFILES
|
|
|
|
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
|
|
|
|
# Compute RESOURCESDLLFILES
|
|
|
|
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
|
|
|
|
case "$ac_given_srcdir" in
|
|
|
|
.) srcdirpre= ;;
|
|
|
|
*) srcdirpre='$(srcdir)/' ;;
|
|
|
|
esac
|
|
|
|
POFILES=
|
|
|
|
UPDATEPOFILES=
|
|
|
|
DUMMYPOFILES=
|
|
|
|
GMOFILES=
|
|
|
|
PROPERTIESFILES=
|
|
|
|
CLASSFILES=
|
|
|
|
QMFILES=
|
|
|
|
MSGFILES=
|
|
|
|
RESOURCESDLLFILES=
|
|
|
|
for lang in $ALL_LINGUAS; do
|
|
|
|
POFILES="$POFILES $srcdirpre$lang.po"
|
|
|
|
UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
|
|
|
|
DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
|
|
|
|
GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
|
|
|
|
PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
|
|
|
|
CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
|
|
|
|
QMFILES="$QMFILES $srcdirpre$lang.qm"
|
|
|
|
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
|
|
|
|
MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
|
2006-11-21 12:00:14 +01:00
|
|
|
frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
|
2004-07-27 17:12:00 +02:00
|
|
|
RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
|
|
|
|
done
|
|
|
|
# CATALOGS depends on both $ac_dir and the user's LINGUAS
|
|
|
|
# environment variable.
|
|
|
|
INST_LINGUAS=
|
|
|
|
if test -n "$ALL_LINGUAS"; then
|
|
|
|
for presentlang in $ALL_LINGUAS; do
|
|
|
|
useit=no
|
|
|
|
if test "%UNSET%" != "$LINGUAS"; then
|
|
|
|
desiredlanguages="$LINGUAS"
|
|
|
|
else
|
|
|
|
desiredlanguages="$ALL_LINGUAS"
|
|
|
|
fi
|
|
|
|
for desiredlang in $desiredlanguages; do
|
|
|
|
# Use the presentlang catalog if desiredlang is
|
|
|
|
# a. equal to presentlang, or
|
|
|
|
# b. a variant of presentlang (because in this case,
|
|
|
|
# presentlang can be used as a fallback for messages
|
|
|
|
# which are not translated in the desiredlang catalog).
|
|
|
|
case "$desiredlang" in
|
|
|
|
"$presentlang"*) useit=yes;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
if test $useit = yes; then
|
|
|
|
INST_LINGUAS="$INST_LINGUAS $presentlang"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
CATALOGS=
|
|
|
|
JAVACATALOGS=
|
|
|
|
QTCATALOGS=
|
|
|
|
TCLCATALOGS=
|
|
|
|
CSHARPCATALOGS=
|
|
|
|
if test -n "$INST_LINGUAS"; then
|
|
|
|
for lang in $INST_LINGUAS; do
|
|
|
|
CATALOGS="$CATALOGS $lang.gmo"
|
|
|
|
JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
|
|
|
|
QTCATALOGS="$QTCATALOGS $lang.qm"
|
|
|
|
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
|
|
|
|
TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
|
2006-11-21 12:00:14 +01:00
|
|
|
frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
|
2004-07-27 17:12:00 +02:00
|
|
|
CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
|
|
|
|
if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
|
|
|
|
# Add dependencies that cannot be formulated as a simple suffix rule.
|
|
|
|
for lang in $ALL_LINGUAS; do
|
|
|
|
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
|
|
|
|
cat >> "$ac_file.tmp" <<EOF
|
|
|
|
$frobbedlang.msg: $lang.po
|
|
|
|
@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
|
|
|
|
\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
|
|
|
|
EOF
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
|
|
|
|
# Add dependencies that cannot be formulated as a simple suffix rule.
|
|
|
|
for lang in $ALL_LINGUAS; do
|
2006-11-21 12:00:14 +01:00
|
|
|
frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
|
2004-07-27 17:12:00 +02:00
|
|
|
cat >> "$ac_file.tmp" <<EOF
|
|
|
|
$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
|
|
|
|
@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
|
|
|
|
\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
|
|
|
|
EOF
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
if test -n "$POMAKEFILEDEPS"; then
|
|
|
|
cat >> "$ac_file.tmp" <<EOF
|
|
|
|
Makefile: $POMAKEFILEDEPS
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
mv "$ac_file.tmp" "$ac_file"
|
|
|
|
])
|
2008-02-15 10:58:01 +01:00
|
|
|
|
|
|
|
dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
|
|
|
|
AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
|
|
|
|
[
|
|
|
|
XGETTEXT_EXTRA_OPTIONS=
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl Registers an option to be passed to xgettext in the po subdirectory.
|
|
|
|
AC_DEFUN([AM_XGETTEXT_OPTION],
|
|
|
|
[
|
|
|
|
AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
|
|
|
|
XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
|
|
|
|
])
|