libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

po.m4 (19013B)


      1 # po.m4
      2 # serial 33 (gettext-0.23)
      3 dnl Copyright (C) 1995-2014, 2016, 2018-2022, 2024 Free Software Foundation,
      4 dnl Inc.
      5 dnl This file is free software; the Free Software Foundation
      6 dnl gives unlimited permission to copy and/or distribute it,
      7 dnl with or without modifications, as long as this notice is preserved.
      8 dnl
      9 dnl This file can be used in projects which are not available under
     10 dnl the GNU General Public License or the GNU Lesser General Public
     11 dnl License but which still want to provide support for the GNU gettext
     12 dnl functionality.
     13 dnl Please note that the actual code of the GNU gettext library is covered
     14 dnl by the GNU Lesser General Public License, and the rest of the GNU
     15 dnl gettext package is covered by the GNU General Public License.
     16 dnl They are *not* in the public domain.
     17 
     18 dnl Authors:
     19 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
     20 dnl   Bruno Haible <bruno@clisp.org>, 2000-2024.
     21 
     22 AC_PREREQ([2.60])
     23 
     24 dnl Checks for all prerequisites of the po subdirectory.
     25 AC_DEFUN([AM_PO_SUBDIRS],
     26 [
     27   AC_REQUIRE([AC_PROG_MAKE_SET])dnl
     28   AC_REQUIRE([AC_PROG_INSTALL])dnl
     29   AC_REQUIRE([AC_PROG_MKDIR_P])dnl
     30   AC_REQUIRE([AC_PROG_SED])dnl
     31   AC_REQUIRE([AM_NLS])dnl
     32 
     33   dnl Release version of the gettext macros. This is used to ensure that
     34   dnl the gettext macros and po/Makefile.in.in are in sync.
     35   AC_SUBST([GETTEXT_MACRO_VERSION], [0.22])
     36 
     37   dnl Perform the following tests also if --disable-nls has been given,
     38   dnl because they are needed for "make dist" to work.
     39 
     40   dnl Search for GNU msgfmt in the PATH.
     41   dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
     42   dnl The second test excludes FreeBSD msgfmt.
     43   AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
     44     [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
     45      (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
     46     :)
     47   AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
     48 
     49   dnl Test whether it is GNU msgfmt >= 0.15.
     50 changequote(,)dnl
     51   case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
     52     '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
     53     *) GMSGFMT_015=$GMSGFMT ;;
     54   esac
     55 changequote([,])dnl
     56   AC_SUBST([GMSGFMT_015])
     57 
     58   dnl Search for GNU xgettext 0.12 or newer in the PATH.
     59   dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
     60   dnl The second test excludes FreeBSD xgettext.
     61   AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
     62     [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
     63      (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)],
     64     :)
     65   dnl Remove leftover from FreeBSD xgettext call.
     66   rm -f messages.po
     67 
     68   dnl Test whether it is GNU xgettext >= 0.15.
     69 changequote(,)dnl
     70   case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
     71     '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
     72     *) XGETTEXT_015=$XGETTEXT ;;
     73   esac
     74 changequote([,])dnl
     75   AC_SUBST([XGETTEXT_015])
     76 
     77   dnl Search for GNU msgmerge 0.11 or newer in the PATH.
     78   AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
     79     [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
     80 
     81   dnl Test whether it is GNU msgmerge >= 0.20.
     82   if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then
     83     MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt'
     84   else
     85     dnl Test whether it is GNU msgmerge >= 0.12.
     86     if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then
     87       MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet'
     88     else
     89       dnl With these old versions, $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) is
     90       dnl slow. But this is not a big problem, as such old gettext versions are
     91       dnl hardly in use any more.
     92       MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet'
     93     fi
     94   fi
     95   AC_SUBST([MSGMERGE_FOR_MSGFMT_OPTION])
     96 
     97   dnl Support for AM_XGETTEXT_OPTION.
     98   test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
     99   AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
    100 
    101   AC_CONFIG_COMMANDS([po-directories], [[
    102     for ac_file in $CONFIG_FILES; do
    103       # Support "outfile[:infile[:infile...]]"
    104       case "$ac_file" in
    105         *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
    106       esac
    107       # PO directories have a Makefile.in generated from Makefile.in.in.
    108       case "$ac_file" in */Makefile.in)
    109         # Adjust a relative srcdir.
    110         ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
    111         ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
    112         ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
    113         # In autoconf-2.13 it is called $ac_given_srcdir.
    114         # In autoconf-2.50 it is called $srcdir.
    115         test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
    116         case "$ac_given_srcdir" in
    117           .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
    118           /*) top_srcdir="$ac_given_srcdir" ;;
    119           *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
    120         esac
    121         # Treat a directory as a PO directory if and only if it has a
    122         # POTFILES.in file. This allows packages to have multiple PO
    123         # directories under different names or in different locations.
    124         if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
    125           rm -f "$ac_dir/POTFILES"
    126           test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
    127           gt_tab=`printf '\t'`
    128           cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
    129           POMAKEFILEDEPS="POTFILES.in"
    130           # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
    131           # on $ac_dir but don't depend on user-specified configuration
    132           # parameters.
    133           if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
    134             # The LINGUAS file contains the set of available languages.
    135             if test -n "$OBSOLETE_ALL_LINGUAS"; then
    136               test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
    137             fi
    138             ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
    139             POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
    140           else
    141             # The set of available languages was given in configure.in.
    142             ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS
    143           fi
    144           # Compute POFILES
    145           # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
    146           # Compute UPDATEPOFILES
    147           # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
    148           # Compute DUMMYPOFILES
    149           # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
    150           # Compute GMOFILES
    151           # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
    152           case "$ac_given_srcdir" in
    153             .) srcdirpre= ;;
    154             *) srcdirpre='$(srcdir)/' ;;
    155           esac
    156           POFILES=
    157           UPDATEPOFILES=
    158           DUMMYPOFILES=
    159           GMOFILES=
    160           for lang in $ALL_LINGUAS; do
    161             POFILES="$POFILES $srcdirpre$lang.po"
    162             UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
    163             DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
    164             GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
    165           done
    166           # CATALOGS depends on both $ac_dir and the user's LINGUAS
    167           # environment variable.
    168           INST_LINGUAS=
    169           if test -n "$ALL_LINGUAS"; then
    170             for presentlang in $ALL_LINGUAS; do
    171               useit=no
    172               if test "%UNSET%" != "$LINGUAS"; then
    173                 desiredlanguages="$LINGUAS"
    174               else
    175                 desiredlanguages="$ALL_LINGUAS"
    176               fi
    177               for desiredlang in $desiredlanguages; do
    178                 # Use the presentlang catalog if desiredlang is
    179                 #   a. equal to presentlang, or
    180                 #   b. a variant of presentlang (because in this case,
    181                 #      presentlang can be used as a fallback for messages
    182                 #      which are not translated in the desiredlang catalog).
    183                 case "$desiredlang" in
    184                   "$presentlang" | "$presentlang"_* | "$presentlang".* | "$presentlang"@*)
    185                     useit=yes
    186                     ;;
    187                 esac
    188               done
    189               if test $useit = yes; then
    190                 INST_LINGUAS="$INST_LINGUAS $presentlang"
    191               fi
    192             done
    193           fi
    194           CATALOGS=
    195           if test -n "$INST_LINGUAS"; then
    196             for lang in $INST_LINGUAS; do
    197               CATALOGS="$CATALOGS $lang.gmo"
    198             done
    199           fi
    200           test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
    201           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"
    202           for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
    203             if test -f "$f"; then
    204               case "$f" in
    205                 *.orig | *.bak | *~) ;;
    206                 *) cat "$f" >> "$ac_dir/Makefile" ;;
    207               esac
    208             fi
    209           done
    210         fi
    211         ;;
    212       esac
    213     done]],
    214    [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
    215     # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS.
    216     OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS"
    217     # Capture the value of LINGUAS because we need it to compute CATALOGS.
    218     LINGUAS="${LINGUAS-%UNSET%}"
    219    ])
    220 ])
    221 
    222 dnl Postprocesses a Makefile in a directory containing PO files.
    223 AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
    224 [
    225   # When this code is run, in config.status, two variables have already been
    226   # set:
    227   # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
    228   # - LINGUAS is the value of the environment variable LINGUAS at configure
    229   #   time.
    230 
    231 changequote(,)dnl
    232   # Adjust a relative srcdir.
    233   ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
    234   ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
    235   ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
    236   # In autoconf-2.13 it is called $ac_given_srcdir.
    237   # In autoconf-2.50 it is called $srcdir.
    238   test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
    239   case "$ac_given_srcdir" in
    240     .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
    241     /*) top_srcdir="$ac_given_srcdir" ;;
    242     *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
    243   esac
    244 
    245   # Find a way to echo strings without interpreting backslash.
    246   if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
    247     gt_echo='echo'
    248   else
    249     if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
    250       gt_echo='printf %s\n'
    251     else
    252       echo_func () {
    253         cat <<EOT
    254 $*
    255 EOT
    256       }
    257       gt_echo='echo_func'
    258     fi
    259   fi
    260 
    261   # A sed script that extracts the value of VARIABLE from a Makefile.
    262   tab=`printf '\t'`
    263   sed_x_variable='
    264 # Test if the hold space is empty.
    265 x
    266 s/P/P/
    267 x
    268 ta
    269 # Yes it was empty. Look if we have the expected variable definition.
    270 /^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{
    271   # Seen the first line of the variable definition.
    272   s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=//
    273   ba
    274 }
    275 bd
    276 :a
    277 # Here we are processing a line from the variable definition.
    278 # Remove comment, more precisely replace it with a space.
    279 s/#.*$/ /
    280 # See if the line ends in a backslash.
    281 tb
    282 :b
    283 s/\\$//
    284 # Print the line, without the trailing backslash.
    285 p
    286 tc
    287 # There was no trailing backslash. The end of the variable definition is
    288 # reached. Clear the hold space.
    289 s/^.*$//
    290 x
    291 bd
    292 :c
    293 # A trailing backslash means that the variable definition continues in the
    294 # next line. Put a nonempty string into the hold space to indicate this.
    295 s/^.*$/P/
    296 x
    297 :d
    298 '
    299 changequote([,])dnl
    300 
    301   # Set POTFILES to the value of the Makefile variable POTFILES.
    302   sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
    303   POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
    304   # Compute POTFILES_DEPS as
    305   #   $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
    306   POTFILES_DEPS=
    307   for file in $POTFILES; do
    308     POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
    309   done
    310   POMAKEFILEDEPS=""
    311 
    312   if test -n "$OBSOLETE_ALL_LINGUAS"; then
    313     test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
    314   fi
    315   if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
    316     # The LINGUAS file contains the set of available languages.
    317     ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
    318     POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
    319   else
    320     # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
    321     sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
    322     ALL_LINGUAS=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
    323   fi
    324   # Compute POFILES
    325   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
    326   # Compute UPDATEPOFILES
    327   # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
    328   # Compute DUMMYPOFILES
    329   # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
    330   # Compute GMOFILES
    331   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
    332   # Compute PROPERTIESFILES
    333   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).properties)
    334   # Compute CLASSFILES
    335   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).class)
    336   # Compute QMFILES
    337   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
    338   # Compute MSGFILES
    339   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
    340   # Compute RESOURCESDLLFILES
    341   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
    342   case "$ac_given_srcdir" in
    343     .) srcdirpre= ;;
    344     *) srcdirpre='$(srcdir)/' ;;
    345   esac
    346   POFILES=
    347   UPDATEPOFILES=
    348   DUMMYPOFILES=
    349   GMOFILES=
    350   PROPERTIESFILES=
    351   CLASSFILES=
    352   QMFILES=
    353   MSGFILES=
    354   RESOURCESDLLFILES=
    355   for lang in $ALL_LINGUAS; do
    356     POFILES="$POFILES $srcdirpre$lang.po"
    357     UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
    358     DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
    359     GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
    360     PROPERTIESFILES="$PROPERTIESFILES \$(srcdir)/\$(DOMAIN)_$lang.properties"
    361     CLASSFILES="$CLASSFILES \$(srcdir)/\$(DOMAIN)_$lang.class"
    362     QMFILES="$QMFILES $srcdirpre$lang.qm"
    363     frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
    364     MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
    365     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/'`
    366     RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
    367   done
    368   # CATALOGS depends on both $ac_dir and the user's LINGUAS
    369   # environment variable.
    370   INST_LINGUAS=
    371   if test -n "$ALL_LINGUAS"; then
    372     for presentlang in $ALL_LINGUAS; do
    373       useit=no
    374       if test "%UNSET%" != "$LINGUAS"; then
    375         desiredlanguages="$LINGUAS"
    376       else
    377         desiredlanguages="$ALL_LINGUAS"
    378       fi
    379       for desiredlang in $desiredlanguages; do
    380         # Use the presentlang catalog if desiredlang is
    381         #   a. equal to presentlang, or
    382         #   b. a variant of presentlang (because in this case,
    383         #      presentlang can be used as a fallback for messages
    384         #      which are not translated in the desiredlang catalog).
    385         case "$desiredlang" in
    386           "$presentlang" | "$presentlang"_* | "$presentlang".* | "$presentlang"@*)
    387             useit=yes
    388             ;;
    389         esac
    390       done
    391       if test $useit = yes; then
    392         INST_LINGUAS="$INST_LINGUAS $presentlang"
    393       fi
    394     done
    395   fi
    396   CATALOGS=
    397   JAVACATALOGS=
    398   QTCATALOGS=
    399   TCLCATALOGS=
    400   CSHARPCATALOGS=
    401   if test -n "$INST_LINGUAS"; then
    402     for lang in $INST_LINGUAS; do
    403       CATALOGS="$CATALOGS $lang.gmo"
    404       JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
    405       QTCATALOGS="$QTCATALOGS $lang.qm"
    406       frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
    407       TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
    408       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/'`
    409       CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
    410     done
    411   fi
    412 
    413   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"
    414   tab=`printf '\t'`
    415   if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
    416     # Add dependencies that cannot be formulated as a simple suffix rule.
    417     for lang in $ALL_LINGUAS; do
    418       frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
    419       cat >> "$ac_file.tmp" <<EOF
    420 $frobbedlang.msg: $lang.po
    421 ${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
    422 ${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
    423 EOF
    424     done
    425   fi
    426   if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
    427     # Add dependencies that cannot be formulated as a simple suffix rule.
    428     for lang in $ALL_LINGUAS; do
    429       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/'`
    430       cat >> "$ac_file.tmp" <<EOF
    431 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
    432 ${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
    433 ${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
    434 EOF
    435     done
    436   fi
    437   if test -n "$POMAKEFILEDEPS"; then
    438     cat >> "$ac_file.tmp" <<EOF
    439 Makefile: $POMAKEFILEDEPS
    440 EOF
    441   fi
    442   mv "$ac_file.tmp" "$ac_file"
    443 ])
    444 
    445 dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
    446 AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
    447 [
    448   XGETTEXT_EXTRA_OPTIONS=
    449 ])
    450 
    451 dnl Registers an option to be passed to xgettext in the po subdirectory.
    452 AC_DEFUN([AM_XGETTEXT_OPTION],
    453 [
    454   AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
    455   XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
    456 ])