11
11
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12
12
# PARTICULAR PURPOSE.
14
m4_if(m4_PACKAGE_VERSION, [2.63],,
15
[m4_fatal([this file was generated for autoconf 2.63.
16
You have another version of autoconf. If you want to use that,
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 If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
376
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
377
dnl Try to locate is.
379
if test -n "$ac_aux_dir"; then
380
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
382
if test -z "$MKINSTALLDIRS"; then
383
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
385
AC_SUBST(MKINSTALLDIRS)
387
dnl Generate list of files to be processed by xgettext which will
388
dnl be included in po/Makefile.
389
test -d po || mkdir po
390
if test "x$srcdir" != "x."; then
391
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
392
posrcprefix="$srcdir/"
394
posrcprefix="../$srcdir/"
400
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
401
< $srcdir/po/POTFILES.in > po/POTFILES
404
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
405
# -------------------------------
406
# Define VARIABLE to the location where catalog files will
407
# be installed by po/Makefile.
408
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
409
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
410
glib_save_prefix="$prefix"
411
glib_save_exec_prefix="$exec_prefix"
412
glib_save_datarootdir="$datarootdir"
413
test "x$prefix" = xNONE && prefix=$ac_default_prefix
414
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
415
datarootdir=`eval echo "${datarootdir}"`
416
if test "x$CATOBJEXT" = "x.mo" ; then
417
localedir=`eval echo "${libdir}/locale"`
419
localedir=`eval echo "${datadir}/locale"`
421
prefix="$glib_save_prefix"
422
exec_prefix="$glib_save_exec_prefix"
423
datarootdir="$glib_save_datarootdir"
424
AC_DEFINE_UNQUOTED($1, "$localedir",
425
[Define the location where the catalogs will be installed])
429
dnl Now the definitions that aclocal will find
431
ifdef(glib_configure_in,[],[
432
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
433
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
436
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
438
# Create a temporary file with TEST-FILE as its contents and pass the
439
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
440
# 0 and perform ACTION-IF-FAIL for any other exit status.
441
AC_DEFUN([GLIB_RUN_PROG],
442
[cat >conftest.foo <<_ACEOF
445
if AC_RUN_LOG([$1 conftest.foo]); then
446
m4_ifval([$3], [$3], [:])
447
m4_ifvaln([$4], [else $4])dnl
448
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
449
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
454
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
455
# serial 40 IT_PROG_INTLTOOL
456
AC_DEFUN([IT_PROG_INTLTOOL], [
458
AC_REQUIRE([AM_NLS])dnl
460
case "$am__api_version" in
462
AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
468
if test -n "$1"; then
469
AC_MSG_CHECKING([for intltool >= $1])
471
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
472
INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
473
[INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
475
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
476
test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
477
AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
480
AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
481
AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
482
AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
483
if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
484
AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
487
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 $< [$]@'
488
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 $< [$]@'
489
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 $< [$]@'
490
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 $< [$]@'
491
INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@'
492
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 $< [$]@'
493
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 $< [$]@'
494
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 $< [$]@'
495
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 $< [$]@'
496
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 $< [$]@'
497
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 $< [$]@'
498
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@'
499
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 $< [$]@'
500
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 $< [$]@'
501
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 $< [$]@'
502
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 $< [$]@'
503
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 $< [$]@'
504
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 $< [$]@'
505
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 $< [$]@'
507
_IT_SUBST(INTLTOOL_DESKTOP_RULE)
508
_IT_SUBST(INTLTOOL_DIRECTORY_RULE)
509
_IT_SUBST(INTLTOOL_KEYS_RULE)
510
_IT_SUBST(INTLTOOL_PROP_RULE)
511
_IT_SUBST(INTLTOOL_OAF_RULE)
512
_IT_SUBST(INTLTOOL_PONG_RULE)
513
_IT_SUBST(INTLTOOL_SERVER_RULE)
514
_IT_SUBST(INTLTOOL_SHEET_RULE)
515
_IT_SUBST(INTLTOOL_SOUNDLIST_RULE)
516
_IT_SUBST(INTLTOOL_UI_RULE)
517
_IT_SUBST(INTLTOOL_XAM_RULE)
518
_IT_SUBST(INTLTOOL_KBD_RULE)
519
_IT_SUBST(INTLTOOL_XML_RULE)
520
_IT_SUBST(INTLTOOL_XML_NOMERGE_RULE)
521
_IT_SUBST(INTLTOOL_CAVES_RULE)
522
_IT_SUBST(INTLTOOL_SCHEMAS_RULE)
523
_IT_SUBST(INTLTOOL_THEME_RULE)
524
_IT_SUBST(INTLTOOL_SERVICE_RULE)
525
_IT_SUBST(INTLTOOL_POLICY_RULE)
527
# Check the gettext tools to make sure they are GNU
528
AC_PATH_PROG(XGETTEXT, xgettext)
529
AC_PATH_PROG(MSGMERGE, msgmerge)
530
AC_PATH_PROG(MSGFMT, msgfmt)
531
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
532
if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
533
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
535
xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
536
mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
537
if test -z "$xgversion" -o -z "$mmversion"; then
538
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
541
AC_PATH_PROG(INTLTOOL_PERL, perl)
542
if test -z "$INTLTOOL_PERL"; then
543
AC_MSG_ERROR([perl not found])
545
AC_MSG_CHECKING([for perl >= 5.8.1])
546
$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1
547
if test $? -ne 0; then
548
AC_MSG_ERROR([perl 5.8.1 is required for intltool])
550
IT_PERL_VERSION="`$INTLTOOL_PERL -e \"printf '%vd', $^V\"`"
551
AC_MSG_RESULT([$IT_PERL_VERSION])
553
if test "x$2" != "xno-xml"; then
554
AC_MSG_CHECKING([for XML::Parser])
555
if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
558
AC_MSG_ERROR([XML::Parser perl module is required for intltool])
562
# Substitute ALL_LINGUAS so we can use it in po/Makefile
563
AC_SUBST(ALL_LINGUAS)
565
# Set DATADIRNAME correctly if it is not set yet
566
# (copied from glib-gettext.m4)
567
if test -z "$DATADIRNAME"; then
569
[AC_LANG_PROGRAM([[]],
570
[[extern int _nl_msg_cat_cntr;
571
return _nl_msg_cat_cntr]])],
575
dnl On Solaris, if bind_textdomain_codeset is in libc,
576
dnl GNU format message catalog is always supported,
577
dnl since both are added to the libc all together.
578
dnl Hence, we'd like to go with DATADIRNAME=share
580
AC_CHECK_FUNC(bind_textdomain_codeset,
581
[DATADIRNAME=share], [DATADIRNAME=lib])
588
AC_SUBST(DATADIRNAME)
595
# IT_PO_SUBDIR(DIRNAME)
596
# ---------------------
597
# All po subdirs have to be declared with this macro; the subdir "po" is
598
# declared by IT_PROG_INTLTOOL.
600
AC_DEFUN([IT_PO_SUBDIR],
601
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
603
dnl The following CONFIG_COMMANDS should be exetuted at the very end
604
dnl of config.status.
605
AC_CONFIG_COMMANDS_PRE([
606
AC_CONFIG_COMMANDS([$1/stamp-it], [
607
if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then
608
AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.])
610
rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
615
'"s|^| $ac_top_srcdir/|" \
616
"$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
618
[sed '/^POTFILES =/,/[^\\]$/ {
622
' "$1/Makefile.in" >"$1/Makefile"]
623
rm -f "$1/Makefile.tmp"
624
mv "$1/stamp-it.tmp" "$1/stamp-it"
629
# _IT_SUBST(VARIABLE)
630
# -------------------
631
# Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
633
AC_DEFUN([_IT_SUBST],
636
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
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
# nls.m4 serial 3 (gettext-0.15)
647
dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
648
dnl This file is free software; the Free Software Foundation
649
dnl gives unlimited permission to copy and/or distribute it,
650
dnl with or without modifications, as long as this notice is preserved.
652
dnl This file can can be used in projects which are not available under
653
dnl the GNU General Public License or the GNU Library General Public
654
dnl License but which still want to provide support for the GNU gettext
656
dnl Please note that the actual code of the GNU gettext library is covered
657
dnl by the GNU Library General Public License, and the rest of the GNU
658
dnl gettext package package is covered by the GNU General Public License.
659
dnl They are *not* in the public domain.
662
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
663
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
669
AC_MSG_CHECKING([whether NLS is requested])
670
dnl Default is enabled NLS
672
[ --disable-nls do not use Native Language Support],
673
USE_NLS=$enableval, USE_NLS=yes)
674
AC_MSG_RESULT($USE_NLS)
678
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
680
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
682
# This program is free software; you can redistribute it and/or modify
683
# it under the terms of the GNU General Public License as published by
684
# the Free Software Foundation; either version 2 of the License, or
685
# (at your option) any later version.
687
# This program is distributed in the hope that it will be useful, but
688
# WITHOUT ANY WARRANTY; without even the implied warranty of
689
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
690
# General Public License for more details.
692
# You should have received a copy of the GNU General Public License
693
# along with this program; if not, write to the Free Software
694
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
696
# As a special exception to the GNU General Public License, if you
697
# distribute this file as part of a program that contains a
698
# configuration script generated by Autoconf, you may include it under
699
# the same distribution terms that you use for the rest of that program.
701
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
702
# ----------------------------------
703
AC_DEFUN([PKG_PROG_PKG_CONFIG],
704
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
705
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
706
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
707
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
708
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
710
if test -n "$PKG_CONFIG"; then
711
_pkg_min_version=m4_default([$1], [0.9.0])
712
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
713
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
721
])# PKG_PROG_PKG_CONFIG
723
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
725
# Check to see whether a particular set of modules exists. Similar
726
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
729
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
730
# this or PKG_CHECK_MODULES is called, or make sure to call
731
# PKG_CHECK_EXISTS manually
732
# --------------------------------------------------------------
733
AC_DEFUN([PKG_CHECK_EXISTS],
734
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
735
if test -n "$PKG_CONFIG" && \
736
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
737
m4_ifval([$2], [$2], [:])
738
m4_ifvaln([$3], [else
743
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
744
# ---------------------------------------------
745
m4_define([_PKG_CONFIG],
746
[if test -n "$$1"; then
748
elif test -n "$PKG_CONFIG"; then
749
PKG_CHECK_EXISTS([$3],
750
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
757
# _PKG_SHORT_ERRORS_SUPPORTED
758
# -----------------------------
759
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
760
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
761
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
762
_pkg_short_errors_supported=yes
764
_pkg_short_errors_supported=no
766
])# _PKG_SHORT_ERRORS_SUPPORTED
769
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
770
# [ACTION-IF-NOT-FOUND])
773
# Note that if there is a possibility the first call to
774
# PKG_CHECK_MODULES might not happen, you should be sure to include an
775
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
778
# --------------------------------------------------------------
779
AC_DEFUN([PKG_CHECK_MODULES],
780
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
781
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
782
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
785
AC_MSG_CHECKING([for $1])
787
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
788
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
790
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
791
and $1[]_LIBS to avoid the need to call pkg-config.
792
See the pkg-config man page for more details.])
794
if test $pkg_failed = yes; then
795
_PKG_SHORT_ERRORS_SUPPORTED
796
if test $_pkg_short_errors_supported = yes; then
797
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
799
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
801
# Put the nasty error message in config.log where it belongs
802
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
804
ifelse([$4], , [AC_MSG_ERROR(dnl
805
[Package requirements ($2) were not met:
809
Consider adjusting the PKG_CONFIG_PATH environment variable if you
810
installed software in a non-standard prefix.
816
elif test $pkg_failed = untried; then
817
ifelse([$4], , [AC_MSG_FAILURE(dnl
818
[The pkg-config script could not be found or is too old. Make sure it
819
is in your PATH or set the PKG_CONFIG environment variable to the full
824
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
827
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
828
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
830
ifelse([$3], , :, [$3])
832
])# PKG_CHECK_MODULES
834
# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
14
m4_ifndef([AC_AUTOCONF_VERSION],
15
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
17
[m4_warning([this file was generated for autoconf 2.67.
18
You have another version of autoconf. It may work, but is not guaranteed to.
19
If you have problems, you may need to regenerate the build system entirely.
20
To do so, use the procedure documented by the package, typically `autoreconf'.])])
22
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
836
24
# This file is free software; the Free Software Foundation
837
25
# gives unlimited permission to copy and/or distribute it,
1692
993
AC_SUBST([am__untar])
1693
994
]) # _AM_PROG_TAR
996
# nls.m4 serial 3 (gettext-0.15)
997
dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
998
dnl This file is free software; the Free Software Foundation
999
dnl gives unlimited permission to copy and/or distribute it,
1000
dnl with or without modifications, as long as this notice is preserved.
1002
dnl This file can can be used in projects which are not available under
1003
dnl the GNU General Public License or the GNU Library General Public
1004
dnl License but which still want to provide support for the GNU gettext
1006
dnl Please note that the actual code of the GNU gettext library is covered
1007
dnl by the GNU Library General Public License, and the rest of the GNU
1008
dnl gettext package package is covered by the GNU General Public License.
1009
dnl They are *not* in the public domain.
1012
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1013
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1019
AC_MSG_CHECKING([whether NLS is requested])
1020
dnl Default is enabled NLS
1022
[ --disable-nls do not use Native Language Support],
1023
USE_NLS=$enableval, USE_NLS=yes)
1024
AC_MSG_RESULT($USE_NLS)
1028
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1029
# serial 1 (pkg-config-0.24)
1031
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1033
# This program is free software; you can redistribute it and/or modify
1034
# it under the terms of the GNU General Public License as published by
1035
# the Free Software Foundation; either version 2 of the License, or
1036
# (at your option) any later version.
1038
# This program is distributed in the hope that it will be useful, but
1039
# WITHOUT ANY WARRANTY; without even the implied warranty of
1040
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1041
# General Public License for more details.
1043
# You should have received a copy of the GNU General Public License
1044
# along with this program; if not, write to the Free Software
1045
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1047
# As a special exception to the GNU General Public License, if you
1048
# distribute this file as part of a program that contains a
1049
# configuration script generated by Autoconf, you may include it under
1050
# the same distribution terms that you use for the rest of that program.
1052
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1053
# ----------------------------------
1054
AC_DEFUN([PKG_PROG_PKG_CONFIG],
1055
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1056
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1057
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1058
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1059
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1061
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1062
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1064
if test -n "$PKG_CONFIG"; then
1065
_pkg_min_version=m4_default([$1], [0.9.0])
1066
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1067
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1068
AC_MSG_RESULT([yes])
1074
])# PKG_PROG_PKG_CONFIG
1076
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1078
# Check to see whether a particular set of modules exists. Similar
1079
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1081
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1082
# only at the first occurence in configure.ac, so if the first place
1083
# it's called might be skipped (such as if it is within an "if", you
1084
# have to call PKG_CHECK_EXISTS manually
1085
# --------------------------------------------------------------
1086
AC_DEFUN([PKG_CHECK_EXISTS],
1087
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1088
if test -n "$PKG_CONFIG" && \
1089
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1090
m4_default([$2], [:])
1091
m4_ifvaln([$3], [else
1095
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1096
# ---------------------------------------------
1097
m4_define([_PKG_CONFIG],
1098
[if test -n "$$1"; then
1100
elif test -n "$PKG_CONFIG"; then
1101
PKG_CHECK_EXISTS([$3],
1102
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1109
# _PKG_SHORT_ERRORS_SUPPORTED
1110
# -----------------------------
1111
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1112
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1113
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1114
_pkg_short_errors_supported=yes
1116
_pkg_short_errors_supported=no
1118
])# _PKG_SHORT_ERRORS_SUPPORTED
1121
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1122
# [ACTION-IF-NOT-FOUND])
1125
# Note that if there is a possibility the first call to
1126
# PKG_CHECK_MODULES might not happen, you should be sure to include an
1127
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1130
# --------------------------------------------------------------
1131
AC_DEFUN([PKG_CHECK_MODULES],
1132
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1133
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1134
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1137
AC_MSG_CHECKING([for $1])
1139
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1140
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1142
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1143
and $1[]_LIBS to avoid the need to call pkg-config.
1144
See the pkg-config man page for more details.])
1146
if test $pkg_failed = yes; then
1148
_PKG_SHORT_ERRORS_SUPPORTED
1149
if test $_pkg_short_errors_supported = yes; then
1150
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1152
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1154
# Put the nasty error message in config.log where it belongs
1155
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1157
m4_default([$4], [AC_MSG_ERROR(
1158
[Package requirements ($2) were not met:
1162
Consider adjusting the PKG_CONFIG_PATH environment variable if you
1163
installed software in a non-standard prefix.
1167
elif test $pkg_failed = untried; then
1169
m4_default([$4], [AC_MSG_FAILURE(
1170
[The pkg-config script could not be found or is too old. Make sure it
1171
is in your PATH or set the PKG_CONFIG environment variable to the full
1176
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
1179
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1180
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1181
AC_MSG_RESULT([yes])
1184
])# PKG_CHECK_MODULES
1186
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
1187
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
1189
# This file is free software, distributed under the terms of the GNU
1190
# General Public License. As a special exception to the GNU General
1191
# Public License, this file may be distributed as part of a program
1192
# that contains a configuration script generated by Autoconf, under
1193
# the same distribution terms as the rest of that program.
1195
# This file can be copied and used freely without restrictions. It can
1196
# be used in projects which are not available under the GNU Public License
1197
# but which still want to provide support for the GNU gettext functionality.
1199
# Macro to add for using GNU gettext.
1200
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
1202
# Modified to never use included libintl.
1203
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
1205
# Major rework to remove unused code
1206
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
1208
# Added better handling of ALL_LINGUAS from GNU gettext version
1209
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
1211
# Modified to require ngettext
1212
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
1214
# We need this here as well, since someone might use autoconf-2.5x
1215
# to configure GLib then an older version to configure a package
1216
# using AM_GLIB_GNU_GETTEXT
1220
dnl We go to great lengths to make sure that aclocal won't
1221
dnl try to pull in the installed version of these macros
1222
dnl when running aclocal in the glib directory.
1224
m4_copy([AC_DEFUN],[glib_DEFUN])
1225
m4_copy([AC_REQUIRE],[glib_REQUIRE])
1227
dnl At the end, if we're not within glib, we'll define the public
1228
dnl definitions in terms of our private definitions.
1232
#--------------------
1233
glib_DEFUN([GLIB_LC_MESSAGES],
1234
[AC_CHECK_HEADERS([locale.h])
1235
if test $ac_cv_header_locale_h = yes; then
1236
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1237
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1238
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1239
if test $am_cv_val_LC_MESSAGES = yes; then
1240
AC_DEFINE(HAVE_LC_MESSAGES, 1,
1241
[Define if your <locale.h> file defines LC_MESSAGES.])
1245
# GLIB_PATH_PROG_WITH_TEST
1246
#----------------------------
1247
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1248
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1249
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
1250
[# Extract the first word of "$2", so it can be a program name with args.
1251
set dummy $2; ac_word=[$]2
1252
AC_MSG_CHECKING([for $ac_word])
1253
AC_CACHE_VAL(ac_cv_path_$1,
1256
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1259
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1260
for ac_dir in ifelse([$5], , $PATH, [$5]); do
1261
test -z "$ac_dir" && ac_dir=.
1262
if test -f $ac_dir/$ac_word; then
1264
ac_cv_path_$1="$ac_dir/$ac_word"
1270
dnl If no 4th arg is given, leave the cache variable unset,
1271
dnl so AC_PATH_PROGS will keep looking.
1272
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1277
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1278
AC_MSG_RESULT([$]$1)
1287
glib_DEFUN([GLIB_WITH_NLS],
1288
dnl NLS is obligatory
1292
gt_cv_have_gettext=no
1298
AC_CHECK_HEADER(libintl.h,
1299
[gt_cv_func_dgettext_libintl="no"
1300
libintl_extra_libs=""
1303
# First check in libc
1305
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
1307
#include <libintl.h>
1309
[return !ngettext ("","", 1)],
1310
gt_cv_func_ngettext_libc=yes,
1311
gt_cv_func_ngettext_libc=no)
1314
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1315
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
1317
#include <libintl.h>
1319
[return !dgettext ("","")],
1320
gt_cv_func_dgettext_libc=yes,
1321
gt_cv_func_dgettext_libc=no)
1325
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1326
AC_CHECK_FUNCS(bind_textdomain_codeset)
1330
# If we don't have everything we want, check in libintl
1332
if test "$gt_cv_func_dgettext_libc" != "yes" \
1333
|| test "$gt_cv_func_ngettext_libc" != "yes" \
1334
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
1336
AC_CHECK_LIB(intl, bindtextdomain,
1337
[AC_CHECK_LIB(intl, ngettext,
1338
[AC_CHECK_LIB(intl, dgettext,
1339
gt_cv_func_dgettext_libintl=yes)])])
1341
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
1342
AC_MSG_CHECKING([if -liconv is needed to use gettext])
1344
AC_CHECK_LIB(intl, ngettext,
1345
[AC_CHECK_LIB(intl, dcgettext,
1346
[gt_cv_func_dgettext_libintl=yes
1347
libintl_extra_libs=-liconv],
1353
# If we found libintl, then check in it for bind_textdomain_codeset();
1354
# we'll prefer libc if neither have bind_textdomain_codeset(),
1355
# and both have dgettext and ngettext
1357
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
1358
glib_save_LIBS="$LIBS"
1359
LIBS="$LIBS -lintl $libintl_extra_libs"
1360
unset ac_cv_func_bind_textdomain_codeset
1361
AC_CHECK_FUNCS(bind_textdomain_codeset)
1362
LIBS="$glib_save_LIBS"
1364
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
1365
gt_cv_func_dgettext_libc=no
1367
if test "$gt_cv_func_dgettext_libc" = "yes" \
1368
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
1369
gt_cv_func_dgettext_libintl=no
1375
if test "$gt_cv_func_dgettext_libc" = "yes" \
1376
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
1377
gt_cv_have_gettext=yes
1380
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
1381
INTLLIBS="-lintl $libintl_extra_libs"
1384
if test "$gt_cv_have_gettext" = "yes"; then
1385
AC_DEFINE(HAVE_GETTEXT,1,
1386
[Define if the GNU gettext() function is already present or preinstalled.])
1387
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1388
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
1389
if test "$MSGFMT" != "no"; then
1390
glib_save_LIBS="$LIBS"
1391
LIBS="$LIBS $INTLLIBS"
1392
AC_CHECK_FUNCS(dcgettext)
1394
AC_MSG_CHECKING([if msgfmt accepts -c])
1395
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
1398
"Content-Type: text/plain; charset=UTF-8\n"
1399
"Project-Id-Version: test 1.0\n"
1400
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
1401
"Last-Translator: test <foo@bar.xx>\n"
1402
"Language-Team: C <LL@li.org>\n"
1403
"MIME-Version: 1.0\n"
1404
"Content-Transfer-Encoding: 8bit\n"
1405
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
1406
AC_SUBST(MSGFMT_OPTS)
1407
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1408
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1409
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1410
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
1411
return _nl_msg_cat_cntr],
1416
dnl On Solaris, if bind_textdomain_codeset is in libc,
1417
dnl GNU format message catalog is always supported,
1418
dnl since both are added to the libc all together.
1419
dnl Hence, we'd like to go with DATADIRNAME=share and
1420
dnl and CATOBJEXT=.gmo in this case.
1421
AC_CHECK_FUNC(bind_textdomain_codeset,
1432
LIBS="$glib_save_LIBS"
1435
gt_cv_have_gettext=no
1440
if test "$gt_cv_have_gettext" = "yes" ; then
1441
AC_DEFINE(ENABLE_NLS, 1,
1442
[always defined to indicate that i18n is enabled])
1445
dnl Test whether we really found GNU xgettext.
1446
if test "$XGETTEXT" != ":"; then
1447
dnl If it is not GNU xgettext we define it as : so that the
1448
dnl Makefiles still can work.
1449
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
1453
[found xgettext program is not GNU xgettext; ignore it])
1458
# We need to process the po/ directory.
1462
[case "$CONFIG_FILES" in *po/Makefile.in*)
1463
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
1466
dnl These rules are solely for the distribution goal. While doing this
1467
dnl we only have to keep exactly one list of the available catalogs
1468
dnl in configure.ac.
1469
for lang in $ALL_LINGUAS; do
1470
GMOFILES="$GMOFILES $lang.gmo"
1471
POFILES="$POFILES $lang.po"
1474
dnl Make all variables we use known to autoconf.
1477
AC_SUBST(DATADIRNAME)
1479
AC_SUBST(INSTOBJEXT)
1481
AC_SUBST(PO_IN_DATADIR_TRUE)
1482
AC_SUBST(PO_IN_DATADIR_FALSE)
1487
# AM_GLIB_GNU_GETTEXT
1488
# -------------------
1489
# Do checks necessary for use of gettext. If a suitable implementation
1490
# of gettext is found in either in libintl or in the C library,
1491
# it will set INTLLIBS to the libraries needed for use of gettext
1492
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
1493
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
1494
# on various variables needed by the Makefile.in.in installed by
1497
glib_DEFUN([GLIB_GNU_GETTEXT],
1498
[AC_REQUIRE([AC_PROG_CC])dnl
1499
AC_REQUIRE([AC_HEADER_STDC])dnl
1504
if test "$gt_cv_have_gettext" = "yes"; then
1505
if test "x$ALL_LINGUAS" = "x"; then
1508
AC_MSG_CHECKING(for catalogs to be installed)
1510
for presentlang in $ALL_LINGUAS; do
1512
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
1513
desiredlanguages="$LINGUAS"
1515
desiredlanguages="$ALL_LINGUAS"
1517
for desiredlang in $desiredlanguages; do
1518
# Use the presentlang catalog if desiredlang is
1519
# a. equal to presentlang, or
1520
# b. a variant of presentlang (because in this case,
1521
# presentlang can be used as a fallback for messages
1522
# which are not translated in the desiredlang catalog).
1523
case "$desiredlang" in
1524
"$presentlang"*) useit=yes;;
1527
if test $useit = yes; then
1528
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1531
LINGUAS=$NEW_LINGUAS
1532
AC_MSG_RESULT($LINGUAS)
1535
dnl Construct list of names of catalog files to be constructed.
1536
if test -n "$LINGUAS"; then
1537
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1541
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1542
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
1543
dnl Try to locate is.
1545
if test -n "$ac_aux_dir"; then
1546
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1548
if test -z "$MKINSTALLDIRS"; then
1549
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1551
AC_SUBST(MKINSTALLDIRS)
1553
dnl Generate list of files to be processed by xgettext which will
1554
dnl be included in po/Makefile.
1555
test -d po || mkdir po
1556
if test "x$srcdir" != "x."; then
1557
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
1558
posrcprefix="$srcdir/"
1560
posrcprefix="../$srcdir/"
1566
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
1567
< $srcdir/po/POTFILES.in > po/POTFILES
1570
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
1571
# -------------------------------
1572
# Define VARIABLE to the location where catalog files will
1573
# be installed by po/Makefile.
1574
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
1575
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
1576
glib_save_prefix="$prefix"
1577
glib_save_exec_prefix="$exec_prefix"
1578
glib_save_datarootdir="$datarootdir"
1579
test "x$prefix" = xNONE && prefix=$ac_default_prefix
1580
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
1581
datarootdir=`eval echo "${datarootdir}"`
1582
if test "x$CATOBJEXT" = "x.mo" ; then
1583
localedir=`eval echo "${libdir}/locale"`
1585
localedir=`eval echo "${datadir}/locale"`
1587
prefix="$glib_save_prefix"
1588
exec_prefix="$glib_save_exec_prefix"
1589
datarootdir="$glib_save_datarootdir"
1590
AC_DEFINE_UNQUOTED($1, "$localedir",
1591
[Define the location where the catalogs will be installed])
1595
dnl Now the definitions that aclocal will find
1597
ifdef(glib_configure_ac,[],[
1598
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
1599
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
1602
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
1604
# Create a temporary file with TEST-FILE as its contents and pass the
1605
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
1606
# 0 and perform ACTION-IF-FAIL for any other exit status.
1607
AC_DEFUN([GLIB_RUN_PROG],
1608
[cat >conftest.foo <<_ACEOF
1611
if AC_RUN_LOG([$1 conftest.foo]); then
1612
m4_ifval([$3], [$3], [:])
1613
m4_ifvaln([$4], [else $4])dnl
1614
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
1615
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
1620
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
1621
# serial 40 IT_PROG_INTLTOOL
1622
AC_DEFUN([IT_PROG_INTLTOOL], [
1623
AC_PREREQ([2.50])dnl
1624
AC_REQUIRE([AM_NLS])dnl
1626
case "$am__api_version" in
1628
AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
1634
if test -n "$1"; then
1635
AC_MSG_CHECKING([for intltool >= $1])
1637
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
1638
INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
1639
[INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
1641
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
1642
test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
1643
AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
1646
AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
1647
AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
1648
AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
1649
if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
1650
AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
1653
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 $< [$]@'
1654
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 $< [$]@'
1655
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 $< [$]@'
1656
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 $< [$]@'
1657
INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@'
1658
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 $< [$]@'
1659
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 $< [$]@'
1660
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 $< [$]@'
1661
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 $< [$]@'
1662
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 $< [$]@'
1663
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 $< [$]@'
1664
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@'
1665
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 $< [$]@'
1666
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 $< [$]@'
1667
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 $< [$]@'
1668
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 $< [$]@'
1669
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 $< [$]@'
1670
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 $< [$]@'
1671
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 $< [$]@'
1673
_IT_SUBST(INTLTOOL_DESKTOP_RULE)
1674
_IT_SUBST(INTLTOOL_DIRECTORY_RULE)
1675
_IT_SUBST(INTLTOOL_KEYS_RULE)
1676
_IT_SUBST(INTLTOOL_PROP_RULE)
1677
_IT_SUBST(INTLTOOL_OAF_RULE)
1678
_IT_SUBST(INTLTOOL_PONG_RULE)
1679
_IT_SUBST(INTLTOOL_SERVER_RULE)
1680
_IT_SUBST(INTLTOOL_SHEET_RULE)
1681
_IT_SUBST(INTLTOOL_SOUNDLIST_RULE)
1682
_IT_SUBST(INTLTOOL_UI_RULE)
1683
_IT_SUBST(INTLTOOL_XAM_RULE)
1684
_IT_SUBST(INTLTOOL_KBD_RULE)
1685
_IT_SUBST(INTLTOOL_XML_RULE)
1686
_IT_SUBST(INTLTOOL_XML_NOMERGE_RULE)
1687
_IT_SUBST(INTLTOOL_CAVES_RULE)
1688
_IT_SUBST(INTLTOOL_SCHEMAS_RULE)
1689
_IT_SUBST(INTLTOOL_THEME_RULE)
1690
_IT_SUBST(INTLTOOL_SERVICE_RULE)
1691
_IT_SUBST(INTLTOOL_POLICY_RULE)
1693
# Check the gettext tools to make sure they are GNU
1694
AC_PATH_PROG(XGETTEXT, xgettext)
1695
AC_PATH_PROG(MSGMERGE, msgmerge)
1696
AC_PATH_PROG(MSGFMT, msgfmt)
1697
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1698
if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
1699
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
1701
xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
1702
mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
1703
mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
1704
if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
1705
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
1708
AC_PATH_PROG(INTLTOOL_PERL, perl)
1709
if test -z "$INTLTOOL_PERL"; then
1710
AC_MSG_ERROR([perl not found])
1712
AC_MSG_CHECKING([for perl >= 5.8.1])
1713
$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1
1714
if test $? -ne 0; then
1715
AC_MSG_ERROR([perl 5.8.1 is required for intltool])
1717
IT_PERL_VERSION="`$INTLTOOL_PERL -e \"printf '%vd', $^V\"`"
1718
AC_MSG_RESULT([$IT_PERL_VERSION])
1720
if test "x$2" != "xno-xml"; then
1721
AC_MSG_CHECKING([for XML::Parser])
1722
if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
1725
AC_MSG_ERROR([XML::Parser perl module is required for intltool])
1729
# Substitute ALL_LINGUAS so we can use it in po/Makefile
1730
AC_SUBST(ALL_LINGUAS)
1732
# Set DATADIRNAME correctly if it is not set yet
1733
# (copied from glib-gettext.m4)
1734
if test -z "$DATADIRNAME"; then
1736
[AC_LANG_PROGRAM([[]],
1737
[[extern int _nl_msg_cat_cntr;
1738
return _nl_msg_cat_cntr]])],
1739
[DATADIRNAME=share],
1742
dnl On Solaris, if bind_textdomain_codeset is in libc,
1743
dnl GNU format message catalog is always supported,
1744
dnl since both are added to the libc all together.
1745
dnl Hence, we'd like to go with DATADIRNAME=share
1747
AC_CHECK_FUNC(bind_textdomain_codeset,
1748
[DATADIRNAME=share], [DATADIRNAME=lib])
1755
AC_SUBST(DATADIRNAME)
1762
# IT_PO_SUBDIR(DIRNAME)
1763
# ---------------------
1764
# All po subdirs have to be declared with this macro; the subdir "po" is
1765
# declared by IT_PROG_INTLTOOL.
1767
AC_DEFUN([IT_PO_SUBDIR],
1768
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
1770
dnl The following CONFIG_COMMANDS should be executed at the very end
1771
dnl of config.status.
1772
AC_CONFIG_COMMANDS_PRE([
1773
AC_CONFIG_COMMANDS([$1/stamp-it], [
1774
if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then
1775
AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.])
1777
rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
1782
'"s|^| $ac_top_srcdir/|" \
1783
"$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
1785
[sed '/^POTFILES =/,/[^\\]$/ {
1789
' "$1/Makefile.in" >"$1/Makefile"]
1790
rm -f "$1/Makefile.tmp"
1791
mv "$1/stamp-it.tmp" "$1/stamp-it"
1796
# _IT_SUBST(VARIABLE)
1797
# -------------------
1798
# Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
1800
AC_DEFUN([_IT_SUBST],
1803
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
1808
AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
1809
# A hint is needed for aclocal from Automake <= 1.9.4:
1810
# AC_DEFUN([AC_PROG_INTLTOOL], ...)