po.m4 18 KB

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