11
11
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12
12
# PARTICULAR PURPOSE.
14
m4_if(m4_PACKAGE_VERSION, [2.61],,
15
[m4_fatal([this file was generated for autoconf 2.61.
16
You have another version of autoconf. If you want to use that,
17
you should regenerate the build system entirely.], [63])])
20
dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas
21
dnl (i.e. pass to gconftool-2
22
dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where
23
dnl you should install foo.schemas files
26
AC_DEFUN([AM_GCONF_SOURCE_2],
28
if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
29
GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
31
GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
34
AC_ARG_WITH(gconf-source,
35
[ --with-gconf-source=sourceaddress Config database for installing schema files.],GCONF_SCHEMA_CONFIG_SOURCE="$withval",)
37
AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
38
AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
40
if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
41
GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
44
AC_ARG_WITH(gconf-schema-file-dir,
45
[ --with-gconf-schema-file-dir=dir Directory for installing schema files.],GCONF_SCHEMA_FILE_DIR="$withval",)
47
AC_SUBST(GCONF_SCHEMA_FILE_DIR)
48
AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
50
AC_ARG_ENABLE(schemas-install,
51
[ --disable-schemas-install Disable the schemas installation],
54
*) AC_MSG_ERROR(bad value ${enableval} for --enable-schemas-install) ;;
56
AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no])
59
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
60
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
62
# This file is free software, distributed under the terms of the GNU
63
# General Public License. As a special exception to the GNU General
64
# Public License, this file may be distributed as part of a program
65
# that contains a configuration script generated by Autoconf, under
66
# the same distribution terms as the rest of that program.
68
# This file can be copied and used freely without restrictions. It can
69
# be used in projects which are not available under the GNU Public License
70
# but which still want to provide support for the GNU gettext functionality.
72
# Macro to add for using GNU gettext.
73
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
75
# Modified to never use included libintl.
76
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
78
# Major rework to remove unused code
79
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
81
# Added better handling of ALL_LINGUAS from GNU gettext version
82
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
84
# Modified to require ngettext
85
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
87
# We need this here as well, since someone might use autoconf-2.5x
88
# to configure GLib then an older version to configure a package
89
# using AM_GLIB_GNU_GETTEXT
93
dnl We go to great lengths to make sure that aclocal won't
94
dnl try to pull in the installed version of these macros
95
dnl when running aclocal in the glib directory.
97
m4_copy([AC_DEFUN],[glib_DEFUN])
98
m4_copy([AC_REQUIRE],[glib_REQUIRE])
100
dnl At the end, if we're not within glib, we'll define the public
101
dnl definitions in terms of our private definitions.
105
#--------------------
106
glib_DEFUN([GLIB_LC_MESSAGES],
107
[AC_CHECK_HEADERS([locale.h])
108
if test $ac_cv_header_locale_h = yes; then
109
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
110
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
111
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
112
if test $am_cv_val_LC_MESSAGES = yes; then
113
AC_DEFINE(HAVE_LC_MESSAGES, 1,
114
[Define if your <locale.h> file defines LC_MESSAGES.])
118
# GLIB_PATH_PROG_WITH_TEST
119
#----------------------------
120
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
121
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
122
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
123
[# Extract the first word of "$2", so it can be a program name with args.
124
set dummy $2; ac_word=[$]2
125
AC_MSG_CHECKING([for $ac_word])
126
AC_CACHE_VAL(ac_cv_path_$1,
129
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
132
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
133
for ac_dir in ifelse([$5], , $PATH, [$5]); do
134
test -z "$ac_dir" && ac_dir=.
135
if test -f $ac_dir/$ac_word; then
137
ac_cv_path_$1="$ac_dir/$ac_word"
143
dnl If no 4th arg is given, leave the cache variable unset,
144
dnl so AC_PATH_PROGS will keep looking.
145
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
150
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
160
glib_DEFUN([GLIB_WITH_NLS],
161
dnl NLS is obligatory
162
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
166
gt_cv_have_gettext=no
172
AC_CHECK_HEADER(libintl.h,
173
[gt_cv_func_dgettext_libintl="no"
174
libintl_extra_libs=""
177
# First check in libc
179
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
183
[return !ngettext ("","", 1)],
184
gt_cv_func_ngettext_libc=yes,
185
gt_cv_func_ngettext_libc=no)
188
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
189
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
193
[return !dgettext ("","")],
194
gt_cv_func_dgettext_libc=yes,
195
gt_cv_func_dgettext_libc=no)
199
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
200
AC_CHECK_FUNCS(bind_textdomain_codeset)
204
# If we don't have everything we want, check in libintl
206
if test "$gt_cv_func_dgettext_libc" != "yes" \
207
|| test "$gt_cv_func_ngettext_libc" != "yes" \
208
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
210
AC_CHECK_LIB(intl, bindtextdomain,
211
[AC_CHECK_LIB(intl, ngettext,
212
[AC_CHECK_LIB(intl, dgettext,
213
gt_cv_func_dgettext_libintl=yes)])])
215
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
216
AC_MSG_CHECKING([if -liconv is needed to use gettext])
218
AC_CHECK_LIB(intl, ngettext,
219
[AC_CHECK_LIB(intl, dcgettext,
220
[gt_cv_func_dgettext_libintl=yes
221
libintl_extra_libs=-liconv],
227
# If we found libintl, then check in it for bind_textdomain_codeset();
228
# we'll prefer libc if neither have bind_textdomain_codeset(),
229
# and both have dgettext and ngettext
231
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
232
glib_save_LIBS="$LIBS"
233
LIBS="$LIBS -lintl $libintl_extra_libs"
234
unset ac_cv_func_bind_textdomain_codeset
235
AC_CHECK_FUNCS(bind_textdomain_codeset)
236
LIBS="$glib_save_LIBS"
238
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
239
gt_cv_func_dgettext_libc=no
241
if test "$gt_cv_func_dgettext_libc" = "yes" \
242
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
243
gt_cv_func_dgettext_libintl=no
249
if test "$gt_cv_func_dgettext_libc" = "yes" \
250
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
251
gt_cv_have_gettext=yes
254
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
255
INTLLIBS="-lintl $libintl_extra_libs"
258
if test "$gt_cv_have_gettext" = "yes"; then
259
AC_DEFINE(HAVE_GETTEXT,1,
260
[Define if the GNU gettext() function is already present or preinstalled.])
261
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
262
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
263
if test "$MSGFMT" != "no"; then
264
glib_save_LIBS="$LIBS"
265
LIBS="$LIBS $INTLLIBS"
266
AC_CHECK_FUNCS(dcgettext)
268
AC_MSG_CHECKING([if msgfmt accepts -c])
269
GLIB_RUN_PROG([msgfmt -c -o /dev/null],[
272
"Content-Type: text/plain; charset=UTF-8\n"
273
"Project-Id-Version: test 1.0\n"
274
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
275
"Last-Translator: test <foo@bar.xx>\n"
276
"Language-Team: C <LL@li.org>\n"
277
"MIME-Version: 1.0\n"
278
"Content-Transfer-Encoding: 8bit\n"
279
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
280
AC_SUBST(MSGFMT_OPTS)
281
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
282
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
283
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
284
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
285
return _nl_msg_cat_cntr],
290
dnl On Solaris, if bind_textdomain_codeset is in libc,
291
dnl GNU format message catalog is always supported,
292
dnl since both are added to the libc all together.
293
dnl Hence, we'd like to go with DATADIRNAME=share and
294
dnl and CATOBJEXT=.gmo in this case.
295
AC_CHECK_FUNC(bind_textdomain_codeset,
306
LIBS="$glib_save_LIBS"
309
gt_cv_have_gettext=no
314
if test "$gt_cv_have_gettext" = "yes" ; then
315
AC_DEFINE(ENABLE_NLS, 1,
316
[always defined to indicate that i18n is enabled])
319
dnl Test whether we really found GNU xgettext.
320
if test "$XGETTEXT" != ":"; then
321
dnl If it is not GNU xgettext we define it as : so that the
322
dnl Makefiles still can work.
323
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
327
[found xgettext program is not GNU xgettext; ignore it])
332
# We need to process the po/ directory.
336
[case "$CONFIG_FILES" in *po/Makefile.in*)
337
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
340
dnl These rules are solely for the distribution goal. While doing this
341
dnl we only have to keep exactly one list of the available catalogs
343
for lang in $ALL_LINGUAS; do
344
GMOFILES="$GMOFILES $lang.gmo"
345
POFILES="$POFILES $lang.po"
348
dnl Make all variables we use known to autoconf.
351
AC_SUBST(DATADIRNAME)
355
AC_SUBST(PO_IN_DATADIR_TRUE)
356
AC_SUBST(PO_IN_DATADIR_FALSE)
361
# AM_GLIB_GNU_GETTEXT
362
# -------------------
363
# Do checks necessary for use of gettext. If a suitable implementation
364
# of gettext is found in either in libintl or in the C library,
365
# it will set INTLLIBS to the libraries needed for use of gettext
366
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
367
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
368
# on various variables needed by the Makefile.in.in installed by
371
glib_DEFUN([GLIB_GNU_GETTEXT],
372
[AC_REQUIRE([AC_PROG_CC])dnl
373
AC_REQUIRE([AC_HEADER_STDC])dnl
378
if test "$gt_cv_have_gettext" = "yes"; then
379
if test "x$ALL_LINGUAS" = "x"; then
382
AC_MSG_CHECKING(for catalogs to be installed)
384
for presentlang in $ALL_LINGUAS; do
386
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
387
desiredlanguages="$LINGUAS"
389
desiredlanguages="$ALL_LINGUAS"
391
for desiredlang in $desiredlanguages; do
392
# Use the presentlang catalog if desiredlang is
393
# a. equal to presentlang, or
394
# b. a variant of presentlang (because in this case,
395
# presentlang can be used as a fallback for messages
396
# which are not translated in the desiredlang catalog).
397
case "$desiredlang" in
398
"$presentlang"*) useit=yes;;
401
if test $useit = yes; then
402
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
406
AC_MSG_RESULT($LINGUAS)
409
dnl Construct list of names of catalog files to be constructed.
410
if test -n "$LINGUAS"; then
411
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
415
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
416
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
417
dnl Try to locate is.
419
if test -n "$ac_aux_dir"; then
420
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
422
if test -z "$MKINSTALLDIRS"; then
423
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
425
AC_SUBST(MKINSTALLDIRS)
427
dnl Generate list of files to be processed by xgettext which will
428
dnl be included in po/Makefile.
429
test -d po || mkdir po
430
if test "x$srcdir" != "x."; then
431
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
432
posrcprefix="$srcdir/"
434
posrcprefix="../$srcdir/"
440
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
441
< $srcdir/po/POTFILES.in > po/POTFILES
444
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
445
# -------------------------------
446
# Define VARIABLE to the location where catalog files will
447
# be installed by po/Makefile.
448
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
449
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
450
glib_save_prefix="$prefix"
451
glib_save_exec_prefix="$exec_prefix"
452
glib_save_datarootdir="$datarootdir"
453
test "x$prefix" = xNONE && prefix=$ac_default_prefix
454
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
455
datarootdir=`eval echo "${datarootdir}"`
456
if test "x$CATOBJEXT" = "x.mo" ; then
457
localedir=`eval echo "${libdir}/locale"`
459
localedir=`eval echo "${datadir}/locale"`
461
prefix="$glib_save_prefix"
462
exec_prefix="$glib_save_exec_prefix"
463
datarootdir="$glib_save_datarootdir"
464
AC_DEFINE_UNQUOTED($1, "$localedir",
465
[Define the location where the catalogs will be installed])
469
dnl Now the definitions that aclocal will find
471
ifdef(glib_configure_in,[],[
472
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
473
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
476
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
478
# Create a temporary file with TEST-FILE as its contents and pass the
479
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
480
# 0 and perform ACTION-IF-FAIL for any other exit status.
481
AC_DEFUN([GLIB_RUN_PROG],
482
[cat >conftest.foo <<_ACEOF
485
if AC_RUN_LOG([$1 conftest.foo]); then
486
m4_ifval([$3], [$3], [:])
487
m4_ifvaln([$4], [else $4])dnl
488
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
489
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
496
dnl GNOME_COMMON_INIT
498
AC_DEFUN([GNOME_COMMON_INIT],
500
dnl this macro should come after AC_CONFIG_MACRO_DIR
501
AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
503
dnl ensure that when the Automake generated makefile calls aclocal,
504
dnl it honours the $ACLOCAL_FLAGS environment variable
505
ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
506
if test -n "$ac_macro_dir"; then
507
ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS"
510
AC_SUBST([ACLOCAL_AMFLAGS])
513
AC_DEFUN([GNOME_DEBUG_CHECK],
515
AC_ARG_ENABLE([debug],
516
AC_HELP_STRING([--enable-debug],
517
[turn on debugging]),,
520
if test x$enable_debug = xyes ; then
521
AC_DEFINE(GNOME_ENABLE_DEBUG, 1,
522
[Enable additional debugging at the expense of performance and size])
526
dnl GNOME_MAINTAINER_MODE_DEFINES ()
527
dnl define DISABLE_DEPRECATED
529
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
531
AC_REQUIRE([AM_MAINTAINER_MODE])
533
if test $USE_MAINTAINER_MODE = yes; then
534
DISABLE_DEPRECATED="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGCONF_DISABLE_DEPRECATED -DBONOBO_DISABLE_DEPRECATED -DBONOBO_UI_DISABLE_DEPRECATED -DGNOME_VFS_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -DLIBGLADE_DISABLE_DEPRECATED"
536
DISABLE_DEPRECATED=""
538
AC_SUBST(DISABLE_DEPRECATED)
541
dnl Do not call GNOME_DOC_DEFINES directly. It is split out from
542
dnl GNOME_DOC_INIT to allow gnome-doc-utils to bootstrap off itself.
543
AC_DEFUN([GNOME_DOC_DEFINES],
545
AC_ARG_WITH([help-dir],
546
AC_HELP_STRING([--with-help-dir=DIR], [path to help docs]),,
547
[with_help_dir='${datadir}/gnome/help'])
548
HELP_DIR="$with_help_dir"
551
AC_ARG_WITH([omf-dir],
552
AC_HELP_STRING([--with-omf-dir=DIR], [path to OMF files]),,
553
[with_omf_dir='${datadir}/omf'])
554
OMF_DIR="$with_omf_dir"
557
AC_ARG_WITH([help-formats],
558
AC_HELP_STRING([--with-help-formats=FORMATS], [list of formats]),,
559
[with_help_formats=''])
560
DOC_USER_FORMATS="$with_help_formats"
561
AC_SUBST(DOC_USER_FORMATS)
563
AC_ARG_ENABLE([scrollkeeper],
564
[AC_HELP_STRING([--disable-scrollkeeper],
565
[do not make updates to the scrollkeeper database])],,
566
enable_scrollkeeper=yes)
567
AM_CONDITIONAL([ENABLE_SK],[test "$gdu_cv_have_gdu" = "yes" -a "$enable_scrollkeeper" = "yes"])
569
AM_CONDITIONAL([HAVE_GNOME_DOC_UTILS],[test "$gdu_cv_have_gdu" = "yes"])
572
# GNOME_DOC_INIT ([MINIMUM-VERSION],[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
574
AC_DEFUN([GNOME_DOC_INIT],
576
ifelse([$1],,[gdu_cv_version_required=0.3.2],[gdu_cv_version_required=$1])
578
PKG_CHECK_EXISTS([gnome-doc-utils >= $gdu_cv_version_required],
579
[gdu_cv_have_gdu=yes],[gdu_cv_have_gdu=no])
581
if test "$gdu_cv_have_gdu" = "yes"; then
582
ifelse([$2],,[:],[$2])
584
ifelse([$3],,[AC_MSG_ERROR([gnome-doc-utils >= $gdu_cv_version_required not found])],[$3])
15
591
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
16
592
# serial 35 IT_PROG_INTLTOOL
7605
8221
AC_SUBST([am__untar])
7606
8222
]) # _AM_PROG_TAR
7608
dnl AM_GCONF_SOURCE_2
7609
dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas
7610
dnl (i.e. pass to gconftool-2
7611
dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where
7612
dnl you should install foo.schemas files
7615
AC_DEFUN([AM_GCONF_SOURCE_2],
7617
if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
7618
GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
7620
GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
7623
AC_ARG_WITH(gconf-source,
7624
[ --with-gconf-source=sourceaddress Config database for installing schema files.],GCONF_SCHEMA_CONFIG_SOURCE="$withval",)
7626
AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
7627
AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
7629
if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
7630
GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
7633
AC_ARG_WITH(gconf-schema-file-dir,
7634
[ --with-gconf-schema-file-dir=dir Directory for installing schema files.],GCONF_SCHEMA_FILE_DIR="$withval",)
7636
AC_SUBST(GCONF_SCHEMA_FILE_DIR)
7637
AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
7639
AC_ARG_ENABLE(schemas-install,
7640
[ --disable-schemas-install Disable the schemas installation],
7641
[case ${enableval} in
7643
*) AC_MSG_ERROR(bad value ${enableval} for --enable-schemas-install) ;;
7645
AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no])
7648
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
7649
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
7651
# This file is free software, distributed under the terms of the GNU
7652
# General Public License. As a special exception to the GNU General
7653
# Public License, this file may be distributed as part of a program
7654
# that contains a configuration script generated by Autoconf, under
7655
# the same distribution terms as the rest of that program.
7657
# This file can be copied and used freely without restrictions. It can
7658
# be used in projects which are not available under the GNU Public License
7659
# but which still want to provide support for the GNU gettext functionality.
7661
# Macro to add for using GNU gettext.
7662
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
7664
# Modified to never use included libintl.
7665
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
7667
# Major rework to remove unused code
7668
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
7670
# Added better handling of ALL_LINGUAS from GNU gettext version
7671
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
7673
# Modified to require ngettext
7674
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
7676
# We need this here as well, since someone might use autoconf-2.5x
7677
# to configure GLib then an older version to configure a package
7678
# using AM_GLIB_GNU_GETTEXT
7682
dnl We go to great lengths to make sure that aclocal won't
7683
dnl try to pull in the installed version of these macros
7684
dnl when running aclocal in the glib directory.
7686
m4_copy([AC_DEFUN],[glib_DEFUN])
7687
m4_copy([AC_REQUIRE],[glib_REQUIRE])
7689
dnl At the end, if we're not within glib, we'll define the public
7690
dnl definitions in terms of our private definitions.
7694
#--------------------
7695
glib_DEFUN([GLIB_LC_MESSAGES],
7696
[AC_CHECK_HEADERS([locale.h])
7697
if test $ac_cv_header_locale_h = yes; then
7698
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
7699
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
7700
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
7701
if test $am_cv_val_LC_MESSAGES = yes; then
7702
AC_DEFINE(HAVE_LC_MESSAGES, 1,
7703
[Define if your <locale.h> file defines LC_MESSAGES.])
7707
# GLIB_PATH_PROG_WITH_TEST
7708
#----------------------------
7709
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
7710
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
7711
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
7712
[# Extract the first word of "$2", so it can be a program name with args.
7713
set dummy $2; ac_word=[$]2
7714
AC_MSG_CHECKING([for $ac_word])
7715
AC_CACHE_VAL(ac_cv_path_$1,
7718
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
7721
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
7722
for ac_dir in ifelse([$5], , $PATH, [$5]); do
7723
test -z "$ac_dir" && ac_dir=.
7724
if test -f $ac_dir/$ac_word; then
7726
ac_cv_path_$1="$ac_dir/$ac_word"
7732
dnl If no 4th arg is given, leave the cache variable unset,
7733
dnl so AC_PATH_PROGS will keep looking.
7734
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
7739
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
7740
AC_MSG_RESULT([$]$1)
7749
glib_DEFUN([GLIB_WITH_NLS],
7750
dnl NLS is obligatory
7754
gt_cv_have_gettext=no
7760
AC_CHECK_HEADER(libintl.h,
7761
[gt_cv_func_dgettext_libintl="no"
7762
libintl_extra_libs=""
7765
# First check in libc
7767
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
7769
#include <libintl.h>
7771
[return !ngettext ("","", 1)],
7772
gt_cv_func_ngettext_libc=yes,
7773
gt_cv_func_ngettext_libc=no)
7776
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
7777
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
7779
#include <libintl.h>
7781
[return !dgettext ("","")],
7782
gt_cv_func_dgettext_libc=yes,
7783
gt_cv_func_dgettext_libc=no)
7787
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
7788
AC_CHECK_FUNCS(bind_textdomain_codeset)
7792
# If we don't have everything we want, check in libintl
7794
if test "$gt_cv_func_dgettext_libc" != "yes" \
7795
|| test "$gt_cv_func_ngettext_libc" != "yes" \
7796
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
7798
AC_CHECK_LIB(intl, bindtextdomain,
7799
[AC_CHECK_LIB(intl, ngettext,
7800
[AC_CHECK_LIB(intl, dgettext,
7801
gt_cv_func_dgettext_libintl=yes)])])
7803
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
7804
AC_MSG_CHECKING([if -liconv is needed to use gettext])
7806
AC_CHECK_LIB(intl, ngettext,
7807
[AC_CHECK_LIB(intl, dcgettext,
7808
[gt_cv_func_dgettext_libintl=yes
7809
libintl_extra_libs=-liconv],
7815
# If we found libintl, then check in it for bind_textdomain_codeset();
7816
# we'll prefer libc if neither have bind_textdomain_codeset(),
7817
# and both have dgettext and ngettext
7819
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
7820
glib_save_LIBS="$LIBS"
7821
LIBS="$LIBS -lintl $libintl_extra_libs"
7822
unset ac_cv_func_bind_textdomain_codeset
7823
AC_CHECK_FUNCS(bind_textdomain_codeset)
7824
LIBS="$glib_save_LIBS"
7826
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
7827
gt_cv_func_dgettext_libc=no
7829
if test "$gt_cv_func_dgettext_libc" = "yes" \
7830
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
7831
gt_cv_func_dgettext_libintl=no
7837
if test "$gt_cv_func_dgettext_libc" = "yes" \
7838
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
7839
gt_cv_have_gettext=yes
7842
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
7843
INTLLIBS="-lintl $libintl_extra_libs"
7846
if test "$gt_cv_have_gettext" = "yes"; then
7847
AC_DEFINE(HAVE_GETTEXT,1,
7848
[Define if the GNU gettext() function is already present or preinstalled.])
7849
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
7850
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
7851
if test "$MSGFMT" != "no"; then
7852
glib_save_LIBS="$LIBS"
7853
LIBS="$LIBS $INTLLIBS"
7854
AC_CHECK_FUNCS(dcgettext)
7855
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
7856
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
7857
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
7858
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
7859
return _nl_msg_cat_cntr],
7864
dnl On Solaris, if bind_textdomain_codeset is in libc,
7865
dnl GNU format message catalog is always supported,
7866
dnl since both are added to the libc all together.
7867
dnl Hence, we'd like to go with DATADIRNAME=share and
7868
dnl and CATOBJEXT=.gmo in this case.
7869
AC_CHECK_FUNC(bind_textdomain_codeset,
7880
LIBS="$glib_save_LIBS"
7883
gt_cv_have_gettext=no
7888
if test "$gt_cv_have_gettext" = "yes" ; then
7889
AC_DEFINE(ENABLE_NLS, 1,
7890
[always defined to indicate that i18n is enabled])
7893
dnl Test whether we really found GNU xgettext.
7894
if test "$XGETTEXT" != ":"; then
7895
dnl If it is not GNU xgettext we define it as : so that the
7896
dnl Makefiles still can work.
7897
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
7901
[found xgettext program is not GNU xgettext; ignore it])
7906
# We need to process the po/ directory.
7910
[case "$CONFIG_FILES" in *po/Makefile.in*)
7911
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
7914
dnl These rules are solely for the distribution goal. While doing this
7915
dnl we only have to keep exactly one list of the available catalogs
7916
dnl in configure.in.
7917
for lang in $ALL_LINGUAS; do
7918
GMOFILES="$GMOFILES $lang.gmo"
7919
POFILES="$POFILES $lang.po"
7922
dnl Make all variables we use known to autoconf.
7925
AC_SUBST(DATADIRNAME)
7927
AC_SUBST(INSTOBJEXT)
7929
AC_SUBST(PO_IN_DATADIR_TRUE)
7930
AC_SUBST(PO_IN_DATADIR_FALSE)
7935
# AM_GLIB_GNU_GETTEXT
7936
# -------------------
7937
# Do checks necessary for use of gettext. If a suitable implementation
7938
# of gettext is found in either in libintl or in the C library,
7939
# it will set INTLLIBS to the libraries needed for use of gettext
7940
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
7941
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
7942
# on various variables needed by the Makefile.in.in installed by
7945
glib_DEFUN([GLIB_GNU_GETTEXT],
7946
[AC_REQUIRE([AC_PROG_CC])dnl
7947
AC_REQUIRE([AC_HEADER_STDC])dnl
7952
if test "$gt_cv_have_gettext" = "yes"; then
7953
if test "x$ALL_LINGUAS" = "x"; then
7956
AC_MSG_CHECKING(for catalogs to be installed)
7958
for presentlang in $ALL_LINGUAS; do
7960
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
7961
desiredlanguages="$LINGUAS"
7963
desiredlanguages="$ALL_LINGUAS"
7965
for desiredlang in $desiredlanguages; do
7966
# Use the presentlang catalog if desiredlang is
7967
# a. equal to presentlang, or
7968
# b. a variant of presentlang (because in this case,
7969
# presentlang can be used as a fallback for messages
7970
# which are not translated in the desiredlang catalog).
7971
case "$desiredlang" in
7972
"$presentlang"*) useit=yes;;
7975
if test $useit = yes; then
7976
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
7979
LINGUAS=$NEW_LINGUAS
7980
AC_MSG_RESULT($LINGUAS)
7983
dnl Construct list of names of catalog files to be constructed.
7984
if test -n "$LINGUAS"; then
7985
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
7989
dnl Generate list of files to be processed by xgettext which will
7990
dnl be included in po/Makefile.
7991
test -d po || mkdir po
7992
if test "x$srcdir" != "x."; then
7993
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
7994
posrcprefix="$srcdir/"
7996
posrcprefix="../$srcdir/"
8002
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
8003
< $srcdir/po/POTFILES.in > po/POTFILES
8006
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
8007
# -------------------------------
8008
# Define VARIABLE to the location where catalog files will
8009
# be installed by po/Makefile.
8010
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
8011
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
8012
glib_save_prefix="$prefix"
8013
glib_save_exec_prefix="$exec_prefix"
8014
test "x$prefix" = xNONE && prefix=$ac_default_prefix
8015
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
8016
if test "x$CATOBJEXT" = "x.mo" ; then
8017
localedir=`eval echo "${libdir}/locale"`
8019
localedir="${datadir}/locale"
8021
expanded_localedir=`eval echo "$localedir"`
8022
test "x$expanded_localedir" = "x$localedir" && break
8023
localedir="$expanded_localedir"
8026
prefix="$glib_save_prefix"
8027
exec_prefix="$glib_save_exec_prefix"
8028
AC_DEFINE_UNQUOTED($1, "$localedir",
8029
[Define the location where the catalogs will be installed])
8033
dnl Now the definitions that aclocal will find
8035
ifdef(glib_configure_in,[],[
8036
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
8037
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
8043
dnl GNOME_COMMON_INIT
8045
AC_DEFUN([GNOME_COMMON_INIT],
8047
dnl this macro should come after AC_CONFIG_MACRO_DIR
8048
AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
8050
dnl ensure that when the Automake generated makefile calls aclocal,
8051
dnl it honours the $ACLOCAL_FLAGS environment variable
8052
ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
8053
if test -n "$ac_macro_dir"; then
8054
ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS"
8057
AC_SUBST([ACLOCAL_AMFLAGS])
8060
AC_DEFUN([GNOME_DEBUG_CHECK],
8062
AC_ARG_ENABLE([debug],
8063
AC_HELP_STRING([--enable-debug],
8064
[turn on debugging]),,
8067
if test x$enable_debug = xyes ; then
8068
AC_DEFINE(GNOME_ENABLE_DEBUG, 1,
8069
[Enable additional debugging at the expense of performance and size])
8073
dnl GNOME_MAINTAINER_MODE_DEFINES ()
8074
dnl define DISABLE_DEPRECATED
8076
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
8078
AC_REQUIRE([AM_MAINTAINER_MODE])
8080
if test $USE_MAINTAINER_MODE = yes; then
8081
DISABLE_DEPRECATED="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED -DBONOBO_DISABLE_DEPRECATED"
8083
DISABLE_DEPRECATED=""
8085
AC_SUBST(DISABLE_DEPRECATED)
8088
dnl GNOME_DOC_INIT([MINIMUM-VERSION])
8090
AC_DEFUN([GNOME_DOC_INIT],
8092
dnl Only apply the version check if we're not configuring ourselves!
8093
if test "x$PACKAGE" != "xgnome-doc-utils"; then
8094
GDU_REQUIRED_VERSION=0.3.2
8095
if test -n "$1"; then
8096
GDU_REQUIRED_VERSION=$1
8099
PKG_CHECK_MODULES([GDU_MODULE_VERSION_CHECK],[gnome-doc-utils >= $GDU_REQUIRED_VERSION])
8102
AC_ARG_WITH([help-dir],
8103
AC_HELP_STRING([--with-help-dir=DIR], [path to help docs]),,
8104
[with_help_dir='${datadir}/gnome/help'])
8105
HELP_DIR="$with_help_dir"
8108
AC_ARG_WITH([omf-dir],
8109
AC_HELP_STRING([--with-omf-dir=DIR], [path to OMF files]),,
8110
[with_omf_dir='${datadir}/omf'])
8111
OMF_DIR="$with_omf_dir"
8114
AC_ARG_WITH([help-formats],
8115
AC_HELP_STRING([--with-help-formats=FORMATS], [list of formats]),,
8116
[with_help_formats=''])
8117
DOC_USER_FORMATS="$with_help_formats"
8118
AC_SUBST(DOC_USER_FORMATS)
8120
AC_ARG_ENABLE([scrollkeeper],
8121
[AC_HELP_STRING([--disable-scrollkeeper],
8122
[do not make updates to the scrollkeeper database])],,
8123
enable_scrollkeeper=yes)
8124
AM_CONDITIONAL(ENABLE_SK, test "x$enable_scrollkeeper" = "xyes")