51
51
AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no])
54
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
55
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
57
# This file is free software, distributed under the terms of the GNU
58
# General Public License. As a special exception to the GNU General
59
# Public License, this file may be distributed as part of a program
60
# that contains a configuration script generated by Autoconf, under
61
# the same distribution terms as the rest of that program.
63
# This file can be copied and used freely without restrictions. It can
64
# be used in projects which are not available under the GNU Public License
65
# but which still want to provide support for the GNU gettext functionality.
67
# Macro to add for using GNU gettext.
68
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
70
# Modified to never use included libintl.
71
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
73
# Major rework to remove unused code
74
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
76
# Added better handling of ALL_LINGUAS from GNU gettext version
77
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
79
# Modified to require ngettext
80
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
82
# We need this here as well, since someone might use autoconf-2.5x
83
# to configure GLib then an older version to configure a package
84
# using AM_GLIB_GNU_GETTEXT
88
dnl We go to great lengths to make sure that aclocal won't
89
dnl try to pull in the installed version of these macros
90
dnl when running aclocal in the glib directory.
92
m4_copy([AC_DEFUN],[glib_DEFUN])
93
m4_copy([AC_REQUIRE],[glib_REQUIRE])
95
dnl At the end, if we're not within glib, we'll define the public
96
dnl definitions in terms of our private definitions.
100
#--------------------
101
glib_DEFUN([GLIB_LC_MESSAGES],
102
[AC_CHECK_HEADERS([locale.h])
103
if test $ac_cv_header_locale_h = yes; then
104
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
105
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
106
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
107
if test $am_cv_val_LC_MESSAGES = yes; then
108
AC_DEFINE(HAVE_LC_MESSAGES, 1,
109
[Define if your <locale.h> file defines LC_MESSAGES.])
113
# GLIB_PATH_PROG_WITH_TEST
114
#----------------------------
115
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
116
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
117
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
118
[# Extract the first word of "$2", so it can be a program name with args.
119
set dummy $2; ac_word=[$]2
120
AC_MSG_CHECKING([for $ac_word])
121
AC_CACHE_VAL(ac_cv_path_$1,
124
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
127
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
128
for ac_dir in ifelse([$5], , $PATH, [$5]); do
129
test -z "$ac_dir" && ac_dir=.
130
if test -f $ac_dir/$ac_word; then
132
ac_cv_path_$1="$ac_dir/$ac_word"
138
dnl If no 4th arg is given, leave the cache variable unset,
139
dnl so AC_PATH_PROGS will keep looking.
140
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
145
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
155
glib_DEFUN([GLIB_WITH_NLS],
156
dnl NLS is obligatory
157
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
161
gt_cv_have_gettext=no
167
AC_CHECK_HEADER(libintl.h,
168
[gt_cv_func_dgettext_libintl="no"
169
libintl_extra_libs=""
172
# First check in libc
174
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
178
[return !ngettext ("","", 1)],
179
gt_cv_func_ngettext_libc=yes,
180
gt_cv_func_ngettext_libc=no)
183
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
184
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
188
[return !dgettext ("","")],
189
gt_cv_func_dgettext_libc=yes,
190
gt_cv_func_dgettext_libc=no)
194
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
195
AC_CHECK_FUNCS(bind_textdomain_codeset)
199
# If we don't have everything we want, check in libintl
201
if test "$gt_cv_func_dgettext_libc" != "yes" \
202
|| test "$gt_cv_func_ngettext_libc" != "yes" \
203
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
205
AC_CHECK_LIB(intl, bindtextdomain,
206
[AC_CHECK_LIB(intl, ngettext,
207
[AC_CHECK_LIB(intl, dgettext,
208
gt_cv_func_dgettext_libintl=yes)])])
210
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
211
AC_MSG_CHECKING([if -liconv is needed to use gettext])
213
AC_CHECK_LIB(intl, ngettext,
214
[AC_CHECK_LIB(intl, dcgettext,
215
[gt_cv_func_dgettext_libintl=yes
216
libintl_extra_libs=-liconv],
222
# If we found libintl, then check in it for bind_textdomain_codeset();
223
# we'll prefer libc if neither have bind_textdomain_codeset(),
224
# and both have dgettext and ngettext
226
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
227
glib_save_LIBS="$LIBS"
228
LIBS="$LIBS -lintl $libintl_extra_libs"
229
unset ac_cv_func_bind_textdomain_codeset
230
AC_CHECK_FUNCS(bind_textdomain_codeset)
231
LIBS="$glib_save_LIBS"
233
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
234
gt_cv_func_dgettext_libc=no
236
if test "$gt_cv_func_dgettext_libc" = "yes" \
237
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
238
gt_cv_func_dgettext_libintl=no
244
if test "$gt_cv_func_dgettext_libc" = "yes" \
245
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
246
gt_cv_have_gettext=yes
249
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
250
INTLLIBS="-lintl $libintl_extra_libs"
253
if test "$gt_cv_have_gettext" = "yes"; then
254
AC_DEFINE(HAVE_GETTEXT,1,
255
[Define if the GNU gettext() function is already present or preinstalled.])
256
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
257
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
258
if test "$MSGFMT" != "no"; then
259
glib_save_LIBS="$LIBS"
260
LIBS="$LIBS $INTLLIBS"
261
AC_CHECK_FUNCS(dcgettext)
263
AC_MSG_CHECKING([if msgfmt accepts -c])
264
GLIB_RUN_PROG([msgfmt -c -o /dev/null],[
267
"Content-Type: text/plain; charset=UTF-8\n"
268
"Project-Id-Version: test 1.0\n"
269
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
270
"Last-Translator: test <foo@bar.xx>\n"
271
"Language-Team: C <LL@li.org>\n"
272
"MIME-Version: 1.0\n"
273
"Content-Transfer-Encoding: 8bit\n"
274
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
275
AC_SUBST(MSGFMT_OPTS)
276
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
277
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
278
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
279
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
280
return _nl_msg_cat_cntr],
285
dnl On Solaris, if bind_textdomain_codeset is in libc,
286
dnl GNU format message catalog is always supported,
287
dnl since both are added to the libc all together.
288
dnl Hence, we'd like to go with DATADIRNAME=share and
289
dnl and CATOBJEXT=.gmo in this case.
290
AC_CHECK_FUNC(bind_textdomain_codeset,
301
LIBS="$glib_save_LIBS"
304
gt_cv_have_gettext=no
309
if test "$gt_cv_have_gettext" = "yes" ; then
310
AC_DEFINE(ENABLE_NLS, 1,
311
[always defined to indicate that i18n is enabled])
314
dnl Test whether we really found GNU xgettext.
315
if test "$XGETTEXT" != ":"; then
316
dnl If it is not GNU xgettext we define it as : so that the
317
dnl Makefiles still can work.
318
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
322
[found xgettext program is not GNU xgettext; ignore it])
327
# We need to process the po/ directory.
331
[case "$CONFIG_FILES" in *po/Makefile.in*)
332
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
335
dnl These rules are solely for the distribution goal. While doing this
336
dnl we only have to keep exactly one list of the available catalogs
338
for lang in $ALL_LINGUAS; do
339
GMOFILES="$GMOFILES $lang.gmo"
340
POFILES="$POFILES $lang.po"
343
dnl Make all variables we use known to autoconf.
346
AC_SUBST(DATADIRNAME)
350
AC_SUBST(PO_IN_DATADIR_TRUE)
351
AC_SUBST(PO_IN_DATADIR_FALSE)
356
# AM_GLIB_GNU_GETTEXT
357
# -------------------
358
# Do checks necessary for use of gettext. If a suitable implementation
359
# of gettext is found in either in libintl or in the C library,
360
# it will set INTLLIBS to the libraries needed for use of gettext
361
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
362
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
363
# on various variables needed by the Makefile.in.in installed by
366
glib_DEFUN([GLIB_GNU_GETTEXT],
367
[AC_REQUIRE([AC_PROG_CC])dnl
368
AC_REQUIRE([AC_HEADER_STDC])dnl
373
if test "$gt_cv_have_gettext" = "yes"; then
374
if test "x$ALL_LINGUAS" = "x"; then
377
AC_MSG_CHECKING(for catalogs to be installed)
379
for presentlang in $ALL_LINGUAS; do
381
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
382
desiredlanguages="$LINGUAS"
384
desiredlanguages="$ALL_LINGUAS"
386
for desiredlang in $desiredlanguages; do
387
# Use the presentlang catalog if desiredlang is
388
# a. equal to presentlang, or
389
# b. a variant of presentlang (because in this case,
390
# presentlang can be used as a fallback for messages
391
# which are not translated in the desiredlang catalog).
392
case "$desiredlang" in
393
"$presentlang"*) useit=yes;;
396
if test $useit = yes; then
397
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
401
AC_MSG_RESULT($LINGUAS)
404
dnl Construct list of names of catalog files to be constructed.
405
if test -n "$LINGUAS"; then
406
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
410
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
411
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
412
dnl Try to locate is.
414
if test -n "$ac_aux_dir"; then
415
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
417
if test -z "$MKINSTALLDIRS"; then
418
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
420
AC_SUBST(MKINSTALLDIRS)
422
dnl Generate list of files to be processed by xgettext which will
423
dnl be included in po/Makefile.
424
test -d po || mkdir po
425
if test "x$srcdir" != "x."; then
426
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
427
posrcprefix="$srcdir/"
429
posrcprefix="../$srcdir/"
435
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
436
< $srcdir/po/POTFILES.in > po/POTFILES
439
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
440
# -------------------------------
441
# Define VARIABLE to the location where catalog files will
442
# be installed by po/Makefile.
443
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
444
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
445
glib_save_prefix="$prefix"
446
glib_save_exec_prefix="$exec_prefix"
447
glib_save_datarootdir="$datarootdir"
448
test "x$prefix" = xNONE && prefix=$ac_default_prefix
449
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
450
datarootdir=`eval echo "${datarootdir}"`
451
if test "x$CATOBJEXT" = "x.mo" ; then
452
localedir=`eval echo "${libdir}/locale"`
454
localedir=`eval echo "${datadir}/locale"`
456
prefix="$glib_save_prefix"
457
exec_prefix="$glib_save_exec_prefix"
458
datarootdir="$glib_save_datarootdir"
459
AC_DEFINE_UNQUOTED($1, "$localedir",
460
[Define the location where the catalogs will be installed])
464
dnl Now the definitions that aclocal will find
466
ifdef(glib_configure_in,[],[
467
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
468
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
471
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
473
# Create a temporary file with TEST-FILE as its contents and pass the
474
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
475
# 0 and perform ACTION-IF-FAIL for any other exit status.
476
AC_DEFUN([GLIB_RUN_PROG],
477
[cat >conftest.foo <<_ACEOF
480
if AC_RUN_LOG([$1 conftest.foo]); then
481
m4_ifval([$3], [$3], [:])
482
m4_ifvaln([$4], [else $4])dnl
483
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
484
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
489
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
490
# serial 35 IT_PROG_INTLTOOL
491
AC_DEFUN([IT_PROG_INTLTOOL],
492
[AC_PREREQ([2.50])dnl
494
case "$am__api_version" in
496
AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
502
if test -n "$1"; then
503
AC_MSG_CHECKING(for intltool >= $1)
505
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
506
INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { print $ 2; }' ${ac_aux_dir}/intltool-update.in`
507
[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`
509
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
510
test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
511
AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
514
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 $< [$]@'
515
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 $< [$]@'
516
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 $< [$]@'
517
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 $< [$]@'
518
INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@'
519
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 $< [$]@'
520
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 $< [$]@'
521
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 $< [$]@'
522
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 $< [$]@'
523
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 $< [$]@'
524
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 $< [$]@'
525
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@'
526
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 $< [$]@'
527
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 $< [$]@'
528
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 $< [$]@'
529
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 $< [$]@'
530
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 $< [$]@'
531
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 $< [$]@'
533
AC_SUBST(INTLTOOL_DESKTOP_RULE)
534
AC_SUBST(INTLTOOL_DIRECTORY_RULE)
535
AC_SUBST(INTLTOOL_KEYS_RULE)
536
AC_SUBST(INTLTOOL_PROP_RULE)
537
AC_SUBST(INTLTOOL_OAF_RULE)
538
AC_SUBST(INTLTOOL_PONG_RULE)
539
AC_SUBST(INTLTOOL_SERVER_RULE)
540
AC_SUBST(INTLTOOL_SHEET_RULE)
541
AC_SUBST(INTLTOOL_SOUNDLIST_RULE)
542
AC_SUBST(INTLTOOL_UI_RULE)
543
AC_SUBST(INTLTOOL_XAM_RULE)
544
AC_SUBST(INTLTOOL_KBD_RULE)
545
AC_SUBST(INTLTOOL_XML_RULE)
546
AC_SUBST(INTLTOOL_XML_NOMERGE_RULE)
547
AC_SUBST(INTLTOOL_CAVES_RULE)
548
AC_SUBST(INTLTOOL_SCHEMAS_RULE)
549
AC_SUBST(INTLTOOL_THEME_RULE)
550
AC_SUBST(INTLTOOL_SERVICE_RULE)
552
# Use the tools built into the package, not the ones that are installed.
553
AC_SUBST(INTLTOOL_EXTRACT, '$(top_builddir)/intltool-extract')
554
AC_SUBST(INTLTOOL_MERGE, '$(top_builddir)/intltool-merge')
555
AC_SUBST(INTLTOOL_UPDATE, '$(top_builddir)/intltool-update')
557
AC_PATH_PROG(INTLTOOL_PERL, perl)
558
if test -z "$INTLTOOL_PERL"; then
559
AC_MSG_ERROR([perl not found; required for intltool])
561
if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then
562
AC_MSG_ERROR([perl 5.x required for intltool])
564
if test "x$2" != "xno-xml"; then
565
AC_MSG_CHECKING([for XML::Parser])
566
if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
569
AC_MSG_ERROR([XML::Parser perl module is required for intltool])
573
AC_PATH_PROG(INTLTOOL_ICONV, iconv, iconv)
574
AC_PATH_PROG(INTLTOOL_MSGFMT, msgfmt, msgfmt)
575
AC_PATH_PROG(INTLTOOL_MSGMERGE, msgmerge, msgmerge)
576
AC_PATH_PROG(INTLTOOL_XGETTEXT, xgettext, xgettext)
578
# Substitute ALL_LINGUAS so we can use it in po/Makefile
579
AC_SUBST(ALL_LINGUAS)
581
# Set DATADIRNAME correctly if it is not set yet
582
# (copied from glib-gettext.m4)
583
if test -z "$DATADIRNAME"; then
584
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
585
return _nl_msg_cat_cntr],
589
dnl On Solaris, if bind_textdomain_codeset is in libc,
590
dnl GNU format message catalog is always supported,
591
dnl since both are added to the libc all together.
592
dnl Hence, we'd like to go with DATADIRNAME=share
594
AC_CHECK_FUNC(bind_textdomain_codeset,
595
[DATADIRNAME=share], [DATADIRNAME=lib])
602
AC_SUBST(DATADIRNAME)
606
dnl The following is very similar to
608
dnl AC_CONFIG_FILES([intltool-extract intltool-merge intltool-update])
610
dnl with the following slight differences:
611
dnl - the *.in files are in ac_aux_dir,
612
dnl - if the file haven't changed upon reconfigure, it's not touched,
613
dnl - the evaluation of the third parameter enables a hack which computes
614
dnl the actual value of $libdir,
615
dnl - the user sees "executing intltool commands", instead of
616
dnl "creating intltool-extract" and such.
618
dnl Nothing crucial here, and we could use AC_CONFIG_FILES, if there were
621
AC_CONFIG_COMMANDS([intltool], [
623
for file in intltool-extract intltool-merge intltool-update; do
624
sed -e "s|@INTLTOOL_EXTRACT@|`pwd`/intltool-extract|g" \
625
-e "s|@INTLTOOL_LIBDIR@|${INTLTOOL_LIBDIR}|g" \
626
-e "s|@INTLTOOL_ICONV@|${INTLTOOL_ICONV}|g" \
627
-e "s|@INTLTOOL_MSGFMT@|${INTLTOOL_MSGFMT}|g" \
628
-e "s|@INTLTOOL_MSGMERGE@|${INTLTOOL_MSGMERGE}|g" \
629
-e "s|@INTLTOOL_XGETTEXT@|${INTLTOOL_XGETTEXT}|g" \
630
-e "s|@INTLTOOL_PERL@|${INTLTOOL_PERL}|g" \
631
< ${ac_aux_dir}/${file}.in > ${file}.out
632
if cmp -s ${file} ${file}.out 2>/dev/null; then
635
mv -f ${file}.out ${file}
642
[INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir='${ac_aux_dir}'
643
prefix="$prefix" exec_prefix="$exec_prefix" INTLTOOL_LIBDIR="$libdir"
644
INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' INTLTOOL_ICONV='${INTLTOOL_ICONV}'
645
INTLTOOL_MSGFMT='${INTLTOOL_MSGFMT}' INTLTOOL_MSGMERGE='${INTLTOOL_MSGMERGE}'
646
INTLTOOL_XGETTEXT='${INTLTOOL_XGETTEXT}'])
651
# IT_PO_SUBDIR(DIRNAME)
652
# ---------------------
653
# All po subdirs have to be declared with this macro; the subdir "po" is
654
# declared by IT_PROG_INTLTOOL.
656
AC_DEFUN([IT_PO_SUBDIR],
657
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
659
dnl The following CONFIG_COMMANDS should be exetuted at the very end
660
dnl of config.status.
661
AC_CONFIG_COMMANDS_PRE([
662
AC_CONFIG_COMMANDS([$1/stamp-it], [
663
rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
668
'"s|^| $ac_top_srcdir/|" \
669
"$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
671
if test ! -f "$1/Makefile"; then
672
AC_MSG_ERROR([$1/Makefile is not ready.])
674
mv "$1/Makefile" "$1/Makefile.tmp"
675
[sed '/^POTFILES =/,/[^\\]$/ {
679
' "$1/Makefile.tmp" >"$1/Makefile"]
680
rm -f "$1/Makefile.tmp"
681
mv "$1/stamp-it.tmp" "$1/stamp-it"
688
AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
689
# A hint is needed for aclocal from Automake <= 1.9.4:
690
# AC_DEFUN([AC_PROG_INTLTOOL], ...)
54
693
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
56
695
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
314
953
Usually this means the macro was only invoked conditionally.]])
957
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
958
# Free Software Foundation, Inc.
960
# This file is free software; the Free Software Foundation
961
# gives unlimited permission to copy and/or distribute it,
962
# with or without modifications, as long as this notice is preserved.
966
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
967
# written in clear, in which case automake, when reading aclocal.m4,
968
# will think it sees a *use*, and therefore will trigger all it's
969
# C support machinery. Also note that it means that autoscan, seeing
970
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
973
# _AM_DEPENDENCIES(NAME)
974
# ----------------------
975
# See how the compiler implements dependency checking.
976
# NAME is "CC", "CXX", "GCJ", or "OBJC".
977
# We try a few techniques and use that to set a single cache variable.
979
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
980
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
981
# dependency, and given that the user is not expected to run this macro,
982
# just rely on AC_PROG_CC.
983
AC_DEFUN([_AM_DEPENDENCIES],
984
[AC_REQUIRE([AM_SET_DEPDIR])dnl
985
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
986
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
987
AC_REQUIRE([AM_DEP_TRACK])dnl
989
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
990
[$1], CXX, [depcc="$CXX" am_compiler_list=],
991
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
992
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
993
[depcc="$$1" am_compiler_list=])
995
AC_CACHE_CHECK([dependency style of $depcc],
996
[am_cv_$1_dependencies_compiler_type],
997
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
998
# We make a subdir and do the tests there. Otherwise we can end up
999
# making bogus files that we don't know about and never remove. For
1000
# instance it was reported that on HP-UX the gcc test will end up
1001
# making a dummy file named `D' -- because `-MD' means `put the output
1004
# Copy depcomp to subdir because otherwise we won't find it if we're
1005
# using a relative directory.
1006
cp "$am_depcomp" conftest.dir
1008
# We will build objects and dependencies in a subdirectory because
1009
# it helps to detect inapplicable dependency modes. For instance
1010
# both Tru64's cc and ICC support -MD to output dependencies as a
1011
# side effect of compilation, but ICC will put the dependencies in
1012
# the current directory while Tru64 will put them in the object
1016
am_cv_$1_dependencies_compiler_type=none
1017
if test "$am_compiler_list" = ""; then
1018
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1020
for depmode in $am_compiler_list; do
1021
# Setup a source with many dependencies, because some compilers
1022
# like to wrap large dependency lists on column 80 (with \), and
1023
# we should not choose a depcomp mode which is confused by this.
1025
# We need to recreate these files for each test, as the compiler may
1026
# overwrite some of them when testing with obscure command lines.
1027
# This happens at least with the AIX C compiler.
1029
for i in 1 2 3 4 5 6; do
1030
echo '#include "conftst'$i'.h"' >> sub/conftest.c
1031
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
1032
# Solaris 8's {/usr,}/bin/sh.
1033
touch sub/conftst$i.h
1035
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1039
# after this tag, mechanisms are not by side-effect, so they'll
1040
# only be used when explicitly requested
1041
if test "x$enable_dependency_tracking" = xyes; then
1049
# We check with `-c' and `-o' for the sake of the "dashmstdout"
1050
# mode. It turns out that the SunPro C++ compiler does not properly
1051
# handle `-M -o', and we need to detect this.
1052
if depmode=$depmode \
1053
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
1054
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1055
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
1056
>/dev/null 2>conftest.err &&
1057
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1058
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
1059
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1060
# icc doesn't choke on unknown options, it will just issue warnings
1061
# or remarks (even with -Werror). So we grep stderr for any message
1062
# that says an option was ignored or not supported.
1063
# When given -MP, icc 7.0 and 7.1 complain thusly:
1064
# icc: Command line warning: ignoring option '-M'; no argument required
1065
# The diagnosis changed in icc 8.0:
1066
# icc: Command line remark: option '-MP' not supported
1067
if (grep 'ignoring option' conftest.err ||
1068
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1069
am_cv_$1_dependencies_compiler_type=$depmode
1078
am_cv_$1_dependencies_compiler_type=none
1081
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1082
AM_CONDITIONAL([am__fastdep$1], [
1083
test "x$enable_dependency_tracking" != xno \
1084
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1090
# Choose a directory name for dependency files.
1091
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
1092
AC_DEFUN([AM_SET_DEPDIR],
1093
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1094
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1100
AC_DEFUN([AM_DEP_TRACK],
1101
[AC_ARG_ENABLE(dependency-tracking,
1102
[ --disable-dependency-tracking speeds up one-time build
1103
--enable-dependency-tracking do not reject slow dependency extractors])
1104
if test "x$enable_dependency_tracking" != xno; then
1105
am_depcomp="$ac_aux_dir/depcomp"
1108
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1109
AC_SUBST([AMDEPBACKSLASH])
1112
# Generate code to set up dependency tracking. -*- Autoconf -*-
1114
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
1115
# Free Software Foundation, Inc.
1117
# This file is free software; the Free Software Foundation
1118
# gives unlimited permission to copy and/or distribute it,
1119
# with or without modifications, as long as this notice is preserved.
1123
# _AM_OUTPUT_DEPENDENCY_COMMANDS
1124
# ------------------------------
1125
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1126
[for mf in $CONFIG_FILES; do
1127
# Strip MF so we end up with the name of the file.
1128
mf=`echo "$mf" | sed -e 's/:.*$//'`
1129
# Check whether this is an Automake generated Makefile or not.
1130
# We used to match only the files named `Makefile.in', but
1131
# some people rename them; so instead we look at the file content.
1132
# Grep'ing the first line is not enough: some people post-process
1133
# each Makefile.in and add a new line on top of each file to say so.
1134
# So let's grep whole file.
1135
if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
1136
dirpart=`AS_DIRNAME("$mf")`
1140
# Extract the definition of DEPDIR, am__include, and am__quote
1141
# from the Makefile without running `make'.
1142
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1143
test -z "$DEPDIR" && continue
1144
am__include=`sed -n 's/^am__include = //p' < "$mf"`
1145
test -z "am__include" && continue
1146
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1147
# When using ansi2knr, U may be empty or an underscore; expand it
1148
U=`sed -n 's/^U = //p' < "$mf"`
1149
# Find all dependency output files, they are included files with
1150
# $(DEPDIR) in their names. We invoke sed twice because it is the
1151
# simplest approach to changing $(DEPDIR) to its actual value in the
1153
for file in `sed -n "
1154
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1155
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1156
# Make sure the directory exists.
1157
test -f "$dirpart/$file" && continue
1158
fdir=`AS_DIRNAME(["$file"])`
1159
AS_MKDIR_P([$dirpart/$fdir])
1160
# echo "creating $dirpart/$file"
1161
echo '# dummy' > "$dirpart/$file"
1164
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1167
# AM_OUTPUT_DEPENDENCY_COMMANDS
1168
# -----------------------------
1169
# This macro should only be invoked once -- use via AC_REQUIRE.
1171
# This code is only required when automatic dependency tracking
1172
# is enabled. FIXME. This creates each `.P' file that we will
1173
# need in order to bootstrap the dependency handling code.
1174
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1175
[AC_CONFIG_COMMANDS([depfiles],
1176
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1177
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
317
1180
# Do all the work for Automake. -*- Autoconf -*-
319
1182
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005