~ubuntu-branches/ubuntu/vivid/intltool/vivid

« back to all changes in this revision

Viewing changes to intltool.m4

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2008-06-04 08:33:24 UTC
  • mfrom: (1.2.16 upstream) (4.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080604083324-t4s3ng5hxxnnsbxi
Tags: 0.40.0-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
## the same distribution terms that you use for the rest of that program.
24
24
 
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
29
29
 
39
39
    AC_MSG_CHECKING([for intltool >= $1])
40
40
 
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; }'`
44
44
    ]
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.])
48
48
fi
49
49
 
 
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.])
 
55
fi
 
56
 
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])
102
109
fi
103
110
 
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')
108
 
 
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])
112
114
fi
152
154
 
153
155
IT_PO_SUBDIR([po])
154
156
 
155
 
dnl The following is very similar to
156
 
dnl
157
 
dnl     AC_CONFIG_FILES([intltool-extract intltool-merge intltool-update])
158
 
dnl
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.
166
 
dnl
167
 
dnl Nothing crucial here, and we could use AC_CONFIG_FILES, if there were
168
 
dnl a reason for it.
169
 
 
170
 
AC_CONFIG_COMMANDS([intltool], [
171
 
 
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
178
 
    rm -f ${file}.out
179
 
  else
180
 
    mv -f ${file}.out ${file}
181
 
  fi
182
 
  chmod ugo+x ${file}
183
 
  chmod u+w ${file}
184
 
done
185
 
 
186
 
],
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}'])
190
 
 
191
157
])
192
158
 
193
159