461
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
462
# serial 42 IT_PROG_INTLTOOL
463
AC_DEFUN([IT_PROG_INTLTOOL], [
465
AC_REQUIRE([AM_NLS])dnl
467
case "$am__api_version" in
469
AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
475
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
476
INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
477
INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
478
if test -n "$1"; then
479
AC_MSG_CHECKING([for intltool >= $1])
480
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
481
test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
482
AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
485
AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
486
AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
487
AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
488
if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
489
AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
492
if test -z "$AM_DEFAULT_VERBOSITY"; then
493
AM_DEFAULT_VERBOSITY=1
495
AC_SUBST([AM_DEFAULT_VERBOSITY])
497
INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))'
498
INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))'
499
INTLTOOL__v_MERGE_0='@echo " ITMRG " [$]@;'
500
AC_SUBST(INTLTOOL_V_MERGE)
501
AC_SUBST(INTLTOOL__v_MERGE_)
502
AC_SUBST(INTLTOOL__v_MERGE_0)
504
INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))'
505
intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))'
506
intltool__v_merge_options_0='-q'
507
AC_SUBST(INTLTOOL_V_MERGE_OPTIONS)
508
AC_SUBST(intltool__v_merge_options_)
509
AC_SUBST(intltool__v_merge_options_0)
511
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 $< [$]@'
512
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 $< [$]@'
513
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 $< [$]@'
514
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 $< [$]@'
515
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 $< [$]@'
516
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 $< [$]@'
517
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 $< [$]@'
518
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 $< [$]@'
519
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 $< [$]@'
520
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 $< [$]@'
521
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 $< [$]@'
522
if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge 5000; then
523
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 $< [$]@'
525
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'
527
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 $< [$]@'
528
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 $< [$]@'
529
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 $< [$]@'
530
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 $< [$]@'
531
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 $< [$]@'
532
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 $< [$]@'
533
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 $< [$]@'
535
_IT_SUBST(INTLTOOL_DESKTOP_RULE)
536
_IT_SUBST(INTLTOOL_DIRECTORY_RULE)
537
_IT_SUBST(INTLTOOL_KEYS_RULE)
538
_IT_SUBST(INTLTOOL_PROP_RULE)
539
_IT_SUBST(INTLTOOL_OAF_RULE)
540
_IT_SUBST(INTLTOOL_PONG_RULE)
541
_IT_SUBST(INTLTOOL_SERVER_RULE)
542
_IT_SUBST(INTLTOOL_SHEET_RULE)
543
_IT_SUBST(INTLTOOL_SOUNDLIST_RULE)
544
_IT_SUBST(INTLTOOL_UI_RULE)
545
_IT_SUBST(INTLTOOL_XAM_RULE)
546
_IT_SUBST(INTLTOOL_KBD_RULE)
547
_IT_SUBST(INTLTOOL_XML_RULE)
548
_IT_SUBST(INTLTOOL_XML_NOMERGE_RULE)
549
_IT_SUBST(INTLTOOL_CAVES_RULE)
550
_IT_SUBST(INTLTOOL_SCHEMAS_RULE)
551
_IT_SUBST(INTLTOOL_THEME_RULE)
552
_IT_SUBST(INTLTOOL_SERVICE_RULE)
553
_IT_SUBST(INTLTOOL_POLICY_RULE)
555
# Check the gettext tools to make sure they are GNU
556
AC_PATH_PROG(XGETTEXT, xgettext)
557
AC_PATH_PROG(MSGMERGE, msgmerge)
558
AC_PATH_PROG(MSGFMT, msgfmt)
559
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
560
if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
561
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
563
xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
564
mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
565
mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
566
if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
567
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
570
AC_PATH_PROG(INTLTOOL_PERL, perl)
571
if test -z "$INTLTOOL_PERL"; then
572
AC_MSG_ERROR([perl not found])
574
AC_MSG_CHECKING([for perl >= 5.8.1])
575
$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1
576
if test $? -ne 0; then
577
AC_MSG_ERROR([perl 5.8.1 is required for intltool])
579
IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"`
580
AC_MSG_RESULT([$IT_PERL_VERSION])
582
if test "x$2" != "xno-xml"; then
583
AC_MSG_CHECKING([for XML::Parser])
584
if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
587
AC_MSG_ERROR([XML::Parser perl module is required for intltool])
591
# Substitute ALL_LINGUAS so we can use it in po/Makefile
592
AC_SUBST(ALL_LINGUAS)
594
# Set DATADIRNAME correctly if it is not set yet
595
# (copied from glib-gettext.m4)
596
if test -z "$DATADIRNAME"; then
598
[AC_LANG_PROGRAM([[]],
599
[[extern int _nl_msg_cat_cntr;
600
return _nl_msg_cat_cntr]])],
604
dnl On Solaris, if bind_textdomain_codeset is in libc,
605
dnl GNU format message catalog is always supported,
606
dnl since both are added to the libc all together.
607
dnl Hence, we'd like to go with DATADIRNAME=share
609
AC_CHECK_FUNC(bind_textdomain_codeset,
610
[DATADIRNAME=share], [DATADIRNAME=lib])
617
AC_SUBST(DATADIRNAME)
624
# IT_PO_SUBDIR(DIRNAME)
625
# ---------------------
626
# All po subdirs have to be declared with this macro; the subdir "po" is
627
# declared by IT_PROG_INTLTOOL.
629
AC_DEFUN([IT_PO_SUBDIR],
630
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
632
dnl The following CONFIG_COMMANDS should be executed at the very end
633
dnl of config.status.
634
AC_CONFIG_COMMANDS_PRE([
635
AC_CONFIG_COMMANDS([$1/stamp-it], [
636
if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then
637
AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.])
639
rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
644
'"s|^| $ac_top_srcdir/|" \
645
"$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
647
[sed '/^POTFILES =/,/[^\\]$/ {
651
' "$1/Makefile.in" >"$1/Makefile"]
652
rm -f "$1/Makefile.tmp"
653
mv "$1/stamp-it.tmp" "$1/stamp-it"
658
# _IT_SUBST(VARIABLE)
659
# -------------------
660
# Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
662
AC_DEFUN([_IT_SUBST],
665
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
670
AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
671
# A hint is needed for aclocal from Automake <= 1.9.4:
672
# AC_DEFUN([AC_PROG_INTLTOOL], ...)
675
# nls.m4 serial 5 (gettext-0.18)
676
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
678
dnl This file is free software; the Free Software Foundation
679
dnl gives unlimited permission to copy and/or distribute it,
680
dnl with or without modifications, as long as this notice is preserved.
682
dnl This file can can be used in projects which are not available under
683
dnl the GNU General Public License or the GNU Library General Public
684
dnl License but which still want to provide support for the GNU gettext
686
dnl Please note that the actual code of the GNU gettext library is covered
687
dnl by the GNU Library General Public License, and the rest of the GNU
688
dnl gettext package package is covered by the GNU General Public License.
689
dnl They are *not* in the public domain.
692
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
693
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
699
AC_MSG_CHECKING([whether NLS is requested])
700
dnl Default is enabled NLS
702
[ --disable-nls do not use Native Language Support],
703
USE_NLS=$enableval, USE_NLS=yes)
704
AC_MSG_RESULT([$USE_NLS])
459
708
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
460
709
# serial 1 (pkg-config-0.24)
617
866
])# PKG_CHECK_MODULES
620
# PKG_INSTALLDIR(DIRECTORY)
621
# -------------------------
622
# Substitutes the variable pkgconfigdir as the location where a module
623
# should install pkg-config .pc files. By default the directory is
624
# $libdir/pkgconfig, but the default can be changed by passing
625
# DIRECTORY. The user can override through the --with-pkgconfigdir
627
AC_DEFUN([PKG_INSTALLDIR],
628
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
629
m4_pushdef([pkg_description],
630
[pkg-config installation directory @<:@]pkg_default[@:>@])
631
AC_ARG_WITH([pkgconfigdir],
632
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
633
[with_pkgconfigdir=]pkg_default)
634
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
635
m4_popdef([pkg_default])
636
m4_popdef([pkg_description])
637
]) dnl PKG_INSTALLDIR
640
# PKG_NOARCH_INSTALLDIR(DIRECTORY)
641
# -------------------------
642
# Substitutes the variable noarch_pkgconfigdir as the location where a
643
# module should install arch-independent pkg-config .pc files. By
644
# default the directory is $datadir/pkgconfig, but the default can be
645
# changed by passing DIRECTORY. The user can override through the
646
# --with-noarch-pkgconfigdir parameter.
647
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
648
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
649
m4_pushdef([pkg_description],
650
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
651
AC_ARG_WITH([noarch-pkgconfigdir],
652
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
653
[with_noarch_pkgconfigdir=]pkg_default)
654
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
655
m4_popdef([pkg_default])
656
m4_popdef([pkg_description])
657
]) dnl PKG_NOARCH_INSTALLDIR
660
# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
661
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
662
# -------------------------------------------
663
# Retrieves the value of the pkg-config variable for the given module.
664
AC_DEFUN([PKG_CHECK_VAR],
665
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
666
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
668
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
669
AS_VAR_COPY([$1], [pkg_cv_][$1])
671
AS_VAR_IF([$1], [""], [$5], [$4])dnl
674
868
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
676
870
# This file is free software; the Free Software Foundation