20
20
If you have problems, you may need to regenerate the build system entirely.
21
21
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
23
# nls.m4 serial 5 (gettext-0.18)
24
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2013 Free Software Foundation,
26
dnl This file is free software; the Free Software Foundation
27
dnl gives unlimited permission to copy and/or distribute it,
28
dnl with or without modifications, as long as this notice is preserved.
30
dnl This file can can be used in projects which are not available under
31
dnl the GNU General Public License or the GNU Library General Public
32
dnl License but which still want to provide support for the GNU gettext
34
dnl Please note that the actual code of the GNU gettext library is covered
35
dnl by the GNU Library General Public License, and the rest of the GNU
36
dnl gettext package package is covered by the GNU General Public License.
37
dnl They are *not* in the public domain.
40
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
41
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
47
AC_MSG_CHECKING([whether NLS is requested])
48
dnl Default is enabled NLS
50
[ --disable-nls do not use Native Language Support],
51
USE_NLS=$enableval, USE_NLS=yes)
52
AC_MSG_RESULT([$USE_NLS])
56
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
57
# serial 1 (pkg-config-0.24)
59
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
61
# This program is free software; you can redistribute it and/or modify
62
# it under the terms of the GNU General Public License as published by
63
# the Free Software Foundation; either version 2 of the License, or
64
# (at your option) any later version.
66
# This program is distributed in the hope that it will be useful, but
67
# WITHOUT ANY WARRANTY; without even the implied warranty of
68
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
69
# General Public License for more details.
71
# You should have received a copy of the GNU General Public License
72
# along with this program; if not, write to the Free Software
73
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
75
# As a special exception to the GNU General Public License, if you
76
# distribute this file as part of a program that contains a
77
# configuration script generated by Autoconf, you may include it under
78
# the same distribution terms that you use for the rest of that program.
80
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
81
# ----------------------------------
82
AC_DEFUN([PKG_PROG_PKG_CONFIG],
83
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
84
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
85
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
86
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
87
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
88
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
90
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
91
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
93
if test -n "$PKG_CONFIG"; then
94
_pkg_min_version=m4_default([$1], [0.9.0])
95
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
96
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
103
])# PKG_PROG_PKG_CONFIG
105
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
107
# Check to see whether a particular set of modules exists. Similar
108
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
110
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
111
# only at the first occurence in configure.ac, so if the first place
112
# it's called might be skipped (such as if it is within an "if", you
113
# have to call PKG_CHECK_EXISTS manually
114
# --------------------------------------------------------------
115
AC_DEFUN([PKG_CHECK_EXISTS],
116
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
117
if test -n "$PKG_CONFIG" && \
118
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
119
m4_default([$2], [:])
120
m4_ifvaln([$3], [else
124
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
125
# ---------------------------------------------
126
m4_define([_PKG_CONFIG],
127
[if test -n "$$1"; then
129
elif test -n "$PKG_CONFIG"; then
130
PKG_CHECK_EXISTS([$3],
131
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
132
test "x$?" != "x0" && pkg_failed=yes ],
139
# _PKG_SHORT_ERRORS_SUPPORTED
140
# -----------------------------
141
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
142
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
143
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
144
_pkg_short_errors_supported=yes
146
_pkg_short_errors_supported=no
148
])# _PKG_SHORT_ERRORS_SUPPORTED
151
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
152
# [ACTION-IF-NOT-FOUND])
155
# Note that if there is a possibility the first call to
156
# PKG_CHECK_MODULES might not happen, you should be sure to include an
157
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
160
# --------------------------------------------------------------
161
AC_DEFUN([PKG_CHECK_MODULES],
162
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
163
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
164
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
167
AC_MSG_CHECKING([for $1])
169
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
170
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
172
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
173
and $1[]_LIBS to avoid the need to call pkg-config.
174
See the pkg-config man page for more details.])
176
if test $pkg_failed = yes; then
178
_PKG_SHORT_ERRORS_SUPPORTED
179
if test $_pkg_short_errors_supported = yes; then
180
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
182
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
184
# Put the nasty error message in config.log where it belongs
185
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
187
m4_default([$4], [AC_MSG_ERROR(
188
[Package requirements ($2) were not met:
192
Consider adjusting the PKG_CONFIG_PATH environment variable if you
193
installed software in a non-standard prefix.
197
elif test $pkg_failed = untried; then
199
m4_default([$4], [AC_MSG_FAILURE(
200
[The pkg-config script could not be found or is too old. Make sure it
201
is in your PATH or set the PKG_CONFIG environment variable to the full
206
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
209
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
210
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
214
])# PKG_CHECK_MODULES
217
# PKG_INSTALLDIR(DIRECTORY)
218
# -------------------------
219
# Substitutes the variable pkgconfigdir as the location where a module
220
# should install pkg-config .pc files. By default the directory is
221
# $libdir/pkgconfig, but the default can be changed by passing
222
# DIRECTORY. The user can override through the --with-pkgconfigdir
224
AC_DEFUN([PKG_INSTALLDIR],
225
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
226
m4_pushdef([pkg_description],
227
[pkg-config installation directory @<:@]pkg_default[@:>@])
228
AC_ARG_WITH([pkgconfigdir],
229
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
230
[with_pkgconfigdir=]pkg_default)
231
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
232
m4_popdef([pkg_default])
233
m4_popdef([pkg_description])
234
]) dnl PKG_INSTALLDIR
237
# PKG_NOARCH_INSTALLDIR(DIRECTORY)
238
# -------------------------
239
# Substitutes the variable noarch_pkgconfigdir as the location where a
240
# module should install arch-independent pkg-config .pc files. By
241
# default the directory is $datadir/pkgconfig, but the default can be
242
# changed by passing DIRECTORY. The user can override through the
243
# --with-noarch-pkgconfigdir parameter.
244
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
245
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
246
m4_pushdef([pkg_description],
247
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
248
AC_ARG_WITH([noarch-pkgconfigdir],
249
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
250
[with_noarch_pkgconfigdir=]pkg_default)
251
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
252
m4_popdef([pkg_default])
253
m4_popdef([pkg_description])
254
]) dnl PKG_NOARCH_INSTALLDIR
257
# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
258
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
259
# -------------------------------------------
260
# Retrieves the value of the pkg-config variable for the given module.
261
AC_DEFUN([PKG_CHECK_VAR],
262
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
263
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
265
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
266
AS_VAR_COPY([$1], [pkg_cv_][$1])
268
AS_VAR_IF([$1], [""], [$5], [$4])dnl
271
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
272
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
274
# This file is free software, distributed under the terms of the GNU
275
# General Public License. As a special exception to the GNU General
276
# Public License, this file may be distributed as part of a program
277
# that contains a configuration script generated by Autoconf, under
278
# the same distribution terms as the rest of that program.
280
# This file can be copied and used freely without restrictions. It can
281
# be used in projects which are not available under the GNU Public License
282
# but which still want to provide support for the GNU gettext functionality.
284
# Macro to add for using GNU gettext.
285
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
287
# Modified to never use included libintl.
288
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
290
# Major rework to remove unused code
291
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
293
# Added better handling of ALL_LINGUAS from GNU gettext version
294
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
296
# Modified to require ngettext
297
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
299
# We need this here as well, since someone might use autoconf-2.5x
300
# to configure GLib then an older version to configure a package
301
# using AM_GLIB_GNU_GETTEXT
305
dnl We go to great lengths to make sure that aclocal won't
306
dnl try to pull in the installed version of these macros
307
dnl when running aclocal in the glib directory.
309
m4_copy([AC_DEFUN],[glib_DEFUN])
310
m4_copy([AC_REQUIRE],[glib_REQUIRE])
312
dnl At the end, if we're not within glib, we'll define the public
313
dnl definitions in terms of our private definitions.
317
#--------------------
318
glib_DEFUN([GLIB_LC_MESSAGES],
319
[AC_CHECK_HEADERS([locale.h])
320
if test $ac_cv_header_locale_h = yes; then
321
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
322
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
323
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
324
if test $am_cv_val_LC_MESSAGES = yes; then
325
AC_DEFINE(HAVE_LC_MESSAGES, 1,
326
[Define if your <locale.h> file defines LC_MESSAGES.])
330
# GLIB_PATH_PROG_WITH_TEST
331
#----------------------------
332
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
333
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
334
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
335
[# Extract the first word of "$2", so it can be a program name with args.
336
set dummy $2; ac_word=[$]2
337
AC_MSG_CHECKING([for $ac_word])
338
AC_CACHE_VAL(ac_cv_path_$1,
341
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
344
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
345
for ac_dir in ifelse([$5], , $PATH, [$5]); do
346
test -z "$ac_dir" && ac_dir=.
347
if test -f $ac_dir/$ac_word; then
349
ac_cv_path_$1="$ac_dir/$ac_word"
355
dnl If no 4th arg is given, leave the cache variable unset,
356
dnl so AC_PATH_PROGS will keep looking.
357
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
362
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
372
glib_DEFUN([GLIB_WITH_NLS],
373
dnl NLS is obligatory
377
gt_cv_have_gettext=no
383
AC_CHECK_HEADER(libintl.h,
384
[gt_cv_func_dgettext_libintl="no"
385
libintl_extra_libs=""
388
# First check in libc
390
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
394
[return !ngettext ("","", 1)],
395
gt_cv_func_ngettext_libc=yes,
396
gt_cv_func_ngettext_libc=no)
399
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
400
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
404
[return !dgettext ("","")],
405
gt_cv_func_dgettext_libc=yes,
406
gt_cv_func_dgettext_libc=no)
410
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
411
AC_CHECK_FUNCS(bind_textdomain_codeset)
415
# If we don't have everything we want, check in libintl
417
if test "$gt_cv_func_dgettext_libc" != "yes" \
418
|| test "$gt_cv_func_ngettext_libc" != "yes" \
419
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
421
AC_CHECK_LIB(intl, bindtextdomain,
422
[AC_CHECK_LIB(intl, ngettext,
423
[AC_CHECK_LIB(intl, dgettext,
424
gt_cv_func_dgettext_libintl=yes)])])
426
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
427
AC_MSG_CHECKING([if -liconv is needed to use gettext])
429
AC_CHECK_LIB(intl, ngettext,
430
[AC_CHECK_LIB(intl, dcgettext,
431
[gt_cv_func_dgettext_libintl=yes
432
libintl_extra_libs=-liconv],
438
# If we found libintl, then check in it for bind_textdomain_codeset();
439
# we'll prefer libc if neither have bind_textdomain_codeset(),
440
# and both have dgettext and ngettext
442
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
443
glib_save_LIBS="$LIBS"
444
LIBS="$LIBS -lintl $libintl_extra_libs"
445
unset ac_cv_func_bind_textdomain_codeset
446
AC_CHECK_FUNCS(bind_textdomain_codeset)
447
LIBS="$glib_save_LIBS"
449
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
450
gt_cv_func_dgettext_libc=no
452
if test "$gt_cv_func_dgettext_libc" = "yes" \
453
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
454
gt_cv_func_dgettext_libintl=no
460
if test "$gt_cv_func_dgettext_libc" = "yes" \
461
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
462
gt_cv_have_gettext=yes
465
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
466
INTLLIBS="-lintl $libintl_extra_libs"
469
if test "$gt_cv_have_gettext" = "yes"; then
470
AC_DEFINE(HAVE_GETTEXT,1,
471
[Define if the GNU gettext() function is already present or preinstalled.])
472
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
473
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
474
if test "$MSGFMT" != "no"; then
475
glib_save_LIBS="$LIBS"
476
LIBS="$LIBS $INTLLIBS"
477
AC_CHECK_FUNCS(dcgettext)
479
AC_MSG_CHECKING([if msgfmt accepts -c])
480
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
483
"Content-Type: text/plain; charset=UTF-8\n"
484
"Project-Id-Version: test 1.0\n"
485
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
486
"Last-Translator: test <foo@bar.xx>\n"
487
"Language-Team: C <LL@li.org>\n"
488
"MIME-Version: 1.0\n"
489
"Content-Transfer-Encoding: 8bit\n"
490
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
491
AC_SUBST(MSGFMT_OPTS)
492
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
493
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
494
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
495
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
496
return _nl_msg_cat_cntr],
501
dnl On Solaris, if bind_textdomain_codeset is in libc,
502
dnl GNU format message catalog is always supported,
503
dnl since both are added to the libc all together.
504
dnl Hence, we'd like to go with DATADIRNAME=share and
505
dnl and CATOBJEXT=.gmo in this case.
506
AC_CHECK_FUNC(bind_textdomain_codeset,
521
LIBS="$glib_save_LIBS"
524
gt_cv_have_gettext=no
529
if test "$gt_cv_have_gettext" = "yes" ; then
530
AC_DEFINE(ENABLE_NLS, 1,
531
[always defined to indicate that i18n is enabled])
534
dnl Test whether we really found GNU xgettext.
535
if test "$XGETTEXT" != ":"; then
536
dnl If it is not GNU xgettext we define it as : so that the
537
dnl Makefiles still can work.
538
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
542
[found xgettext program is not GNU xgettext; ignore it])
547
# We need to process the po/ directory.
551
[case "$CONFIG_FILES" in *po/Makefile.in*)
552
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
555
dnl These rules are solely for the distribution goal. While doing this
556
dnl we only have to keep exactly one list of the available catalogs
558
for lang in $ALL_LINGUAS; do
559
GMOFILES="$GMOFILES $lang.gmo"
560
POFILES="$POFILES $lang.po"
563
dnl Make all variables we use known to autoconf.
566
AC_SUBST(DATADIRNAME)
570
AC_SUBST(PO_IN_DATADIR_TRUE)
571
AC_SUBST(PO_IN_DATADIR_FALSE)
576
# AM_GLIB_GNU_GETTEXT
577
# -------------------
578
# Do checks necessary for use of gettext. If a suitable implementation
579
# of gettext is found in either in libintl or in the C library,
580
# it will set INTLLIBS to the libraries needed for use of gettext
581
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
582
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
583
# on various variables needed by the Makefile.in.in installed by
586
glib_DEFUN([GLIB_GNU_GETTEXT],
587
[AC_REQUIRE([AC_PROG_CC])dnl
592
if test "$gt_cv_have_gettext" = "yes"; then
593
if test "x$ALL_LINGUAS" = "x"; then
596
AC_MSG_CHECKING(for catalogs to be installed)
598
for presentlang in $ALL_LINGUAS; do
600
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
601
desiredlanguages="$LINGUAS"
603
desiredlanguages="$ALL_LINGUAS"
605
for desiredlang in $desiredlanguages; do
606
# Use the presentlang catalog if desiredlang is
607
# a. equal to presentlang, or
608
# b. a variant of presentlang (because in this case,
609
# presentlang can be used as a fallback for messages
610
# which are not translated in the desiredlang catalog).
611
case "$desiredlang" in
612
"$presentlang"*) useit=yes;;
615
if test $useit = yes; then
616
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
620
AC_MSG_RESULT($LINGUAS)
623
dnl Construct list of names of catalog files to be constructed.
624
if test -n "$LINGUAS"; then
625
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
629
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
630
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
631
dnl Try to locate is.
633
if test -n "$ac_aux_dir"; then
634
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
636
if test -z "$MKINSTALLDIRS"; then
637
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
639
AC_SUBST(MKINSTALLDIRS)
641
dnl Generate list of files to be processed by xgettext which will
642
dnl be included in po/Makefile.
643
test -d po || mkdir po
644
if test "x$srcdir" != "x."; then
645
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
646
posrcprefix="$srcdir/"
648
posrcprefix="../$srcdir/"
654
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
655
< $srcdir/po/POTFILES.in > po/POTFILES
658
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
659
# -------------------------------
660
# Define VARIABLE to the location where catalog files will
661
# be installed by po/Makefile.
662
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
663
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
664
glib_save_prefix="$prefix"
665
glib_save_exec_prefix="$exec_prefix"
666
glib_save_datarootdir="$datarootdir"
667
test "x$prefix" = xNONE && prefix=$ac_default_prefix
668
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
669
datarootdir=`eval echo "${datarootdir}"`
670
if test "x$CATOBJEXT" = "x.mo" ; then
671
localedir=`eval echo "${libdir}/locale"`
673
localedir=`eval echo "${datadir}/locale"`
675
prefix="$glib_save_prefix"
676
exec_prefix="$glib_save_exec_prefix"
677
datarootdir="$glib_save_datarootdir"
678
AC_DEFINE_UNQUOTED($1, "$localedir",
679
[Define the location where the catalogs will be installed])
683
dnl Now the definitions that aclocal will find
685
ifdef(glib_configure_ac,[],[
686
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
687
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
690
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
692
# Create a temporary file with TEST-FILE as its contents and pass the
693
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
694
# 0 and perform ACTION-IF-FAIL for any other exit status.
695
AC_DEFUN([GLIB_RUN_PROG],
696
[cat >conftest.foo <<_ACEOF
699
if AC_RUN_LOG([$1 conftest.foo]); then
700
m4_ifval([$3], [$3], [:])
701
m4_ifvaln([$4], [else $4])dnl
702
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
703
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
708
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
709
dnl the schema should be compiled
712
AC_DEFUN([GLIB_GSETTINGS],
714
m4_pattern_allow([AM_V_GEN])
715
AC_ARG_ENABLE(schemas-compile,
716
AS_HELP_STRING([--disable-schemas-compile],
717
[Disable regeneration of gschemas.compiled on install]),
718
[case ${enableval} in
719
yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE="" ;;
720
no) GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;;
721
*) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;;
723
AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE])
724
PKG_PROG_PKG_CONFIG([0.16])
725
AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas])
726
if test x$cross_compiling != xyes; then
727
GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0`
729
AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas)
731
AC_SUBST(GLIB_COMPILE_SCHEMAS)
732
if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then
733
ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2])
735
ifelse([$1],,[:],[$1])
739
.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas
741
mostlyclean-am: clean-gsettings-schemas
743
gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE))
745
%.gschema.valid: %.gschema.xml $(gsettings__enum_file)
746
$(AM_V_GEN) $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$< && mkdir -p [$](@D) && touch [$]@
748
all-am: $(gsettings_SCHEMAS:.xml=.valid)
749
uninstall-am: uninstall-gsettings-schemas
750
install-data-am: install-gsettings-schemas
752
.SECONDARY: $(gsettings_SCHEMAS)
754
install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file)
756
if test -n "$^"; then \
757
test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \
758
$(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \
759
test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \
762
uninstall-gsettings-schemas:
764
@list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; test -n "$(gsettingsschemadir)" || list=; \
765
files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \
766
test -n "$$files" || exit 0; \
767
echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \
768
cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files
769
test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
771
clean-gsettings-schemas:
772
rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
774
ifdef gsettings_ENUM_NAMESPACE
775
$(gsettings__enum_file): $(gsettings_ENUM_FILES)
776
$(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 [$]@
779
_GSETTINGS_SUBST(GSETTINGS_RULES)
782
dnl _GSETTINGS_SUBST(VARIABLE)
783
dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
784
AC_DEFUN([_GSETTINGS_SUBST],
787
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
23
791
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
25
793
# This file is free software; the Free Software Foundation
1075
1843
m4_default([$2], [:])
1079
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
1080
# serial 42 IT_PROG_INTLTOOL
1081
AC_DEFUN([IT_PROG_INTLTOOL], [
1082
AC_PREREQ([2.50])dnl
1083
AC_REQUIRE([AM_NLS])dnl
1085
case "$am__api_version" in
1087
AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
1093
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
1094
INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
1095
INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
1096
if test -n "$1"; then
1097
AC_MSG_CHECKING([for intltool >= $1])
1098
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
1099
test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
1100
AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
1103
AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
1104
AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
1105
AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
1106
if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
1107
AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
1110
if test -z "$AM_DEFAULT_VERBOSITY"; then
1111
AM_DEFAULT_VERBOSITY=1
1113
AC_SUBST([AM_DEFAULT_VERBOSITY])
1115
INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))'
1116
INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))'
1117
INTLTOOL__v_MERGE_0='@echo " ITMRG " [$]@;'
1118
AC_SUBST(INTLTOOL_V_MERGE)
1119
AC_SUBST(INTLTOOL__v_MERGE_)
1120
AC_SUBST(INTLTOOL__v_MERGE_0)
1122
INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))'
1123
intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))'
1124
intltool__v_merge_options_0='-q'
1125
AC_SUBST(INTLTOOL_V_MERGE_OPTIONS)
1126
AC_SUBST(intltool__v_merge_options_)
1127
AC_SUBST(intltool__v_merge_options_0)
1129
INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1130
INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1131
INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1132
INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1133
INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -p $(top_srcdir)/po $< [$]@'
1134
INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1135
INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1136
INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1137
INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1138
INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1139
INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1140
if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge 5000; then
1141
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u --no-translations $< [$]@'
1143
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.[$][$]RANDOM && mkdir [$][$]_it_tmp_dir && LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u [$][$]_it_tmp_dir $< [$]@ && rmdir [$][$]_it_tmp_dir'
1145
INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1146
INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1147
INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1148
INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1149
INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1150
INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1151
INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1153
_IT_SUBST(INTLTOOL_DESKTOP_RULE)
1154
_IT_SUBST(INTLTOOL_DIRECTORY_RULE)
1155
_IT_SUBST(INTLTOOL_KEYS_RULE)
1156
_IT_SUBST(INTLTOOL_PROP_RULE)
1157
_IT_SUBST(INTLTOOL_OAF_RULE)
1158
_IT_SUBST(INTLTOOL_PONG_RULE)
1159
_IT_SUBST(INTLTOOL_SERVER_RULE)
1160
_IT_SUBST(INTLTOOL_SHEET_RULE)
1161
_IT_SUBST(INTLTOOL_SOUNDLIST_RULE)
1162
_IT_SUBST(INTLTOOL_UI_RULE)
1163
_IT_SUBST(INTLTOOL_XAM_RULE)
1164
_IT_SUBST(INTLTOOL_KBD_RULE)
1165
_IT_SUBST(INTLTOOL_XML_RULE)
1166
_IT_SUBST(INTLTOOL_XML_NOMERGE_RULE)
1167
_IT_SUBST(INTLTOOL_CAVES_RULE)
1168
_IT_SUBST(INTLTOOL_SCHEMAS_RULE)
1169
_IT_SUBST(INTLTOOL_THEME_RULE)
1170
_IT_SUBST(INTLTOOL_SERVICE_RULE)
1171
_IT_SUBST(INTLTOOL_POLICY_RULE)
1173
# Check the gettext tools to make sure they are GNU
1174
AC_PATH_PROG(XGETTEXT, xgettext)
1175
AC_PATH_PROG(MSGMERGE, msgmerge)
1176
AC_PATH_PROG(MSGFMT, msgfmt)
1177
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1178
if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
1179
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
1181
xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
1182
mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
1183
mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
1184
if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
1185
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
1188
AC_PATH_PROG(INTLTOOL_PERL, perl)
1189
if test -z "$INTLTOOL_PERL"; then
1190
AC_MSG_ERROR([perl not found])
1192
AC_MSG_CHECKING([for perl >= 5.8.1])
1193
$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1
1194
if test $? -ne 0; then
1195
AC_MSG_ERROR([perl 5.8.1 is required for intltool])
1197
IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"`
1198
AC_MSG_RESULT([$IT_PERL_VERSION])
1200
if test "x$2" != "xno-xml"; then
1201
AC_MSG_CHECKING([for XML::Parser])
1202
if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
1205
AC_MSG_ERROR([XML::Parser perl module is required for intltool])
1209
# Substitute ALL_LINGUAS so we can use it in po/Makefile
1210
AC_SUBST(ALL_LINGUAS)
1212
# Set DATADIRNAME correctly if it is not set yet
1213
# (copied from glib-gettext.m4)
1214
if test -z "$DATADIRNAME"; then
1216
[AC_LANG_PROGRAM([[]],
1217
[[extern int _nl_msg_cat_cntr;
1218
return _nl_msg_cat_cntr]])],
1219
[DATADIRNAME=share],
1222
dnl On Solaris, if bind_textdomain_codeset is in libc,
1223
dnl GNU format message catalog is always supported,
1224
dnl since both are added to the libc all together.
1225
dnl Hence, we'd like to go with DATADIRNAME=share
1227
AC_CHECK_FUNC(bind_textdomain_codeset,
1228
[DATADIRNAME=share], [DATADIRNAME=lib])
1235
AC_SUBST(DATADIRNAME)
1242
# IT_PO_SUBDIR(DIRNAME)
1243
# ---------------------
1244
# All po subdirs have to be declared with this macro; the subdir "po" is
1245
# declared by IT_PROG_INTLTOOL.
1247
AC_DEFUN([IT_PO_SUBDIR],
1248
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
1250
dnl The following CONFIG_COMMANDS should be executed at the very end
1251
dnl of config.status.
1252
AC_CONFIG_COMMANDS_PRE([
1253
AC_CONFIG_COMMANDS([$1/stamp-it], [
1254
if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then
1255
AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.])
1257
rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
1262
'"s|^| $ac_top_srcdir/|" \
1263
"$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
1265
[sed '/^POTFILES =/,/[^\\]$/ {
1269
' "$1/Makefile.in" >"$1/Makefile"]
1270
rm -f "$1/Makefile.tmp"
1271
mv "$1/stamp-it.tmp" "$1/stamp-it"
1276
# _IT_SUBST(VARIABLE)
1277
# -------------------
1278
# Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
1280
AC_DEFUN([_IT_SUBST],
1283
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
1288
AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
1289
# A hint is needed for aclocal from Automake <= 1.9.4:
1290
# AC_DEFUN([AC_PROG_INTLTOOL], ...)
1293
# nls.m4 serial 5 (gettext-0.18)
1294
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2013 Free Software Foundation,
1296
dnl This file is free software; the Free Software Foundation
1297
dnl gives unlimited permission to copy and/or distribute it,
1298
dnl with or without modifications, as long as this notice is preserved.
1300
dnl This file can can be used in projects which are not available under
1301
dnl the GNU General Public License or the GNU Library General Public
1302
dnl License but which still want to provide support for the GNU gettext
1304
dnl Please note that the actual code of the GNU gettext library is covered
1305
dnl by the GNU Library General Public License, and the rest of the GNU
1306
dnl gettext package package is covered by the GNU General Public License.
1307
dnl They are *not* in the public domain.
1310
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1311
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1317
AC_MSG_CHECKING([whether NLS is requested])
1318
dnl Default is enabled NLS
1319
AC_ARG_ENABLE([nls],
1320
[ --disable-nls do not use Native Language Support],
1321
USE_NLS=$enableval, USE_NLS=yes)
1322
AC_MSG_RESULT([$USE_NLS])
1326
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1327
# serial 1 (pkg-config-0.24)
1329
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1331
# This program is free software; you can redistribute it and/or modify
1332
# it under the terms of the GNU General Public License as published by
1333
# the Free Software Foundation; either version 2 of the License, or
1334
# (at your option) any later version.
1336
# This program is distributed in the hope that it will be useful, but
1337
# WITHOUT ANY WARRANTY; without even the implied warranty of
1338
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1339
# General Public License for more details.
1341
# You should have received a copy of the GNU General Public License
1342
# along with this program; if not, write to the Free Software
1343
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1345
# As a special exception to the GNU General Public License, if you
1346
# distribute this file as part of a program that contains a
1347
# configuration script generated by Autoconf, you may include it under
1348
# the same distribution terms that you use for the rest of that program.
1350
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1351
# ----------------------------------
1352
AC_DEFUN([PKG_PROG_PKG_CONFIG],
1353
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1354
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
1355
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
1356
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1357
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1358
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1360
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1361
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1363
if test -n "$PKG_CONFIG"; then
1364
_pkg_min_version=m4_default([$1], [0.9.0])
1365
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1366
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1367
AC_MSG_RESULT([yes])
1373
])# PKG_PROG_PKG_CONFIG
1375
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1377
# Check to see whether a particular set of modules exists. Similar
1378
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1380
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1381
# only at the first occurence in configure.ac, so if the first place
1382
# it's called might be skipped (such as if it is within an "if", you
1383
# have to call PKG_CHECK_EXISTS manually
1384
# --------------------------------------------------------------
1385
AC_DEFUN([PKG_CHECK_EXISTS],
1386
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1387
if test -n "$PKG_CONFIG" && \
1388
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1389
m4_default([$2], [:])
1390
m4_ifvaln([$3], [else
1394
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1395
# ---------------------------------------------
1396
m4_define([_PKG_CONFIG],
1397
[if test -n "$$1"; then
1399
elif test -n "$PKG_CONFIG"; then
1400
PKG_CHECK_EXISTS([$3],
1401
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
1402
test "x$?" != "x0" && pkg_failed=yes ],
1409
# _PKG_SHORT_ERRORS_SUPPORTED
1410
# -----------------------------
1411
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1412
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1413
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1414
_pkg_short_errors_supported=yes
1416
_pkg_short_errors_supported=no
1418
])# _PKG_SHORT_ERRORS_SUPPORTED
1421
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1422
# [ACTION-IF-NOT-FOUND])
1425
# Note that if there is a possibility the first call to
1426
# PKG_CHECK_MODULES might not happen, you should be sure to include an
1427
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1430
# --------------------------------------------------------------
1431
AC_DEFUN([PKG_CHECK_MODULES],
1432
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1433
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1434
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1437
AC_MSG_CHECKING([for $1])
1439
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1440
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1442
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1443
and $1[]_LIBS to avoid the need to call pkg-config.
1444
See the pkg-config man page for more details.])
1446
if test $pkg_failed = yes; then
1448
_PKG_SHORT_ERRORS_SUPPORTED
1449
if test $_pkg_short_errors_supported = yes; then
1450
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
1452
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
1454
# Put the nasty error message in config.log where it belongs
1455
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1457
m4_default([$4], [AC_MSG_ERROR(
1458
[Package requirements ($2) were not met:
1462
Consider adjusting the PKG_CONFIG_PATH environment variable if you
1463
installed software in a non-standard prefix.
1467
elif test $pkg_failed = untried; then
1469
m4_default([$4], [AC_MSG_FAILURE(
1470
[The pkg-config script could not be found or is too old. Make sure it
1471
is in your PATH or set the PKG_CONFIG environment variable to the full
1476
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
1479
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1480
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1481
AC_MSG_RESULT([yes])
1484
])# PKG_CHECK_MODULES
1487
# PKG_INSTALLDIR(DIRECTORY)
1488
# -------------------------
1489
# Substitutes the variable pkgconfigdir as the location where a module
1490
# should install pkg-config .pc files. By default the directory is
1491
# $libdir/pkgconfig, but the default can be changed by passing
1492
# DIRECTORY. The user can override through the --with-pkgconfigdir
1494
AC_DEFUN([PKG_INSTALLDIR],
1495
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
1496
m4_pushdef([pkg_description],
1497
[pkg-config installation directory @<:@]pkg_default[@:>@])
1498
AC_ARG_WITH([pkgconfigdir],
1499
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
1500
[with_pkgconfigdir=]pkg_default)
1501
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
1502
m4_popdef([pkg_default])
1503
m4_popdef([pkg_description])
1504
]) dnl PKG_INSTALLDIR
1507
# PKG_NOARCH_INSTALLDIR(DIRECTORY)
1508
# -------------------------
1509
# Substitutes the variable noarch_pkgconfigdir as the location where a
1510
# module should install arch-independent pkg-config .pc files. By
1511
# default the directory is $datadir/pkgconfig, but the default can be
1512
# changed by passing DIRECTORY. The user can override through the
1513
# --with-noarch-pkgconfigdir parameter.
1514
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
1515
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
1516
m4_pushdef([pkg_description],
1517
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
1518
AC_ARG_WITH([noarch-pkgconfigdir],
1519
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
1520
[with_noarch_pkgconfigdir=]pkg_default)
1521
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
1522
m4_popdef([pkg_default])
1523
m4_popdef([pkg_description])
1524
]) dnl PKG_NOARCH_INSTALLDIR
1527
# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
1528
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1529
# -------------------------------------------
1530
# Retrieves the value of the pkg-config variable for the given module.
1531
AC_DEFUN([PKG_CHECK_VAR],
1532
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1533
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
1535
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
1536
AS_VAR_COPY([$1], [pkg_cv_][$1])
1538
AS_VAR_IF([$1], [""], [$5], [$4])dnl
1541
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
1542
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
1544
# This file is free software, distributed under the terms of the GNU
1545
# General Public License. As a special exception to the GNU General
1546
# Public License, this file may be distributed as part of a program
1547
# that contains a configuration script generated by Autoconf, under
1548
# the same distribution terms as the rest of that program.
1550
# This file can be copied and used freely without restrictions. It can
1551
# be used in projects which are not available under the GNU Public License
1552
# but which still want to provide support for the GNU gettext functionality.
1554
# Macro to add for using GNU gettext.
1555
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
1557
# Modified to never use included libintl.
1558
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
1560
# Major rework to remove unused code
1561
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
1563
# Added better handling of ALL_LINGUAS from GNU gettext version
1564
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
1566
# Modified to require ngettext
1567
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
1569
# We need this here as well, since someone might use autoconf-2.5x
1570
# to configure GLib then an older version to configure a package
1571
# using AM_GLIB_GNU_GETTEXT
1575
dnl We go to great lengths to make sure that aclocal won't
1576
dnl try to pull in the installed version of these macros
1577
dnl when running aclocal in the glib directory.
1579
m4_copy([AC_DEFUN],[glib_DEFUN])
1580
m4_copy([AC_REQUIRE],[glib_REQUIRE])
1582
dnl At the end, if we're not within glib, we'll define the public
1583
dnl definitions in terms of our private definitions.
1587
#--------------------
1588
glib_DEFUN([GLIB_LC_MESSAGES],
1589
[AC_CHECK_HEADERS([locale.h])
1590
if test $ac_cv_header_locale_h = yes; then
1591
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1592
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1593
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1594
if test $am_cv_val_LC_MESSAGES = yes; then
1595
AC_DEFINE(HAVE_LC_MESSAGES, 1,
1596
[Define if your <locale.h> file defines LC_MESSAGES.])
1600
# GLIB_PATH_PROG_WITH_TEST
1601
#----------------------------
1602
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1603
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1604
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
1605
[# Extract the first word of "$2", so it can be a program name with args.
1606
set dummy $2; ac_word=[$]2
1607
AC_MSG_CHECKING([for $ac_word])
1608
AC_CACHE_VAL(ac_cv_path_$1,
1611
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1614
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1615
for ac_dir in ifelse([$5], , $PATH, [$5]); do
1616
test -z "$ac_dir" && ac_dir=.
1617
if test -f $ac_dir/$ac_word; then
1619
ac_cv_path_$1="$ac_dir/$ac_word"
1625
dnl If no 4th arg is given, leave the cache variable unset,
1626
dnl so AC_PATH_PROGS will keep looking.
1627
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1632
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1633
AC_MSG_RESULT([$]$1)
1642
glib_DEFUN([GLIB_WITH_NLS],
1643
dnl NLS is obligatory
1647
gt_cv_have_gettext=no
1653
AC_CHECK_HEADER(libintl.h,
1654
[gt_cv_func_dgettext_libintl="no"
1655
libintl_extra_libs=""
1658
# First check in libc
1660
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
1662
#include <libintl.h>
1664
[return !ngettext ("","", 1)],
1665
gt_cv_func_ngettext_libc=yes,
1666
gt_cv_func_ngettext_libc=no)
1669
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1670
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
1672
#include <libintl.h>
1674
[return !dgettext ("","")],
1675
gt_cv_func_dgettext_libc=yes,
1676
gt_cv_func_dgettext_libc=no)
1680
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1681
AC_CHECK_FUNCS(bind_textdomain_codeset)
1685
# If we don't have everything we want, check in libintl
1687
if test "$gt_cv_func_dgettext_libc" != "yes" \
1688
|| test "$gt_cv_func_ngettext_libc" != "yes" \
1689
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
1691
AC_CHECK_LIB(intl, bindtextdomain,
1692
[AC_CHECK_LIB(intl, ngettext,
1693
[AC_CHECK_LIB(intl, dgettext,
1694
gt_cv_func_dgettext_libintl=yes)])])
1696
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
1697
AC_MSG_CHECKING([if -liconv is needed to use gettext])
1699
AC_CHECK_LIB(intl, ngettext,
1700
[AC_CHECK_LIB(intl, dcgettext,
1701
[gt_cv_func_dgettext_libintl=yes
1702
libintl_extra_libs=-liconv],
1708
# If we found libintl, then check in it for bind_textdomain_codeset();
1709
# we'll prefer libc if neither have bind_textdomain_codeset(),
1710
# and both have dgettext and ngettext
1712
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
1713
glib_save_LIBS="$LIBS"
1714
LIBS="$LIBS -lintl $libintl_extra_libs"
1715
unset ac_cv_func_bind_textdomain_codeset
1716
AC_CHECK_FUNCS(bind_textdomain_codeset)
1717
LIBS="$glib_save_LIBS"
1719
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
1720
gt_cv_func_dgettext_libc=no
1722
if test "$gt_cv_func_dgettext_libc" = "yes" \
1723
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
1724
gt_cv_func_dgettext_libintl=no
1730
if test "$gt_cv_func_dgettext_libc" = "yes" \
1731
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
1732
gt_cv_have_gettext=yes
1735
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
1736
INTLLIBS="-lintl $libintl_extra_libs"
1739
if test "$gt_cv_have_gettext" = "yes"; then
1740
AC_DEFINE(HAVE_GETTEXT,1,
1741
[Define if the GNU gettext() function is already present or preinstalled.])
1742
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1743
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
1744
if test "$MSGFMT" != "no"; then
1745
glib_save_LIBS="$LIBS"
1746
LIBS="$LIBS $INTLLIBS"
1747
AC_CHECK_FUNCS(dcgettext)
1749
AC_MSG_CHECKING([if msgfmt accepts -c])
1750
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
1753
"Content-Type: text/plain; charset=UTF-8\n"
1754
"Project-Id-Version: test 1.0\n"
1755
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
1756
"Last-Translator: test <foo@bar.xx>\n"
1757
"Language-Team: C <LL@li.org>\n"
1758
"MIME-Version: 1.0\n"
1759
"Content-Transfer-Encoding: 8bit\n"
1760
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
1761
AC_SUBST(MSGFMT_OPTS)
1762
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1763
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1764
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1765
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
1766
return _nl_msg_cat_cntr],
1771
dnl On Solaris, if bind_textdomain_codeset is in libc,
1772
dnl GNU format message catalog is always supported,
1773
dnl since both are added to the libc all together.
1774
dnl Hence, we'd like to go with DATADIRNAME=share and
1775
dnl and CATOBJEXT=.gmo in this case.
1776
AC_CHECK_FUNC(bind_textdomain_codeset,
1791
LIBS="$glib_save_LIBS"
1794
gt_cv_have_gettext=no
1799
if test "$gt_cv_have_gettext" = "yes" ; then
1800
AC_DEFINE(ENABLE_NLS, 1,
1801
[always defined to indicate that i18n is enabled])
1804
dnl Test whether we really found GNU xgettext.
1805
if test "$XGETTEXT" != ":"; then
1806
dnl If it is not GNU xgettext we define it as : so that the
1807
dnl Makefiles still can work.
1808
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
1812
[found xgettext program is not GNU xgettext; ignore it])
1817
# We need to process the po/ directory.
1821
[case "$CONFIG_FILES" in *po/Makefile.in*)
1822
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
1825
dnl These rules are solely for the distribution goal. While doing this
1826
dnl we only have to keep exactly one list of the available catalogs
1827
dnl in configure.ac.
1828
for lang in $ALL_LINGUAS; do
1829
GMOFILES="$GMOFILES $lang.gmo"
1830
POFILES="$POFILES $lang.po"
1833
dnl Make all variables we use known to autoconf.
1836
AC_SUBST(DATADIRNAME)
1838
AC_SUBST(INSTOBJEXT)
1840
AC_SUBST(PO_IN_DATADIR_TRUE)
1841
AC_SUBST(PO_IN_DATADIR_FALSE)
1846
# AM_GLIB_GNU_GETTEXT
1847
# -------------------
1848
# Do checks necessary for use of gettext. If a suitable implementation
1849
# of gettext is found in either in libintl or in the C library,
1850
# it will set INTLLIBS to the libraries needed for use of gettext
1851
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
1852
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
1853
# on various variables needed by the Makefile.in.in installed by
1856
glib_DEFUN([GLIB_GNU_GETTEXT],
1857
[AC_REQUIRE([AC_PROG_CC])dnl
1862
if test "$gt_cv_have_gettext" = "yes"; then
1863
if test "x$ALL_LINGUAS" = "x"; then
1866
AC_MSG_CHECKING(for catalogs to be installed)
1868
for presentlang in $ALL_LINGUAS; do
1870
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
1871
desiredlanguages="$LINGUAS"
1873
desiredlanguages="$ALL_LINGUAS"
1875
for desiredlang in $desiredlanguages; do
1876
# Use the presentlang catalog if desiredlang is
1877
# a. equal to presentlang, or
1878
# b. a variant of presentlang (because in this case,
1879
# presentlang can be used as a fallback for messages
1880
# which are not translated in the desiredlang catalog).
1881
case "$desiredlang" in
1882
"$presentlang"*) useit=yes;;
1885
if test $useit = yes; then
1886
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1889
LINGUAS=$NEW_LINGUAS
1890
AC_MSG_RESULT($LINGUAS)
1893
dnl Construct list of names of catalog files to be constructed.
1894
if test -n "$LINGUAS"; then
1895
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1899
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1900
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
1901
dnl Try to locate is.
1903
if test -n "$ac_aux_dir"; then
1904
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1906
if test -z "$MKINSTALLDIRS"; then
1907
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1909
AC_SUBST(MKINSTALLDIRS)
1911
dnl Generate list of files to be processed by xgettext which will
1912
dnl be included in po/Makefile.
1913
test -d po || mkdir po
1914
if test "x$srcdir" != "x."; then
1915
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
1916
posrcprefix="$srcdir/"
1918
posrcprefix="../$srcdir/"
1924
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
1925
< $srcdir/po/POTFILES.in > po/POTFILES
1928
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
1929
# -------------------------------
1930
# Define VARIABLE to the location where catalog files will
1931
# be installed by po/Makefile.
1932
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
1933
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
1934
glib_save_prefix="$prefix"
1935
glib_save_exec_prefix="$exec_prefix"
1936
glib_save_datarootdir="$datarootdir"
1937
test "x$prefix" = xNONE && prefix=$ac_default_prefix
1938
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
1939
datarootdir=`eval echo "${datarootdir}"`
1940
if test "x$CATOBJEXT" = "x.mo" ; then
1941
localedir=`eval echo "${libdir}/locale"`
1943
localedir=`eval echo "${datadir}/locale"`
1945
prefix="$glib_save_prefix"
1946
exec_prefix="$glib_save_exec_prefix"
1947
datarootdir="$glib_save_datarootdir"
1948
AC_DEFINE_UNQUOTED($1, "$localedir",
1949
[Define the location where the catalogs will be installed])
1953
dnl Now the definitions that aclocal will find
1955
ifdef(glib_configure_ac,[],[
1956
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
1957
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
1960
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
1962
# Create a temporary file with TEST-FILE as its contents and pass the
1963
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
1964
# 0 and perform ACTION-IF-FAIL for any other exit status.
1965
AC_DEFUN([GLIB_RUN_PROG],
1966
[cat >conftest.foo <<_ACEOF
1969
if AC_RUN_LOG([$1 conftest.foo]); then
1970
m4_ifval([$3], [$3], [:])
1971
m4_ifvaln([$4], [else $4])dnl
1972
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
1973
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
1978
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
1979
dnl the schema should be compiled
1982
AC_DEFUN([GLIB_GSETTINGS],
1984
m4_pattern_allow([AM_V_GEN])
1985
AC_ARG_ENABLE(schemas-compile,
1986
AS_HELP_STRING([--disable-schemas-compile],
1987
[Disable regeneration of gschemas.compiled on install]),
1988
[case ${enableval} in
1989
yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE="" ;;
1990
no) GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;;
1991
*) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;;
1993
AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE])
1994
PKG_PROG_PKG_CONFIG([0.16])
1995
AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas])
1996
if test x$cross_compiling != xyes; then
1997
GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0`
1999
AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas)
2001
AC_SUBST(GLIB_COMPILE_SCHEMAS)
2002
if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then
2003
ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2])
2005
ifelse([$1],,[:],[$1])
2009
.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas
2011
mostlyclean-am: clean-gsettings-schemas
2013
gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE))
2015
%.gschema.valid: %.gschema.xml $(gsettings__enum_file)
2016
$(AM_V_GEN) $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$< && mkdir -p [$](@D) && touch [$]@
2018
all-am: $(gsettings_SCHEMAS:.xml=.valid)
2019
uninstall-am: uninstall-gsettings-schemas
2020
install-data-am: install-gsettings-schemas
2022
.SECONDARY: $(gsettings_SCHEMAS)
2024
install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file)
2026
if test -n "$^"; then \
2027
test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \
2028
$(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \
2029
test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \
2032
uninstall-gsettings-schemas:
2033
@$(NORMAL_UNINSTALL)
2034
@list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; test -n "$(gsettingsschemadir)" || list=; \
2035
files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \
2036
test -n "$$files" || exit 0; \
2037
echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \
2038
cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files
2039
test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
2041
clean-gsettings-schemas:
2042
rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
2044
ifdef gsettings_ENUM_NAMESPACE
2045
$(gsettings__enum_file): $(gsettings_ENUM_FILES)
2046
$(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 [$]@
2049
_GSETTINGS_SUBST(GSETTINGS_RULES)
2052
dnl _GSETTINGS_SUBST(VARIABLE)
2053
dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
2054
AC_DEFUN([_GSETTINGS_SUBST],
2057
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
2061
dnl -*- mode: autoconf -*-
2066
dnl GTK_DOC_CHECK([minimum-gtk-doc-version])
2067
AC_DEFUN([GTK_DOC_CHECK],
2069
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2070
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
2071
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
2073
ifelse([$1],[],[gtk_doc_requires="gtk-doc"],[gtk_doc_requires="gtk-doc >= $1"])
2074
AC_MSG_CHECKING([for gtk-doc])
2075
PKG_CHECK_EXISTS([$gtk_doc_requires],[have_gtk_doc=yes],[have_gtk_doc=no])
2076
AC_MSG_RESULT($have_gtk_doc)
2078
if test "$have_gtk_doc" = "no"; then
2080
You will not be able to create source packages with 'make dist'
2081
because $gtk_doc_requires is not found.])
2084
dnl check for tools we added during development
2085
dnl Use AC_CHECK_PROG to avoid the check target using an absolute path that
2086
dnl may not be writable by the user. Currently, automake requires that the
2087
dnl test name must end in '.test'.
2088
dnl https://bugzilla.gnome.org/show_bug.cgi?id=701638
2089
AC_CHECK_PROG([GTKDOC_CHECK],[gtkdoc-check],[gtkdoc-check.test])
2090
AC_PATH_PROG([GTKDOC_CHECK_PATH],[gtkdoc-check])
2091
AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true])
2092
AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf])
2094
dnl for overriding the documentation installation directory
2095
AC_ARG_WITH([html-dir],
2096
AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
2097
[with_html_dir='${datadir}/gtk-doc/html'])
2098
HTML_DIR="$with_html_dir"
2099
AC_SUBST([HTML_DIR])
2101
dnl enable/disable documentation building
2102
AC_ARG_ENABLE([gtk-doc],
2103
AS_HELP_STRING([--enable-gtk-doc],
2104
[use gtk-doc to build documentation [[default=no]]]),,
2105
[enable_gtk_doc=no])
2107
AC_MSG_CHECKING([whether to build gtk-doc documentation])
2108
AC_MSG_RESULT($enable_gtk_doc)
2110
if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then
2112
You must have $gtk_doc_requires installed to build documentation for
2113
$PACKAGE_NAME. Please install gtk-doc or disable building the
2114
documentation by adding '--disable-gtk-doc' to '[$]0'.])
2117
dnl don't check for glib if we build glib
2118
if test "x$PACKAGE_NAME" != "xglib"; then
2119
dnl don't fail if someone does not have glib
2120
PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,[:])
2123
dnl enable/disable output formats
2124
AC_ARG_ENABLE([gtk-doc-html],
2125
AS_HELP_STRING([--enable-gtk-doc-html],
2126
[build documentation in html format [[default=yes]]]),,
2127
[enable_gtk_doc_html=yes])
2128
AC_ARG_ENABLE([gtk-doc-pdf],
2129
AS_HELP_STRING([--enable-gtk-doc-pdf],
2130
[build documentation in pdf format [[default=no]]]),,
2131
[enable_gtk_doc_pdf=no])
2133
if test -z "$GTKDOC_MKPDF"; then
2134
enable_gtk_doc_pdf=no
2137
if test -z "$AM_DEFAULT_VERBOSITY"; then
2138
AM_DEFAULT_VERBOSITY=1
2140
AC_SUBST([AM_DEFAULT_VERBOSITY])
2142
AM_CONDITIONAL([HAVE_GTK_DOC], [test x$have_gtk_doc = xyes])
2143
AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes])
2144
AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes])
2145
AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes])
2146
AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"])
2147
AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"])
1846
m4_include([m4/gtk-doc.m4])
1847
m4_include([m4/intltool.m4])