po.m4 19 KB

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