11
11
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12
12
# PARTICULAR PURPOSE.
15
dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas
16
dnl (i.e. pass to gconftool-2
17
dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where
18
dnl you should install foo.schemas files
21
AC_DEFUN([AM_GCONF_SOURCE_2],
23
if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
24
GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
26
GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
29
AC_ARG_WITH(gconf-source,
30
[ --with-gconf-source=sourceaddress Config database for installing schema files.],GCONF_SCHEMA_CONFIG_SOURCE="$withval",)
32
AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
33
AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
35
if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
36
GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
39
AC_ARG_WITH(gconf-schema-file-dir,
40
[ --with-gconf-schema-file-dir=dir Directory for installing schema files.],GCONF_SCHEMA_FILE_DIR="$withval",)
42
AC_SUBST(GCONF_SCHEMA_FILE_DIR)
43
AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
45
AC_ARG_ENABLE(schemas-install,
46
[ --disable-schemas-install Disable the schemas installation],
49
*) AC_MSG_ERROR(bad value ${enableval} for --enable-schemas-install) ;;
51
AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no])
54
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
55
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
57
# This file is free software, distributed under the terms of the GNU
58
# General Public License. As a special exception to the GNU General
59
# Public License, this file may be distributed as part of a program
60
# that contains a configuration script generated by Autoconf, under
61
# the same distribution terms as the rest of that program.
63
# This file can be copied and used freely without restrictions. It can
64
# be used in projects which are not available under the GNU Public License
65
# but which still want to provide support for the GNU gettext functionality.
67
# Macro to add for using GNU gettext.
68
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
70
# Modified to never use included libintl.
71
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
73
# Major rework to remove unused code
74
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
76
# Added better handling of ALL_LINGUAS from GNU gettext version
77
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
79
# Modified to require ngettext
80
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
82
# We need this here as well, since someone might use autoconf-2.5x
83
# to configure GLib then an older version to configure a package
84
# using AM_GLIB_GNU_GETTEXT
88
dnl We go to great lengths to make sure that aclocal won't
89
dnl try to pull in the installed version of these macros
90
dnl when running aclocal in the glib directory.
92
m4_copy([AC_DEFUN],[glib_DEFUN])
93
m4_copy([AC_REQUIRE],[glib_REQUIRE])
95
dnl At the end, if we're not within glib, we'll define the public
96
dnl definitions in terms of our private definitions.
100
#--------------------
101
glib_DEFUN([GLIB_LC_MESSAGES],
102
[AC_CHECK_HEADERS([locale.h])
103
if test $ac_cv_header_locale_h = yes; then
104
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
105
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
106
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
107
if test $am_cv_val_LC_MESSAGES = yes; then
108
AC_DEFINE(HAVE_LC_MESSAGES, 1,
109
[Define if your <locale.h> file defines LC_MESSAGES.])
113
# GLIB_PATH_PROG_WITH_TEST
114
#----------------------------
115
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
116
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
117
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
118
[# Extract the first word of "$2", so it can be a program name with args.
119
set dummy $2; ac_word=[$]2
120
AC_MSG_CHECKING([for $ac_word])
121
AC_CACHE_VAL(ac_cv_path_$1,
124
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
127
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
128
for ac_dir in ifelse([$5], , $PATH, [$5]); do
129
test -z "$ac_dir" && ac_dir=.
130
if test -f $ac_dir/$ac_word; then
132
ac_cv_path_$1="$ac_dir/$ac_word"
138
dnl If no 4th arg is given, leave the cache variable unset,
139
dnl so AC_PATH_PROGS will keep looking.
140
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
145
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
155
glib_DEFUN([GLIB_WITH_NLS],
156
dnl NLS is obligatory
160
gt_cv_have_gettext=no
166
AC_CHECK_HEADER(libintl.h,
167
[gt_cv_func_dgettext_libintl="no"
168
libintl_extra_libs=""
171
# First check in libc
173
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
177
[return !ngettext ("","", 1)],
178
gt_cv_func_ngettext_libc=yes,
179
gt_cv_func_ngettext_libc=no)
182
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
183
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
187
[return !dgettext ("","")],
188
gt_cv_func_dgettext_libc=yes,
189
gt_cv_func_dgettext_libc=no)
193
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
194
AC_CHECK_FUNCS(bind_textdomain_codeset)
198
# If we don't have everything we want, check in libintl
200
if test "$gt_cv_func_dgettext_libc" != "yes" \
201
|| test "$gt_cv_func_ngettext_libc" != "yes" \
202
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
204
AC_CHECK_LIB(intl, bindtextdomain,
205
[AC_CHECK_LIB(intl, ngettext,
206
[AC_CHECK_LIB(intl, dgettext,
207
gt_cv_func_dgettext_libintl=yes)])])
209
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
210
AC_MSG_CHECKING([if -liconv is needed to use gettext])
212
AC_CHECK_LIB(intl, ngettext,
213
[AC_CHECK_LIB(intl, dcgettext,
214
[gt_cv_func_dgettext_libintl=yes
215
libintl_extra_libs=-liconv],
221
# If we found libintl, then check in it for bind_textdomain_codeset();
222
# we'll prefer libc if neither have bind_textdomain_codeset(),
223
# and both have dgettext and ngettext
225
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
226
glib_save_LIBS="$LIBS"
227
LIBS="$LIBS -lintl $libintl_extra_libs"
228
unset ac_cv_func_bind_textdomain_codeset
229
AC_CHECK_FUNCS(bind_textdomain_codeset)
230
LIBS="$glib_save_LIBS"
232
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
233
gt_cv_func_dgettext_libc=no
235
if test "$gt_cv_func_dgettext_libc" = "yes" \
236
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
237
gt_cv_func_dgettext_libintl=no
243
if test "$gt_cv_func_dgettext_libc" = "yes" \
244
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
245
gt_cv_have_gettext=yes
248
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
249
INTLLIBS="-lintl $libintl_extra_libs"
252
if test "$gt_cv_have_gettext" = "yes"; then
253
AC_DEFINE(HAVE_GETTEXT,1,
254
[Define if the GNU gettext() function is already present or preinstalled.])
255
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
256
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
257
if test "$MSGFMT" != "no"; then
258
glib_save_LIBS="$LIBS"
259
LIBS="$LIBS $INTLLIBS"
260
AC_CHECK_FUNCS(dcgettext)
261
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
262
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
263
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
264
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
265
return _nl_msg_cat_cntr],
270
dnl On Solaris, if bind_textdomain_codeset is in libc,
271
dnl GNU format message catalog is always supported,
272
dnl since both are added to the libc all together.
273
dnl Hence, we'd like to go with DATADIRNAME=share and
274
dnl and CATOBJEXT=.gmo in this case.
275
AC_CHECK_FUNC(bind_textdomain_codeset,
286
LIBS="$glib_save_LIBS"
289
gt_cv_have_gettext=no
294
if test "$gt_cv_have_gettext" = "yes" ; then
295
AC_DEFINE(ENABLE_NLS, 1,
296
[always defined to indicate that i18n is enabled])
299
dnl Test whether we really found GNU xgettext.
300
if test "$XGETTEXT" != ":"; then
301
dnl If it is not GNU xgettext we define it as : so that the
302
dnl Makefiles still can work.
303
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
307
[found xgettext program is not GNU xgettext; ignore it])
312
# We need to process the po/ directory.
316
[case "$CONFIG_FILES" in *po/Makefile.in*)
317
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
320
dnl These rules are solely for the distribution goal. While doing this
321
dnl we only have to keep exactly one list of the available catalogs
323
for lang in $ALL_LINGUAS; do
324
GMOFILES="$GMOFILES $lang.gmo"
325
POFILES="$POFILES $lang.po"
328
dnl Make all variables we use known to autoconf.
331
AC_SUBST(DATADIRNAME)
335
AC_SUBST(PO_IN_DATADIR_TRUE)
336
AC_SUBST(PO_IN_DATADIR_FALSE)
341
# AM_GLIB_GNU_GETTEXT
342
# -------------------
343
# Do checks necessary for use of gettext. If a suitable implementation
344
# of gettext is found in either in libintl or in the C library,
345
# it will set INTLLIBS to the libraries needed for use of gettext
346
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
347
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
348
# on various variables needed by the Makefile.in.in installed by
351
glib_DEFUN([GLIB_GNU_GETTEXT],
352
[AC_REQUIRE([AC_PROG_CC])dnl
353
AC_REQUIRE([AC_HEADER_STDC])dnl
358
if test "$gt_cv_have_gettext" = "yes"; then
359
if test "x$ALL_LINGUAS" = "x"; then
362
AC_MSG_CHECKING(for catalogs to be installed)
364
for presentlang in $ALL_LINGUAS; do
366
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
367
desiredlanguages="$LINGUAS"
369
desiredlanguages="$ALL_LINGUAS"
371
for desiredlang in $desiredlanguages; do
372
# Use the presentlang catalog if desiredlang is
373
# a. equal to presentlang, or
374
# b. a variant of presentlang (because in this case,
375
# presentlang can be used as a fallback for messages
376
# which are not translated in the desiredlang catalog).
377
case "$desiredlang" in
378
"$presentlang"*) useit=yes;;
381
if test $useit = yes; then
382
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
386
AC_MSG_RESULT($LINGUAS)
389
dnl Construct list of names of catalog files to be constructed.
390
if test -n "$LINGUAS"; then
391
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
395
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
396
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
397
dnl Try to locate is.
399
if test -n "$ac_aux_dir"; then
400
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
402
if test -z "$MKINSTALLDIRS"; then
403
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
405
AC_SUBST(MKINSTALLDIRS)
407
dnl Generate list of files to be processed by xgettext which will
408
dnl be included in po/Makefile.
409
test -d po || mkdir po
410
if test "x$srcdir" != "x."; then
411
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
412
posrcprefix="$srcdir/"
414
posrcprefix="../$srcdir/"
420
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
421
< $srcdir/po/POTFILES.in > po/POTFILES
424
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
425
# -------------------------------
426
# Define VARIABLE to the location where catalog files will
427
# be installed by po/Makefile.
428
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
429
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
430
glib_save_prefix="$prefix"
431
glib_save_exec_prefix="$exec_prefix"
432
test "x$prefix" = xNONE && prefix=$ac_default_prefix
433
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
434
if test "x$CATOBJEXT" = "x.mo" ; then
435
localedir=`eval echo "${libdir}/locale"`
437
localedir=`eval echo "${datadir}/locale"`
439
prefix="$glib_save_prefix"
440
exec_prefix="$glib_save_exec_prefix"
441
AC_DEFINE_UNQUOTED($1, "$localedir",
442
[Define the location where the catalogs will be installed])
446
dnl Now the definitions that aclocal will find
448
ifdef(glib_configure_in,[],[
449
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
450
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
456
dnl GNOME_COMMON_INIT
458
AC_DEFUN([GNOME_COMMON_INIT],
460
dnl this macro should come after AC_CONFIG_MACRO_DIR
461
AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
463
dnl ensure that when the Automake generated makefile calls aclocal,
464
dnl it honours the $ACLOCAL_FLAGS environment variable
465
ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
466
if test -n "$ac_macro_dir"; then
467
ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS"
470
AC_SUBST([ACLOCAL_AMFLAGS])
473
AC_DEFUN([GNOME_DEBUG_CHECK],
475
AC_ARG_ENABLE([debug],
476
AC_HELP_STRING([--enable-debug],
477
[turn on debugging]),,
480
if test x$enable_debug = xyes ; then
481
AC_DEFINE(GNOME_ENABLE_DEBUG, 1,
482
[Enable additional debugging at the expense of performance and size])
486
dnl GNOME_MAINTAINER_MODE_DEFINES ()
487
dnl define DISABLE_DEPRECATED
489
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
491
AC_REQUIRE([AM_MAINTAINER_MODE])
493
if test $USE_MAINTAINER_MODE = yes; then
494
DISABLE_DEPRECATED="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED -DBONOBO_DISABLE_DEPRECATED"
496
DISABLE_DEPRECATED=""
498
AC_SUBST(DISABLE_DEPRECATED)
501
dnl GNOME_DOC_INIT([MINIMUM-VERSION])
503
AC_DEFUN([GNOME_DOC_INIT],
505
dnl Only apply the version check if we're not configuring ourselves!
506
if test "x$PACKAGE" != "xgnome-doc-utils"; then
507
GDU_REQUIRED_VERSION=0.3.2
508
if test -n "$1"; then
509
GDU_REQUIRED_VERSION=$1
512
PKG_CHECK_MODULES([GDU_MODULE_VERSION_CHECK],[gnome-doc-utils >= $GDU_REQUIRED_VERSION])
515
AC_ARG_WITH([help-dir],
516
AC_HELP_STRING([--with-help-dir=DIR], [path to help docs]),,
517
[with_help_dir='${datadir}/gnome/help'])
518
HELP_DIR="$with_help_dir"
521
AC_ARG_WITH([omf-dir],
522
AC_HELP_STRING([--with-omf-dir=DIR], [path to OMF files]),,
523
[with_omf_dir='${datadir}/omf'])
524
OMF_DIR="$with_omf_dir"
527
AC_ARG_WITH([help-formats],
528
AC_HELP_STRING([--with-help-formats=FORMATS], [list of formats]),,
529
[with_help_formats=''])
530
DOC_USER_FORMATS="$with_help_formats"
531
AC_SUBST(DOC_USER_FORMATS)
533
AC_ARG_ENABLE([scrollkeeper],
534
[AC_HELP_STRING([--disable-scrollkeeper],
535
[do not make updates to the scrollkeeper database])],,
536
enable_scrollkeeper=yes)
537
AM_CONDITIONAL(ENABLE_SK, test "x$enable_scrollkeeper" = "xyes")
540
gdumk=`pkg-config --variable datadir gnome-doc-utils`/gnome-doc-utils/gnome-doc-utils.make
541
if test -f $srcdir/gnome-doc-utils.m4; then
542
if ! cmp -s $srcdir/gnome-doc-utils.make gnome-doc-utils.make; then
543
cp $srcdir/gnome-doc-utils.make gnome-doc-utils.make
546
if ! cmp -s $gdumk gnome-doc-utils.make; then
547
cp $gdumk gnome-doc-utils.make
550
if ! grep 'gnome-doc-utils\.make' $ac_top_srcdir/Makefile.am >/dev/null; then
551
echo gnome-doc-utils.make should be added to EXTRA_DIST in Makefile.am
557
15
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
558
16
# serial 35 IT_PROG_INTLTOOL
8175
7605
AC_SUBST([am__untar])
8176
7606
]) # _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=`eval echo "${datadir}/locale"`
8021
prefix="$glib_save_prefix"
8022
exec_prefix="$glib_save_exec_prefix"
8023
AC_DEFINE_UNQUOTED($1, "$localedir",
8024
[Define the location where the catalogs will be installed])
8028
dnl Now the definitions that aclocal will find
8030
ifdef(glib_configure_in,[],[
8031
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
8032
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
8038
dnl GNOME_COMMON_INIT
8040
AC_DEFUN([GNOME_COMMON_INIT],
8042
dnl this macro should come after AC_CONFIG_MACRO_DIR
8043
AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
8045
dnl ensure that when the Automake generated makefile calls aclocal,
8046
dnl it honours the $ACLOCAL_FLAGS environment variable
8047
ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
8048
if test -n "$ac_macro_dir"; then
8049
ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS"
8052
AC_SUBST([ACLOCAL_AMFLAGS])
8055
AC_DEFUN([GNOME_DEBUG_CHECK],
8057
AC_ARG_ENABLE([debug],
8058
AC_HELP_STRING([--enable-debug],
8059
[turn on debugging]),,
8062
if test x$enable_debug = xyes ; then
8063
AC_DEFINE(GNOME_ENABLE_DEBUG, 1,
8064
[Enable additional debugging at the expense of performance and size])
8068
dnl GNOME_MAINTAINER_MODE_DEFINES ()
8069
dnl define DISABLE_DEPRECATED
8071
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
8073
AC_REQUIRE([AM_MAINTAINER_MODE])
8075
if test $USE_MAINTAINER_MODE = yes; then
8076
DISABLE_DEPRECATED="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED -DBONOBO_DISABLE_DEPRECATED"
8078
DISABLE_DEPRECATED=""
8080
AC_SUBST(DISABLE_DEPRECATED)
8083
dnl GNOME_DOC_INIT([MINIMUM-VERSION])
8085
AC_DEFUN([GNOME_DOC_INIT],
8087
dnl Only apply the version check if we're not configuring ourselves!
8088
if test "x$PACKAGE" != "xgnome-doc-utils"; then
8089
GDU_REQUIRED_VERSION=0.3.2
8090
if test -n "$1"; then
8091
GDU_REQUIRED_VERSION=$1
8094
PKG_CHECK_MODULES([GDU_MODULE_VERSION_CHECK],[gnome-doc-utils >= $GDU_REQUIRED_VERSION])
8097
AC_ARG_WITH([help-dir],
8098
AC_HELP_STRING([--with-help-dir=DIR], [path to help docs]),,
8099
[with_help_dir='${datadir}/gnome/help'])
8100
HELP_DIR="$with_help_dir"
8103
AC_ARG_WITH([omf-dir],
8104
AC_HELP_STRING([--with-omf-dir=DIR], [path to OMF files]),,
8105
[with_omf_dir='${datadir}/omf'])
8106
OMF_DIR="$with_omf_dir"
8109
AC_ARG_WITH([help-formats],
8110
AC_HELP_STRING([--with-help-formats=FORMATS], [list of formats]),,
8111
[with_help_formats=''])
8112
DOC_USER_FORMATS="$with_help_formats"
8113
AC_SUBST(DOC_USER_FORMATS)
8115
AC_ARG_ENABLE([scrollkeeper],
8116
[AC_HELP_STRING([--disable-scrollkeeper],
8117
[do not make updates to the scrollkeeper database])],,
8118
enable_scrollkeeper=yes)
8119
AM_CONDITIONAL(ENABLE_SK, test "x$enable_scrollkeeper" = "xyes")