16
16
You have another version of autoconf. If you want to use that,
17
17
you should regenerate the build system entirely.], [63])])
19
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
20
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
22
# This file is free software, distributed under the terms of the GNU
23
# General Public License. As a special exception to the GNU General
24
# Public License, this file may be distributed as part of a program
25
# that contains a configuration script generated by Autoconf, under
26
# the same distribution terms as the rest of that program.
28
# This file can be copied and used freely without restrictions. It can
29
# be used in projects which are not available under the GNU Public License
30
# but which still want to provide support for the GNU gettext functionality.
32
# Macro to add for using GNU gettext.
33
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
35
# Modified to never use included libintl.
36
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
38
# Major rework to remove unused code
39
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
41
# Added better handling of ALL_LINGUAS from GNU gettext version
42
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
44
# Modified to require ngettext
45
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
47
# We need this here as well, since someone might use autoconf-2.5x
48
# to configure GLib then an older version to configure a package
49
# using AM_GLIB_GNU_GETTEXT
53
dnl We go to great lengths to make sure that aclocal won't
54
dnl try to pull in the installed version of these macros
55
dnl when running aclocal in the glib directory.
57
m4_copy([AC_DEFUN],[glib_DEFUN])
58
m4_copy([AC_REQUIRE],[glib_REQUIRE])
60
dnl At the end, if we're not within glib, we'll define the public
61
dnl definitions in terms of our private definitions.
66
glib_DEFUN([GLIB_LC_MESSAGES],
67
[AC_CHECK_HEADERS([locale.h])
68
if test $ac_cv_header_locale_h = yes; then
69
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
70
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
71
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
72
if test $am_cv_val_LC_MESSAGES = yes; then
73
AC_DEFINE(HAVE_LC_MESSAGES, 1,
74
[Define if your <locale.h> file defines LC_MESSAGES.])
78
# GLIB_PATH_PROG_WITH_TEST
79
#----------------------------
80
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
81
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
82
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
83
[# Extract the first word of "$2", so it can be a program name with args.
84
set dummy $2; ac_word=[$]2
85
AC_MSG_CHECKING([for $ac_word])
86
AC_CACHE_VAL(ac_cv_path_$1,
89
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
92
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
93
for ac_dir in ifelse([$5], , $PATH, [$5]); do
94
test -z "$ac_dir" && ac_dir=.
95
if test -f $ac_dir/$ac_word; then
97
ac_cv_path_$1="$ac_dir/$ac_word"
103
dnl If no 4th arg is given, leave the cache variable unset,
104
dnl so AC_PATH_PROGS will keep looking.
105
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
110
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
120
glib_DEFUN([GLIB_WITH_NLS],
121
dnl NLS is obligatory
122
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
126
gt_cv_have_gettext=no
132
AC_CHECK_HEADER(libintl.h,
133
[gt_cv_func_dgettext_libintl="no"
134
libintl_extra_libs=""
137
# First check in libc
139
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
143
[return !ngettext ("","", 1)],
144
gt_cv_func_ngettext_libc=yes,
145
gt_cv_func_ngettext_libc=no)
148
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
149
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
153
[return !dgettext ("","")],
154
gt_cv_func_dgettext_libc=yes,
155
gt_cv_func_dgettext_libc=no)
159
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
160
AC_CHECK_FUNCS(bind_textdomain_codeset)
164
# If we don't have everything we want, check in libintl
166
if test "$gt_cv_func_dgettext_libc" != "yes" \
167
|| test "$gt_cv_func_ngettext_libc" != "yes" \
168
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
170
AC_CHECK_LIB(intl, bindtextdomain,
171
[AC_CHECK_LIB(intl, ngettext,
172
[AC_CHECK_LIB(intl, dgettext,
173
gt_cv_func_dgettext_libintl=yes)])])
175
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
176
AC_MSG_CHECKING([if -liconv is needed to use gettext])
178
AC_CHECK_LIB(intl, ngettext,
179
[AC_CHECK_LIB(intl, dcgettext,
180
[gt_cv_func_dgettext_libintl=yes
181
libintl_extra_libs=-liconv],
187
# If we found libintl, then check in it for bind_textdomain_codeset();
188
# we'll prefer libc if neither have bind_textdomain_codeset(),
189
# and both have dgettext and ngettext
191
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
192
glib_save_LIBS="$LIBS"
193
LIBS="$LIBS -lintl $libintl_extra_libs"
194
unset ac_cv_func_bind_textdomain_codeset
195
AC_CHECK_FUNCS(bind_textdomain_codeset)
196
LIBS="$glib_save_LIBS"
198
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
199
gt_cv_func_dgettext_libc=no
201
if test "$gt_cv_func_dgettext_libc" = "yes" \
202
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
203
gt_cv_func_dgettext_libintl=no
209
if test "$gt_cv_func_dgettext_libc" = "yes" \
210
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
211
gt_cv_have_gettext=yes
214
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
215
INTLLIBS="-lintl $libintl_extra_libs"
218
if test "$gt_cv_have_gettext" = "yes"; then
219
AC_DEFINE(HAVE_GETTEXT,1,
220
[Define if the GNU gettext() function is already present or preinstalled.])
221
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
222
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
223
if test "$MSGFMT" != "no"; then
224
glib_save_LIBS="$LIBS"
225
LIBS="$LIBS $INTLLIBS"
226
AC_CHECK_FUNCS(dcgettext)
228
AC_MSG_CHECKING([if msgfmt accepts -c])
229
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
232
"Content-Type: text/plain; charset=UTF-8\n"
233
"Project-Id-Version: test 1.0\n"
234
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
235
"Last-Translator: test <foo@bar.xx>\n"
236
"Language-Team: C <LL@li.org>\n"
237
"MIME-Version: 1.0\n"
238
"Content-Transfer-Encoding: 8bit\n"
239
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
240
AC_SUBST(MSGFMT_OPTS)
241
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
242
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
243
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
244
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
245
return _nl_msg_cat_cntr],
250
dnl On Solaris, if bind_textdomain_codeset is in libc,
251
dnl GNU format message catalog is always supported,
252
dnl since both are added to the libc all together.
253
dnl Hence, we'd like to go with DATADIRNAME=share and
254
dnl and CATOBJEXT=.gmo in this case.
255
AC_CHECK_FUNC(bind_textdomain_codeset,
266
LIBS="$glib_save_LIBS"
269
gt_cv_have_gettext=no
274
if test "$gt_cv_have_gettext" = "yes" ; then
275
AC_DEFINE(ENABLE_NLS, 1,
276
[always defined to indicate that i18n is enabled])
279
dnl Test whether we really found GNU xgettext.
280
if test "$XGETTEXT" != ":"; then
281
dnl If it is not GNU xgettext we define it as : so that the
282
dnl Makefiles still can work.
283
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
287
[found xgettext program is not GNU xgettext; ignore it])
292
# We need to process the po/ directory.
296
[case "$CONFIG_FILES" in *po/Makefile.in*)
297
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
300
dnl These rules are solely for the distribution goal. While doing this
301
dnl we only have to keep exactly one list of the available catalogs
303
for lang in $ALL_LINGUAS; do
304
GMOFILES="$GMOFILES $lang.gmo"
305
POFILES="$POFILES $lang.po"
308
dnl Make all variables we use known to autoconf.
311
AC_SUBST(DATADIRNAME)
315
AC_SUBST(PO_IN_DATADIR_TRUE)
316
AC_SUBST(PO_IN_DATADIR_FALSE)
321
# AM_GLIB_GNU_GETTEXT
322
# -------------------
323
# Do checks necessary for use of gettext. If a suitable implementation
324
# of gettext is found in either in libintl or in the C library,
325
# it will set INTLLIBS to the libraries needed for use of gettext
326
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
327
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
328
# on various variables needed by the Makefile.in.in installed by
331
glib_DEFUN([GLIB_GNU_GETTEXT],
332
[AC_REQUIRE([AC_PROG_CC])dnl
333
AC_REQUIRE([AC_HEADER_STDC])dnl
338
if test "$gt_cv_have_gettext" = "yes"; then
339
if test "x$ALL_LINGUAS" = "x"; then
342
AC_MSG_CHECKING(for catalogs to be installed)
344
for presentlang in $ALL_LINGUAS; do
346
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
347
desiredlanguages="$LINGUAS"
349
desiredlanguages="$ALL_LINGUAS"
351
for desiredlang in $desiredlanguages; do
352
# Use the presentlang catalog if desiredlang is
353
# a. equal to presentlang, or
354
# b. a variant of presentlang (because in this case,
355
# presentlang can be used as a fallback for messages
356
# which are not translated in the desiredlang catalog).
357
case "$desiredlang" in
358
"$presentlang"*) useit=yes;;
361
if test $useit = yes; then
362
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
366
AC_MSG_RESULT($LINGUAS)
369
dnl Construct list of names of catalog files to be constructed.
370
if test -n "$LINGUAS"; then
371
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
375
dnl Generate list of files to be processed by xgettext which will
376
dnl be included in po/Makefile.
377
test -d po || mkdir po
378
if test "x$srcdir" != "x."; then
379
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
380
posrcprefix="$srcdir/"
382
posrcprefix="../$srcdir/"
388
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
389
< $srcdir/po/POTFILES.in > po/POTFILES
392
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
393
# -------------------------------
394
# Define VARIABLE to the location where catalog files will
395
# be installed by po/Makefile.
396
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
397
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
398
glib_save_prefix="$prefix"
399
glib_save_exec_prefix="$exec_prefix"
400
glib_save_datarootdir="$datarootdir"
401
test "x$prefix" = xNONE && prefix=$ac_default_prefix
402
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
403
datarootdir=`eval echo "${datarootdir}"`
404
if test "x$CATOBJEXT" = "x.mo" ; then
405
localedir=`eval echo "${libdir}/locale"`
407
localedir=`eval echo "${datadir}/locale"`
409
prefix="$glib_save_prefix"
410
exec_prefix="$glib_save_exec_prefix"
411
datarootdir="$glib_save_datarootdir"
412
AC_DEFINE_UNQUOTED($1, "$localedir",
413
[Define the location where the catalogs will be installed])
417
dnl Now the definitions that aclocal will find
419
ifdef(glib_configure_in,[],[
420
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
421
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
424
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
426
# Create a temporary file with TEST-FILE as its contents and pass the
427
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
428
# 0 and perform ACTION-IF-FAIL for any other exit status.
429
AC_DEFUN([GLIB_RUN_PROG],
430
[cat >conftest.foo <<_ACEOF
433
if AC_RUN_LOG([$1 conftest.foo]); then
434
m4_ifval([$3], [$3], [:])
435
m4_ifvaln([$4], [else $4])dnl
436
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
437
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
442
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
443
# serial 35 IT_PROG_INTLTOOL
444
AC_DEFUN([IT_PROG_INTLTOOL],
445
[AC_PREREQ([2.50])dnl
447
case "$am__api_version" in
449
AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
455
if test -n "$1"; then
456
AC_MSG_CHECKING(for intltool >= $1)
458
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
459
INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { print $ 2; }' ${ac_aux_dir}/intltool-update.in`
460
[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`
462
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
463
test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
464
AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
467
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 $< [$]@'
468
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 $< [$]@'
469
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 $< [$]@'
470
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 $< [$]@'
471
INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@'
472
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 $< [$]@'
473
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 $< [$]@'
474
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 $< [$]@'
475
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 $< [$]@'
476
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 $< [$]@'
477
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 $< [$]@'
478
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@'
479
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 $< [$]@'
480
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 $< [$]@'
481
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 $< [$]@'
482
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 $< [$]@'
483
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 $< [$]@'
484
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 $< [$]@'
486
AC_SUBST(INTLTOOL_DESKTOP_RULE)
487
AC_SUBST(INTLTOOL_DIRECTORY_RULE)
488
AC_SUBST(INTLTOOL_KEYS_RULE)
489
AC_SUBST(INTLTOOL_PROP_RULE)
490
AC_SUBST(INTLTOOL_OAF_RULE)
491
AC_SUBST(INTLTOOL_PONG_RULE)
492
AC_SUBST(INTLTOOL_SERVER_RULE)
493
AC_SUBST(INTLTOOL_SHEET_RULE)
494
AC_SUBST(INTLTOOL_SOUNDLIST_RULE)
495
AC_SUBST(INTLTOOL_UI_RULE)
496
AC_SUBST(INTLTOOL_XAM_RULE)
497
AC_SUBST(INTLTOOL_KBD_RULE)
498
AC_SUBST(INTLTOOL_XML_RULE)
499
AC_SUBST(INTLTOOL_XML_NOMERGE_RULE)
500
AC_SUBST(INTLTOOL_CAVES_RULE)
501
AC_SUBST(INTLTOOL_SCHEMAS_RULE)
502
AC_SUBST(INTLTOOL_THEME_RULE)
503
AC_SUBST(INTLTOOL_SERVICE_RULE)
505
# Use the tools built into the package, not the ones that are installed.
506
AC_SUBST(INTLTOOL_EXTRACT, '$(top_builddir)/intltool-extract')
507
AC_SUBST(INTLTOOL_MERGE, '$(top_builddir)/intltool-merge')
508
AC_SUBST(INTLTOOL_UPDATE, '$(top_builddir)/intltool-update')
510
AC_PATH_PROG(INTLTOOL_PERL, perl)
511
if test -z "$INTLTOOL_PERL"; then
512
AC_MSG_ERROR([perl not found; required for intltool])
514
if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then
515
AC_MSG_ERROR([perl 5.x required for intltool])
517
if test "x$2" != "xno-xml"; then
518
AC_MSG_CHECKING([for XML::Parser])
519
if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
522
AC_MSG_ERROR([XML::Parser perl module is required for intltool])
526
AC_PATH_PROG(INTLTOOL_ICONV, iconv, iconv)
527
AC_PATH_PROG(INTLTOOL_MSGFMT, msgfmt, msgfmt)
528
AC_PATH_PROG(INTLTOOL_MSGMERGE, msgmerge, msgmerge)
529
AC_PATH_PROG(INTLTOOL_XGETTEXT, xgettext, xgettext)
531
# Substitute ALL_LINGUAS so we can use it in po/Makefile
532
AC_SUBST(ALL_LINGUAS)
534
# Set DATADIRNAME correctly if it is not set yet
535
# (copied from glib-gettext.m4)
536
if test -z "$DATADIRNAME"; then
537
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
538
return _nl_msg_cat_cntr],
542
dnl On Solaris, if bind_textdomain_codeset is in libc,
543
dnl GNU format message catalog is always supported,
544
dnl since both are added to the libc all together.
545
dnl Hence, we'd like to go with DATADIRNAME=share
547
AC_CHECK_FUNC(bind_textdomain_codeset,
548
[DATADIRNAME=share], [DATADIRNAME=lib])
555
AC_SUBST(DATADIRNAME)
559
dnl The following is very similar to
561
dnl AC_CONFIG_FILES([intltool-extract intltool-merge intltool-update])
563
dnl with the following slight differences:
564
dnl - the *.in files are in ac_aux_dir,
565
dnl - if the file haven't changed upon reconfigure, it's not touched,
566
dnl - the evaluation of the third parameter enables a hack which computes
567
dnl the actual value of $libdir,
568
dnl - the user sees "executing intltool commands", instead of
569
dnl "creating intltool-extract" and such.
571
dnl Nothing crucial here, and we could use AC_CONFIG_FILES, if there were
574
AC_CONFIG_COMMANDS([intltool], [
576
for file in intltool-extract intltool-merge intltool-update; do
577
sed -e "s|@INTLTOOL_EXTRACT@|`pwd`/intltool-extract|g" \
578
-e "s|@INTLTOOL_LIBDIR@|${INTLTOOL_LIBDIR}|g" \
579
-e "s|@INTLTOOL_ICONV@|${INTLTOOL_ICONV}|g" \
580
-e "s|@INTLTOOL_MSGFMT@|${INTLTOOL_MSGFMT}|g" \
581
-e "s|@INTLTOOL_MSGMERGE@|${INTLTOOL_MSGMERGE}|g" \
582
-e "s|@INTLTOOL_XGETTEXT@|${INTLTOOL_XGETTEXT}|g" \
583
-e "s|@INTLTOOL_PERL@|${INTLTOOL_PERL}|g" \
584
< ${ac_aux_dir}/${file}.in > ${file}.out
585
if cmp -s ${file} ${file}.out 2>/dev/null; then
588
mv -f ${file}.out ${file}
595
[INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir='${ac_aux_dir}'
596
prefix="$prefix" exec_prefix="$exec_prefix" INTLTOOL_LIBDIR="$libdir"
597
INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' INTLTOOL_ICONV='${INTLTOOL_ICONV}'
598
INTLTOOL_MSGFMT='${INTLTOOL_MSGFMT}' INTLTOOL_MSGMERGE='${INTLTOOL_MSGMERGE}'
599
INTLTOOL_XGETTEXT='${INTLTOOL_XGETTEXT}'])
604
# IT_PO_SUBDIR(DIRNAME)
605
# ---------------------
606
# All po subdirs have to be declared with this macro; the subdir "po" is
607
# declared by IT_PROG_INTLTOOL.
609
AC_DEFUN([IT_PO_SUBDIR],
610
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
612
dnl The following CONFIG_COMMANDS should be exetuted at the very end
613
dnl of config.status.
614
AC_CONFIG_COMMANDS_PRE([
615
AC_CONFIG_COMMANDS([$1/stamp-it], [
616
rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
621
'"s|^| $ac_top_srcdir/|" \
622
"$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
624
if test ! -f "$1/Makefile"; then
625
AC_MSG_ERROR([$1/Makefile is not ready.])
627
mv "$1/Makefile" "$1/Makefile.tmp"
628
[sed '/^POTFILES =/,/[^\\]$/ {
632
' "$1/Makefile.tmp" >"$1/Makefile"]
633
rm -f "$1/Makefile.tmp"
634
mv "$1/stamp-it.tmp" "$1/stamp-it"
641
AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
642
# A hint is needed for aclocal from Automake <= 1.9.4:
643
# AC_DEFUN([AC_PROG_INTLTOOL], ...)
646
19
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
648
21
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
923
296
Usually this means the macro was only invoked conditionally.]])
926
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
927
# Free Software Foundation, Inc.
929
# This file is free software; the Free Software Foundation
930
# gives unlimited permission to copy and/or distribute it,
931
# with or without modifications, as long as this notice is preserved.
935
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
936
# written in clear, in which case automake, when reading aclocal.m4,
937
# will think it sees a *use*, and therefore will trigger all it's
938
# C support machinery. Also note that it means that autoscan, seeing
939
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
942
# _AM_DEPENDENCIES(NAME)
943
# ----------------------
944
# See how the compiler implements dependency checking.
945
# NAME is "CC", "CXX", "GCJ", or "OBJC".
946
# We try a few techniques and use that to set a single cache variable.
948
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
949
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
950
# dependency, and given that the user is not expected to run this macro,
951
# just rely on AC_PROG_CC.
952
AC_DEFUN([_AM_DEPENDENCIES],
953
[AC_REQUIRE([AM_SET_DEPDIR])dnl
954
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
955
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
956
AC_REQUIRE([AM_DEP_TRACK])dnl
958
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
959
[$1], CXX, [depcc="$CXX" am_compiler_list=],
960
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
961
[$1], UPC, [depcc="$UPC" am_compiler_list=],
962
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
963
[depcc="$$1" am_compiler_list=])
965
AC_CACHE_CHECK([dependency style of $depcc],
966
[am_cv_$1_dependencies_compiler_type],
967
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
968
# We make a subdir and do the tests there. Otherwise we can end up
969
# making bogus files that we don't know about and never remove. For
970
# instance it was reported that on HP-UX the gcc test will end up
971
# making a dummy file named `D' -- because `-MD' means `put the output
974
# Copy depcomp to subdir because otherwise we won't find it if we're
975
# using a relative directory.
976
cp "$am_depcomp" conftest.dir
978
# We will build objects and dependencies in a subdirectory because
979
# it helps to detect inapplicable dependency modes. For instance
980
# both Tru64's cc and ICC support -MD to output dependencies as a
981
# side effect of compilation, but ICC will put the dependencies in
982
# the current directory while Tru64 will put them in the object
986
am_cv_$1_dependencies_compiler_type=none
987
if test "$am_compiler_list" = ""; then
988
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
990
for depmode in $am_compiler_list; do
991
# Setup a source with many dependencies, because some compilers
992
# like to wrap large dependency lists on column 80 (with \), and
993
# we should not choose a depcomp mode which is confused by this.
995
# We need to recreate these files for each test, as the compiler may
996
# overwrite some of them when testing with obscure command lines.
997
# This happens at least with the AIX C compiler.
999
for i in 1 2 3 4 5 6; do
1000
echo '#include "conftst'$i'.h"' >> sub/conftest.c
1001
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
1002
# Solaris 8's {/usr,}/bin/sh.
1003
touch sub/conftst$i.h
1005
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1009
# after this tag, mechanisms are not by side-effect, so they'll
1010
# only be used when explicitly requested
1011
if test "x$enable_dependency_tracking" = xyes; then
1019
# We check with `-c' and `-o' for the sake of the "dashmstdout"
1020
# mode. It turns out that the SunPro C++ compiler does not properly
1021
# handle `-M -o', and we need to detect this.
1022
if depmode=$depmode \
1023
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
1024
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1025
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
1026
>/dev/null 2>conftest.err &&
1027
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1028
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1029
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
1030
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1031
# icc doesn't choke on unknown options, it will just issue warnings
1032
# or remarks (even with -Werror). So we grep stderr for any message
1033
# that says an option was ignored or not supported.
1034
# When given -MP, icc 7.0 and 7.1 complain thusly:
1035
# icc: Command line warning: ignoring option '-M'; no argument required
1036
# The diagnosis changed in icc 8.0:
1037
# icc: Command line remark: option '-MP' not supported
1038
if (grep 'ignoring option' conftest.err ||
1039
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1040
am_cv_$1_dependencies_compiler_type=$depmode
1049
am_cv_$1_dependencies_compiler_type=none
1052
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1053
AM_CONDITIONAL([am__fastdep$1], [
1054
test "x$enable_dependency_tracking" != xno \
1055
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1061
# Choose a directory name for dependency files.
1062
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
1063
AC_DEFUN([AM_SET_DEPDIR],
1064
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1065
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1071
AC_DEFUN([AM_DEP_TRACK],
1072
[AC_ARG_ENABLE(dependency-tracking,
1073
[ --disable-dependency-tracking speeds up one-time build
1074
--enable-dependency-tracking do not reject slow dependency extractors])
1075
if test "x$enable_dependency_tracking" != xno; then
1076
am_depcomp="$ac_aux_dir/depcomp"
1079
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1080
AC_SUBST([AMDEPBACKSLASH])dnl
1081
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1084
# Generate code to set up dependency tracking. -*- Autoconf -*-
1086
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
1087
# Free Software Foundation, Inc.
1089
# This file is free software; the Free Software Foundation
1090
# gives unlimited permission to copy and/or distribute it,
1091
# with or without modifications, as long as this notice is preserved.
1095
# _AM_OUTPUT_DEPENDENCY_COMMANDS
1096
# ------------------------------
1097
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1098
[for mf in $CONFIG_FILES; do
1099
# Strip MF so we end up with the name of the file.
1100
mf=`echo "$mf" | sed -e 's/:.*$//'`
1101
# Check whether this is an Automake generated Makefile or not.
1102
# We used to match only the files named `Makefile.in', but
1103
# some people rename them; so instead we look at the file content.
1104
# Grep'ing the first line is not enough: some people post-process
1105
# each Makefile.in and add a new line on top of each file to say so.
1106
# Grep'ing the whole file is not good either: AIX grep has a line
1107
# limit of 2048, but all sed's we know have understand at least 4000.
1108
if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
1109
dirpart=`AS_DIRNAME("$mf")`
1113
# Extract the definition of DEPDIR, am__include, and am__quote
1114
# from the Makefile without running `make'.
1115
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1116
test -z "$DEPDIR" && continue
1117
am__include=`sed -n 's/^am__include = //p' < "$mf"`
1118
test -z "am__include" && continue
1119
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1120
# When using ansi2knr, U may be empty or an underscore; expand it
1121
U=`sed -n 's/^U = //p' < "$mf"`
1122
# Find all dependency output files, they are included files with
1123
# $(DEPDIR) in their names. We invoke sed twice because it is the
1124
# simplest approach to changing $(DEPDIR) to its actual value in the
1126
for file in `sed -n "
1127
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1128
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1129
# Make sure the directory exists.
1130
test -f "$dirpart/$file" && continue
1131
fdir=`AS_DIRNAME(["$file"])`
1132
AS_MKDIR_P([$dirpart/$fdir])
1133
# echo "creating $dirpart/$file"
1134
echo '# dummy' > "$dirpart/$file"
1137
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1140
# AM_OUTPUT_DEPENDENCY_COMMANDS
1141
# -----------------------------
1142
# This macro should only be invoked once -- use via AC_REQUIRE.
1144
# This code is only required when automatic dependency tracking
1145
# is enabled. FIXME. This creates each `.P' file that we will
1146
# need in order to bootstrap the dependency handling code.
1147
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1148
[AC_CONFIG_COMMANDS([depfiles],
1149
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1150
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1153
299
# Do all the work for Automake. -*- Autoconf -*-
1155
301
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,