po.m4 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. # po.m4 serial 20 (gettext-0.18.2)
  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([AM_NLS])dnl
  26. dnl Release version of the gettext macros. This is used to ensure that
  27. dnl the gettext macros and po/Makefile.in.in are in sync.
  28. AC_SUBST([GETTEXT_MACRO_VERSION], [0.18])
  29. dnl Perform the following tests also if --disable-nls has been given,
  30. dnl because they are needed for "make dist" to work.
  31. dnl Search for GNU msgfmt in the PATH.
  32. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
  33. dnl The second test excludes FreeBSD msgfmt.
  34. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
  35. [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
  36. (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
  37. :)
  38. AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
  39. dnl Test whether it is GNU msgfmt >= 0.15.
  40. changequote(,)dnl
  41. case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
  42. '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
  43. *) MSGFMT_015=$MSGFMT ;;
  44. esac
  45. changequote([,])dnl
  46. AC_SUBST([MSGFMT_015])
  47. changequote(,)dnl
  48. case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
  49. '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
  50. *) GMSGFMT_015=$GMSGFMT ;;
  51. esac
  52. changequote([,])dnl
  53. AC_SUBST([GMSGFMT_015])
  54. dnl Search for GNU xgettext 0.12 or newer in the PATH.
  55. dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
  56. dnl The second test excludes FreeBSD xgettext.
  57. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
  58. [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
  59. (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)],
  60. :)
  61. dnl Remove leftover from FreeBSD xgettext call.
  62. rm -f messages.po
  63. dnl Test whether it is GNU xgettext >= 0.15.
  64. changequote(,)dnl
  65. case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
  66. '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
  67. *) XGETTEXT_015=$XGETTEXT ;;
  68. esac
  69. changequote([,])dnl
  70. AC_SUBST([XGETTEXT_015])
  71. dnl Search for GNU msgmerge 0.11 or newer in the PATH.
  72. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
  73. [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
  74. dnl Installation directories.
  75. dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
  76. dnl have to define it here, so that it can be used in po/Makefile.
  77. test -n "$localedir" || localedir='${datadir}/locale'
  78. AC_SUBST([localedir])
  79. dnl Support for AM_XGETTEXT_OPTION.
  80. test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
  81. AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
  82. AC_CONFIG_COMMANDS([po-directories], [[
  83. for ac_file in $CONFIG_FILES; do
  84. # Support "outfile[:infile[:infile...]]"
  85. case "$ac_file" in
  86. *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  87. esac
  88. # PO directories have a Makefile.in generated from Makefile.in.in.
  89. case "$ac_file" in */Makefile.in)
  90. # Adjust a relative srcdir.
  91. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
  92. ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
  93. ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
  94. # In autoconf-2.13 it is called $ac_given_srcdir.
  95. # In autoconf-2.50 it is called $srcdir.
  96. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
  97. case "$ac_given_srcdir" in
  98. .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
  99. /*) top_srcdir="$ac_given_srcdir" ;;
  100. *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
  101. esac
  102. # Treat a directory as a PO directory if and only if it has a
  103. # POTFILES.in file. This allows packages to have multiple PO
  104. # directories under different names or in different locations.
  105. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
  106. rm -f "$ac_dir/POTFILES"
  107. test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
  108. gt_tab=`printf '\t'`
  109. 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"
  110. POMAKEFILEDEPS="POTFILES.in"
  111. # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
  112. # on $ac_dir but don't depend on user-specified configuration
  113. # parameters.
  114. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
  115. # The LINGUAS file contains the set of available languages.
  116. if test -n "$OBSOLETE_ALL_LINGUAS"; then
  117. test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
  118. fi
  119. ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
  120. # Hide the ALL_LINGUAS assignment from automake < 1.5.
  121. eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
  122. POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
  123. else
  124. # The set of available languages was given in configure.in.
  125. # Hide the ALL_LINGUAS assignment from automake < 1.5.
  126. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
  127. fi
  128. # Compute POFILES
  129. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
  130. # Compute UPDATEPOFILES
  131. # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
  132. # Compute DUMMYPOFILES
  133. # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
  134. # Compute GMOFILES
  135. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
  136. case "$ac_given_srcdir" in
  137. .) srcdirpre= ;;
  138. *) srcdirpre='$(srcdir)/' ;;
  139. esac
  140. POFILES=
  141. UPDATEPOFILES=
  142. DUMMYPOFILES=
  143. GMOFILES=
  144. for lang in $ALL_LINGUAS; do
  145. POFILES="$POFILES $srcdirpre$lang.po"
  146. UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
  147. DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
  148. GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
  149. done
  150. # CATALOGS depends on both $ac_dir and the user's LINGUAS
  151. # environment variable.
  152. INST_LINGUAS=
  153. if test -n "$ALL_LINGUAS"; then
  154. for presentlang in $ALL_LINGUAS; do
  155. useit=no
  156. if test "%UNSET%" != "$LINGUAS"; then
  157. desiredlanguages="$LINGUAS"
  158. else
  159. desiredlanguages="$ALL_LINGUAS"
  160. fi
  161. for desiredlang in $desiredlanguages; do
  162. # Use the presentlang catalog if desiredlang is
  163. # a. equal to presentlang, or
  164. # b. a variant of presentlang (because in this case,
  165. # presentlang can be used as a fallback for messages
  166. # which are not translated in the desiredlang catalog).
  167. case "$desiredlang" in
  168. "$presentlang"*) useit=yes;;
  169. esac
  170. done
  171. if test $useit = yes; then
  172. INST_LINGUAS="$INST_LINGUAS $presentlang"
  173. fi
  174. done
  175. fi
  176. CATALOGS=
  177. if test -n "$INST_LINGUAS"; then
  178. for lang in $INST_LINGUAS; do
  179. CATALOGS="$CATALOGS $lang.gmo"
  180. done
  181. fi
  182. test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
  183. 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"
  184. for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
  185. if test -f "$f"; then
  186. case "$f" in
  187. *.orig | *.bak | *~) ;;
  188. *) cat "$f" >> "$ac_dir/Makefile" ;;
  189. esac
  190. fi
  191. done
  192. fi
  193. ;;
  194. esac
  195. done]],
  196. [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
  197. # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
  198. # from automake < 1.5.
  199. eval '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. # Hide the ALL_LINGUAS assignment from automake < 1.5.
  302. eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
  303. # Compute POFILES
  304. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
  305. # Compute UPDATEPOFILES
  306. # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
  307. # Compute DUMMYPOFILES
  308. # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
  309. # Compute GMOFILES
  310. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
  311. # Compute PROPERTIESFILES
  312. # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
  313. # Compute CLASSFILES
  314. # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
  315. # Compute QMFILES
  316. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
  317. # Compute MSGFILES
  318. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
  319. # Compute RESOURCESDLLFILES
  320. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
  321. case "$ac_given_srcdir" in
  322. .) srcdirpre= ;;
  323. *) srcdirpre='$(srcdir)/' ;;
  324. esac
  325. POFILES=
  326. UPDATEPOFILES=
  327. DUMMYPOFILES=
  328. GMOFILES=
  329. PROPERTIESFILES=
  330. CLASSFILES=
  331. QMFILES=
  332. MSGFILES=
  333. RESOURCESDLLFILES=
  334. for lang in $ALL_LINGUAS; do
  335. POFILES="$POFILES $srcdirpre$lang.po"
  336. UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
  337. DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
  338. GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
  339. PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
  340. CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
  341. QMFILES="$QMFILES $srcdirpre$lang.qm"
  342. frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
  343. MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
  344. 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/'`
  345. RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
  346. done
  347. # CATALOGS depends on both $ac_dir and the user's LINGUAS
  348. # environment variable.
  349. INST_LINGUAS=
  350. if test -n "$ALL_LINGUAS"; then
  351. for presentlang in $ALL_LINGUAS; do
  352. useit=no
  353. if test "%UNSET%" != "$LINGUAS"; then
  354. desiredlanguages="$LINGUAS"
  355. else
  356. desiredlanguages="$ALL_LINGUAS"
  357. fi
  358. for desiredlang in $desiredlanguages; do
  359. # Use the presentlang catalog if desiredlang is
  360. # a. equal to presentlang, or
  361. # b. a variant of presentlang (because in this case,
  362. # presentlang can be used as a fallback for messages
  363. # which are not translated in the desiredlang catalog).
  364. case "$desiredlang" in
  365. "$presentlang"*) useit=yes;;
  366. esac
  367. done
  368. if test $useit = yes; then
  369. INST_LINGUAS="$INST_LINGUAS $presentlang"
  370. fi
  371. done
  372. fi
  373. CATALOGS=
  374. JAVACATALOGS=
  375. QTCATALOGS=
  376. TCLCATALOGS=
  377. CSHARPCATALOGS=
  378. if test -n "$INST_LINGUAS"; then
  379. for lang in $INST_LINGUAS; do
  380. CATALOGS="$CATALOGS $lang.gmo"
  381. JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
  382. QTCATALOGS="$QTCATALOGS $lang.qm"
  383. frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
  384. TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
  385. 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/'`
  386. CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
  387. done
  388. fi
  389. 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"
  390. tab=`printf '\t'`
  391. if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
  392. # Add dependencies that cannot be formulated as a simple suffix rule.
  393. for lang in $ALL_LINGUAS; do
  394. frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
  395. cat >> "$ac_file.tmp" <<EOF
  396. $frobbedlang.msg: $lang.po
  397. ${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
  398. ${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
  399. EOF
  400. done
  401. fi
  402. if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
  403. # Add dependencies that cannot be formulated as a simple suffix rule.
  404. for lang in $ALL_LINGUAS; do
  405. 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/'`
  406. cat >> "$ac_file.tmp" <<EOF
  407. $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
  408. ${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
  409. ${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
  410. EOF
  411. done
  412. fi
  413. if test -n "$POMAKEFILEDEPS"; then
  414. cat >> "$ac_file.tmp" <<EOF
  415. Makefile: $POMAKEFILEDEPS
  416. EOF
  417. fi
  418. mv "$ac_file.tmp" "$ac_file"
  419. ])
  420. dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
  421. AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
  422. [
  423. XGETTEXT_EXTRA_OPTIONS=
  424. ])
  425. dnl Registers an option to be passed to xgettext in the po subdirectory.
  426. AC_DEFUN([AM_XGETTEXT_OPTION],
  427. [
  428. AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
  429. XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
  430. ])