po.m4 18 KB

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