1032
1007
AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
1010
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
1011
# serial 35 IT_PROG_INTLTOOL
1012
AC_DEFUN([IT_PROG_INTLTOOL],
1013
[AC_PREREQ([2.50])dnl
1015
case "$am__api_version" in
1017
AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
1023
if test -n "$1"; then
1024
AC_MSG_CHECKING(for intltool >= $1)
1026
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
1027
INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { print $ 2; }' ${ac_aux_dir}/intltool-update.in`
1028
[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`
1030
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
1031
test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
1032
AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
1035
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 $< [$]@'
1036
INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.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 $< [$]@'
1037
INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1038
INTLTOOL_PROP_RULE='%.prop: %.prop.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 $< [$]@'
1039
INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@'
1040
INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1041
INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1042
INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1043
INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.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 $< [$]@'
1044
INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1045
INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1046
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@'
1047
INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1048
INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1049
INTLTOOL_CAVES_RULE='%.caves: %.caves.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 $< [$]@'
1050
INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1051
INTLTOOL_THEME_RULE='%.theme: %.theme.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 $< [$]@'
1052
INTLTOOL_SERVICE_RULE='%.service: %.service.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 $< [$]@'
1054
AC_SUBST(INTLTOOL_DESKTOP_RULE)
1055
AC_SUBST(INTLTOOL_DIRECTORY_RULE)
1056
AC_SUBST(INTLTOOL_KEYS_RULE)
1057
AC_SUBST(INTLTOOL_PROP_RULE)
1058
AC_SUBST(INTLTOOL_OAF_RULE)
1059
AC_SUBST(INTLTOOL_PONG_RULE)
1060
AC_SUBST(INTLTOOL_SERVER_RULE)
1061
AC_SUBST(INTLTOOL_SHEET_RULE)
1062
AC_SUBST(INTLTOOL_SOUNDLIST_RULE)
1063
AC_SUBST(INTLTOOL_UI_RULE)
1064
AC_SUBST(INTLTOOL_XAM_RULE)
1065
AC_SUBST(INTLTOOL_KBD_RULE)
1066
AC_SUBST(INTLTOOL_XML_RULE)
1067
AC_SUBST(INTLTOOL_XML_NOMERGE_RULE)
1068
AC_SUBST(INTLTOOL_CAVES_RULE)
1069
AC_SUBST(INTLTOOL_SCHEMAS_RULE)
1070
AC_SUBST(INTLTOOL_THEME_RULE)
1071
AC_SUBST(INTLTOOL_SERVICE_RULE)
1073
# Use the tools built into the package, not the ones that are installed.
1074
AC_SUBST(INTLTOOL_EXTRACT, '$(top_builddir)/intltool-extract')
1075
AC_SUBST(INTLTOOL_MERGE, '$(top_builddir)/intltool-merge')
1076
AC_SUBST(INTLTOOL_UPDATE, '$(top_builddir)/intltool-update')
1078
AC_PATH_PROG(INTLTOOL_PERL, perl)
1079
if test -z "$INTLTOOL_PERL"; then
1080
AC_MSG_ERROR([perl not found; required for intltool])
1082
if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then
1083
AC_MSG_ERROR([perl 5.x required for intltool])
1085
if test "x$2" != "xno-xml"; then
1086
AC_MSG_CHECKING([for XML::Parser])
1087
if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
1090
AC_MSG_ERROR([XML::Parser perl module is required for intltool])
1094
AC_PATH_PROG(INTLTOOL_ICONV, iconv, iconv)
1095
AC_PATH_PROG(INTLTOOL_MSGFMT, msgfmt, msgfmt)
1096
AC_PATH_PROG(INTLTOOL_MSGMERGE, msgmerge, msgmerge)
1097
AC_PATH_PROG(INTLTOOL_XGETTEXT, xgettext, xgettext)
1099
# Substitute ALL_LINGUAS so we can use it in po/Makefile
1100
AC_SUBST(ALL_LINGUAS)
1102
# Set DATADIRNAME correctly if it is not set yet
1103
# (copied from glib-gettext.m4)
1104
if test -z "$DATADIRNAME"; then
1105
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
1106
return _nl_msg_cat_cntr],
1107
[DATADIRNAME=share],
1110
dnl On Solaris, if bind_textdomain_codeset is in libc,
1111
dnl GNU format message catalog is always supported,
1112
dnl since both are added to the libc all together.
1113
dnl Hence, we'd like to go with DATADIRNAME=share
1115
AC_CHECK_FUNC(bind_textdomain_codeset,
1116
[DATADIRNAME=share], [DATADIRNAME=lib])
1123
AC_SUBST(DATADIRNAME)
1127
dnl The following is very similar to
1129
dnl AC_CONFIG_FILES([intltool-extract intltool-merge intltool-update])
1131
dnl with the following slight differences:
1132
dnl - the *.in files are in ac_aux_dir,
1133
dnl - if the file haven't changed upon reconfigure, it's not touched,
1134
dnl - the evaluation of the third parameter enables a hack which computes
1135
dnl the actual value of $libdir,
1136
dnl - the user sees "executing intltool commands", instead of
1137
dnl "creating intltool-extract" and such.
1139
dnl Nothing crucial here, and we could use AC_CONFIG_FILES, if there were
1140
dnl a reason for it.
1142
AC_CONFIG_COMMANDS([intltool], [
1144
for file in intltool-extract intltool-merge intltool-update; do
1145
sed -e "s|@INTLTOOL_EXTRACT@|`pwd`/intltool-extract|g" \
1146
-e "s|@INTLTOOL_LIBDIR@|${INTLTOOL_LIBDIR}|g" \
1147
-e "s|@INTLTOOL_ICONV@|${INTLTOOL_ICONV}|g" \
1148
-e "s|@INTLTOOL_MSGFMT@|${INTLTOOL_MSGFMT}|g" \
1149
-e "s|@INTLTOOL_MSGMERGE@|${INTLTOOL_MSGMERGE}|g" \
1150
-e "s|@INTLTOOL_XGETTEXT@|${INTLTOOL_XGETTEXT}|g" \
1151
-e "s|@INTLTOOL_PERL@|${INTLTOOL_PERL}|g" \
1152
< ${ac_aux_dir}/${file}.in > ${file}.out
1153
if cmp -s ${file} ${file}.out 2>/dev/null; then
1156
mv -f ${file}.out ${file}
1163
[INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir='${ac_aux_dir}'
1164
prefix="$prefix" exec_prefix="$exec_prefix" INTLTOOL_LIBDIR="$libdir"
1165
INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' INTLTOOL_ICONV='${INTLTOOL_ICONV}'
1166
INTLTOOL_MSGFMT='${INTLTOOL_MSGFMT}' INTLTOOL_MSGMERGE='${INTLTOOL_MSGMERGE}'
1167
INTLTOOL_XGETTEXT='${INTLTOOL_XGETTEXT}'])
1172
# IT_PO_SUBDIR(DIRNAME)
1173
# ---------------------
1174
# All po subdirs have to be declared with this macro; the subdir "po" is
1175
# declared by IT_PROG_INTLTOOL.
1177
AC_DEFUN([IT_PO_SUBDIR],
1178
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
1180
dnl The following CONFIG_COMMANDS should be exetuted at the very end
1181
dnl of config.status.
1182
AC_CONFIG_COMMANDS_PRE([
1183
AC_CONFIG_COMMANDS([$1/stamp-it], [
1184
rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
1189
'"s|^| $ac_top_srcdir/|" \
1190
"$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
1192
if test ! -f "$1/Makefile"; then
1193
AC_MSG_ERROR([$1/Makefile is not ready.])
1195
mv "$1/Makefile" "$1/Makefile.tmp"
1196
[sed '/^POTFILES =/,/[^\\]$/ {
1200
' "$1/Makefile.tmp" >"$1/Makefile"]
1201
rm -f "$1/Makefile.tmp"
1202
mv "$1/stamp-it.tmp" "$1/stamp-it"
1209
AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
1210
# A hint is needed for aclocal from Automake <= 1.9.4:
1211
# AC_DEFUN([AC_PROG_INTLTOOL], ...)
1034
1214
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1036
1216
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.