11
11
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12
12
# PARTICULAR PURPOSE.
14
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
15
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
17
# This file is free software, distributed under the terms of the GNU
18
# General Public License. As a special exception to the GNU General
19
# Public License, this file may be distributed as part of a program
20
# that contains a configuration script generated by Autoconf, under
21
# the same distribution terms as the rest of that program.
23
# This file can be copied and used freely without restrictions. It can
24
# be used in projects which are not available under the GNU Public License
25
# but which still want to provide support for the GNU gettext functionality.
27
# Macro to add for using GNU gettext.
28
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
30
# Modified to never use included libintl.
31
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
33
# Major rework to remove unused code
34
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
36
# Added better handling of ALL_LINGUAS from GNU gettext version
37
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
39
# Modified to require ngettext
40
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
42
# We need this here as well, since someone might use autoconf-2.5x
43
# to configure GLib then an older version to configure a package
44
# using AM_GLIB_GNU_GETTEXT
48
dnl We go to great lengths to make sure that aclocal won't
49
dnl try to pull in the installed version of these macros
50
dnl when running aclocal in the glib directory.
52
m4_copy([AC_DEFUN],[glib_DEFUN])
53
m4_copy([AC_REQUIRE],[glib_REQUIRE])
55
dnl At the end, if we're not within glib, we'll define the public
56
dnl definitions in terms of our private definitions.
61
glib_DEFUN([GLIB_LC_MESSAGES],
62
[AC_CHECK_HEADERS([locale.h])
63
if test $ac_cv_header_locale_h = yes; then
64
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
65
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
66
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
67
if test $am_cv_val_LC_MESSAGES = yes; then
68
AC_DEFINE(HAVE_LC_MESSAGES, 1,
69
[Define if your <locale.h> file defines LC_MESSAGES.])
73
# GLIB_PATH_PROG_WITH_TEST
74
#----------------------------
75
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
76
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
77
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
78
[# Extract the first word of "$2", so it can be a program name with args.
79
set dummy $2; ac_word=[$]2
80
AC_MSG_CHECKING([for $ac_word])
81
AC_CACHE_VAL(ac_cv_path_$1,
84
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
87
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
88
for ac_dir in ifelse([$5], , $PATH, [$5]); do
89
test -z "$ac_dir" && ac_dir=.
90
if test -f $ac_dir/$ac_word; then
92
ac_cv_path_$1="$ac_dir/$ac_word"
98
dnl If no 4th arg is given, leave the cache variable unset,
99
dnl so AC_PATH_PROGS will keep looking.
100
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
105
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
115
glib_DEFUN([GLIB_WITH_NLS],
116
dnl NLS is obligatory
120
gt_cv_have_gettext=no
126
AC_CHECK_HEADER(libintl.h,
127
[gt_cv_func_dgettext_libintl="no"
128
libintl_extra_libs=""
131
# First check in libc
133
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
137
[return !ngettext ("","", 1)],
138
gt_cv_func_ngettext_libc=yes,
139
gt_cv_func_ngettext_libc=no)
142
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
143
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
147
[return !dgettext ("","")],
148
gt_cv_func_dgettext_libc=yes,
149
gt_cv_func_dgettext_libc=no)
153
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
154
AC_CHECK_FUNCS(bind_textdomain_codeset)
158
# If we don't have everything we want, check in libintl
160
if test "$gt_cv_func_dgettext_libc" != "yes" \
161
|| test "$gt_cv_func_ngettext_libc" != "yes" \
162
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
164
AC_CHECK_LIB(intl, bindtextdomain,
165
[AC_CHECK_LIB(intl, ngettext,
166
[AC_CHECK_LIB(intl, dgettext,
167
gt_cv_func_dgettext_libintl=yes)])])
169
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
170
AC_MSG_CHECKING([if -liconv is needed to use gettext])
172
AC_CHECK_LIB(intl, ngettext,
173
[AC_CHECK_LIB(intl, dcgettext,
174
[gt_cv_func_dgettext_libintl=yes
175
libintl_extra_libs=-liconv],
181
# If we found libintl, then check in it for bind_textdomain_codeset();
182
# we'll prefer libc if neither have bind_textdomain_codeset(),
183
# and both have dgettext and ngettext
185
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
186
glib_save_LIBS="$LIBS"
187
LIBS="$LIBS -lintl $libintl_extra_libs"
188
unset ac_cv_func_bind_textdomain_codeset
189
AC_CHECK_FUNCS(bind_textdomain_codeset)
190
LIBS="$glib_save_LIBS"
192
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
193
gt_cv_func_dgettext_libc=no
195
if test "$gt_cv_func_dgettext_libc" = "yes" \
196
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
197
gt_cv_func_dgettext_libintl=no
203
if test "$gt_cv_func_dgettext_libc" = "yes" \
204
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
205
gt_cv_have_gettext=yes
208
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
209
INTLLIBS="-lintl $libintl_extra_libs"
212
if test "$gt_cv_have_gettext" = "yes"; then
213
AC_DEFINE(HAVE_GETTEXT,1,
214
[Define if the GNU gettext() function is already present or preinstalled.])
215
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
216
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
217
if test "$MSGFMT" != "no"; then
218
glib_save_LIBS="$LIBS"
219
LIBS="$LIBS $INTLLIBS"
220
AC_CHECK_FUNCS(dcgettext)
221
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
222
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
223
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
224
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
225
return _nl_msg_cat_cntr],
230
dnl On Solaris, if bind_textdomain_codeset is in libc,
231
dnl GNU format message catalog is always supported,
232
dnl since both are added to the libc all together.
233
dnl Hence, we'd like to go with DATADIRNAME=share and
234
dnl and CATOBJEXT=.gmo in this case.
235
AC_CHECK_FUNC(bind_textdomain_codeset,
246
LIBS="$glib_save_LIBS"
249
gt_cv_have_gettext=no
254
if test "$gt_cv_have_gettext" = "yes" ; then
255
AC_DEFINE(ENABLE_NLS, 1,
256
[always defined to indicate that i18n is enabled])
259
dnl Test whether we really found GNU xgettext.
260
if test "$XGETTEXT" != ":"; then
261
dnl If it is not GNU xgettext we define it as : so that the
262
dnl Makefiles still can work.
263
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
267
[found xgettext program is not GNU xgettext; ignore it])
272
# We need to process the po/ directory.
276
[case "$CONFIG_FILES" in *po/Makefile.in*)
277
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
280
dnl These rules are solely for the distribution goal. While doing this
281
dnl we only have to keep exactly one list of the available catalogs
283
for lang in $ALL_LINGUAS; do
284
GMOFILES="$GMOFILES $lang.gmo"
285
POFILES="$POFILES $lang.po"
288
dnl Make all variables we use known to autoconf.
291
AC_SUBST(DATADIRNAME)
295
AC_SUBST(PO_IN_DATADIR_TRUE)
296
AC_SUBST(PO_IN_DATADIR_FALSE)
301
# AM_GLIB_GNU_GETTEXT
302
# -------------------
303
# Do checks necessary for use of gettext. If a suitable implementation
304
# of gettext is found in either in libintl or in the C library,
305
# it will set INTLLIBS to the libraries needed for use of gettext
306
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
307
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
308
# on various variables needed by the Makefile.in.in installed by
311
glib_DEFUN([GLIB_GNU_GETTEXT],
312
[AC_REQUIRE([AC_PROG_CC])dnl
313
AC_REQUIRE([AC_HEADER_STDC])dnl
318
if test "$gt_cv_have_gettext" = "yes"; then
319
if test "x$ALL_LINGUAS" = "x"; then
322
AC_MSG_CHECKING(for catalogs to be installed)
324
for presentlang in $ALL_LINGUAS; do
326
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
327
desiredlanguages="$LINGUAS"
329
desiredlanguages="$ALL_LINGUAS"
331
for desiredlang in $desiredlanguages; do
332
# Use the presentlang catalog if desiredlang is
333
# a. equal to presentlang, or
334
# b. a variant of presentlang (because in this case,
335
# presentlang can be used as a fallback for messages
336
# which are not translated in the desiredlang catalog).
337
case "$desiredlang" in
338
"$presentlang"*) useit=yes;;
341
if test $useit = yes; then
342
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
346
AC_MSG_RESULT($LINGUAS)
349
dnl Construct list of names of catalog files to be constructed.
350
if test -n "$LINGUAS"; then
351
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
355
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
356
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
357
dnl Try to locate is.
359
if test -n "$ac_aux_dir"; then
360
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
362
if test -z "$MKINSTALLDIRS"; then
363
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
365
AC_SUBST(MKINSTALLDIRS)
367
dnl Generate list of files to be processed by xgettext which will
368
dnl be included in po/Makefile.
369
test -d po || mkdir po
370
if test "x$srcdir" != "x."; then
371
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
372
posrcprefix="$srcdir/"
374
posrcprefix="../$srcdir/"
380
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
381
< $srcdir/po/POTFILES.in > po/POTFILES
384
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
385
# -------------------------------
386
# Define VARIABLE to the location where catalog files will
387
# be installed by po/Makefile.
388
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
389
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
390
glib_save_prefix="$prefix"
391
glib_save_exec_prefix="$exec_prefix"
392
test "x$prefix" = xNONE && prefix=$ac_default_prefix
393
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
394
if test "x$CATOBJEXT" = "x.mo" ; then
395
localedir=`eval echo "${libdir}/locale"`
397
localedir=`eval echo "${datadir}/locale"`
399
prefix="$glib_save_prefix"
400
exec_prefix="$glib_save_exec_prefix"
401
AC_DEFINE_UNQUOTED($1, "$localedir",
402
[Define the location where the catalogs will be installed])
406
dnl Now the definitions that aclocal will find
408
ifdef(glib_configure_in,[],[
409
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
410
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
413
dnl -*- mode: autoconf -*-
418
dnl GTK_DOC_CHECK([minimum-gtk-doc-version])
419
AC_DEFUN([GTK_DOC_CHECK],
421
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
422
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
423
dnl for overriding the documentation installation directory
424
AC_ARG_WITH(html-dir,
425
AC_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
426
[with_html_dir='${datadir}/gtk-doc/html'])
427
HTML_DIR="$with_html_dir"
430
dnl enable/disable documentation building
431
AC_ARG_ENABLE(gtk-doc,
432
AC_HELP_STRING([--enable-gtk-doc],
433
[use gtk-doc to build documentation [default=no]]),,
437
if test x$enable_gtk_doc = xyes; then
438
if test -z "$PKG_CONFIG"; then
439
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
441
if test "$PKG_CONFIG" != "no" && $PKG_CONFIG --exists gtk-doc; then
445
dnl do we want to do a version check?
447
[gtk_doc_min_version=$1
448
if test "$have_gtk_doc" = yes; then
449
AC_MSG_CHECKING([gtk-doc version >= $gtk_doc_min_version])
450
if $PKG_CONFIG --atleast-version $gtk_doc_min_version gtk-doc; then
458
if test "$have_gtk_doc" != yes; then
463
AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
464
AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL")
14
467
# isc-posix.m4 serial 2 (gettext-0.11.2)
15
468
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
16
469
dnl This file is free software; the Free Software Foundation
7459
7912
AC_SUBST([am__untar])
7460
7913
]) # _AM_PROG_TAR
7462
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
7463
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
7465
# This file is free software, distributed under the terms of the GNU
7466
# General Public License. As a special exception to the GNU General
7467
# Public License, this file may be distributed as part of a program
7468
# that contains a configuration script generated by Autoconf, under
7469
# the same distribution terms as the rest of that program.
7471
# This file can be copied and used freely without restrictions. It can
7472
# be used in projects which are not available under the GNU Public License
7473
# but which still want to provide support for the GNU gettext functionality.
7475
# Macro to add for using GNU gettext.
7476
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
7478
# Modified to never use included libintl.
7479
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
7481
# Major rework to remove unused code
7482
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
7484
# Added better handling of ALL_LINGUAS from GNU gettext version
7485
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
7487
# Modified to require ngettext
7488
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
7490
# We need this here as well, since someone might use autoconf-2.5x
7491
# to configure GLib then an older version to configure a package
7492
# using AM_GLIB_GNU_GETTEXT
7496
dnl We go to great lengths to make sure that aclocal won't
7497
dnl try to pull in the installed version of these macros
7498
dnl when running aclocal in the glib directory.
7500
m4_copy([AC_DEFUN],[glib_DEFUN])
7501
m4_copy([AC_REQUIRE],[glib_REQUIRE])
7503
dnl At the end, if we're not within glib, we'll define the public
7504
dnl definitions in terms of our private definitions.
7508
#--------------------
7509
glib_DEFUN([GLIB_LC_MESSAGES],
7510
[AC_CHECK_HEADERS([locale.h])
7511
if test $ac_cv_header_locale_h = yes; then
7512
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
7513
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
7514
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
7515
if test $am_cv_val_LC_MESSAGES = yes; then
7516
AC_DEFINE(HAVE_LC_MESSAGES, 1,
7517
[Define if your <locale.h> file defines LC_MESSAGES.])
7521
# GLIB_PATH_PROG_WITH_TEST
7522
#----------------------------
7523
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
7524
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
7525
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
7526
[# Extract the first word of "$2", so it can be a program name with args.
7527
set dummy $2; ac_word=[$]2
7528
AC_MSG_CHECKING([for $ac_word])
7529
AC_CACHE_VAL(ac_cv_path_$1,
7532
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
7535
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
7536
for ac_dir in ifelse([$5], , $PATH, [$5]); do
7537
test -z "$ac_dir" && ac_dir=.
7538
if test -f $ac_dir/$ac_word; then
7540
ac_cv_path_$1="$ac_dir/$ac_word"
7546
dnl If no 4th arg is given, leave the cache variable unset,
7547
dnl so AC_PATH_PROGS will keep looking.
7548
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
7553
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
7554
AC_MSG_RESULT([$]$1)
7563
glib_DEFUN([GLIB_WITH_NLS],
7564
dnl NLS is obligatory
7565
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7569
gt_cv_have_gettext=no
7575
AC_CHECK_HEADER(libintl.h,
7576
[gt_cv_func_dgettext_libintl="no"
7577
libintl_extra_libs=""
7580
# First check in libc
7582
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
7584
#include <libintl.h>
7586
[return !ngettext ("","", 1)],
7587
gt_cv_func_ngettext_libc=yes,
7588
gt_cv_func_ngettext_libc=no)
7591
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
7592
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
7594
#include <libintl.h>
7596
[return !dgettext ("","")],
7597
gt_cv_func_dgettext_libc=yes,
7598
gt_cv_func_dgettext_libc=no)
7602
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
7603
AC_CHECK_FUNCS(bind_textdomain_codeset)
7607
# If we don't have everything we want, check in libintl
7609
if test "$gt_cv_func_dgettext_libc" != "yes" \
7610
|| test "$gt_cv_func_ngettext_libc" != "yes" \
7611
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
7613
AC_CHECK_LIB(intl, bindtextdomain,
7614
[AC_CHECK_LIB(intl, ngettext,
7615
[AC_CHECK_LIB(intl, dgettext,
7616
gt_cv_func_dgettext_libintl=yes)])])
7618
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
7619
AC_MSG_CHECKING([if -liconv is needed to use gettext])
7621
AC_CHECK_LIB(intl, ngettext,
7622
[AC_CHECK_LIB(intl, dcgettext,
7623
[gt_cv_func_dgettext_libintl=yes
7624
libintl_extra_libs=-liconv],
7630
# If we found libintl, then check in it for bind_textdomain_codeset();
7631
# we'll prefer libc if neither have bind_textdomain_codeset(),
7632
# and both have dgettext and ngettext
7634
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
7635
glib_save_LIBS="$LIBS"
7636
LIBS="$LIBS -lintl $libintl_extra_libs"
7637
unset ac_cv_func_bind_textdomain_codeset
7638
AC_CHECK_FUNCS(bind_textdomain_codeset)
7639
LIBS="$glib_save_LIBS"
7641
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
7642
gt_cv_func_dgettext_libc=no
7644
if test "$gt_cv_func_dgettext_libc" = "yes" \
7645
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
7646
gt_cv_func_dgettext_libintl=no
7652
if test "$gt_cv_func_dgettext_libc" = "yes" \
7653
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
7654
gt_cv_have_gettext=yes
7657
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
7658
INTLLIBS="-lintl $libintl_extra_libs"
7661
if test "$gt_cv_have_gettext" = "yes"; then
7662
AC_DEFINE(HAVE_GETTEXT,1,
7663
[Define if the GNU gettext() function is already present or preinstalled.])
7664
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
7665
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
7666
if test "$MSGFMT" != "no"; then
7667
glib_save_LIBS="$LIBS"
7668
LIBS="$LIBS $INTLLIBS"
7669
AC_CHECK_FUNCS(dcgettext)
7670
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
7671
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
7672
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
7673
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
7674
return _nl_msg_cat_cntr],
7679
dnl On Solaris, if bind_textdomain_codeset is in libc,
7680
dnl GNU format message catalog is always supported,
7681
dnl since both are added to the libc all together.
7682
dnl Hence, we'd like to go with DATADIRNAME=share and
7683
dnl and CATOBJEXT=.gmo in this case.
7684
AC_CHECK_FUNC(bind_textdomain_codeset,
7695
LIBS="$glib_save_LIBS"
7698
gt_cv_have_gettext=no
7703
if test "$gt_cv_have_gettext" = "yes" ; then
7704
AC_DEFINE(ENABLE_NLS, 1,
7705
[always defined to indicate that i18n is enabled])
7708
dnl Test whether we really found GNU xgettext.
7709
if test "$XGETTEXT" != ":"; then
7710
dnl If it is not GNU xgettext we define it as : so that the
7711
dnl Makefiles still can work.
7712
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
7716
[found xgettext program is not GNU xgettext; ignore it])
7721
# We need to process the po/ directory.
7725
[case "$CONFIG_FILES" in *po/Makefile.in*)
7726
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
7729
dnl These rules are solely for the distribution goal. While doing this
7730
dnl we only have to keep exactly one list of the available catalogs
7731
dnl in configure.in.
7732
for lang in $ALL_LINGUAS; do
7733
GMOFILES="$GMOFILES $lang.gmo"
7734
POFILES="$POFILES $lang.po"
7737
dnl Make all variables we use known to autoconf.
7740
AC_SUBST(DATADIRNAME)
7742
AC_SUBST(INSTOBJEXT)
7744
AC_SUBST(PO_IN_DATADIR_TRUE)
7745
AC_SUBST(PO_IN_DATADIR_FALSE)
7750
# AM_GLIB_GNU_GETTEXT
7751
# -------------------
7752
# Do checks necessary for use of gettext. If a suitable implementation
7753
# of gettext is found in either in libintl or in the C library,
7754
# it will set INTLLIBS to the libraries needed for use of gettext
7755
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
7756
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
7757
# on various variables needed by the Makefile.in.in installed by
7760
glib_DEFUN([GLIB_GNU_GETTEXT],
7761
[AC_REQUIRE([AC_PROG_CC])dnl
7762
AC_REQUIRE([AC_HEADER_STDC])dnl
7767
if test "$gt_cv_have_gettext" = "yes"; then
7768
if test "x$ALL_LINGUAS" = "x"; then
7771
AC_MSG_CHECKING(for catalogs to be installed)
7773
for presentlang in $ALL_LINGUAS; do
7775
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
7776
desiredlanguages="$LINGUAS"
7778
desiredlanguages="$ALL_LINGUAS"
7780
for desiredlang in $desiredlanguages; do
7781
# Use the presentlang catalog if desiredlang is
7782
# a. equal to presentlang, or
7783
# b. a variant of presentlang (because in this case,
7784
# presentlang can be used as a fallback for messages
7785
# which are not translated in the desiredlang catalog).
7786
case "$desiredlang" in
7787
"$presentlang"*) useit=yes;;
7790
if test $useit = yes; then
7791
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
7794
LINGUAS=$NEW_LINGUAS
7795
AC_MSG_RESULT($LINGUAS)
7798
dnl Construct list of names of catalog files to be constructed.
7799
if test -n "$LINGUAS"; then
7800
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
7804
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
7805
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
7806
dnl Try to locate is.
7808
if test -n "$ac_aux_dir"; then
7809
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
7811
if test -z "$MKINSTALLDIRS"; then
7812
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
7814
AC_SUBST(MKINSTALLDIRS)
7816
dnl Generate list of files to be processed by xgettext which will
7817
dnl be included in po/Makefile.
7818
test -d po || mkdir po
7819
if test "x$srcdir" != "x."; then
7820
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
7821
posrcprefix="$srcdir/"
7823
posrcprefix="../$srcdir/"
7829
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
7830
< $srcdir/po/POTFILES.in > po/POTFILES
7833
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
7834
# -------------------------------
7835
# Define VARIABLE to the location where catalog files will
7836
# be installed by po/Makefile.
7837
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
7838
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
7839
glib_save_prefix="$prefix"
7840
glib_save_exec_prefix="$exec_prefix"
7841
glib_save_datarootdir="$datarootdir"
7842
test "x$prefix" = xNONE && prefix=$ac_default_prefix
7843
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
7844
datarootdir=`eval echo "${datarootdir}"`
7845
if test "x$CATOBJEXT" = "x.mo" ; then
7846
localedir=`eval echo "${libdir}/locale"`
7848
localedir=`eval echo "${datadir}/locale"`
7850
prefix="$glib_save_prefix"
7851
exec_prefix="$glib_save_exec_prefix"
7852
datarootdir="$glib_save_datarootdir"
7853
AC_DEFINE_UNQUOTED($1, "$localedir",
7854
[Define the location where the catalogs will be installed])
7858
dnl Now the definitions that aclocal will find
7860
ifdef(glib_configure_in,[],[
7861
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
7862
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
7865
dnl -*- mode: autoconf -*-
7870
dnl GTK_DOC_CHECK([minimum-gtk-doc-version])
7871
AC_DEFUN([GTK_DOC_CHECK],
7873
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
7874
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
7875
dnl for overriding the documentation installation directory
7876
AC_ARG_WITH(html-dir,
7877
AC_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
7878
[with_html_dir='${datadir}/gtk-doc/html'])
7879
HTML_DIR="$with_html_dir"
7882
dnl enable/disable documentation building
7883
AC_ARG_ENABLE(gtk-doc,
7884
AC_HELP_STRING([--enable-gtk-doc],
7885
[use gtk-doc to build documentation [default=no]]),,
7889
if test x$enable_gtk_doc = xyes; then
7890
if test -z "$PKG_CONFIG"; then
7891
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
7893
if test "$PKG_CONFIG" != "no" && $PKG_CONFIG --exists gtk-doc; then
7897
dnl do we want to do a version check?
7899
[gtk_doc_min_version=$1
7900
if test "$have_gtk_doc" = yes; then
7901
AC_MSG_CHECKING([gtk-doc version >= $gtk_doc_min_version])
7902
if $PKG_CONFIG --atleast-version $gtk_doc_min_version gtk-doc; then
7910
if test "$have_gtk_doc" != yes; then
7915
AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
7916
AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL")