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