19
19
If you have problems, you may need to regenerate the build system entirely.
20
20
To do so, use the procedure documented by the package, typically `autoreconf'.])])
23
dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas
24
dnl (i.e. pass to gconftool-2
25
dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where
26
dnl you should install foo.schemas files
29
AC_DEFUN([AM_GCONF_SOURCE_2],
31
if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
32
GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
34
GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
37
AC_ARG_WITH([gconf-source],
38
AC_HELP_STRING([--with-gconf-source=sourceaddress],
39
[Config database for installing schema files.]),
40
[GCONF_SCHEMA_CONFIG_SOURCE="$withval"],)
42
AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
43
AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
45
if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
46
GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
49
AC_ARG_WITH([gconf-schema-file-dir],
50
AC_HELP_STRING([--with-gconf-schema-file-dir=dir],
51
[Directory for installing schema files.]),
52
[GCONF_SCHEMA_FILE_DIR="$withval"],)
54
AC_SUBST(GCONF_SCHEMA_FILE_DIR)
55
AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
57
AC_ARG_ENABLE(schemas-install,
58
AC_HELP_STRING([--disable-schemas-install],
59
[Disable the schemas installation]),
62
*) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-install]) ;;
64
AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no])
67
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
68
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
70
# This file is free software, distributed under the terms of the GNU
71
# General Public License. As a special exception to the GNU General
72
# Public License, this file may be distributed as part of a program
73
# that contains a configuration script generated by Autoconf, under
74
# the same distribution terms as the rest of that program.
76
# This file can be copied and used freely without restrictions. It can
77
# be used in projects which are not available under the GNU Public License
78
# but which still want to provide support for the GNU gettext functionality.
80
# Macro to add for using GNU gettext.
81
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
83
# Modified to never use included libintl.
84
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
86
# Major rework to remove unused code
87
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
89
# Added better handling of ALL_LINGUAS from GNU gettext version
90
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
92
# Modified to require ngettext
93
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
95
# We need this here as well, since someone might use autoconf-2.5x
96
# to configure GLib then an older version to configure a package
97
# using AM_GLIB_GNU_GETTEXT
101
dnl We go to great lengths to make sure that aclocal won't
102
dnl try to pull in the installed version of these macros
103
dnl when running aclocal in the glib directory.
105
m4_copy([AC_DEFUN],[glib_DEFUN])
106
m4_copy([AC_REQUIRE],[glib_REQUIRE])
108
dnl At the end, if we're not within glib, we'll define the public
109
dnl definitions in terms of our private definitions.
113
#--------------------
114
glib_DEFUN([GLIB_LC_MESSAGES],
115
[AC_CHECK_HEADERS([locale.h])
116
if test $ac_cv_header_locale_h = yes; then
117
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
118
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
119
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
120
if test $am_cv_val_LC_MESSAGES = yes; then
121
AC_DEFINE(HAVE_LC_MESSAGES, 1,
122
[Define if your <locale.h> file defines LC_MESSAGES.])
126
# GLIB_PATH_PROG_WITH_TEST
127
#----------------------------
128
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
129
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
130
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
131
[# Extract the first word of "$2", so it can be a program name with args.
132
set dummy $2; ac_word=[$]2
133
AC_MSG_CHECKING([for $ac_word])
134
AC_CACHE_VAL(ac_cv_path_$1,
137
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
140
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
141
for ac_dir in ifelse([$5], , $PATH, [$5]); do
142
test -z "$ac_dir" && ac_dir=.
143
if test -f $ac_dir/$ac_word; then
145
ac_cv_path_$1="$ac_dir/$ac_word"
151
dnl If no 4th arg is given, leave the cache variable unset,
152
dnl so AC_PATH_PROGS will keep looking.
153
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
158
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
168
glib_DEFUN([GLIB_WITH_NLS],
169
dnl NLS is obligatory
173
gt_cv_have_gettext=no
179
AC_CHECK_HEADER(libintl.h,
180
[gt_cv_func_dgettext_libintl="no"
181
libintl_extra_libs=""
184
# First check in libc
186
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
190
[return !ngettext ("","", 1)],
191
gt_cv_func_ngettext_libc=yes,
192
gt_cv_func_ngettext_libc=no)
195
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
196
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
200
[return !dgettext ("","")],
201
gt_cv_func_dgettext_libc=yes,
202
gt_cv_func_dgettext_libc=no)
206
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
207
AC_CHECK_FUNCS(bind_textdomain_codeset)
211
# If we don't have everything we want, check in libintl
213
if test "$gt_cv_func_dgettext_libc" != "yes" \
214
|| test "$gt_cv_func_ngettext_libc" != "yes" \
215
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
217
AC_CHECK_LIB(intl, bindtextdomain,
218
[AC_CHECK_LIB(intl, ngettext,
219
[AC_CHECK_LIB(intl, dgettext,
220
gt_cv_func_dgettext_libintl=yes)])])
222
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
223
AC_MSG_CHECKING([if -liconv is needed to use gettext])
225
AC_CHECK_LIB(intl, ngettext,
226
[AC_CHECK_LIB(intl, dcgettext,
227
[gt_cv_func_dgettext_libintl=yes
228
libintl_extra_libs=-liconv],
234
# If we found libintl, then check in it for bind_textdomain_codeset();
235
# we'll prefer libc if neither have bind_textdomain_codeset(),
236
# and both have dgettext and ngettext
238
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
239
glib_save_LIBS="$LIBS"
240
LIBS="$LIBS -lintl $libintl_extra_libs"
241
unset ac_cv_func_bind_textdomain_codeset
242
AC_CHECK_FUNCS(bind_textdomain_codeset)
243
LIBS="$glib_save_LIBS"
245
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
246
gt_cv_func_dgettext_libc=no
248
if test "$gt_cv_func_dgettext_libc" = "yes" \
249
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
250
gt_cv_func_dgettext_libintl=no
256
if test "$gt_cv_func_dgettext_libc" = "yes" \
257
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
258
gt_cv_have_gettext=yes
261
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
262
INTLLIBS="-lintl $libintl_extra_libs"
265
if test "$gt_cv_have_gettext" = "yes"; then
266
AC_DEFINE(HAVE_GETTEXT,1,
267
[Define if the GNU gettext() function is already present or preinstalled.])
268
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
269
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
270
if test "$MSGFMT" != "no"; then
271
glib_save_LIBS="$LIBS"
272
LIBS="$LIBS $INTLLIBS"
273
AC_CHECK_FUNCS(dcgettext)
275
AC_MSG_CHECKING([if msgfmt accepts -c])
276
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
279
"Content-Type: text/plain; charset=UTF-8\n"
280
"Project-Id-Version: test 1.0\n"
281
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
282
"Last-Translator: test <foo@bar.xx>\n"
283
"Language-Team: C <LL@li.org>\n"
284
"MIME-Version: 1.0\n"
285
"Content-Transfer-Encoding: 8bit\n"
286
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
287
AC_SUBST(MSGFMT_OPTS)
288
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
289
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
290
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
291
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
292
return _nl_msg_cat_cntr],
297
dnl On Solaris, if bind_textdomain_codeset is in libc,
298
dnl GNU format message catalog is always supported,
299
dnl since both are added to the libc all together.
300
dnl Hence, we'd like to go with DATADIRNAME=share and
301
dnl and CATOBJEXT=.gmo in this case.
302
AC_CHECK_FUNC(bind_textdomain_codeset,
313
LIBS="$glib_save_LIBS"
316
gt_cv_have_gettext=no
321
if test "$gt_cv_have_gettext" = "yes" ; then
322
AC_DEFINE(ENABLE_NLS, 1,
323
[always defined to indicate that i18n is enabled])
326
dnl Test whether we really found GNU xgettext.
327
if test "$XGETTEXT" != ":"; then
328
dnl If it is not GNU xgettext we define it as : so that the
329
dnl Makefiles still can work.
330
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
334
[found xgettext program is not GNU xgettext; ignore it])
339
# We need to process the po/ directory.
343
[case "$CONFIG_FILES" in *po/Makefile.in*)
344
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
347
dnl These rules are solely for the distribution goal. While doing this
348
dnl we only have to keep exactly one list of the available catalogs
350
for lang in $ALL_LINGUAS; do
351
GMOFILES="$GMOFILES $lang.gmo"
352
POFILES="$POFILES $lang.po"
355
dnl Make all variables we use known to autoconf.
358
AC_SUBST(DATADIRNAME)
362
AC_SUBST(PO_IN_DATADIR_TRUE)
363
AC_SUBST(PO_IN_DATADIR_FALSE)
368
# AM_GLIB_GNU_GETTEXT
369
# -------------------
370
# Do checks necessary for use of gettext. If a suitable implementation
371
# of gettext is found in either in libintl or in the C library,
372
# it will set INTLLIBS to the libraries needed for use of gettext
373
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
374
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
375
# on various variables needed by the Makefile.in.in installed by
378
glib_DEFUN([GLIB_GNU_GETTEXT],
379
[AC_REQUIRE([AC_PROG_CC])dnl
380
AC_REQUIRE([AC_HEADER_STDC])dnl
385
if test "$gt_cv_have_gettext" = "yes"; then
386
if test "x$ALL_LINGUAS" = "x"; then
389
AC_MSG_CHECKING(for catalogs to be installed)
391
for presentlang in $ALL_LINGUAS; do
393
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
394
desiredlanguages="$LINGUAS"
396
desiredlanguages="$ALL_LINGUAS"
398
for desiredlang in $desiredlanguages; do
399
# Use the presentlang catalog if desiredlang is
400
# a. equal to presentlang, or
401
# b. a variant of presentlang (because in this case,
402
# presentlang can be used as a fallback for messages
403
# which are not translated in the desiredlang catalog).
404
case "$desiredlang" in
405
"$presentlang"*) useit=yes;;
408
if test $useit = yes; then
409
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
413
AC_MSG_RESULT($LINGUAS)
416
dnl Construct list of names of catalog files to be constructed.
417
if test -n "$LINGUAS"; then
418
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
422
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
423
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
424
dnl Try to locate is.
426
if test -n "$ac_aux_dir"; then
427
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
429
if test -z "$MKINSTALLDIRS"; then
430
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
432
AC_SUBST(MKINSTALLDIRS)
434
dnl Generate list of files to be processed by xgettext which will
435
dnl be included in po/Makefile.
436
test -d po || mkdir po
437
if test "x$srcdir" != "x."; then
438
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
439
posrcprefix="$srcdir/"
441
posrcprefix="../$srcdir/"
447
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
448
< $srcdir/po/POTFILES.in > po/POTFILES
451
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
452
# -------------------------------
453
# Define VARIABLE to the location where catalog files will
454
# be installed by po/Makefile.
455
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
456
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
457
glib_save_prefix="$prefix"
458
glib_save_exec_prefix="$exec_prefix"
459
glib_save_datarootdir="$datarootdir"
460
test "x$prefix" = xNONE && prefix=$ac_default_prefix
461
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
462
datarootdir=`eval echo "${datarootdir}"`
463
if test "x$CATOBJEXT" = "x.mo" ; then
464
localedir=`eval echo "${libdir}/locale"`
466
localedir=`eval echo "${datadir}/locale"`
468
prefix="$glib_save_prefix"
469
exec_prefix="$glib_save_exec_prefix"
470
datarootdir="$glib_save_datarootdir"
471
AC_DEFINE_UNQUOTED($1, "$localedir",
472
[Define the location where the catalogs will be installed])
476
dnl Now the definitions that aclocal will find
478
ifdef(glib_configure_in,[],[
479
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
480
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
483
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
485
# Create a temporary file with TEST-FILE as its contents and pass the
486
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
487
# 0 and perform ACTION-IF-FAIL for any other exit status.
488
AC_DEFUN([GLIB_RUN_PROG],
489
[cat >conftest.foo <<_ACEOF
492
if AC_RUN_LOG([$1 conftest.foo]); then
493
m4_ifval([$3], [$3], [:])
494
m4_ifvaln([$4], [else $4])dnl
495
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
496
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
500
# nls.m4 serial 3 (gettext-0.15)
501
dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
502
dnl This file is free software; the Free Software Foundation
503
dnl gives unlimited permission to copy and/or distribute it,
504
dnl with or without modifications, as long as this notice is preserved.
506
dnl This file can can be used in projects which are not available under
507
dnl the GNU General Public License or the GNU Library General Public
508
dnl License but which still want to provide support for the GNU gettext
510
dnl Please note that the actual code of the GNU gettext library is covered
511
dnl by the GNU Library General Public License, and the rest of the GNU
512
dnl gettext package package is covered by the GNU General Public License.
513
dnl They are *not* in the public domain.
516
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
517
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
523
AC_MSG_CHECKING([whether NLS is requested])
524
dnl Default is enabled NLS
526
[ --disable-nls do not use Native Language Support],
527
USE_NLS=$enableval, USE_NLS=yes)
528
AC_MSG_RESULT($USE_NLS)
22
532
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
24
534
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.