2N/Adnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
2N/Adnl This file is free software; the Free Software Foundation
2N/Adnl gives unlimited permission to copy
and/or distribute it,
2N/Adnl with or without modifications, as long as this notice is preserved.
2N/Adnl This file can can be used in projects which are not available under
2N/Adnl the GNU General Public License or the GNU Library General Public
2N/Adnl License but which still want to provide support for the GNU gettext
2N/Adnl Please note that the actual code of the GNU gettext library is covered
2N/Adnl by the GNU Library General Public License, and the rest of the GNU
2N/Adnl gettext package package is covered by the GNU General Public License.
2N/Adnl They are *not* in the public domain.
2N/Adnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
2N/Adnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
2N/Adnl Checks for all prerequisites of the po subdirectory.
2N/AAC_DEFUN([AM_PO_SUBDIRS],
2N/A AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2N/A AC_REQUIRE([AC_PROG_INSTALL])dnl
2N/A AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
2N/A AC_REQUIRE([AM_NLS])dnl
2N/A dnl Release version of the gettext macros. This is used to ensure that
2N/A AC_SUBST([GETTEXT_MACRO_VERSION], [0.18])
2N/A dnl Perform the following tests also if --disable-nls has been given,
2N/A dnl because they are needed for "make dist" to work.
2N/A dnl Search for GNU msgfmt in the PATH.
2N/A dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
2N/A dnl The second test excludes FreeBSD msgfmt.
2N/A AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
2N/A [$ac_dir/$ac_word --statistics
/dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
2N/A AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
2N/A dnl Test whether it is GNU msgfmt >= 0.15.
2N/A case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2N/A '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
2N/A *) MSGFMT_015=$MSGFMT ;;
2N/A AC_SUBST([MSGFMT_015])
2N/A case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2N/A '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
2N/A *) GMSGFMT_015=$GMSGFMT ;;
2N/A AC_SUBST([GMSGFMT_015])
2N/A dnl Search for GNU xgettext 0.12 or newer in the PATH.
2N/A dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
2N/A dnl The second test excludes FreeBSD xgettext.
2N/A AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
2N/A [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address=
/dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
2N/A (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)],
2N/A dnl Remove leftover from FreeBSD xgettext call.
2N/A dnl Test whether it is GNU xgettext >= 0.15.
2N/A case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2N/A '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
2N/A *) XGETTEXT_015=$XGETTEXT ;;
2N/A AC_SUBST([XGETTEXT_015])
2N/A dnl Search for GNU msgmerge 0.11 or newer in the PATH.
2N/A AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
2N/A dnl Installation directories.
2N/A dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
2N/A test -n "$localedir" || localedir='${datadir}/locale'
2N/A AC_SUBST([localedir])
2N/A dnl Support for AM_XGETTEXT_OPTION.
2N/A test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
2N/A AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
2N/A AC_CONFIG_COMMANDS([po-directories], [[
2N/A for ac_file in $CONFIG_FILES; do
2N/A # Support "outfile[:infile[:infile...]]"
2N/A *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2N/A # Adjust a relative srcdir.
2N/A ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2N/A ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2N/A ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2N/A # In autoconf-2.13 it is called $ac_given_srcdir.
2N/A # In autoconf-2.50 it is called $srcdir.
2N/A test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2N/A case "$ac_given_srcdir" in
2N/A .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2N/A /*) top_srcdir="$ac_given_srcdir" ;;
2N/A *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
2N/A # Treat a directory as a PO directory if and only if it has a
2N/A # directories under different names or in different locations.
2N/A # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
2N/A # on $ac_dir but don't depend on user-specified configuration
2N/A # The LINGUAS file contains the set of available languages.
2N/A if test -n "$OBSOLETE_ALL_LINGUAS"; then
2N/A test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in
configure.in is obsolete" || echo "setting ALL_LINGUAS in
configure.in is obsolete"
2N/A # Hide the ALL_LINGUAS assigment from automake < 1.5.
2N/A eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2N/A POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2N/A # Hide the ALL_LINGUAS assigment from automake < 1.5.
2N/A eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
2N/A # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2N/A # Compute UPDATEPOFILES
2N/A # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2N/A # Compute DUMMYPOFILES
2N/A # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2N/A # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2N/A case "$ac_given_srcdir" in
2N/A *) srcdirpre='$(srcdir)/' ;;
2N/A for lang in $ALL_LINGUAS; do
2N/A # CATALOGS depends on both $ac_dir and the user's LINGUAS
2N/A # environment variable.
2N/A if test -n "$ALL_LINGUAS"; then
2N/A for presentlang in $ALL_LINGUAS; do
2N/A if test "%UNSET%" != "$LINGUAS"; then
2N/A desiredlanguages="$LINGUAS"
2N/A desiredlanguages="$ALL_LINGUAS"
2N/A for desiredlang in $desiredlanguages; do
2N/A # Use the presentlang catalog if desiredlang is
2N/A # a. equal to presentlang, or
2N/A # b. a variant of presentlang (because in this case,
2N/A # presentlang can be used as a fallback for messages
2N/A # which are not translated in the desiredlang catalog).
2N/A case "$desiredlang" in
2N/A "$presentlang"*) useit=yes;;
2N/A if test $useit = yes; then
2N/A INST_LINGUAS="$INST_LINGUAS $presentlang"
2N/A if test -n "$INST_LINGUAS"; then
2N/A for lang in $INST_LINGUAS; do
2N/A 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"
2N/A for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
2N/A if test -f "$f"; then
2N/A *.orig | *.bak | *~) ;;
2N/A [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
2N/A # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
2N/A # from automake < 1.5.
2N/A eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
2N/A # Capture the value of LINGUAS because we need it to compute CATALOGS.
2N/A LINGUAS="${LINGUAS-%UNSET%}"
2N/Adnl Postprocesses a Makefile in a directory containing PO files.
2N/AAC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
2N/A # - LINGUAS is the value of the environment variable LINGUAS at configure
2N/A # Adjust a relative srcdir.
2N/A ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2N/A ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2N/A ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2N/A # In autoconf-2.13 it is called $ac_given_srcdir.
2N/A # In autoconf-2.50 it is called $srcdir.
2N/A test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2N/A case "$ac_given_srcdir" in
2N/A .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2N/A /*) top_srcdir="$ac_given_srcdir" ;;
2N/A *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
2N/A # Find a way to echo strings without interpreting backslash.
2N/A gt_echo='printf %s\n'
2N/A # A sed script that extracts the value of VARIABLE from a Makefile.
2N/A# Test if the hold space is empty.
2N/A# Yes it was empty. Look if we have the expected variable definition.
2N/A/^[ ]*VARIABLE[ ]*=/{
2N/A # Seen the first line of the variable definition.
2N/A s/^[ ]*VARIABLE[ ]*=//
2N/A# Here we are processing a line from the variable definition.
2N/A# Remove comment, more precisely replace it with a space.
2N/A# See if the line ends in a backslash.
2N/A# Print the line, without the trailing backslash.
2N/A# There was no trailing backslash. The end of the variable definition is
2N/A# reached. Clear the hold space.
2N/A# A trailing backslash means that the variable definition continues in the
2N/A# next line. Put a nonempty string into the hold space to indicate this.
2N/A # Set POTFILES to the value of the Makefile variable POTFILES.
2N/A POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
2N/A # Compute POTFILES_DEPS as
2N/A # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
2N/A for file in $POTFILES; do
2N/A POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
2N/A if test -n "$OBSOLETE_ALL_LINGUAS"; then
2N/A test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in
configure.in is obsolete" || echo "setting ALL_LINGUAS in
configure.in is obsolete"
2N/A # The LINGUAS file contains the set of available languages.
2N/A POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2N/A # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
2N/A ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
2N/A # Hide the ALL_LINGUAS assigment from automake < 1.5.
2N/A eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2N/A # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2N/A # Compute UPDATEPOFILES
2N/A # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2N/A # Compute DUMMYPOFILES
2N/A # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2N/A # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2N/A # Compute PROPERTIESFILES
2N/A # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
2N/A # Compute CLASSFILES
2N/A # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
2N/A # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
2N/A # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
2N/A # Compute RESOURCESDLLFILES
2N/A # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN)
.resources.dll)
2N/A case "$ac_given_srcdir" in
2N/A *) srcdirpre='$(srcdir)/' ;;
2N/A for lang in $ALL_LINGUAS; do
2N/A 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/'`
2N/A RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN)
.resources.dll"
2N/A # CATALOGS depends on both $ac_dir and the user's LINGUAS
2N/A # environment variable.
2N/A if test -n "$ALL_LINGUAS"; then
2N/A for presentlang in $ALL_LINGUAS; do
2N/A if test "%UNSET%" != "$LINGUAS"; then
2N/A desiredlanguages="$LINGUAS"
2N/A desiredlanguages="$ALL_LINGUAS"
2N/A for desiredlang in $desiredlanguages; do
2N/A # Use the presentlang catalog if desiredlang is
2N/A # a. equal to presentlang, or
2N/A # b. a variant of presentlang (because in this case,
2N/A # presentlang can be used as a fallback for messages
2N/A # which are not translated in the desiredlang catalog).
2N/A case "$desiredlang" in
2N/A "$presentlang"*) useit=yes;;
2N/A if test $useit = yes; then
2N/A INST_LINGUAS="$INST_LINGUAS $presentlang"
2N/A if test -n "$INST_LINGUAS"; then
2N/A for lang in $INST_LINGUAS; do
2N/A 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/'`
2N/A 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"
2N/A # Add dependencies that cannot be formulated as a simple suffix rule.
2N/A for lang in $ALL_LINGUAS; do
2N/A @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$
lang.po"; \
2N/A # Add dependencies that cannot be formulated as a simple suffix rule.
2N/A for lang in $ALL_LINGUAS; do
2N/A 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/'`
2N/A @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$
lang.po -r \$(DOMAIN)"; \
2N/A \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$
lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$
frobbedlang.msg"; exit 1; }
2N/A if test -n "$POMAKEFILEDEPS"; then
2N/AMakefile: $POMAKEFILEDEPS
2N/Adnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
2N/AAC_DEFUN([AM_XGETTEXT_OPTION_INIT],
2N/A XGETTEXT_EXTRA_OPTIONS=
2N/Adnl Registers an option to be passed to xgettext in the po subdirectory.
2N/AAC_DEFUN([AM_XGETTEXT_OPTION],
2N/A AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
2N/A XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"