You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

450 lines
18 KiB

  1. # po.m4 serial 17 (gettext-0.18)
  2. dnl Copyright (C) 1995-2010 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 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. cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
  109. POMAKEFILEDEPS="POTFILES.in"
  110. # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
  111. # on $ac_dir but don't depend on user-specified configuration
  112. # parameters.
  113. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
  114. # The LINGUAS file contains the set of available languages.
  115. if test -n "$OBSOLETE_ALL_LINGUAS"; then
  116. test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
  117. fi
  118. ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
  119. # Hide the ALL_LINGUAS assigment from automake < 1.5.
  120. eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
  121. POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
  122. else
  123. # The set of available languages was given in configure.in.
  124. # Hide the ALL_LINGUAS assigment from automake < 1.5.
  125. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
  126. fi
  127. # Compute POFILES
  128. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
  129. # Compute UPDATEPOFILES
  130. # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
  131. # Compute DUMMYPOFILES
  132. # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
  133. # Compute GMOFILES
  134. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
  135. case "$ac_given_srcdir" in
  136. .) srcdirpre= ;;
  137. *) srcdirpre='$(srcdir)/' ;;
  138. esac
  139. POFILES=
  140. UPDATEPOFILES=
  141. DUMMYPOFILES=
  142. GMOFILES=
  143. for lang in $ALL_LINGUAS; do
  144. POFILES="$POFILES $srcdirpre$lang.po"
  145. UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
  146. DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
  147. GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
  148. done
  149. # CATALOGS depends on both $ac_dir and the user's LINGUAS
  150. # environment variable.
  151. INST_LINGUAS=
  152. if test -n "$ALL_LINGUAS"; then
  153. for presentlang in $ALL_LINGUAS; do
  154. useit=no
  155. if test "%UNSET%" != "$LINGUAS"; then
  156. desiredlanguages="$LINGUAS"
  157. else
  158. desiredlanguages="$ALL_LINGUAS"
  159. fi
  160. for desiredlang in $desiredlanguages; do
  161. # Use the presentlang catalog if desiredlang is
  162. # a. equal to presentlang, or
  163. # b. a variant of presentlang (because in this case,
  164. # presentlang can be used as a fallback for messages
  165. # which are not translated in the desiredlang catalog).
  166. case "$desiredlang" in
  167. "$presentlang"*) useit=yes;;
  168. esac
  169. done
  170. if test $useit = yes; then
  171. INST_LINGUAS="$INST_LINGUAS $presentlang"
  172. fi
  173. done
  174. fi
  175. CATALOGS=
  176. if test -n "$INST_LINGUAS"; then
  177. for lang in $INST_LINGUAS; do
  178. CATALOGS="$CATALOGS $lang.gmo"
  179. done
  180. fi
  181. test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
  182. 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"
  183. for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
  184. if test -f "$f"; then
  185. case "$f" in
  186. *.orig | *.bak | *~) ;;
  187. *) cat "$f" >> "$ac_dir/Makefile" ;;
  188. esac
  189. fi
  190. done
  191. fi
  192. ;;
  193. esac
  194. done]],
  195. [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
  196. # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
  197. # from automake < 1.5.
  198. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
  199. # Capture the value of LINGUAS because we need it to compute CATALOGS.
  200. LINGUAS="${LINGUAS-%UNSET%}"
  201. ])
  202. ])
  203. dnl Postprocesses a Makefile in a directory containing PO files.
  204. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
  205. [
  206. # When this code is run, in config.status, two variables have already been
  207. # set:
  208. # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
  209. # - LINGUAS is the value of the environment variable LINGUAS at configure
  210. # time.
  211. changequote(,)dnl
  212. # Adjust a relative srcdir.
  213. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
  214. ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
  215. ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
  216. # In autoconf-2.13 it is called $ac_given_srcdir.
  217. # In autoconf-2.50 it is called $srcdir.
  218. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
  219. case "$ac_given_srcdir" in
  220. .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
  221. /*) top_srcdir="$ac_given_srcdir" ;;
  222. *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
  223. esac
  224. # Find a way to echo strings without interpreting backslash.
  225. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
  226. gt_echo='echo'
  227. else
  228. if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
  229. gt_echo='printf %s\n'
  230. else
  231. echo_func () {
  232. cat <<EOT
  233. $*
  234. EOT
  235. }
  236. gt_echo='echo_func'
  237. fi
  238. fi
  239. # A sed script that extracts the value of VARIABLE from a Makefile.
  240. sed_x_variable='
  241. # Test if the hold space is empty.
  242. x
  243. s/P/P/
  244. x
  245. ta
  246. # Yes it was empty. Look if we have the expected variable definition.
  247. /^[ ]*VARIABLE[ ]*=/{
  248. # Seen the first line of the variable definition.
  249. s/^[ ]*VARIABLE[ ]*=//
  250. ba
  251. }
  252. bd
  253. :a
  254. # Here we are processing a line from the variable definition.
  255. # Remove comment, more precisely replace it with a space.
  256. s/#.*$/ /
  257. # See if the line ends in a backslash.
  258. tb
  259. :b
  260. s/\\$//
  261. # Print the line, without the trailing backslash.
  262. p
  263. tc
  264. # There was no trailing backslash. The end of the variable definition is
  265. # reached. Clear the hold space.
  266. s/^.*$//
  267. x
  268. bd
  269. :c
  270. # A trailing backslash means that the variable definition continues in the
  271. # next line. Put a nonempty string into the hold space to indicate this.
  272. s/^.*$/P/
  273. x
  274. :d
  275. '
  276. changequote([,])dnl
  277. # Set POTFILES to the value of the Makefile variable POTFILES.
  278. sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
  279. POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
  280. # Compute POTFILES_DEPS as
  281. # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
  282. POTFILES_DEPS=
  283. for file in $POTFILES; do
  284. POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
  285. done
  286. POMAKEFILEDEPS=""
  287. if test -n "$OBSOLETE_ALL_LINGUAS"; then
  288. test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
  289. fi
  290. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
  291. # The LINGUAS file contains the set of available languages.
  292. ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
  293. POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
  294. else
  295. # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
  296. sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
  297. ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
  298. fi
  299. # Hide the ALL_LINGUAS assigment from automake < 1.5.
  300. eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
  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), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
  311. # Compute CLASSFILES
  312. # as $(foreach lang, $(ALL_LINGUAS), $(top_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 \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
  338. CLASSFILES="$CLASSFILES \$(top_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. if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
  389. # Add dependencies that cannot be formulated as a simple suffix rule.
  390. for lang in $ALL_LINGUAS; do
  391. frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
  392. cat >> "$ac_file.tmp" <<EOF
  393. $frobbedlang.msg: $lang.po
  394. @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
  395. \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
  396. EOF
  397. done
  398. fi
  399. if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
  400. # Add dependencies that cannot be formulated as a simple suffix rule.
  401. for lang in $ALL_LINGUAS; do
  402. 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/'`
  403. cat >> "$ac_file.tmp" <<EOF
  404. $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
  405. @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
  406. \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
  407. EOF
  408. done
  409. fi
  410. if test -n "$POMAKEFILEDEPS"; then
  411. cat >> "$ac_file.tmp" <<EOF
  412. Makefile: $POMAKEFILEDEPS
  413. EOF
  414. fi
  415. mv "$ac_file.tmp" "$ac_file"
  416. ])
  417. dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
  418. AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
  419. [
  420. XGETTEXT_EXTRA_OPTIONS=
  421. ])
  422. dnl Registers an option to be passed to xgettext in the po subdirectory.
  423. AC_DEFUN([AM_XGETTEXT_OPTION],
  424. [
  425. AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
  426. XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
  427. ])