23
23
## the same distribution terms that you use for the rest of that program.
25
25
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
26
# serial 36 IT_PROG_INTLTOOL
26
# serial 40 IT_PROG_INTLTOOL
27
27
AC_DEFUN([IT_PROG_INTLTOOL],
28
28
[AC_PREREQ([2.50])dnl
39
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 $< [$]@'
101
108
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
104
# Use the tools built into the package, not the ones that are installed.
105
AC_SUBST(INTLTOOL_EXTRACT, '$(top_builddir)/intltool-extract')
106
AC_SUBST(INTLTOOL_MERGE, '$(top_builddir)/intltool-merge')
107
AC_SUBST(INTLTOOL_UPDATE, '$(top_builddir)/intltool-update')
109
AC_PATH_PROG(INTLTOOL_PERL, perl)
111
AC_PATH_PROG(INTLTOOL_PERL, [perl])
110
112
if test -z "$INTLTOOL_PERL"; then
111
113
AC_MSG_ERROR([perl not found; required for intltool])
153
155
IT_PO_SUBDIR([po])
155
dnl The following is very similar to
157
dnl AC_CONFIG_FILES([intltool-extract intltool-merge intltool-update])
159
dnl with the following slight differences:
160
dnl - the *.in files are in ac_aux_dir,
161
dnl - if the file haven't changed upon reconfigure, it's not touched,
162
dnl - the evaluation of the third parameter enables a hack which computes
163
dnl the actual value of $libdir,
164
dnl - the user sees "executing intltool commands", instead of
165
dnl "creating intltool-extract" and such.
167
dnl Nothing crucial here, and we could use AC_CONFIG_FILES, if there were
170
AC_CONFIG_COMMANDS([intltool], [
172
for file in intltool-extract intltool-merge intltool-update; do
173
sed -e "s|@INTLTOOL_EXTRACT@|`pwd`/intltool-extract|g" \
174
-e "s|@INTLTOOL_LIBDIR@|${INTLTOOL_LIBDIR}|g" \
175
-e "s|@INTLTOOL_PERL@|${INTLTOOL_PERL}|g" \
176
< ${ac_aux_dir}/${file}.in > ${file}.out
177
if cmp -s ${file} ${file}.out 2>/dev/null; then
180
mv -f ${file}.out ${file}
187
[INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir='${ac_aux_dir}'
188
prefix="$prefix" exec_prefix="$exec_prefix" INTLTOOL_LIBDIR="$libdir"
189
INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}'])