1468
1468
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
1469
# serial 2 IT_PROG_INTLTOOL
1469
# serial 35 IT_PROG_INTLTOOL
1470
1470
AC_DEFUN([IT_PROG_INTLTOOL],
1471
[AC_PREREQ([2.50])dnl
1473
case "$am__api_version" in
1475
AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
1473
1481
if test -n "$1"; then
1474
1482
AC_MSG_CHECKING(for intltool >= $1)
1476
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ printf "%d", $[1] * 100 + $[2]; }'`
1477
INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { printf $[2]; }' < ${ac_aux_dir}/intltool-update.in`
1479
INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split(${{2}}, VERSION, "."); printf "%d\n", VERSION[1] * 100 + VERSION[2];}' < ${ac_aux_dir}/intltool-update.in`
1482
if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT"; then
1483
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
1485
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found. Your intltool is too old. You need intltool $1 or later.])
1484
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
1485
INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { print $ 2; }' ${ac_aux_dir}/intltool-update.in`
1486
[INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split($ 2, VERSION, "."); print VERSION[1] * 1000 + VERSION[2] * 100 + VERSION[3];}' ${ac_aux_dir}/intltool-update.in`
1488
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
1489
test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
1490
AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
1490
1493
INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1522
1526
AC_SUBST(INTLTOOL_CAVES_RULE)
1523
1527
AC_SUBST(INTLTOOL_SCHEMAS_RULE)
1524
1528
AC_SUBST(INTLTOOL_THEME_RULE)
1529
AC_SUBST(INTLTOOL_SERVICE_RULE)
1526
1531
# Use the tools built into the package, not the ones that are installed.
1528
INTLTOOL_EXTRACT='$(top_builddir)/intltool-extract'
1529
INTLTOOL_MERGE='$(top_builddir)/intltool-merge'
1530
INTLTOOL_UPDATE='$(top_builddir)/intltool-update'
1532
AC_SUBST(INTLTOOL_EXTRACT)
1533
AC_SUBST(INTLTOOL_MERGE)
1534
AC_SUBST(INTLTOOL_UPDATE)
1532
AC_SUBST(INTLTOOL_EXTRACT, '$(top_builddir)/intltool-extract')
1533
AC_SUBST(INTLTOOL_MERGE, '$(top_builddir)/intltool-merge')
1534
AC_SUBST(INTLTOOL_UPDATE, '$(top_builddir)/intltool-update')
1536
1536
AC_PATH_PROG(INTLTOOL_PERL, perl)
1537
1537
if test -z "$INTLTOOL_PERL"; then
1554
1554
AC_PATH_PROG(INTLTOOL_MSGMERGE, msgmerge, msgmerge)
1555
1555
AC_PATH_PROG(INTLTOOL_XGETTEXT, xgettext, xgettext)
1557
# Remove file type tags (using []) from po/POTFILES.
1559
ifdef([AC_DIVERSION_ICMDS],[
1560
AC_DIVERT_PUSH(AC_DIVERSION_ICMDS)
1561
[mv -f po/POTFILES po/POTFILES.tmp
1562
sed -e '/[[]encoding.*]/d' -e 's/[[].*] *//' < po/POTFILES.tmp > po/POTFILES
1563
rm -f po/POTFILES.tmp
1567
ifdef([AC_CONFIG_COMMANDS_PRE],[
1568
AC_CONFIG_COMMANDS_PRE([
1569
[mv -f po/POTFILES po/POTFILES.tmp
1570
sed -e '/[[]encoding.*]/d' -e 's/[[].*] *//' < po/POTFILES.tmp > po/POTFILES
1571
rm -f po/POTFILES.tmp
1577
# Manually sed perl in so people don't have to put the intltool scripts in AC_OUTPUT.
1557
# Substitute ALL_LINGUAS so we can use it in po/Makefile
1558
AC_SUBST(ALL_LINGUAS)
1562
dnl The following is very similar to
1564
dnl AC_CONFIG_FILES([intltool-extract intltool-merge intltool-update])
1566
dnl with the following slight differences:
1567
dnl - the *.in files are in ac_aux_dir,
1568
dnl - if the file haven't changed upon reconfigure, it's not touched,
1569
dnl - the evaluation of the third parameter enables a hack which computes
1570
dnl the actual value of $libdir,
1571
dnl - the user sees "executing intltool commands", instead of
1572
dnl "creating intltool-extract" and such.
1574
dnl Nothing crucial here, and we could use AC_CONFIG_FILES, if there were
1575
dnl a reason for it.
1579
1577
AC_CONFIG_COMMANDS([intltool], [
1581
intltool_edit="-e 's#@INTLTOOL_EXTRACT@#`pwd`/intltool-extract#g' \
1582
-e 's#@INTLTOOL_ICONV@#${INTLTOOL_ICONV}#g' \
1583
-e 's#@INTLTOOL_MSGFMT@#${INTLTOOL_MSGFMT}#g' \
1584
-e 's#@INTLTOOL_MSGMERGE@#${INTLTOOL_MSGMERGE}#g' \
1585
-e 's#@INTLTOOL_XGETTEXT@#${INTLTOOL_XGETTEXT}#g' \
1586
-e 's#@INTLTOOL_PERL@#${INTLTOOL_PERL}#g'"
1588
eval sed ${intltool_edit} < ${ac_aux_dir}/intltool-extract.in \
1589
> intltool-extract.out
1590
if cmp -s intltool-extract intltool-extract.out 2>/dev/null; then
1591
rm -f intltool-extract.out
1593
mv -f intltool-extract.out intltool-extract
1595
chmod ugo+x intltool-extract
1596
chmod u+w intltool-extract
1598
eval sed ${intltool_edit} < ${ac_aux_dir}/intltool-merge.in \
1599
> intltool-merge.out
1600
if cmp -s intltool-merge intltool-merge.out 2>/dev/null; then
1601
rm -f intltool-merge.out
1603
mv -f intltool-merge.out intltool-merge
1605
chmod ugo+x intltool-merge
1606
chmod u+w intltool-merge
1608
eval sed ${intltool_edit} < ${ac_aux_dir}/intltool-update.in \
1609
> intltool-update.out
1610
if cmp -s intltool-update intltool-update.out 2>/dev/null; then
1611
rm -f intltool-update.out
1613
mv -f intltool-update.out intltool-update
1615
chmod ugo+x intltool-update
1616
chmod u+w intltool-update
1618
], INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir=${ac_aux_dir}
1619
INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' ICONV='${INTLTOOL_ICONV}'
1620
MSGFMT='${INTLTOOL_MSGFMT}' MSGMERGE='${INTLTOOL_MSGMERGE}'
1621
XGETTEXT='${INTLTOOL_XGETTEXT}')
1579
for file in intltool-extract intltool-merge intltool-update; do
1580
sed -e "s|@INTLTOOL_EXTRACT@|`pwd`/intltool-extract|g" \
1581
-e "s|@INTLTOOL_LIBDIR@|${INTLTOOL_LIBDIR}|g" \
1582
-e "s|@INTLTOOL_ICONV@|${INTLTOOL_ICONV}|g" \
1583
-e "s|@INTLTOOL_MSGFMT@|${INTLTOOL_MSGFMT}|g" \
1584
-e "s|@INTLTOOL_MSGMERGE@|${INTLTOOL_MSGMERGE}|g" \
1585
-e "s|@INTLTOOL_XGETTEXT@|${INTLTOOL_XGETTEXT}|g" \
1586
-e "s|@INTLTOOL_PERL@|${INTLTOOL_PERL}|g" \
1587
< ${ac_aux_dir}/${file}.in > ${file}.out
1588
if cmp -s ${file} ${file}.out 2>/dev/null; then
1591
mv -f ${file}.out ${file}
1598
[INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir='${ac_aux_dir}'
1599
prefix="$prefix" exec_prefix="$exec_prefix" INTLTOOL_LIBDIR="$libdir"
1600
INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' INTLTOOL_ICONV='${INTLTOOL_ICONV}'
1601
INTLTOOL_MSGFMT='${INTLTOOL_MSGFMT}' INTLTOOL_MSGMERGE='${INTLTOOL_MSGMERGE}'
1602
INTLTOOL_XGETTEXT='${INTLTOOL_XGETTEXT}'])
1607
# IT_PO_SUBDIR(DIRNAME)
1608
# ---------------------
1609
# All po subdirs have to be declared with this macro; the subdir "po" is
1610
# declared by IT_PROG_INTLTOOL.
1612
AC_DEFUN([IT_PO_SUBDIR],
1613
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
1615
dnl The following CONFIG_COMMANDS should be exetuted at the very end
1616
dnl of config.status.
1617
AC_CONFIG_COMMANDS_PRE([
1618
AC_CONFIG_COMMANDS([$1/stamp-it], [
1619
rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
1624
'"s|^| $ac_top_srcdir/|" \
1625
"$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
1627
if test ! -f "$1/Makefile"; then
1628
AC_MSG_ERROR([$1/Makefile is not ready.])
1630
mv "$1/Makefile" "$1/Makefile.tmp"
1631
[sed '/^POTFILES =/,/[^\\]$/ {
1635
' "$1/Makefile.tmp" >"$1/Makefile"]
1636
rm -f "$1/Makefile.tmp"
1637
mv "$1/stamp-it.tmp" "$1/stamp-it"
1625
1643
# deprecated macros
1626
AC_DEFUN([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL($@)])
1644
AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
1645
# A hint is needed for aclocal from Automake <= 1.9.4:
1646
# AC_DEFUN([AC_PROG_INTLTOOL], ...)
1629
1649
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-