20
20
If you have problems, you may need to regenerate the build system entirely.
21
21
To do so, use the procedure documented by the package, typically `autoreconf'.])])
23
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
24
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
26
# This file is free software, distributed under the terms of the GNU
27
# General Public License. As a special exception to the GNU General
28
# Public License, this file may be distributed as part of a program
29
# that contains a configuration script generated by Autoconf, under
30
# the same distribution terms as the rest of that program.
32
# This file can be copied and used freely without restrictions. It can
33
# be used in projects which are not available under the GNU Public License
34
# but which still want to provide support for the GNU gettext functionality.
36
# Macro to add for using GNU gettext.
37
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
39
# Modified to never use included libintl.
40
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
42
# Major rework to remove unused code
43
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
45
# Added better handling of ALL_LINGUAS from GNU gettext version
46
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
48
# Modified to require ngettext
49
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
51
# We need this here as well, since someone might use autoconf-2.5x
52
# to configure GLib then an older version to configure a package
53
# using AM_GLIB_GNU_GETTEXT
57
dnl We go to great lengths to make sure that aclocal won't
58
dnl try to pull in the installed version of these macros
59
dnl when running aclocal in the glib directory.
61
m4_copy([AC_DEFUN],[glib_DEFUN])
62
m4_copy([AC_REQUIRE],[glib_REQUIRE])
64
dnl At the end, if we're not within glib, we'll define the public
65
dnl definitions in terms of our private definitions.
70
glib_DEFUN([GLIB_LC_MESSAGES],
71
[AC_CHECK_HEADERS([locale.h])
72
if test $ac_cv_header_locale_h = yes; then
73
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
74
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
75
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
76
if test $am_cv_val_LC_MESSAGES = yes; then
77
AC_DEFINE(HAVE_LC_MESSAGES, 1,
78
[Define if your <locale.h> file defines LC_MESSAGES.])
82
# GLIB_PATH_PROG_WITH_TEST
83
#----------------------------
84
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
85
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
86
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
87
[# Extract the first word of "$2", so it can be a program name with args.
88
set dummy $2; ac_word=[$]2
89
AC_MSG_CHECKING([for $ac_word])
90
AC_CACHE_VAL(ac_cv_path_$1,
93
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
96
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
97
for ac_dir in ifelse([$5], , $PATH, [$5]); do
98
test -z "$ac_dir" && ac_dir=.
99
if test -f $ac_dir/$ac_word; then
101
ac_cv_path_$1="$ac_dir/$ac_word"
107
dnl If no 4th arg is given, leave the cache variable unset,
108
dnl so AC_PATH_PROGS will keep looking.
109
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
114
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
124
glib_DEFUN([GLIB_WITH_NLS],
125
dnl NLS is obligatory
129
gt_cv_have_gettext=no
135
AC_CHECK_HEADER(libintl.h,
136
[gt_cv_func_dgettext_libintl="no"
137
libintl_extra_libs=""
140
# First check in libc
142
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
146
[return !ngettext ("","", 1)],
147
gt_cv_func_ngettext_libc=yes,
148
gt_cv_func_ngettext_libc=no)
151
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
152
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
156
[return !dgettext ("","")],
157
gt_cv_func_dgettext_libc=yes,
158
gt_cv_func_dgettext_libc=no)
162
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
163
AC_CHECK_FUNCS(bind_textdomain_codeset)
167
# If we don't have everything we want, check in libintl
169
if test "$gt_cv_func_dgettext_libc" != "yes" \
170
|| test "$gt_cv_func_ngettext_libc" != "yes" \
171
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
173
AC_CHECK_LIB(intl, bindtextdomain,
174
[AC_CHECK_LIB(intl, ngettext,
175
[AC_CHECK_LIB(intl, dgettext,
176
gt_cv_func_dgettext_libintl=yes)])])
178
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
179
AC_MSG_CHECKING([if -liconv is needed to use gettext])
181
AC_CHECK_LIB(intl, ngettext,
182
[AC_CHECK_LIB(intl, dcgettext,
183
[gt_cv_func_dgettext_libintl=yes
184
libintl_extra_libs=-liconv],
190
# If we found libintl, then check in it for bind_textdomain_codeset();
191
# we'll prefer libc if neither have bind_textdomain_codeset(),
192
# and both have dgettext and ngettext
194
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
195
glib_save_LIBS="$LIBS"
196
LIBS="$LIBS -lintl $libintl_extra_libs"
197
unset ac_cv_func_bind_textdomain_codeset
198
AC_CHECK_FUNCS(bind_textdomain_codeset)
199
LIBS="$glib_save_LIBS"
201
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
202
gt_cv_func_dgettext_libc=no
204
if test "$gt_cv_func_dgettext_libc" = "yes" \
205
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
206
gt_cv_func_dgettext_libintl=no
212
if test "$gt_cv_func_dgettext_libc" = "yes" \
213
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
214
gt_cv_have_gettext=yes
217
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
218
INTLLIBS="-lintl $libintl_extra_libs"
221
if test "$gt_cv_have_gettext" = "yes"; then
222
AC_DEFINE(HAVE_GETTEXT,1,
223
[Define if the GNU gettext() function is already present or preinstalled.])
224
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
225
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
226
if test "$MSGFMT" != "no"; then
227
glib_save_LIBS="$LIBS"
228
LIBS="$LIBS $INTLLIBS"
229
AC_CHECK_FUNCS(dcgettext)
231
AC_MSG_CHECKING([if msgfmt accepts -c])
232
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
235
"Content-Type: text/plain; charset=UTF-8\n"
236
"Project-Id-Version: test 1.0\n"
237
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
238
"Last-Translator: test <foo@bar.xx>\n"
239
"Language-Team: C <LL@li.org>\n"
240
"MIME-Version: 1.0\n"
241
"Content-Transfer-Encoding: 8bit\n"
242
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
243
AC_SUBST(MSGFMT_OPTS)
244
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
245
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
246
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
247
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
248
return _nl_msg_cat_cntr],
253
dnl On Solaris, if bind_textdomain_codeset is in libc,
254
dnl GNU format message catalog is always supported,
255
dnl since both are added to the libc all together.
256
dnl Hence, we'd like to go with DATADIRNAME=share and
257
dnl and CATOBJEXT=.gmo in this case.
258
AC_CHECK_FUNC(bind_textdomain_codeset,
273
LIBS="$glib_save_LIBS"
276
gt_cv_have_gettext=no
281
if test "$gt_cv_have_gettext" = "yes" ; then
282
AC_DEFINE(ENABLE_NLS, 1,
283
[always defined to indicate that i18n is enabled])
286
dnl Test whether we really found GNU xgettext.
287
if test "$XGETTEXT" != ":"; then
288
dnl If it is not GNU xgettext we define it as : so that the
289
dnl Makefiles still can work.
290
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
294
[found xgettext program is not GNU xgettext; ignore it])
299
# We need to process the po/ directory.
303
[case "$CONFIG_FILES" in *po/Makefile.in*)
304
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
307
dnl These rules are solely for the distribution goal. While doing this
308
dnl we only have to keep exactly one list of the available catalogs
310
for lang in $ALL_LINGUAS; do
311
GMOFILES="$GMOFILES $lang.gmo"
312
POFILES="$POFILES $lang.po"
315
dnl Make all variables we use known to autoconf.
318
AC_SUBST(DATADIRNAME)
322
AC_SUBST(PO_IN_DATADIR_TRUE)
323
AC_SUBST(PO_IN_DATADIR_FALSE)
328
# AM_GLIB_GNU_GETTEXT
329
# -------------------
330
# Do checks necessary for use of gettext. If a suitable implementation
331
# of gettext is found in either in libintl or in the C library,
332
# it will set INTLLIBS to the libraries needed for use of gettext
333
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
334
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
335
# on various variables needed by the Makefile.in.in installed by
338
glib_DEFUN([GLIB_GNU_GETTEXT],
339
[AC_REQUIRE([AC_PROG_CC])dnl
340
AC_REQUIRE([AC_HEADER_STDC])dnl
345
if test "$gt_cv_have_gettext" = "yes"; then
346
if test "x$ALL_LINGUAS" = "x"; then
349
AC_MSG_CHECKING(for catalogs to be installed)
351
for presentlang in $ALL_LINGUAS; do
353
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
354
desiredlanguages="$LINGUAS"
356
desiredlanguages="$ALL_LINGUAS"
358
for desiredlang in $desiredlanguages; do
359
# Use the presentlang catalog if desiredlang is
360
# a. equal to presentlang, or
361
# b. a variant of presentlang (because in this case,
362
# presentlang can be used as a fallback for messages
363
# which are not translated in the desiredlang catalog).
364
case "$desiredlang" in
365
"$presentlang"*) useit=yes;;
368
if test $useit = yes; then
369
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
373
AC_MSG_RESULT($LINGUAS)
376
dnl Construct list of names of catalog files to be constructed.
377
if test -n "$LINGUAS"; then
378
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
382
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
383
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
384
dnl Try to locate is.
386
if test -n "$ac_aux_dir"; then
387
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
389
if test -z "$MKINSTALLDIRS"; then
390
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
392
AC_SUBST(MKINSTALLDIRS)
394
dnl Generate list of files to be processed by xgettext which will
395
dnl be included in po/Makefile.
396
test -d po || mkdir po
397
if test "x$srcdir" != "x."; then
398
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
399
posrcprefix="$srcdir/"
401
posrcprefix="../$srcdir/"
407
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
408
< $srcdir/po/POTFILES.in > po/POTFILES
411
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
412
# -------------------------------
413
# Define VARIABLE to the location where catalog files will
414
# be installed by po/Makefile.
415
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
416
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
417
glib_save_prefix="$prefix"
418
glib_save_exec_prefix="$exec_prefix"
419
glib_save_datarootdir="$datarootdir"
420
test "x$prefix" = xNONE && prefix=$ac_default_prefix
421
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
422
datarootdir=`eval echo "${datarootdir}"`
423
if test "x$CATOBJEXT" = "x.mo" ; then
424
localedir=`eval echo "${libdir}/locale"`
426
localedir=`eval echo "${datadir}/locale"`
428
prefix="$glib_save_prefix"
429
exec_prefix="$glib_save_exec_prefix"
430
datarootdir="$glib_save_datarootdir"
431
AC_DEFINE_UNQUOTED($1, "$localedir",
432
[Define the location where the catalogs will be installed])
436
dnl Now the definitions that aclocal will find
438
ifdef(glib_configure_ac,[],[
439
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
440
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
443
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
445
# Create a temporary file with TEST-FILE as its contents and pass the
446
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
447
# 0 and perform ACTION-IF-FAIL for any other exit status.
448
AC_DEFUN([GLIB_RUN_PROG],
449
[cat >conftest.foo <<_ACEOF
452
if AC_RUN_LOG([$1 conftest.foo]); then
453
m4_ifval([$3], [$3], [:])
454
m4_ifvaln([$4], [else $4])dnl
455
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
456
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
461
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
462
# serial 41 IT_PROG_INTLTOOL
463
AC_DEFUN([IT_PROG_INTLTOOL], [
465
AC_REQUIRE([AM_NLS])dnl
467
case "$am__api_version" in
469
AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
475
if test -n "$1"; then
476
AC_MSG_CHECKING([for intltool >= $1])
478
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
479
INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
480
[INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
482
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
483
test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
484
AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
487
AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
488
AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
489
AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
490
if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
491
AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
494
if test -z "$AM_DEFAULT_VERBOSITY"; then
495
AM_DEFAULT_VERBOSITY=1
497
AC_SUBST([AM_DEFAULT_VERBOSITY])
499
INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))'
500
INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))'
501
INTLTOOL__v_MERGE_0='@echo " ITMRG " [$]@;'
502
AC_SUBST(INTLTOOL_V_MERGE)
503
AC_SUBST(INTLTOOL__v_MERGE_)
504
AC_SUBST(INTLTOOL__v_MERGE_0)
506
INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))'
507
intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))'
508
intltool__v_merge_options_0='-q'
509
AC_SUBST(INTLTOOL_V_MERGE_OPTIONS)
510
AC_SUBST(intltool__v_merge_options_)
511
AC_SUBST(intltool__v_merge_options_0)
513
INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
514
INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
515
INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
516
INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
517
INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -p $(top_srcdir)/po $< [$]@'
518
INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
519
INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
520
INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
521
INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
522
INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
523
INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
524
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u --no-translations $< [$]@'
525
INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
526
INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
527
INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
528
INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
529
INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
530
INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
531
INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
533
_IT_SUBST(INTLTOOL_DESKTOP_RULE)
534
_IT_SUBST(INTLTOOL_DIRECTORY_RULE)
535
_IT_SUBST(INTLTOOL_KEYS_RULE)
536
_IT_SUBST(INTLTOOL_PROP_RULE)
537
_IT_SUBST(INTLTOOL_OAF_RULE)
538
_IT_SUBST(INTLTOOL_PONG_RULE)
539
_IT_SUBST(INTLTOOL_SERVER_RULE)
540
_IT_SUBST(INTLTOOL_SHEET_RULE)
541
_IT_SUBST(INTLTOOL_SOUNDLIST_RULE)
542
_IT_SUBST(INTLTOOL_UI_RULE)
543
_IT_SUBST(INTLTOOL_XAM_RULE)
544
_IT_SUBST(INTLTOOL_KBD_RULE)
545
_IT_SUBST(INTLTOOL_XML_RULE)
546
_IT_SUBST(INTLTOOL_XML_NOMERGE_RULE)
547
_IT_SUBST(INTLTOOL_CAVES_RULE)
548
_IT_SUBST(INTLTOOL_SCHEMAS_RULE)
549
_IT_SUBST(INTLTOOL_THEME_RULE)
550
_IT_SUBST(INTLTOOL_SERVICE_RULE)
551
_IT_SUBST(INTLTOOL_POLICY_RULE)
553
# Check the gettext tools to make sure they are GNU
554
AC_PATH_PROG(XGETTEXT, xgettext)
555
AC_PATH_PROG(MSGMERGE, msgmerge)
556
AC_PATH_PROG(MSGFMT, msgfmt)
557
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
558
if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
559
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
561
xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
562
mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
563
mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
564
if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
565
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
568
AC_PATH_PROG(INTLTOOL_PERL, perl)
569
if test -z "$INTLTOOL_PERL"; then
570
AC_MSG_ERROR([perl not found])
572
AC_MSG_CHECKING([for perl >= 5.8.1])
573
$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1
574
if test $? -ne 0; then
575
AC_MSG_ERROR([perl 5.8.1 is required for intltool])
577
IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"`
578
AC_MSG_RESULT([$IT_PERL_VERSION])
580
if test "x$2" != "xno-xml"; then
581
AC_MSG_CHECKING([for XML::Parser])
582
if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
585
AC_MSG_ERROR([XML::Parser perl module is required for intltool])
589
# Substitute ALL_LINGUAS so we can use it in po/Makefile
590
AC_SUBST(ALL_LINGUAS)
592
# Set DATADIRNAME correctly if it is not set yet
593
# (copied from glib-gettext.m4)
594
if test -z "$DATADIRNAME"; then
596
[AC_LANG_PROGRAM([[]],
597
[[extern int _nl_msg_cat_cntr;
598
return _nl_msg_cat_cntr]])],
602
dnl On Solaris, if bind_textdomain_codeset is in libc,
603
dnl GNU format message catalog is always supported,
604
dnl since both are added to the libc all together.
605
dnl Hence, we'd like to go with DATADIRNAME=share
607
AC_CHECK_FUNC(bind_textdomain_codeset,
608
[DATADIRNAME=share], [DATADIRNAME=lib])
615
AC_SUBST(DATADIRNAME)
622
# IT_PO_SUBDIR(DIRNAME)
623
# ---------------------
624
# All po subdirs have to be declared with this macro; the subdir "po" is
625
# declared by IT_PROG_INTLTOOL.
627
AC_DEFUN([IT_PO_SUBDIR],
628
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
630
dnl The following CONFIG_COMMANDS should be executed at the very end
631
dnl of config.status.
632
AC_CONFIG_COMMANDS_PRE([
633
AC_CONFIG_COMMANDS([$1/stamp-it], [
634
if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then
635
AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.])
637
rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
642
'"s|^| $ac_top_srcdir/|" \
643
"$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
645
[sed '/^POTFILES =/,/[^\\]$/ {
649
' "$1/Makefile.in" >"$1/Makefile"]
650
rm -f "$1/Makefile.tmp"
651
mv "$1/stamp-it.tmp" "$1/stamp-it"
656
# _IT_SUBST(VARIABLE)
657
# -------------------
658
# Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
660
AC_DEFUN([_IT_SUBST],
663
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
668
AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
669
# A hint is needed for aclocal from Automake <= 1.9.4:
670
# AC_DEFUN([AC_PROG_INTLTOOL], ...)
23
673
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
25
675
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,