38
38
if test -n "$1"; then
39
AC_MSG_CHECKING(for intltool >= $1)
39
AC_MSG_CHECKING([for intltool >= $1])
41
41
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
42
INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { print $ 2; }' ${ac_aux_dir}/intltool-update.in`
43
[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`
42
INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
43
[INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
45
45
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
46
46
test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
47
47
AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
50
AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
51
AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
52
AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
53
if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
54
AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
50
57
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 $< [$]@'
51
58
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 $< [$]@'
52
59
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 $< [$]@'
65
72
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 $< [$]@'
66
73
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 $< [$]@'
67
74
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 $< [$]@'
75
INTLTOOL_POLICY_RULE='%.policy: %.policy.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 $< [$]@'
69
77
AC_SUBST(INTLTOOL_DESKTOP_RULE)
70
78
AC_SUBST(INTLTOOL_DIRECTORY_RULE)
84
92
AC_SUBST(INTLTOOL_SCHEMAS_RULE)
85
93
AC_SUBST(INTLTOOL_THEME_RULE)
86
94
AC_SUBST(INTLTOOL_SERVICE_RULE)
88
# Use the tools built into the package, not the ones that are installed.
89
AC_SUBST(INTLTOOL_EXTRACT, '$(top_builddir)/intltool-extract')
90
AC_SUBST(INTLTOOL_MERGE, '$(top_builddir)/intltool-merge')
91
AC_SUBST(INTLTOOL_UPDATE, '$(top_builddir)/intltool-update')
93
AC_PATH_PROG(INTLTOOL_PERL, perl)
95
AC_SUBST(INTLTOOL_POLICY_RULE)
97
# Check the gettext tools to make sure they are GNU
98
AC_PATH_PROG(XGETTEXT, xgettext)
99
AC_PATH_PROG(MSGMERGE, msgmerge)
100
AC_PATH_PROG(MSGFMT, msgfmt)
101
if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
102
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
104
xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
105
mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
106
mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
107
if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
108
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
111
AC_PATH_PROG(INTLTOOL_PERL, [perl])
94
112
if test -z "$INTLTOOL_PERL"; then
95
113
AC_MSG_ERROR([perl not found; required for intltool])
109
AC_PATH_PROG(INTLTOOL_ICONV, iconv, iconv)
110
AC_PATH_PROG(INTLTOOL_MSGFMT, msgfmt, msgfmt)
111
AC_PATH_PROG(INTLTOOL_MSGMERGE, msgmerge, msgmerge)
112
AC_PATH_PROG(INTLTOOL_XGETTEXT, xgettext, xgettext)
114
127
# Substitute ALL_LINGUAS so we can use it in po/Makefile
115
128
AC_SUBST(ALL_LINGUAS)
130
# Set DATADIRNAME correctly if it is not set yet
131
# (copied from glib-gettext.m4)
132
if test -z "$DATADIRNAME"; then
134
[AC_LANG_PROGRAM([[]],
135
[[extern int _nl_msg_cat_cntr;
136
return _nl_msg_cat_cntr]])],
140
dnl On Solaris, if bind_textdomain_codeset is in libc,
141
dnl GNU format message catalog is always supported,
142
dnl since both are added to the libc all together.
143
dnl Hence, we'd like to go with DATADIRNAME=share
145
AC_CHECK_FUNC(bind_textdomain_codeset,
146
[DATADIRNAME=share], [DATADIRNAME=lib])
153
AC_SUBST(DATADIRNAME)
117
155
IT_PO_SUBDIR([po])
119
dnl The following is very similar to
121
dnl AC_CONFIG_FILES([intltool-extract intltool-merge intltool-update])
123
dnl with the following slight differences:
124
dnl - the *.in files are in ac_aux_dir,
125
dnl - if the file haven't changed upon reconfigure, it's not touched,
126
dnl - the evaluation of the third parameter enables a hack which computes
127
dnl the actual value of $libdir,
128
dnl - the user sees "executing intltool commands", instead of
129
dnl "creating intltool-extract" and such.
131
dnl Nothing crucial here, and we could use AC_CONFIG_FILES, if there were
134
AC_CONFIG_COMMANDS([intltool], [
136
for file in intltool-extract intltool-merge intltool-update; do
137
sed -e "s|@INTLTOOL_EXTRACT@|`pwd`/intltool-extract|g" \
138
-e "s|@INTLTOOL_LIBDIR@|${INTLTOOL_LIBDIR}|g" \
139
-e "s|@INTLTOOL_ICONV@|${INTLTOOL_ICONV}|g" \
140
-e "s|@INTLTOOL_MSGFMT@|${INTLTOOL_MSGFMT}|g" \
141
-e "s|@INTLTOOL_MSGMERGE@|${INTLTOOL_MSGMERGE}|g" \
142
-e "s|@INTLTOOL_XGETTEXT@|${INTLTOOL_XGETTEXT}|g" \
143
-e "s|@INTLTOOL_PERL@|${INTLTOOL_PERL}|g" \
144
< ${ac_aux_dir}/${file}.in > ${file}.out
145
if cmp -s ${file} ${file}.out 2>/dev/null; then
148
mv -f ${file}.out ${file}
155
[INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir='${ac_aux_dir}'
156
prefix="$prefix" exec_prefix="$exec_prefix" INTLTOOL_LIBDIR="$libdir"
157
INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' INTLTOOL_ICONV='${INTLTOOL_ICONV}'
158
INTLTOOL_MSGFMT='${INTLTOOL_MSGFMT}' INTLTOOL_MSGMERGE='${INTLTOOL_MSGMERGE}'
159
INTLTOOL_XGETTEXT='${INTLTOOL_XGETTEXT}'])