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'.])])
22
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
23
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
25
# This file is free software, distributed under the terms of the GNU
26
# General Public License. As a special exception to the GNU General
27
# Public License, this file may be distributed as part of a program
28
# that contains a configuration script generated by Autoconf, under
29
# the same distribution terms as the rest of that program.
31
# This file can be copied and used freely without restrictions. It can
32
# be used in projects which are not available under the GNU Public License
33
# but which still want to provide support for the GNU gettext functionality.
35
# Macro to add for using GNU gettext.
36
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
38
# Modified to never use included libintl.
39
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
41
# Major rework to remove unused code
42
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
44
# Added better handling of ALL_LINGUAS from GNU gettext version
45
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
47
# Modified to require ngettext
48
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
50
# We need this here as well, since someone might use autoconf-2.5x
51
# to configure GLib then an older version to configure a package
52
# using AM_GLIB_GNU_GETTEXT
56
dnl We go to great lengths to make sure that aclocal won't
57
dnl try to pull in the installed version of these macros
58
dnl when running aclocal in the glib directory.
60
m4_copy([AC_DEFUN],[glib_DEFUN])
61
m4_copy([AC_REQUIRE],[glib_REQUIRE])
63
dnl At the end, if we're not within glib, we'll define the public
64
dnl definitions in terms of our private definitions.
69
glib_DEFUN([GLIB_LC_MESSAGES],
70
[AC_CHECK_HEADERS([locale.h])
71
if test $ac_cv_header_locale_h = yes; then
72
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
73
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
74
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
75
if test $am_cv_val_LC_MESSAGES = yes; then
76
AC_DEFINE(HAVE_LC_MESSAGES, 1,
77
[Define if your <locale.h> file defines LC_MESSAGES.])
81
# GLIB_PATH_PROG_WITH_TEST
82
#----------------------------
83
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
84
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
85
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
86
[# Extract the first word of "$2", so it can be a program name with args.
87
set dummy $2; ac_word=[$]2
88
AC_MSG_CHECKING([for $ac_word])
89
AC_CACHE_VAL(ac_cv_path_$1,
92
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
95
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
96
for ac_dir in ifelse([$5], , $PATH, [$5]); do
97
test -z "$ac_dir" && ac_dir=.
98
if test -f $ac_dir/$ac_word; then
100
ac_cv_path_$1="$ac_dir/$ac_word"
106
dnl If no 4th arg is given, leave the cache variable unset,
107
dnl so AC_PATH_PROGS will keep looking.
108
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
113
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
123
glib_DEFUN([GLIB_WITH_NLS],
124
dnl NLS is obligatory
128
gt_cv_have_gettext=no
134
AC_CHECK_HEADER(libintl.h,
135
[gt_cv_func_dgettext_libintl="no"
136
libintl_extra_libs=""
139
# First check in libc
141
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
145
[return !ngettext ("","", 1)],
146
gt_cv_func_ngettext_libc=yes,
147
gt_cv_func_ngettext_libc=no)
150
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
151
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
155
[return !dgettext ("","")],
156
gt_cv_func_dgettext_libc=yes,
157
gt_cv_func_dgettext_libc=no)
161
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
162
AC_CHECK_FUNCS(bind_textdomain_codeset)
166
# If we don't have everything we want, check in libintl
168
if test "$gt_cv_func_dgettext_libc" != "yes" \
169
|| test "$gt_cv_func_ngettext_libc" != "yes" \
170
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
172
AC_CHECK_LIB(intl, bindtextdomain,
173
[AC_CHECK_LIB(intl, ngettext,
174
[AC_CHECK_LIB(intl, dgettext,
175
gt_cv_func_dgettext_libintl=yes)])])
177
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
178
AC_MSG_CHECKING([if -liconv is needed to use gettext])
180
AC_CHECK_LIB(intl, ngettext,
181
[AC_CHECK_LIB(intl, dcgettext,
182
[gt_cv_func_dgettext_libintl=yes
183
libintl_extra_libs=-liconv],
189
# If we found libintl, then check in it for bind_textdomain_codeset();
190
# we'll prefer libc if neither have bind_textdomain_codeset(),
191
# and both have dgettext and ngettext
193
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
194
glib_save_LIBS="$LIBS"
195
LIBS="$LIBS -lintl $libintl_extra_libs"
196
unset ac_cv_func_bind_textdomain_codeset
197
AC_CHECK_FUNCS(bind_textdomain_codeset)
198
LIBS="$glib_save_LIBS"
200
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
201
gt_cv_func_dgettext_libc=no
203
if test "$gt_cv_func_dgettext_libc" = "yes" \
204
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
205
gt_cv_func_dgettext_libintl=no
211
if test "$gt_cv_func_dgettext_libc" = "yes" \
212
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
213
gt_cv_have_gettext=yes
216
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
217
INTLLIBS="-lintl $libintl_extra_libs"
220
if test "$gt_cv_have_gettext" = "yes"; then
221
AC_DEFINE(HAVE_GETTEXT,1,
222
[Define if the GNU gettext() function is already present or preinstalled.])
223
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
224
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
225
if test "$MSGFMT" != "no"; then
226
glib_save_LIBS="$LIBS"
227
LIBS="$LIBS $INTLLIBS"
228
AC_CHECK_FUNCS(dcgettext)
230
AC_MSG_CHECKING([if msgfmt accepts -c])
231
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
234
"Content-Type: text/plain; charset=UTF-8\n"
235
"Project-Id-Version: test 1.0\n"
236
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
237
"Last-Translator: test <foo@bar.xx>\n"
238
"Language-Team: C <LL@li.org>\n"
239
"MIME-Version: 1.0\n"
240
"Content-Transfer-Encoding: 8bit\n"
241
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
242
AC_SUBST(MSGFMT_OPTS)
243
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
244
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
245
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
246
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
247
return _nl_msg_cat_cntr],
252
dnl On Solaris, if bind_textdomain_codeset is in libc,
253
dnl GNU format message catalog is always supported,
254
dnl since both are added to the libc all together.
255
dnl Hence, we'd like to go with DATADIRNAME=share and
256
dnl and CATOBJEXT=.gmo in this case.
257
AC_CHECK_FUNC(bind_textdomain_codeset,
268
LIBS="$glib_save_LIBS"
271
gt_cv_have_gettext=no
276
if test "$gt_cv_have_gettext" = "yes" ; then
277
AC_DEFINE(ENABLE_NLS, 1,
278
[always defined to indicate that i18n is enabled])
281
dnl Test whether we really found GNU xgettext.
282
if test "$XGETTEXT" != ":"; then
283
dnl If it is not GNU xgettext we define it as : so that the
284
dnl Makefiles still can work.
285
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
289
[found xgettext program is not GNU xgettext; ignore it])
294
# We need to process the po/ directory.
298
[case "$CONFIG_FILES" in *po/Makefile.in*)
299
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
302
dnl These rules are solely for the distribution goal. While doing this
303
dnl we only have to keep exactly one list of the available catalogs
305
for lang in $ALL_LINGUAS; do
306
GMOFILES="$GMOFILES $lang.gmo"
307
POFILES="$POFILES $lang.po"
310
dnl Make all variables we use known to autoconf.
313
AC_SUBST(DATADIRNAME)
317
AC_SUBST(PO_IN_DATADIR_TRUE)
318
AC_SUBST(PO_IN_DATADIR_FALSE)
323
# AM_GLIB_GNU_GETTEXT
324
# -------------------
325
# Do checks necessary for use of gettext. If a suitable implementation
326
# of gettext is found in either in libintl or in the C library,
327
# it will set INTLLIBS to the libraries needed for use of gettext
328
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
329
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
330
# on various variables needed by the Makefile.in.in installed by
333
glib_DEFUN([GLIB_GNU_GETTEXT],
334
[AC_REQUIRE([AC_PROG_CC])dnl
335
AC_REQUIRE([AC_HEADER_STDC])dnl
340
if test "$gt_cv_have_gettext" = "yes"; then
341
if test "x$ALL_LINGUAS" = "x"; then
344
AC_MSG_CHECKING(for catalogs to be installed)
346
for presentlang in $ALL_LINGUAS; do
348
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
349
desiredlanguages="$LINGUAS"
351
desiredlanguages="$ALL_LINGUAS"
353
for desiredlang in $desiredlanguages; do
354
# Use the presentlang catalog if desiredlang is
355
# a. equal to presentlang, or
356
# b. a variant of presentlang (because in this case,
357
# presentlang can be used as a fallback for messages
358
# which are not translated in the desiredlang catalog).
359
case "$desiredlang" in
360
"$presentlang"*) useit=yes;;
363
if test $useit = yes; then
364
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
368
AC_MSG_RESULT($LINGUAS)
371
dnl Construct list of names of catalog files to be constructed.
372
if test -n "$LINGUAS"; then
373
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
377
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
378
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
379
dnl Try to locate is.
381
if test -n "$ac_aux_dir"; then
382
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
384
if test -z "$MKINSTALLDIRS"; then
385
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
387
AC_SUBST(MKINSTALLDIRS)
389
dnl Generate list of files to be processed by xgettext which will
390
dnl be included in po/Makefile.
391
test -d po || mkdir po
392
if test "x$srcdir" != "x."; then
393
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
394
posrcprefix="$srcdir/"
396
posrcprefix="../$srcdir/"
402
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
403
< $srcdir/po/POTFILES.in > po/POTFILES
406
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
407
# -------------------------------
408
# Define VARIABLE to the location where catalog files will
409
# be installed by po/Makefile.
410
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
411
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
412
glib_save_prefix="$prefix"
413
glib_save_exec_prefix="$exec_prefix"
414
glib_save_datarootdir="$datarootdir"
415
test "x$prefix" = xNONE && prefix=$ac_default_prefix
416
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
417
datarootdir=`eval echo "${datarootdir}"`
418
if test "x$CATOBJEXT" = "x.mo" ; then
419
localedir=`eval echo "${libdir}/locale"`
421
localedir=`eval echo "${datadir}/locale"`
423
prefix="$glib_save_prefix"
424
exec_prefix="$glib_save_exec_prefix"
425
datarootdir="$glib_save_datarootdir"
426
AC_DEFINE_UNQUOTED($1, "$localedir",
427
[Define the location where the catalogs will be installed])
431
dnl Now the definitions that aclocal will find
433
ifdef(glib_configure_ac,[],[
434
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
435
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
438
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
440
# Create a temporary file with TEST-FILE as its contents and pass the
441
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
442
# 0 and perform ACTION-IF-FAIL for any other exit status.
443
AC_DEFUN([GLIB_RUN_PROG],
444
[cat >conftest.foo <<_ACEOF
447
if AC_RUN_LOG([$1 conftest.foo]); then
448
m4_ifval([$3], [$3], [:])
449
m4_ifvaln([$4], [else $4])dnl
450
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
451
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
456
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
457
dnl the schema should be compiled
460
AC_DEFUN([GLIB_GSETTINGS],
462
m4_pattern_allow([AM_V_GEN])
463
AC_ARG_ENABLE(schemas-compile,
464
AC_HELP_STRING([--disable-schemas-compile],
465
[Disable regeneration of gschemas.compiled on install]),
466
[case ${enableval} in
467
yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE="" ;;
468
no) GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;;
469
*) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;;
471
AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE])
472
PKG_PROG_PKG_CONFIG([0.16])
473
AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas])
474
if test x$cross_compiling != xyes; then
475
GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0`
477
AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas)
479
AC_SUBST(GLIB_COMPILE_SCHEMAS)
480
if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then
481
ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2])
483
ifelse([$1],,[:],[$1])
487
.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas
489
mostlyclean-am: clean-gsettings-schemas
491
gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE))
493
%.gschema.valid: %.gschema.xml $(gsettings__enum_file)
494
$(AM_V_GEN) if test -f "$<"; then d=; else d="$(srcdir)/"; fi; $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$${d}$< && touch [$]@
496
all-am: $(gsettings_SCHEMAS:.xml=.valid)
497
uninstall-am: uninstall-gsettings-schemas
498
install-data-am: install-gsettings-schemas
500
.SECONDARY: $(gsettings_SCHEMAS)
502
install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file)
504
if test -n "$^"; then \
505
test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \
506
$(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \
507
test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \
510
uninstall-gsettings-schemas:
512
@list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; test -n "$(gsettingsschemadir)" || list=; \
513
files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \
514
test -n "$$files" || exit 0; \
515
echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \
516
cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files
517
test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
519
clean-gsettings-schemas:
520
rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
522
ifdef gsettings_ENUM_NAMESPACE
523
$(gsettings__enum_file): $(gsettings_ENUM_FILES)
524
$(AM_V_GEN) glib-mkenums --comments '\''<!-- @comment@ -->'\'' --fhead "<schemalist>" --vhead " <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod " <value nick='\''@valuenick@'\'' value='\''@valuenum@'\''/>" --vtail " </@type@>" --ftail "</schemalist>" [$]^ > [$]@.tmp && mv [$]@.tmp [$]@
527
_GSETTINGS_SUBST(GSETTINGS_RULES)
530
dnl _GSETTINGS_SUBST(VARIABLE)
531
dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
532
AC_DEFUN([_GSETTINGS_SUBST],
535
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
539
# nls.m4 serial 5 (gettext-0.18)
540
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
542
dnl This file is free software; the Free Software Foundation
543
dnl gives unlimited permission to copy and/or distribute it,
544
dnl with or without modifications, as long as this notice is preserved.
546
dnl This file can can be used in projects which are not available under
547
dnl the GNU General Public License or the GNU Library General Public
548
dnl License but which still want to provide support for the GNU gettext
550
dnl Please note that the actual code of the GNU gettext library is covered
551
dnl by the GNU Library General Public License, and the rest of the GNU
552
dnl gettext package package is covered by the GNU General Public License.
553
dnl They are *not* in the public domain.
556
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
557
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
563
AC_MSG_CHECKING([whether NLS is requested])
564
dnl Default is enabled NLS
566
[ --disable-nls do not use Native Language Support],
567
USE_NLS=$enableval, USE_NLS=yes)
568
AC_MSG_RESULT([$USE_NLS])
572
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
573
# serial 1 (pkg-config-0.24)
575
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
577
# This program is free software; you can redistribute it and/or modify
578
# it under the terms of the GNU General Public License as published by
579
# the Free Software Foundation; either version 2 of the License, or
580
# (at your option) any later version.
582
# This program is distributed in the hope that it will be useful, but
583
# WITHOUT ANY WARRANTY; without even the implied warranty of
584
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
585
# General Public License for more details.
587
# You should have received a copy of the GNU General Public License
588
# along with this program; if not, write to the Free Software
589
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
591
# As a special exception to the GNU General Public License, if you
592
# distribute this file as part of a program that contains a
593
# configuration script generated by Autoconf, you may include it under
594
# the same distribution terms that you use for the rest of that program.
596
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
597
# ----------------------------------
598
AC_DEFUN([PKG_PROG_PKG_CONFIG],
599
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
600
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
601
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
602
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
603
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
605
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
606
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
608
if test -n "$PKG_CONFIG"; then
609
_pkg_min_version=m4_default([$1], [0.9.0])
610
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
611
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
618
])# PKG_PROG_PKG_CONFIG
620
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
622
# Check to see whether a particular set of modules exists. Similar
623
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
625
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
626
# only at the first occurence in configure.ac, so if the first place
627
# it's called might be skipped (such as if it is within an "if", you
628
# have to call PKG_CHECK_EXISTS manually
629
# --------------------------------------------------------------
630
AC_DEFUN([PKG_CHECK_EXISTS],
631
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
632
if test -n "$PKG_CONFIG" && \
633
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
634
m4_default([$2], [:])
635
m4_ifvaln([$3], [else
639
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
640
# ---------------------------------------------
641
m4_define([_PKG_CONFIG],
642
[if test -n "$$1"; then
644
elif test -n "$PKG_CONFIG"; then
645
PKG_CHECK_EXISTS([$3],
646
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
653
# _PKG_SHORT_ERRORS_SUPPORTED
654
# -----------------------------
655
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
656
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
657
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
658
_pkg_short_errors_supported=yes
660
_pkg_short_errors_supported=no
662
])# _PKG_SHORT_ERRORS_SUPPORTED
665
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
666
# [ACTION-IF-NOT-FOUND])
669
# Note that if there is a possibility the first call to
670
# PKG_CHECK_MODULES might not happen, you should be sure to include an
671
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
674
# --------------------------------------------------------------
675
AC_DEFUN([PKG_CHECK_MODULES],
676
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
677
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
678
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
681
AC_MSG_CHECKING([for $1])
683
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
684
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
686
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
687
and $1[]_LIBS to avoid the need to call pkg-config.
688
See the pkg-config man page for more details.])
690
if test $pkg_failed = yes; then
692
_PKG_SHORT_ERRORS_SUPPORTED
693
if test $_pkg_short_errors_supported = yes; then
694
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
696
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
698
# Put the nasty error message in config.log where it belongs
699
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
701
m4_default([$4], [AC_MSG_ERROR(
702
[Package requirements ($2) were not met:
706
Consider adjusting the PKG_CONFIG_PATH environment variable if you
707
installed software in a non-standard prefix.
711
elif test $pkg_failed = untried; then
713
m4_default([$4], [AC_MSG_FAILURE(
714
[The pkg-config script could not be found or is too old. Make sure it
715
is in your PATH or set the PKG_CONFIG environment variable to the full
720
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
723
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
724
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
728
])# PKG_CHECK_MODULES
22
730
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
24
732
# This file is free software; the Free Software Foundation
1028
1736
AC_SUBST([am__untar])
1029
1737
]) # _AM_PROG_TAR
1031
# nls.m4 serial 5 (gettext-0.18)
1032
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
1034
dnl This file is free software; the Free Software Foundation
1035
dnl gives unlimited permission to copy and/or distribute it,
1036
dnl with or without modifications, as long as this notice is preserved.
1038
dnl This file can can be used in projects which are not available under
1039
dnl the GNU General Public License or the GNU Library General Public
1040
dnl License but which still want to provide support for the GNU gettext
1042
dnl Please note that the actual code of the GNU gettext library is covered
1043
dnl by the GNU Library General Public License, and the rest of the GNU
1044
dnl gettext package package is covered by the GNU General Public License.
1045
dnl They are *not* in the public domain.
1048
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1049
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1055
AC_MSG_CHECKING([whether NLS is requested])
1056
dnl Default is enabled NLS
1057
AC_ARG_ENABLE([nls],
1058
[ --disable-nls do not use Native Language Support],
1059
USE_NLS=$enableval, USE_NLS=yes)
1060
AC_MSG_RESULT([$USE_NLS])
1064
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1065
# serial 1 (pkg-config-0.24)
1067
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1069
# This program is free software; you can redistribute it and/or modify
1070
# it under the terms of the GNU General Public License as published by
1071
# the Free Software Foundation; either version 2 of the License, or
1072
# (at your option) any later version.
1074
# This program is distributed in the hope that it will be useful, but
1075
# WITHOUT ANY WARRANTY; without even the implied warranty of
1076
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1077
# General Public License for more details.
1079
# You should have received a copy of the GNU General Public License
1080
# along with this program; if not, write to the Free Software
1081
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1083
# As a special exception to the GNU General Public License, if you
1084
# distribute this file as part of a program that contains a
1085
# configuration script generated by Autoconf, you may include it under
1086
# the same distribution terms that you use for the rest of that program.
1088
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1089
# ----------------------------------
1090
AC_DEFUN([PKG_PROG_PKG_CONFIG],
1091
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1092
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1093
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1094
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1095
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1097
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1098
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1100
if test -n "$PKG_CONFIG"; then
1101
_pkg_min_version=m4_default([$1], [0.9.0])
1102
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1103
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1104
AC_MSG_RESULT([yes])
1110
])# PKG_PROG_PKG_CONFIG
1112
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1114
# Check to see whether a particular set of modules exists. Similar
1115
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1117
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1118
# only at the first occurence in configure.ac, so if the first place
1119
# it's called might be skipped (such as if it is within an "if", you
1120
# have to call PKG_CHECK_EXISTS manually
1121
# --------------------------------------------------------------
1122
AC_DEFUN([PKG_CHECK_EXISTS],
1123
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1124
if test -n "$PKG_CONFIG" && \
1125
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1126
m4_default([$2], [:])
1127
m4_ifvaln([$3], [else
1131
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1132
# ---------------------------------------------
1133
m4_define([_PKG_CONFIG],
1134
[if test -n "$$1"; then
1136
elif test -n "$PKG_CONFIG"; then
1137
PKG_CHECK_EXISTS([$3],
1138
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1145
# _PKG_SHORT_ERRORS_SUPPORTED
1146
# -----------------------------
1147
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1148
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1149
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1150
_pkg_short_errors_supported=yes
1152
_pkg_short_errors_supported=no
1154
])# _PKG_SHORT_ERRORS_SUPPORTED
1157
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1158
# [ACTION-IF-NOT-FOUND])
1161
# Note that if there is a possibility the first call to
1162
# PKG_CHECK_MODULES might not happen, you should be sure to include an
1163
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1166
# --------------------------------------------------------------
1167
AC_DEFUN([PKG_CHECK_MODULES],
1168
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1169
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1170
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1173
AC_MSG_CHECKING([for $1])
1175
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1176
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1178
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1179
and $1[]_LIBS to avoid the need to call pkg-config.
1180
See the pkg-config man page for more details.])
1182
if test $pkg_failed = yes; then
1184
_PKG_SHORT_ERRORS_SUPPORTED
1185
if test $_pkg_short_errors_supported = yes; then
1186
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1188
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1190
# Put the nasty error message in config.log where it belongs
1191
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1193
m4_default([$4], [AC_MSG_ERROR(
1194
[Package requirements ($2) were not met:
1198
Consider adjusting the PKG_CONFIG_PATH environment variable if you
1199
installed software in a non-standard prefix.
1203
elif test $pkg_failed = untried; then
1205
m4_default([$4], [AC_MSG_FAILURE(
1206
[The pkg-config script could not be found or is too old. Make sure it
1207
is in your PATH or set the PKG_CONFIG environment variable to the full
1212
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
1215
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1216
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1217
AC_MSG_RESULT([yes])
1220
])# PKG_CHECK_MODULES
1222
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
1223
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
1225
# This file is free software, distributed under the terms of the GNU
1226
# General Public License. As a special exception to the GNU General
1227
# Public License, this file may be distributed as part of a program
1228
# that contains a configuration script generated by Autoconf, under
1229
# the same distribution terms as the rest of that program.
1231
# This file can be copied and used freely without restrictions. It can
1232
# be used in projects which are not available under the GNU Public License
1233
# but which still want to provide support for the GNU gettext functionality.
1235
# Macro to add for using GNU gettext.
1236
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
1238
# Modified to never use included libintl.
1239
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
1241
# Major rework to remove unused code
1242
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
1244
# Added better handling of ALL_LINGUAS from GNU gettext version
1245
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
1247
# Modified to require ngettext
1248
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
1250
# We need this here as well, since someone might use autoconf-2.5x
1251
# to configure GLib then an older version to configure a package
1252
# using AM_GLIB_GNU_GETTEXT
1256
dnl We go to great lengths to make sure that aclocal won't
1257
dnl try to pull in the installed version of these macros
1258
dnl when running aclocal in the glib directory.
1260
m4_copy([AC_DEFUN],[glib_DEFUN])
1261
m4_copy([AC_REQUIRE],[glib_REQUIRE])
1263
dnl At the end, if we're not within glib, we'll define the public
1264
dnl definitions in terms of our private definitions.
1268
#--------------------
1269
glib_DEFUN([GLIB_LC_MESSAGES],
1270
[AC_CHECK_HEADERS([locale.h])
1271
if test $ac_cv_header_locale_h = yes; then
1272
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1273
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1274
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1275
if test $am_cv_val_LC_MESSAGES = yes; then
1276
AC_DEFINE(HAVE_LC_MESSAGES, 1,
1277
[Define if your <locale.h> file defines LC_MESSAGES.])
1281
# GLIB_PATH_PROG_WITH_TEST
1282
#----------------------------
1283
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1284
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1285
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
1286
[# Extract the first word of "$2", so it can be a program name with args.
1287
set dummy $2; ac_word=[$]2
1288
AC_MSG_CHECKING([for $ac_word])
1289
AC_CACHE_VAL(ac_cv_path_$1,
1292
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1295
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1296
for ac_dir in ifelse([$5], , $PATH, [$5]); do
1297
test -z "$ac_dir" && ac_dir=.
1298
if test -f $ac_dir/$ac_word; then
1300
ac_cv_path_$1="$ac_dir/$ac_word"
1306
dnl If no 4th arg is given, leave the cache variable unset,
1307
dnl so AC_PATH_PROGS will keep looking.
1308
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1313
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1314
AC_MSG_RESULT([$]$1)
1323
glib_DEFUN([GLIB_WITH_NLS],
1324
dnl NLS is obligatory
1328
gt_cv_have_gettext=no
1334
AC_CHECK_HEADER(libintl.h,
1335
[gt_cv_func_dgettext_libintl="no"
1336
libintl_extra_libs=""
1339
# First check in libc
1341
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
1343
#include <libintl.h>
1345
[return !ngettext ("","", 1)],
1346
gt_cv_func_ngettext_libc=yes,
1347
gt_cv_func_ngettext_libc=no)
1350
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1351
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
1353
#include <libintl.h>
1355
[return !dgettext ("","")],
1356
gt_cv_func_dgettext_libc=yes,
1357
gt_cv_func_dgettext_libc=no)
1361
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1362
AC_CHECK_FUNCS(bind_textdomain_codeset)
1366
# If we don't have everything we want, check in libintl
1368
if test "$gt_cv_func_dgettext_libc" != "yes" \
1369
|| test "$gt_cv_func_ngettext_libc" != "yes" \
1370
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
1372
AC_CHECK_LIB(intl, bindtextdomain,
1373
[AC_CHECK_LIB(intl, ngettext,
1374
[AC_CHECK_LIB(intl, dgettext,
1375
gt_cv_func_dgettext_libintl=yes)])])
1377
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
1378
AC_MSG_CHECKING([if -liconv is needed to use gettext])
1380
AC_CHECK_LIB(intl, ngettext,
1381
[AC_CHECK_LIB(intl, dcgettext,
1382
[gt_cv_func_dgettext_libintl=yes
1383
libintl_extra_libs=-liconv],
1389
# If we found libintl, then check in it for bind_textdomain_codeset();
1390
# we'll prefer libc if neither have bind_textdomain_codeset(),
1391
# and both have dgettext and ngettext
1393
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
1394
glib_save_LIBS="$LIBS"
1395
LIBS="$LIBS -lintl $libintl_extra_libs"
1396
unset ac_cv_func_bind_textdomain_codeset
1397
AC_CHECK_FUNCS(bind_textdomain_codeset)
1398
LIBS="$glib_save_LIBS"
1400
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
1401
gt_cv_func_dgettext_libc=no
1403
if test "$gt_cv_func_dgettext_libc" = "yes" \
1404
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
1405
gt_cv_func_dgettext_libintl=no
1411
if test "$gt_cv_func_dgettext_libc" = "yes" \
1412
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
1413
gt_cv_have_gettext=yes
1416
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
1417
INTLLIBS="-lintl $libintl_extra_libs"
1420
if test "$gt_cv_have_gettext" = "yes"; then
1421
AC_DEFINE(HAVE_GETTEXT,1,
1422
[Define if the GNU gettext() function is already present or preinstalled.])
1423
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1424
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
1425
if test "$MSGFMT" != "no"; then
1426
glib_save_LIBS="$LIBS"
1427
LIBS="$LIBS $INTLLIBS"
1428
AC_CHECK_FUNCS(dcgettext)
1430
AC_MSG_CHECKING([if msgfmt accepts -c])
1431
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
1434
"Content-Type: text/plain; charset=UTF-8\n"
1435
"Project-Id-Version: test 1.0\n"
1436
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
1437
"Last-Translator: test <foo@bar.xx>\n"
1438
"Language-Team: C <LL@li.org>\n"
1439
"MIME-Version: 1.0\n"
1440
"Content-Transfer-Encoding: 8bit\n"
1441
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
1442
AC_SUBST(MSGFMT_OPTS)
1443
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1444
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1445
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1446
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
1447
return _nl_msg_cat_cntr],
1452
dnl On Solaris, if bind_textdomain_codeset is in libc,
1453
dnl GNU format message catalog is always supported,
1454
dnl since both are added to the libc all together.
1455
dnl Hence, we'd like to go with DATADIRNAME=share and
1456
dnl and CATOBJEXT=.gmo in this case.
1457
AC_CHECK_FUNC(bind_textdomain_codeset,
1468
LIBS="$glib_save_LIBS"
1471
gt_cv_have_gettext=no
1476
if test "$gt_cv_have_gettext" = "yes" ; then
1477
AC_DEFINE(ENABLE_NLS, 1,
1478
[always defined to indicate that i18n is enabled])
1481
dnl Test whether we really found GNU xgettext.
1482
if test "$XGETTEXT" != ":"; then
1483
dnl If it is not GNU xgettext we define it as : so that the
1484
dnl Makefiles still can work.
1485
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
1489
[found xgettext program is not GNU xgettext; ignore it])
1494
# We need to process the po/ directory.
1498
[case "$CONFIG_FILES" in *po/Makefile.in*)
1499
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
1502
dnl These rules are solely for the distribution goal. While doing this
1503
dnl we only have to keep exactly one list of the available catalogs
1504
dnl in configure.ac.
1505
for lang in $ALL_LINGUAS; do
1506
GMOFILES="$GMOFILES $lang.gmo"
1507
POFILES="$POFILES $lang.po"
1510
dnl Make all variables we use known to autoconf.
1513
AC_SUBST(DATADIRNAME)
1515
AC_SUBST(INSTOBJEXT)
1517
AC_SUBST(PO_IN_DATADIR_TRUE)
1518
AC_SUBST(PO_IN_DATADIR_FALSE)
1523
# AM_GLIB_GNU_GETTEXT
1524
# -------------------
1525
# Do checks necessary for use of gettext. If a suitable implementation
1526
# of gettext is found in either in libintl or in the C library,
1527
# it will set INTLLIBS to the libraries needed for use of gettext
1528
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
1529
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
1530
# on various variables needed by the Makefile.in.in installed by
1533
glib_DEFUN([GLIB_GNU_GETTEXT],
1534
[AC_REQUIRE([AC_PROG_CC])dnl
1535
AC_REQUIRE([AC_HEADER_STDC])dnl
1540
if test "$gt_cv_have_gettext" = "yes"; then
1541
if test "x$ALL_LINGUAS" = "x"; then
1544
AC_MSG_CHECKING(for catalogs to be installed)
1546
for presentlang in $ALL_LINGUAS; do
1548
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
1549
desiredlanguages="$LINGUAS"
1551
desiredlanguages="$ALL_LINGUAS"
1553
for desiredlang in $desiredlanguages; do
1554
# Use the presentlang catalog if desiredlang is
1555
# a. equal to presentlang, or
1556
# b. a variant of presentlang (because in this case,
1557
# presentlang can be used as a fallback for messages
1558
# which are not translated in the desiredlang catalog).
1559
case "$desiredlang" in
1560
"$presentlang"*) useit=yes;;
1563
if test $useit = yes; then
1564
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1567
LINGUAS=$NEW_LINGUAS
1568
AC_MSG_RESULT($LINGUAS)
1571
dnl Construct list of names of catalog files to be constructed.
1572
if test -n "$LINGUAS"; then
1573
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1577
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1578
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
1579
dnl Try to locate is.
1581
if test -n "$ac_aux_dir"; then
1582
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1584
if test -z "$MKINSTALLDIRS"; then
1585
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1587
AC_SUBST(MKINSTALLDIRS)
1589
dnl Generate list of files to be processed by xgettext which will
1590
dnl be included in po/Makefile.
1591
test -d po || mkdir po
1592
if test "x$srcdir" != "x."; then
1593
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
1594
posrcprefix="$srcdir/"
1596
posrcprefix="../$srcdir/"
1602
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
1603
< $srcdir/po/POTFILES.in > po/POTFILES
1606
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
1607
# -------------------------------
1608
# Define VARIABLE to the location where catalog files will
1609
# be installed by po/Makefile.
1610
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
1611
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
1612
glib_save_prefix="$prefix"
1613
glib_save_exec_prefix="$exec_prefix"
1614
glib_save_datarootdir="$datarootdir"
1615
test "x$prefix" = xNONE && prefix=$ac_default_prefix
1616
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
1617
datarootdir=`eval echo "${datarootdir}"`
1618
if test "x$CATOBJEXT" = "x.mo" ; then
1619
localedir=`eval echo "${libdir}/locale"`
1621
localedir=`eval echo "${datadir}/locale"`
1623
prefix="$glib_save_prefix"
1624
exec_prefix="$glib_save_exec_prefix"
1625
datarootdir="$glib_save_datarootdir"
1626
AC_DEFINE_UNQUOTED($1, "$localedir",
1627
[Define the location where the catalogs will be installed])
1631
dnl Now the definitions that aclocal will find
1633
ifdef(glib_configure_ac,[],[
1634
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
1635
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
1638
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
1640
# Create a temporary file with TEST-FILE as its contents and pass the
1641
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
1642
# 0 and perform ACTION-IF-FAIL for any other exit status.
1643
AC_DEFUN([GLIB_RUN_PROG],
1644
[cat >conftest.foo <<_ACEOF
1647
if AC_RUN_LOG([$1 conftest.foo]); then
1648
m4_ifval([$3], [$3], [:])
1649
m4_ifvaln([$4], [else $4])dnl
1650
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
1651
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
1656
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
1657
dnl the schema should be compiled
1660
AC_DEFUN([GLIB_GSETTINGS],
1662
m4_pattern_allow([AM_V_GEN])
1663
AC_ARG_ENABLE(schemas-compile,
1664
AS_HELP_STRING([--disable-schemas-compile],
1665
[Disable regeneration of gschemas.compiled on install]),
1666
[case ${enableval} in
1667
yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE="" ;;
1668
no) GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;;
1669
*) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;;
1671
AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE])
1672
PKG_PROG_PKG_CONFIG([0.16])
1673
AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas])
1674
if test x$cross_compiling != xyes; then
1675
GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0`
1677
AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas)
1679
AC_SUBST(GLIB_COMPILE_SCHEMAS)
1680
if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then
1681
ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2])
1683
ifelse([$1],,[:],[$1])
1687
.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas
1689
mostlyclean-am: clean-gsettings-schemas
1691
gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE))
1693
%.gschema.valid: %.gschema.xml $(gsettings__enum_file)
1694
$(AM_V_GEN) if test -f "$<"; then d=; else d="$(srcdir)/"; fi; $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$${d}$< && touch [$]@
1696
all-am: $(gsettings_SCHEMAS:.xml=.valid)
1697
uninstall-am: uninstall-gsettings-schemas
1698
install-data-am: install-gsettings-schemas
1700
.SECONDARY: $(gsettings_SCHEMAS)
1702
install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file)
1704
if test -n "$^"; then \
1705
test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \
1706
$(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \
1707
test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \
1710
uninstall-gsettings-schemas:
1711
@$(NORMAL_UNINSTALL)
1712
@list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; test -n "$(gsettingsschemadir)" || list=; \
1713
files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \
1714
test -n "$$files" || exit 0; \
1715
echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \
1716
cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files
1717
test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
1719
clean-gsettings-schemas:
1720
rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
1722
ifdef gsettings_ENUM_NAMESPACE
1723
$(gsettings__enum_file): $(gsettings_ENUM_FILES)
1724
$(AM_V_GEN) glib-mkenums --comments '\''<!-- @comment@ -->'\'' --fhead "<schemalist>" --vhead " <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod " <value nick='\''@valuenick@'\'' value='\''@valuenum@'\''/>" --vtail " </@type@>" --ftail "</schemalist>" [$]^ > [$]@.tmp && mv [$]@.tmp [$]@
1727
_GSETTINGS_SUBST(GSETTINGS_RULES)
1730
dnl _GSETTINGS_SUBST(VARIABLE)
1731
dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
1732
AC_DEFUN([_GSETTINGS_SUBST],
1735
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
1739
1739
m4_include([m4/gnome-doc-utils.m4])
1740
1740
m4_include([m4/intltool.m4])
1741
1741
m4_include([m4/libtool.m4])