14
14
m4_ifndef([AC_AUTOCONF_VERSION],
15
15
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16
m4_if(AC_AUTOCONF_VERSION, [2.62],,
17
[m4_warning([this file was generated for autoconf 2.62.
16
m4_if(AC_AUTOCONF_VERSION, [2.63],,
17
[m4_warning([this file was generated for autoconf 2.63.
18
18
You have another version of autoconf. It may work, but is not guaranteed to.
19
19
If you have problems, you may need to regenerate the build system entirely.
20
20
To do so, use the procedure documented by the package, typically `autoreconf'.])])
22
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
23
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
25
# This file is free software, distributed under the terms of the GNU
26
# General Public License. As a special exception to the GNU General
27
# Public License, this file may be distributed as part of a program
28
# that contains a configuration script generated by Autoconf, under
29
# the same distribution terms as the rest of that program.
31
# This file can be copied and used freely without restrictions. It can
32
# be used in projects which are not available under the GNU Public License
33
# but which still want to provide support for the GNU gettext functionality.
35
# Macro to add for using GNU gettext.
36
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
38
# Modified to never use included libintl.
39
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
41
# Major rework to remove unused code
42
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
44
# Added better handling of ALL_LINGUAS from GNU gettext version
45
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
47
# Modified to require ngettext
48
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
50
# We need this here as well, since someone might use autoconf-2.5x
51
# to configure GLib then an older version to configure a package
52
# using AM_GLIB_GNU_GETTEXT
56
dnl We go to great lengths to make sure that aclocal won't
57
dnl try to pull in the installed version of these macros
58
dnl when running aclocal in the glib directory.
60
m4_copy([AC_DEFUN],[glib_DEFUN])
61
m4_copy([AC_REQUIRE],[glib_REQUIRE])
63
dnl At the end, if we're not within glib, we'll define the public
64
dnl definitions in terms of our private definitions.
69
glib_DEFUN([GLIB_LC_MESSAGES],
70
[AC_CHECK_HEADERS([locale.h])
71
if test $ac_cv_header_locale_h = yes; then
72
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
73
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
74
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
75
if test $am_cv_val_LC_MESSAGES = yes; then
76
AC_DEFINE(HAVE_LC_MESSAGES, 1,
77
[Define if your <locale.h> file defines LC_MESSAGES.])
81
# GLIB_PATH_PROG_WITH_TEST
82
#----------------------------
83
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
84
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
85
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
86
[# Extract the first word of "$2", so it can be a program name with args.
87
set dummy $2; ac_word=[$]2
88
AC_MSG_CHECKING([for $ac_word])
89
AC_CACHE_VAL(ac_cv_path_$1,
92
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
95
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
96
for ac_dir in ifelse([$5], , $PATH, [$5]); do
97
test -z "$ac_dir" && ac_dir=.
98
if test -f $ac_dir/$ac_word; then
100
ac_cv_path_$1="$ac_dir/$ac_word"
106
dnl If no 4th arg is given, leave the cache variable unset,
107
dnl so AC_PATH_PROGS will keep looking.
108
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
113
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
123
glib_DEFUN([GLIB_WITH_NLS],
124
dnl NLS is obligatory
128
gt_cv_have_gettext=no
134
AC_CHECK_HEADER(libintl.h,
135
[gt_cv_func_dgettext_libintl="no"
136
libintl_extra_libs=""
139
# First check in libc
141
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
145
[return !ngettext ("","", 1)],
146
gt_cv_func_ngettext_libc=yes,
147
gt_cv_func_ngettext_libc=no)
150
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
151
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
155
[return !dgettext ("","")],
156
gt_cv_func_dgettext_libc=yes,
157
gt_cv_func_dgettext_libc=no)
161
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
162
AC_CHECK_FUNCS(bind_textdomain_codeset)
166
# If we don't have everything we want, check in libintl
168
if test "$gt_cv_func_dgettext_libc" != "yes" \
169
|| test "$gt_cv_func_ngettext_libc" != "yes" \
170
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
172
AC_CHECK_LIB(intl, bindtextdomain,
173
[AC_CHECK_LIB(intl, ngettext,
174
[AC_CHECK_LIB(intl, dgettext,
175
gt_cv_func_dgettext_libintl=yes)])])
177
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
178
AC_MSG_CHECKING([if -liconv is needed to use gettext])
180
AC_CHECK_LIB(intl, ngettext,
181
[AC_CHECK_LIB(intl, dcgettext,
182
[gt_cv_func_dgettext_libintl=yes
183
libintl_extra_libs=-liconv],
189
# If we found libintl, then check in it for bind_textdomain_codeset();
190
# we'll prefer libc if neither have bind_textdomain_codeset(),
191
# and both have dgettext and ngettext
193
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
194
glib_save_LIBS="$LIBS"
195
LIBS="$LIBS -lintl $libintl_extra_libs"
196
unset ac_cv_func_bind_textdomain_codeset
197
AC_CHECK_FUNCS(bind_textdomain_codeset)
198
LIBS="$glib_save_LIBS"
200
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
201
gt_cv_func_dgettext_libc=no
203
if test "$gt_cv_func_dgettext_libc" = "yes" \
204
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
205
gt_cv_func_dgettext_libintl=no
211
if test "$gt_cv_func_dgettext_libc" = "yes" \
212
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
213
gt_cv_have_gettext=yes
216
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
217
INTLLIBS="-lintl $libintl_extra_libs"
220
if test "$gt_cv_have_gettext" = "yes"; then
221
AC_DEFINE(HAVE_GETTEXT,1,
222
[Define if the GNU gettext() function is already present or preinstalled.])
223
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
224
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
225
if test "$MSGFMT" != "no"; then
226
glib_save_LIBS="$LIBS"
227
LIBS="$LIBS $INTLLIBS"
228
AC_CHECK_FUNCS(dcgettext)
230
AC_MSG_CHECKING([if msgfmt accepts -c])
231
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
234
"Content-Type: text/plain; charset=UTF-8\n"
235
"Project-Id-Version: test 1.0\n"
236
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
237
"Last-Translator: test <foo@bar.xx>\n"
238
"Language-Team: C <LL@li.org>\n"
239
"MIME-Version: 1.0\n"
240
"Content-Transfer-Encoding: 8bit\n"
241
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
242
AC_SUBST(MSGFMT_OPTS)
243
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
244
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
245
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
246
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
247
return _nl_msg_cat_cntr],
252
dnl On Solaris, if bind_textdomain_codeset is in libc,
253
dnl GNU format message catalog is always supported,
254
dnl since both are added to the libc all together.
255
dnl Hence, we'd like to go with DATADIRNAME=share and
256
dnl and CATOBJEXT=.gmo in this case.
257
AC_CHECK_FUNC(bind_textdomain_codeset,
268
LIBS="$glib_save_LIBS"
271
gt_cv_have_gettext=no
276
if test "$gt_cv_have_gettext" = "yes" ; then
277
AC_DEFINE(ENABLE_NLS, 1,
278
[always defined to indicate that i18n is enabled])
281
dnl Test whether we really found GNU xgettext.
282
if test "$XGETTEXT" != ":"; then
283
dnl If it is not GNU xgettext we define it as : so that the
284
dnl Makefiles still can work.
285
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
289
[found xgettext program is not GNU xgettext; ignore it])
294
# We need to process the po/ directory.
298
[case "$CONFIG_FILES" in *po/Makefile.in*)
299
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
302
dnl These rules are solely for the distribution goal. While doing this
303
dnl we only have to keep exactly one list of the available catalogs
305
for lang in $ALL_LINGUAS; do
306
GMOFILES="$GMOFILES $lang.gmo"
307
POFILES="$POFILES $lang.po"
310
dnl Make all variables we use known to autoconf.
313
AC_SUBST(DATADIRNAME)
317
AC_SUBST(PO_IN_DATADIR_TRUE)
318
AC_SUBST(PO_IN_DATADIR_FALSE)
323
# AM_GLIB_GNU_GETTEXT
324
# -------------------
325
# Do checks necessary for use of gettext. If a suitable implementation
326
# of gettext is found in either in libintl or in the C library,
327
# it will set INTLLIBS to the libraries needed for use of gettext
328
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
329
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
330
# on various variables needed by the Makefile.in.in installed by
333
glib_DEFUN([GLIB_GNU_GETTEXT],
334
[AC_REQUIRE([AC_PROG_CC])dnl
335
AC_REQUIRE([AC_HEADER_STDC])dnl
340
if test "$gt_cv_have_gettext" = "yes"; then
341
if test "x$ALL_LINGUAS" = "x"; then
344
AC_MSG_CHECKING(for catalogs to be installed)
346
for presentlang in $ALL_LINGUAS; do
348
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
349
desiredlanguages="$LINGUAS"
351
desiredlanguages="$ALL_LINGUAS"
353
for desiredlang in $desiredlanguages; do
354
# Use the presentlang catalog if desiredlang is
355
# a. equal to presentlang, or
356
# b. a variant of presentlang (because in this case,
357
# presentlang can be used as a fallback for messages
358
# which are not translated in the desiredlang catalog).
359
case "$desiredlang" in
360
"$presentlang"*) useit=yes;;
363
if test $useit = yes; then
364
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
368
AC_MSG_RESULT($LINGUAS)
371
dnl Construct list of names of catalog files to be constructed.
372
if test -n "$LINGUAS"; then
373
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
377
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
378
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
379
dnl Try to locate is.
381
if test -n "$ac_aux_dir"; then
382
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
384
if test -z "$MKINSTALLDIRS"; then
385
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
387
AC_SUBST(MKINSTALLDIRS)
389
dnl Generate list of files to be processed by xgettext which will
390
dnl be included in po/Makefile.
391
test -d po || mkdir po
392
if test "x$srcdir" != "x."; then
393
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
394
posrcprefix="$srcdir/"
396
posrcprefix="../$srcdir/"
402
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
403
< $srcdir/po/POTFILES.in > po/POTFILES
406
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
407
# -------------------------------
408
# Define VARIABLE to the location where catalog files will
409
# be installed by po/Makefile.
410
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
411
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
412
glib_save_prefix="$prefix"
413
glib_save_exec_prefix="$exec_prefix"
414
glib_save_datarootdir="$datarootdir"
415
test "x$prefix" = xNONE && prefix=$ac_default_prefix
416
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
417
datarootdir=`eval echo "${datarootdir}"`
418
if test "x$CATOBJEXT" = "x.mo" ; then
419
localedir=`eval echo "${libdir}/locale"`
421
localedir=`eval echo "${datadir}/locale"`
423
prefix="$glib_save_prefix"
424
exec_prefix="$glib_save_exec_prefix"
425
datarootdir="$glib_save_datarootdir"
426
AC_DEFINE_UNQUOTED($1, "$localedir",
427
[Define the location where the catalogs will be installed])
431
dnl Now the definitions that aclocal will find
433
ifdef(glib_configure_in,[],[
434
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
435
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
438
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
440
# Create a temporary file with TEST-FILE as its contents and pass the
441
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
442
# 0 and perform ACTION-IF-FAIL for any other exit status.
443
AC_DEFUN([GLIB_RUN_PROG],
444
[cat >conftest.foo <<_ACEOF
447
if AC_RUN_LOG([$1 conftest.foo]); then
448
m4_ifval([$3], [$3], [:])
449
m4_ifvaln([$4], [else $4])dnl
450
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
451
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
456
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
457
# serial 40 IT_PROG_INTLTOOL
458
AC_DEFUN([IT_PROG_INTLTOOL], [
460
AC_REQUIRE([AM_NLS])dnl
462
case "$am__api_version" in
464
AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
470
if test -n "$1"; then
471
AC_MSG_CHECKING([for intltool >= $1])
473
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
474
INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
475
[INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
477
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
478
test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
479
AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
482
AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
483
AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
484
AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
485
if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
486
AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
489
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 $< [$]@'
490
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 $< [$]@'
491
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 $< [$]@'
492
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 $< [$]@'
493
INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@'
494
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 $< [$]@'
495
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 $< [$]@'
496
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 $< [$]@'
497
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 $< [$]@'
498
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 $< [$]@'
499
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 $< [$]@'
500
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@'
501
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 $< [$]@'
502
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 $< [$]@'
503
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 $< [$]@'
504
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 $< [$]@'
505
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 $< [$]@'
506
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 $< [$]@'
507
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 $< [$]@'
509
AC_SUBST(INTLTOOL_DESKTOP_RULE)
510
AC_SUBST(INTLTOOL_DIRECTORY_RULE)
511
AC_SUBST(INTLTOOL_KEYS_RULE)
512
AC_SUBST(INTLTOOL_PROP_RULE)
513
AC_SUBST(INTLTOOL_OAF_RULE)
514
AC_SUBST(INTLTOOL_PONG_RULE)
515
AC_SUBST(INTLTOOL_SERVER_RULE)
516
AC_SUBST(INTLTOOL_SHEET_RULE)
517
AC_SUBST(INTLTOOL_SOUNDLIST_RULE)
518
AC_SUBST(INTLTOOL_UI_RULE)
519
AC_SUBST(INTLTOOL_XAM_RULE)
520
AC_SUBST(INTLTOOL_KBD_RULE)
521
AC_SUBST(INTLTOOL_XML_RULE)
522
AC_SUBST(INTLTOOL_XML_NOMERGE_RULE)
523
AC_SUBST(INTLTOOL_CAVES_RULE)
524
AC_SUBST(INTLTOOL_SCHEMAS_RULE)
525
AC_SUBST(INTLTOOL_THEME_RULE)
526
AC_SUBST(INTLTOOL_SERVICE_RULE)
527
AC_SUBST(INTLTOOL_POLICY_RULE)
529
# Check the gettext tools to make sure they are GNU
530
AC_PATH_PROG(XGETTEXT, xgettext)
531
AC_PATH_PROG(MSGMERGE, msgmerge)
532
AC_PATH_PROG(MSGFMT, msgfmt)
533
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
534
if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
535
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
537
xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
538
mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
539
mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
540
if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
541
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
544
AC_PATH_PROG(INTLTOOL_PERL, [perl])
545
if test -z "$INTLTOOL_PERL"; then
546
AC_MSG_ERROR([perl not found; required for intltool])
548
if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then
549
AC_MSG_ERROR([perl 5.x required for intltool])
551
if test "x$2" != "xno-xml"; then
552
AC_MSG_CHECKING([for XML::Parser])
553
if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
556
AC_MSG_ERROR([XML::Parser perl module is required for intltool])
560
# Substitute ALL_LINGUAS so we can use it in po/Makefile
561
AC_SUBST(ALL_LINGUAS)
563
# Set DATADIRNAME correctly if it is not set yet
564
# (copied from glib-gettext.m4)
565
if test -z "$DATADIRNAME"; then
567
[AC_LANG_PROGRAM([[]],
568
[[extern int _nl_msg_cat_cntr;
569
return _nl_msg_cat_cntr]])],
573
dnl On Solaris, if bind_textdomain_codeset is in libc,
574
dnl GNU format message catalog is always supported,
575
dnl since both are added to the libc all together.
576
dnl Hence, we'd like to go with DATADIRNAME=share
578
AC_CHECK_FUNC(bind_textdomain_codeset,
579
[DATADIRNAME=share], [DATADIRNAME=lib])
586
AC_SUBST(DATADIRNAME)
593
# IT_PO_SUBDIR(DIRNAME)
594
# ---------------------
595
# All po subdirs have to be declared with this macro; the subdir "po" is
596
# declared by IT_PROG_INTLTOOL.
598
AC_DEFUN([IT_PO_SUBDIR],
599
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
601
dnl The following CONFIG_COMMANDS should be exetuted at the very end
602
dnl of config.status.
603
AC_CONFIG_COMMANDS_PRE([
604
AC_CONFIG_COMMANDS([$1/stamp-it], [
605
if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" ]; then
606
AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.])
608
rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
613
'"s|^| $ac_top_srcdir/|" \
614
"$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
616
[sed '/^POTFILES =/,/[^\\]$/ {
620
' "$1/Makefile.in" >"$1/Makefile"]
621
rm -f "$1/Makefile.tmp"
622
mv "$1/stamp-it.tmp" "$1/stamp-it"
628
AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
629
# A hint is needed for aclocal from Automake <= 1.9.4:
630
# AC_DEFUN([AC_PROG_INTLTOOL], ...)
633
# nls.m4 serial 3 (gettext-0.15)
634
dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
635
dnl This file is free software; the Free Software Foundation
636
dnl gives unlimited permission to copy and/or distribute it,
637
dnl with or without modifications, as long as this notice is preserved.
639
dnl This file can can be used in projects which are not available under
640
dnl the GNU General Public License or the GNU Library General Public
641
dnl License but which still want to provide support for the GNU gettext
643
dnl Please note that the actual code of the GNU gettext library is covered
644
dnl by the GNU Library General Public License, and the rest of the GNU
645
dnl gettext package package is covered by the GNU General Public License.
646
dnl They are *not* in the public domain.
649
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
650
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
656
AC_MSG_CHECKING([whether NLS is requested])
657
dnl Default is enabled NLS
659
[ --disable-nls do not use Native Language Support],
660
USE_NLS=$enableval, USE_NLS=yes)
661
AC_MSG_RESULT($USE_NLS)
665
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
667
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
669
# This program is free software; you can redistribute it and/or modify
670
# it under the terms of the GNU General Public License as published by
671
# the Free Software Foundation; either version 2 of the License, or
672
# (at your option) any later version.
674
# This program is distributed in the hope that it will be useful, but
675
# WITHOUT ANY WARRANTY; without even the implied warranty of
676
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
677
# General Public License for more details.
679
# You should have received a copy of the GNU General Public License
680
# along with this program; if not, write to the Free Software
681
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
683
# As a special exception to the GNU General Public License, if you
684
# distribute this file as part of a program that contains a
685
# configuration script generated by Autoconf, you may include it under
686
# the same distribution terms that you use for the rest of that program.
688
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
689
# ----------------------------------
690
AC_DEFUN([PKG_PROG_PKG_CONFIG],
691
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
692
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
693
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
694
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
695
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
697
if test -n "$PKG_CONFIG"; then
698
_pkg_min_version=m4_default([$1], [0.9.0])
699
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
700
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
708
])# PKG_PROG_PKG_CONFIG
710
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
712
# Check to see whether a particular set of modules exists. Similar
713
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
716
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
717
# this or PKG_CHECK_MODULES is called, or make sure to call
718
# PKG_CHECK_EXISTS manually
719
# --------------------------------------------------------------
720
AC_DEFUN([PKG_CHECK_EXISTS],
721
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
722
if test -n "$PKG_CONFIG" && \
723
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
724
m4_ifval([$2], [$2], [:])
725
m4_ifvaln([$3], [else
730
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
731
# ---------------------------------------------
732
m4_define([_PKG_CONFIG],
733
[if test -n "$$1"; then
735
elif test -n "$PKG_CONFIG"; then
736
PKG_CHECK_EXISTS([$3],
737
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
744
# _PKG_SHORT_ERRORS_SUPPORTED
745
# -----------------------------
746
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
747
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
748
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
749
_pkg_short_errors_supported=yes
751
_pkg_short_errors_supported=no
753
])# _PKG_SHORT_ERRORS_SUPPORTED
756
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
757
# [ACTION-IF-NOT-FOUND])
760
# Note that if there is a possibility the first call to
761
# PKG_CHECK_MODULES might not happen, you should be sure to include an
762
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
765
# --------------------------------------------------------------
766
AC_DEFUN([PKG_CHECK_MODULES],
767
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
768
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
769
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
772
AC_MSG_CHECKING([for $1])
774
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
775
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
777
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
778
and $1[]_LIBS to avoid the need to call pkg-config.
779
See the pkg-config man page for more details.])
781
if test $pkg_failed = yes; then
782
_PKG_SHORT_ERRORS_SUPPORTED
783
if test $_pkg_short_errors_supported = yes; then
784
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
786
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
788
# Put the nasty error message in config.log where it belongs
789
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
791
ifelse([$4], , [AC_MSG_ERROR(dnl
792
[Package requirements ($2) were not met:
796
Consider adjusting the PKG_CONFIG_PATH environment variable if you
797
installed software in a non-standard prefix.
803
elif test $pkg_failed = untried; then
804
ifelse([$4], , [AC_MSG_FAILURE(dnl
805
[The pkg-config script could not be found or is too old. Make sure it
806
is in your PATH or set the PKG_CONFIG environment variable to the full
811
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
814
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
815
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
817
ifelse([$3], , :, [$3])
819
])# PKG_CHECK_MODULES
22
821
# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
24
823
# This file is free software; the Free Software Foundation
1076
1875
AC_SUBST([am__untar])
1077
1876
]) # _AM_PROG_TAR
1079
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
1080
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
1082
# This file is free software, distributed under the terms of the GNU
1083
# General Public License. As a special exception to the GNU General
1084
# Public License, this file may be distributed as part of a program
1085
# that contains a configuration script generated by Autoconf, under
1086
# the same distribution terms as the rest of that program.
1088
# This file can be copied and used freely without restrictions. It can
1089
# be used in projects which are not available under the GNU Public License
1090
# but which still want to provide support for the GNU gettext functionality.
1092
# Macro to add for using GNU gettext.
1093
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
1095
# Modified to never use included libintl.
1096
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
1098
# Major rework to remove unused code
1099
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
1101
# Added better handling of ALL_LINGUAS from GNU gettext version
1102
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
1104
# Modified to require ngettext
1105
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
1107
# We need this here as well, since someone might use autoconf-2.5x
1108
# to configure GLib then an older version to configure a package
1109
# using AM_GLIB_GNU_GETTEXT
1113
dnl We go to great lengths to make sure that aclocal won't
1114
dnl try to pull in the installed version of these macros
1115
dnl when running aclocal in the glib directory.
1117
m4_copy([AC_DEFUN],[glib_DEFUN])
1118
m4_copy([AC_REQUIRE],[glib_REQUIRE])
1120
dnl At the end, if we're not within glib, we'll define the public
1121
dnl definitions in terms of our private definitions.
1125
#--------------------
1126
glib_DEFUN([GLIB_LC_MESSAGES],
1127
[AC_CHECK_HEADERS([locale.h])
1128
if test $ac_cv_header_locale_h = yes; then
1129
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1130
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1131
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1132
if test $am_cv_val_LC_MESSAGES = yes; then
1133
AC_DEFINE(HAVE_LC_MESSAGES, 1,
1134
[Define if your <locale.h> file defines LC_MESSAGES.])
1138
# GLIB_PATH_PROG_WITH_TEST
1139
#----------------------------
1140
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1141
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1142
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
1143
[# Extract the first word of "$2", so it can be a program name with args.
1144
set dummy $2; ac_word=[$]2
1145
AC_MSG_CHECKING([for $ac_word])
1146
AC_CACHE_VAL(ac_cv_path_$1,
1149
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1152
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1153
for ac_dir in ifelse([$5], , $PATH, [$5]); do
1154
test -z "$ac_dir" && ac_dir=.
1155
if test -f $ac_dir/$ac_word; then
1157
ac_cv_path_$1="$ac_dir/$ac_word"
1163
dnl If no 4th arg is given, leave the cache variable unset,
1164
dnl so AC_PATH_PROGS will keep looking.
1165
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1170
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1171
AC_MSG_RESULT([$]$1)
1180
glib_DEFUN([GLIB_WITH_NLS],
1181
dnl NLS is obligatory
1185
gt_cv_have_gettext=no
1191
AC_CHECK_HEADER(libintl.h,
1192
[gt_cv_func_dgettext_libintl="no"
1193
libintl_extra_libs=""
1196
# First check in libc
1198
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
1200
#include <libintl.h>
1202
[return !ngettext ("","", 1)],
1203
gt_cv_func_ngettext_libc=yes,
1204
gt_cv_func_ngettext_libc=no)
1207
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1208
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
1210
#include <libintl.h>
1212
[return !dgettext ("","")],
1213
gt_cv_func_dgettext_libc=yes,
1214
gt_cv_func_dgettext_libc=no)
1218
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1219
AC_CHECK_FUNCS(bind_textdomain_codeset)
1223
# If we don't have everything we want, check in libintl
1225
if test "$gt_cv_func_dgettext_libc" != "yes" \
1226
|| test "$gt_cv_func_ngettext_libc" != "yes" \
1227
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
1229
AC_CHECK_LIB(intl, bindtextdomain,
1230
[AC_CHECK_LIB(intl, ngettext,
1231
[AC_CHECK_LIB(intl, dgettext,
1232
gt_cv_func_dgettext_libintl=yes)])])
1234
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
1235
AC_MSG_CHECKING([if -liconv is needed to use gettext])
1237
AC_CHECK_LIB(intl, ngettext,
1238
[AC_CHECK_LIB(intl, dcgettext,
1239
[gt_cv_func_dgettext_libintl=yes
1240
libintl_extra_libs=-liconv],
1246
# If we found libintl, then check in it for bind_textdomain_codeset();
1247
# we'll prefer libc if neither have bind_textdomain_codeset(),
1248
# and both have dgettext and ngettext
1250
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
1251
glib_save_LIBS="$LIBS"
1252
LIBS="$LIBS -lintl $libintl_extra_libs"
1253
unset ac_cv_func_bind_textdomain_codeset
1254
AC_CHECK_FUNCS(bind_textdomain_codeset)
1255
LIBS="$glib_save_LIBS"
1257
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
1258
gt_cv_func_dgettext_libc=no
1260
if test "$gt_cv_func_dgettext_libc" = "yes" \
1261
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
1262
gt_cv_func_dgettext_libintl=no
1268
if test "$gt_cv_func_dgettext_libc" = "yes" \
1269
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
1270
gt_cv_have_gettext=yes
1273
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
1274
INTLLIBS="-lintl $libintl_extra_libs"
1277
if test "$gt_cv_have_gettext" = "yes"; then
1278
AC_DEFINE(HAVE_GETTEXT,1,
1279
[Define if the GNU gettext() function is already present or preinstalled.])
1280
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1281
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
1282
if test "$MSGFMT" != "no"; then
1283
glib_save_LIBS="$LIBS"
1284
LIBS="$LIBS $INTLLIBS"
1285
AC_CHECK_FUNCS(dcgettext)
1287
AC_MSG_CHECKING([if msgfmt accepts -c])
1288
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
1291
"Content-Type: text/plain; charset=UTF-8\n"
1292
"Project-Id-Version: test 1.0\n"
1293
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
1294
"Last-Translator: test <foo@bar.xx>\n"
1295
"Language-Team: C <LL@li.org>\n"
1296
"MIME-Version: 1.0\n"
1297
"Content-Transfer-Encoding: 8bit\n"
1298
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
1299
AC_SUBST(MSGFMT_OPTS)
1300
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1301
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1302
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1303
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
1304
return _nl_msg_cat_cntr],
1309
dnl On Solaris, if bind_textdomain_codeset is in libc,
1310
dnl GNU format message catalog is always supported,
1311
dnl since both are added to the libc all together.
1312
dnl Hence, we'd like to go with DATADIRNAME=share and
1313
dnl and CATOBJEXT=.gmo in this case.
1314
AC_CHECK_FUNC(bind_textdomain_codeset,
1325
LIBS="$glib_save_LIBS"
1328
gt_cv_have_gettext=no
1333
if test "$gt_cv_have_gettext" = "yes" ; then
1334
AC_DEFINE(ENABLE_NLS, 1,
1335
[always defined to indicate that i18n is enabled])
1338
dnl Test whether we really found GNU xgettext.
1339
if test "$XGETTEXT" != ":"; then
1340
dnl If it is not GNU xgettext we define it as : so that the
1341
dnl Makefiles still can work.
1342
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
1346
[found xgettext program is not GNU xgettext; ignore it])
1351
# We need to process the po/ directory.
1355
[case "$CONFIG_FILES" in *po/Makefile.in*)
1356
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
1359
dnl These rules are solely for the distribution goal. While doing this
1360
dnl we only have to keep exactly one list of the available catalogs
1361
dnl in configure.in.
1362
for lang in $ALL_LINGUAS; do
1363
GMOFILES="$GMOFILES $lang.gmo"
1364
POFILES="$POFILES $lang.po"
1367
dnl Make all variables we use known to autoconf.
1370
AC_SUBST(DATADIRNAME)
1372
AC_SUBST(INSTOBJEXT)
1374
AC_SUBST(PO_IN_DATADIR_TRUE)
1375
AC_SUBST(PO_IN_DATADIR_FALSE)
1380
# AM_GLIB_GNU_GETTEXT
1381
# -------------------
1382
# Do checks necessary for use of gettext. If a suitable implementation
1383
# of gettext is found in either in libintl or in the C library,
1384
# it will set INTLLIBS to the libraries needed for use of gettext
1385
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
1386
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
1387
# on various variables needed by the Makefile.in.in installed by
1390
glib_DEFUN([GLIB_GNU_GETTEXT],
1391
[AC_REQUIRE([AC_PROG_CC])dnl
1392
AC_REQUIRE([AC_HEADER_STDC])dnl
1397
if test "$gt_cv_have_gettext" = "yes"; then
1398
if test "x$ALL_LINGUAS" = "x"; then
1401
AC_MSG_CHECKING(for catalogs to be installed)
1403
for presentlang in $ALL_LINGUAS; do
1405
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
1406
desiredlanguages="$LINGUAS"
1408
desiredlanguages="$ALL_LINGUAS"
1410
for desiredlang in $desiredlanguages; do
1411
# Use the presentlang catalog if desiredlang is
1412
# a. equal to presentlang, or
1413
# b. a variant of presentlang (because in this case,
1414
# presentlang can be used as a fallback for messages
1415
# which are not translated in the desiredlang catalog).
1416
case "$desiredlang" in
1417
"$presentlang"*) useit=yes;;
1420
if test $useit = yes; then
1421
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1424
LINGUAS=$NEW_LINGUAS
1425
AC_MSG_RESULT($LINGUAS)
1428
dnl Construct list of names of catalog files to be constructed.
1429
if test -n "$LINGUAS"; then
1430
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1434
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1435
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
1436
dnl Try to locate is.
1438
if test -n "$ac_aux_dir"; then
1439
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1441
if test -z "$MKINSTALLDIRS"; then
1442
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1444
AC_SUBST(MKINSTALLDIRS)
1446
dnl Generate list of files to be processed by xgettext which will
1447
dnl be included in po/Makefile.
1448
test -d po || mkdir po
1449
if test "x$srcdir" != "x."; then
1450
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
1451
posrcprefix="$srcdir/"
1453
posrcprefix="../$srcdir/"
1459
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
1460
< $srcdir/po/POTFILES.in > po/POTFILES
1463
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
1464
# -------------------------------
1465
# Define VARIABLE to the location where catalog files will
1466
# be installed by po/Makefile.
1467
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
1468
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
1469
glib_save_prefix="$prefix"
1470
glib_save_exec_prefix="$exec_prefix"
1471
glib_save_datarootdir="$datarootdir"
1472
test "x$prefix" = xNONE && prefix=$ac_default_prefix
1473
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
1474
datarootdir=`eval echo "${datarootdir}"`
1475
if test "x$CATOBJEXT" = "x.mo" ; then
1476
localedir=`eval echo "${libdir}/locale"`
1478
localedir=`eval echo "${datadir}/locale"`
1480
prefix="$glib_save_prefix"
1481
exec_prefix="$glib_save_exec_prefix"
1482
datarootdir="$glib_save_datarootdir"
1483
AC_DEFINE_UNQUOTED($1, "$localedir",
1484
[Define the location where the catalogs will be installed])
1488
dnl Now the definitions that aclocal will find
1490
ifdef(glib_configure_in,[],[
1491
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
1492
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
1495
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
1497
# Create a temporary file with TEST-FILE as its contents and pass the
1498
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
1499
# 0 and perform ACTION-IF-FAIL for any other exit status.
1500
AC_DEFUN([GLIB_RUN_PROG],
1501
[cat >conftest.foo <<_ACEOF
1504
if AC_RUN_LOG([$1 conftest.foo]); then
1505
m4_ifval([$3], [$3], [:])
1506
m4_ifvaln([$4], [else $4])dnl
1507
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
1508
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
1513
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
1514
# serial 40 IT_PROG_INTLTOOL
1515
AC_DEFUN([IT_PROG_INTLTOOL],
1516
[AC_PREREQ([2.50])dnl
1518
case "$am__api_version" in
1520
AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
1526
if test -n "$1"; then
1527
AC_MSG_CHECKING([for intltool >= $1])
1529
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
1530
INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
1531
[INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
1533
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
1534
test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
1535
AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
1538
AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
1539
AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
1540
AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
1541
if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
1542
AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
1545
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 $< [$]@'
1546
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 $< [$]@'
1547
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 $< [$]@'
1548
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 $< [$]@'
1549
INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@'
1550
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 $< [$]@'
1551
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 $< [$]@'
1552
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 $< [$]@'
1553
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 $< [$]@'
1554
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 $< [$]@'
1555
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 $< [$]@'
1556
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@'
1557
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 $< [$]@'
1558
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 $< [$]@'
1559
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 $< [$]@'
1560
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 $< [$]@'
1561
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 $< [$]@'
1562
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 $< [$]@'
1563
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 $< [$]@'
1565
AC_SUBST(INTLTOOL_DESKTOP_RULE)
1566
AC_SUBST(INTLTOOL_DIRECTORY_RULE)
1567
AC_SUBST(INTLTOOL_KEYS_RULE)
1568
AC_SUBST(INTLTOOL_PROP_RULE)
1569
AC_SUBST(INTLTOOL_OAF_RULE)
1570
AC_SUBST(INTLTOOL_PONG_RULE)
1571
AC_SUBST(INTLTOOL_SERVER_RULE)
1572
AC_SUBST(INTLTOOL_SHEET_RULE)
1573
AC_SUBST(INTLTOOL_SOUNDLIST_RULE)
1574
AC_SUBST(INTLTOOL_UI_RULE)
1575
AC_SUBST(INTLTOOL_XAM_RULE)
1576
AC_SUBST(INTLTOOL_KBD_RULE)
1577
AC_SUBST(INTLTOOL_XML_RULE)
1578
AC_SUBST(INTLTOOL_XML_NOMERGE_RULE)
1579
AC_SUBST(INTLTOOL_CAVES_RULE)
1580
AC_SUBST(INTLTOOL_SCHEMAS_RULE)
1581
AC_SUBST(INTLTOOL_THEME_RULE)
1582
AC_SUBST(INTLTOOL_SERVICE_RULE)
1583
AC_SUBST(INTLTOOL_POLICY_RULE)
1585
# Check the gettext tools to make sure they are GNU
1586
AC_PATH_PROG(XGETTEXT, xgettext)
1587
AC_PATH_PROG(MSGMERGE, msgmerge)
1588
AC_PATH_PROG(MSGFMT, msgfmt)
1589
if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
1590
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
1592
xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
1593
mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
1594
mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
1595
if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
1596
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
1599
AC_PATH_PROG(INTLTOOL_PERL, [perl])
1600
if test -z "$INTLTOOL_PERL"; then
1601
AC_MSG_ERROR([perl not found; required for intltool])
1603
if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then
1604
AC_MSG_ERROR([perl 5.x required for intltool])
1606
if test "x$2" != "xno-xml"; then
1607
AC_MSG_CHECKING([for XML::Parser])
1608
if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
1611
AC_MSG_ERROR([XML::Parser perl module is required for intltool])
1615
# Substitute ALL_LINGUAS so we can use it in po/Makefile
1616
AC_SUBST(ALL_LINGUAS)
1618
# Set DATADIRNAME correctly if it is not set yet
1619
# (copied from glib-gettext.m4)
1620
if test -z "$DATADIRNAME"; then
1622
[AC_LANG_PROGRAM([[]],
1623
[[extern int _nl_msg_cat_cntr;
1624
return _nl_msg_cat_cntr]])],
1625
[DATADIRNAME=share],
1628
dnl On Solaris, if bind_textdomain_codeset is in libc,
1629
dnl GNU format message catalog is always supported,
1630
dnl since both are added to the libc all together.
1631
dnl Hence, we'd like to go with DATADIRNAME=share
1633
AC_CHECK_FUNC(bind_textdomain_codeset,
1634
[DATADIRNAME=share], [DATADIRNAME=lib])
1641
AC_SUBST(DATADIRNAME)
1648
# IT_PO_SUBDIR(DIRNAME)
1649
# ---------------------
1650
# All po subdirs have to be declared with this macro; the subdir "po" is
1651
# declared by IT_PROG_INTLTOOL.
1653
AC_DEFUN([IT_PO_SUBDIR],
1654
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
1656
dnl The following CONFIG_COMMANDS should be exetuted at the very end
1657
dnl of config.status.
1658
AC_CONFIG_COMMANDS_PRE([
1659
AC_CONFIG_COMMANDS([$1/stamp-it], [
1660
rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
1665
'"s|^| $ac_top_srcdir/|" \
1666
"$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
1668
if test ! -f "$1/Makefile"; then
1669
AC_MSG_ERROR([$1/Makefile is not ready.])
1671
mv "$1/Makefile" "$1/Makefile.tmp"
1672
[sed '/^POTFILES =/,/[^\\]$/ {
1676
' "$1/Makefile.tmp" >"$1/Makefile"]
1677
rm -f "$1/Makefile.tmp"
1678
mv "$1/stamp-it.tmp" "$1/stamp-it"
1685
AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
1686
# A hint is needed for aclocal from Automake <= 1.9.4:
1687
# AC_DEFUN([AC_PROG_INTLTOOL], ...)
1690
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1692
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1694
# This program is free software; you can redistribute it and/or modify
1695
# it under the terms of the GNU General Public License as published by
1696
# the Free Software Foundation; either version 2 of the License, or
1697
# (at your option) any later version.
1699
# This program is distributed in the hope that it will be useful, but
1700
# WITHOUT ANY WARRANTY; without even the implied warranty of
1701
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1702
# General Public License for more details.
1704
# You should have received a copy of the GNU General Public License
1705
# along with this program; if not, write to the Free Software
1706
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1708
# As a special exception to the GNU General Public License, if you
1709
# distribute this file as part of a program that contains a
1710
# configuration script generated by Autoconf, you may include it under
1711
# the same distribution terms that you use for the rest of that program.
1713
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1714
# ----------------------------------
1715
AC_DEFUN([PKG_PROG_PKG_CONFIG],
1716
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1717
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1718
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
1719
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1720
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1722
if test -n "$PKG_CONFIG"; then
1723
_pkg_min_version=m4_default([$1], [0.9.0])
1724
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1725
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1726
AC_MSG_RESULT([yes])
1733
])# PKG_PROG_PKG_CONFIG
1735
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1737
# Check to see whether a particular set of modules exists. Similar
1738
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1741
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
1742
# this or PKG_CHECK_MODULES is called, or make sure to call
1743
# PKG_CHECK_EXISTS manually
1744
# --------------------------------------------------------------
1745
AC_DEFUN([PKG_CHECK_EXISTS],
1746
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1747
if test -n "$PKG_CONFIG" && \
1748
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1749
m4_ifval([$2], [$2], [:])
1750
m4_ifvaln([$3], [else
1755
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1756
# ---------------------------------------------
1757
m4_define([_PKG_CONFIG],
1758
[if test -n "$$1"; then
1760
elif test -n "$PKG_CONFIG"; then
1761
PKG_CHECK_EXISTS([$3],
1762
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1769
# _PKG_SHORT_ERRORS_SUPPORTED
1770
# -----------------------------
1771
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1772
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1773
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1774
_pkg_short_errors_supported=yes
1776
_pkg_short_errors_supported=no
1778
])# _PKG_SHORT_ERRORS_SUPPORTED
1781
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1782
# [ACTION-IF-NOT-FOUND])
1785
# Note that if there is a possibility the first call to
1786
# PKG_CHECK_MODULES might not happen, you should be sure to include an
1787
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1790
# --------------------------------------------------------------
1791
AC_DEFUN([PKG_CHECK_MODULES],
1792
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1793
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1794
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1797
AC_MSG_CHECKING([for $1])
1799
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1800
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1802
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1803
and $1[]_LIBS to avoid the need to call pkg-config.
1804
See the pkg-config man page for more details.])
1806
if test $pkg_failed = yes; then
1807
_PKG_SHORT_ERRORS_SUPPORTED
1808
if test $_pkg_short_errors_supported = yes; then
1809
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1811
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1813
# Put the nasty error message in config.log where it belongs
1814
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1816
ifelse([$4], , [AC_MSG_ERROR(dnl
1817
[Package requirements ($2) were not met:
1821
Consider adjusting the PKG_CONFIG_PATH environment variable if you
1822
installed software in a non-standard prefix.
1826
[AC_MSG_RESULT([no])
1828
elif test $pkg_failed = untried; then
1829
ifelse([$4], , [AC_MSG_FAILURE(dnl
1830
[The pkg-config script could not be found or is too old. Make sure it
1831
is in your PATH or set the PKG_CONFIG environment variable to the full
1836
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
1839
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1840
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1841
AC_MSG_RESULT([yes])
1842
ifelse([$3], , :, [$3])
1844
])# PKG_CHECK_MODULES
1846
1878
m4_include([acinclude.m4])