po.m4 18 KB

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