1# generated automatically by aclocal 1.11 -*- Autoconf -*-
2
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14m4_ifndef([AC_AUTOCONF_VERSION],
15  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
17[m4_warning([this file was generated for autoconf 2.63.
18You have another version of autoconf.  It may work, but is not guaranteed to.
19If you have problems, you may need to regenerate the build system entirely.
20To do so, use the procedure documented by the package, typically `autoreconf'.])])
21
22# Copyright (C) 1995-2002 Free Software Foundation, Inc.
23# Copyright (C) 2001-2003,2004 Red Hat, Inc.
24#
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.
30#
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.
34#
35# Macro to add for using GNU gettext.
36# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
37#
38# Modified to never use included libintl.
39# Owen Taylor <otaylor@redhat.com>, 12/15/1998
40#
41# Major rework to remove unused code
42# Owen Taylor <otaylor@redhat.com>, 12/11/2002
43#
44# Added better handling of ALL_LINGUAS from GNU gettext version
45# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
46#
47# Modified to require ngettext
48# Matthias Clasen <mclasen@redhat.com> 08/06/2004
49#
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
53AC_PREREQ(2.53)
54
55dnl
56dnl We go to great lengths to make sure that aclocal won't
57dnl try to pull in the installed version of these macros
58dnl when running aclocal in the glib directory.
59dnl
60m4_copy([AC_DEFUN],[glib_DEFUN])
61m4_copy([AC_REQUIRE],[glib_REQUIRE])
62dnl
63dnl At the end, if we're not within glib, we'll define the public
64dnl definitions in terms of our private definitions.
65dnl
66
67# GLIB_LC_MESSAGES
68#--------------------
69glib_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.])
78    fi
79  fi])
80
81# GLIB_PATH_PROG_WITH_TEST
82#----------------------------
83dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
84dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
85glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
86[# Extract the first word of "$2", so it can be a program name with args.
87set dummy $2; ac_word=[$]2
88AC_MSG_CHECKING([for $ac_word])
89AC_CACHE_VAL(ac_cv_path_$1,
90[case "[$]$1" in
91  /*)
92  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
93  ;;
94  *)
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
99      if [$3]; then
100	ac_cv_path_$1="$ac_dir/$ac_word"
101	break
102      fi
103    fi
104  done
105  IFS="$ac_save_ifs"
106dnl If no 4th arg is given, leave the cache variable unset,
107dnl so AC_PATH_PROGS will keep looking.
108ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
109])dnl
110  ;;
111esac])dnl
112$1="$ac_cv_path_$1"
113if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
114  AC_MSG_RESULT([$]$1)
115else
116  AC_MSG_RESULT(no)
117fi
118AC_SUBST($1)dnl
119])
120
121# GLIB_WITH_NLS
122#-----------------
123glib_DEFUN([GLIB_WITH_NLS],
124  dnl NLS is obligatory
125  [USE_NLS=yes
126    AC_SUBST(USE_NLS)
127
128    gt_cv_have_gettext=no
129
130    CATOBJEXT=NONE
131    XGETTEXT=:
132    INTLLIBS=
133
134    AC_CHECK_HEADER(libintl.h,
135     [gt_cv_func_dgettext_libintl="no"
136      libintl_extra_libs=""
137
138      #
139      # First check in libc
140      #
141      AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
142        [AC_TRY_LINK([
143#include <libintl.h>
144],
145         [return !ngettext ("","", 1)],
146	  gt_cv_func_ngettext_libc=yes,
147          gt_cv_func_ngettext_libc=no)
148        ])
149
150      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
151	      AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
152        	[AC_TRY_LINK([
153#include <libintl.h>
154],
155	          [return !dgettext ("","")],
156		  gt_cv_func_dgettext_libc=yes,
157	          gt_cv_func_dgettext_libc=no)
158        	])
159      fi
160
161      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
162        AC_CHECK_FUNCS(bind_textdomain_codeset)
163      fi
164
165      #
166      # If we don't have everything we want, check in libintl
167      #
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
171
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)])])
176
177	if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
178	  AC_MSG_CHECKING([if -liconv is needed to use gettext])
179	  AC_MSG_RESULT([])
180  	  AC_CHECK_LIB(intl, ngettext,
181          	[AC_CHECK_LIB(intl, dcgettext,
182		       [gt_cv_func_dgettext_libintl=yes
183			libintl_extra_libs=-liconv],
184			:,-liconv)],
185		:,-liconv)
186        fi
187
188        #
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
192        #
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"
199
200          if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
201            gt_cv_func_dgettext_libc=no
202          else
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
206            fi
207          fi
208        fi
209      fi
210
211      if test "$gt_cv_func_dgettext_libc" = "yes" \
212	|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
213        gt_cv_have_gettext=yes
214      fi
215
216      if test "$gt_cv_func_dgettext_libintl" = "yes"; then
217        INTLLIBS="-lintl $libintl_extra_libs"
218      fi
219
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)
229	  MSGFMT_OPTS=
230	  AC_MSG_CHECKING([if msgfmt accepts -c])
231	  GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
232msgid ""
233msgstr ""
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],
248	    [CATOBJEXT=.gmo
249             DATADIRNAME=share],
250	    [case $host in
251	    *-*-solaris*)
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,
258	      [CATOBJEXT=.gmo
259               DATADIRNAME=share],
260	      [CATOBJEXT=.mo
261               DATADIRNAME=lib])
262	    ;;
263	    *)
264	    CATOBJEXT=.mo
265            DATADIRNAME=lib
266	    ;;
267	    esac])
268          LIBS="$glib_save_LIBS"
269	  INSTOBJEXT=.mo
270	else
271	  gt_cv_have_gettext=no
272	fi
273      fi
274    ])
275
276    if test "$gt_cv_have_gettext" = "yes" ; then
277      AC_DEFINE(ENABLE_NLS, 1,
278        [always defined to indicate that i18n is enabled])
279    fi
280
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
286        : ;
287      else
288        AC_MSG_RESULT(
289	  [found xgettext program is not GNU xgettext; ignore it])
290        XGETTEXT=":"
291      fi
292    fi
293
294    # We need to process the po/ directory.
295    POSUB=po
296
297    AC_OUTPUT_COMMANDS(
298      [case "$CONFIG_FILES" in *po/Makefile.in*)
299        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
300      esac])
301
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
304    dnl in configure.in.
305    for lang in $ALL_LINGUAS; do
306      GMOFILES="$GMOFILES $lang.gmo"
307      POFILES="$POFILES $lang.po"
308    done
309
310    dnl Make all variables we use known to autoconf.
311    AC_SUBST(CATALOGS)
312    AC_SUBST(CATOBJEXT)
313    AC_SUBST(DATADIRNAME)
314    AC_SUBST(GMOFILES)
315    AC_SUBST(INSTOBJEXT)
316    AC_SUBST(INTLLIBS)
317    AC_SUBST(PO_IN_DATADIR_TRUE)
318    AC_SUBST(PO_IN_DATADIR_FALSE)
319    AC_SUBST(POFILES)
320    AC_SUBST(POSUB)
321  ])
322
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
331# glib-gettextize.
332dnl
333glib_DEFUN([GLIB_GNU_GETTEXT],
334  [AC_REQUIRE([AC_PROG_CC])dnl
335   AC_REQUIRE([AC_HEADER_STDC])dnl
336
337   GLIB_LC_MESSAGES
338   GLIB_WITH_NLS
339
340   if test "$gt_cv_have_gettext" = "yes"; then
341     if test "x$ALL_LINGUAS" = "x"; then
342       LINGUAS=
343     else
344       AC_MSG_CHECKING(for catalogs to be installed)
345       NEW_LINGUAS=
346       for presentlang in $ALL_LINGUAS; do
347         useit=no
348         if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
349           desiredlanguages="$LINGUAS"
350         else
351           desiredlanguages="$ALL_LINGUAS"
352         fi
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;;
361           esac
362         done
363         if test $useit = yes; then
364           NEW_LINGUAS="$NEW_LINGUAS $presentlang"
365         fi
366       done
367       LINGUAS=$NEW_LINGUAS
368       AC_MSG_RESULT($LINGUAS)
369     fi
370
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
374     fi
375   fi
376
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.
380   MKINSTALLDIRS=
381   if test -n "$ac_aux_dir"; then
382     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
383   fi
384   if test -z "$MKINSTALLDIRS"; then
385     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
386   fi
387   AC_SUBST(MKINSTALLDIRS)
388
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/"
395     else
396       posrcprefix="../$srcdir/"
397     fi
398   else
399     posrcprefix="../"
400   fi
401   rm -f po/POTFILES
402   sed -e "/^#/d" -e "/^\$/d" -e "s,.*,	$posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
403	< $srcdir/po/POTFILES.in > po/POTFILES
404  ])
405
406# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
407# -------------------------------
408# Define VARIABLE to the location where catalog files will
409# be installed by po/Makefile.
410glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
411[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
412glib_save_prefix="$prefix"
413glib_save_exec_prefix="$exec_prefix"
414glib_save_datarootdir="$datarootdir"
415test "x$prefix" = xNONE && prefix=$ac_default_prefix
416test "x$exec_prefix" = xNONE && exec_prefix=$prefix
417datarootdir=`eval echo "${datarootdir}"`
418if test "x$CATOBJEXT" = "x.mo" ; then
419  localedir=`eval echo "${libdir}/locale"`
420else
421  localedir=`eval echo "${datadir}/locale"`
422fi
423prefix="$glib_save_prefix"
424exec_prefix="$glib_save_exec_prefix"
425datarootdir="$glib_save_datarootdir"
426AC_DEFINE_UNQUOTED($1, "$localedir",
427  [Define the location where the catalogs will be installed])
428])
429
430dnl
431dnl Now the definitions that aclocal will find
432dnl
433ifdef(glib_configure_in,[],[
434AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
435AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
436])dnl
437
438# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
439#
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.
443AC_DEFUN([GLIB_RUN_PROG],
444[cat >conftest.foo <<_ACEOF
445$2
446_ACEOF
447if AC_RUN_LOG([$1 conftest.foo]); then
448  m4_ifval([$3], [$3], [:])
449m4_ifvaln([$4], [else $4])dnl
450echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
451sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
452fi])
453
454
455# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
456#
457# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
458#
459# This program is free software; you can redistribute it and/or modify
460# it under the terms of the GNU General Public License as published by
461# the Free Software Foundation; either version 2 of the License, or
462# (at your option) any later version.
463#
464# This program is distributed in the hope that it will be useful, but
465# WITHOUT ANY WARRANTY; without even the implied warranty of
466# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
467# General Public License for more details.
468#
469# You should have received a copy of the GNU General Public License
470# along with this program; if not, write to the Free Software
471# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
472#
473# As a special exception to the GNU General Public License, if you
474# distribute this file as part of a program that contains a
475# configuration script generated by Autoconf, you may include it under
476# the same distribution terms that you use for the rest of that program.
477
478# PKG_PROG_PKG_CONFIG([MIN-VERSION])
479# ----------------------------------
480AC_DEFUN([PKG_PROG_PKG_CONFIG],
481[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
482m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
483AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
484if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
485	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
486fi
487if test -n "$PKG_CONFIG"; then
488	_pkg_min_version=m4_default([$1], [0.9.0])
489	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
490	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
491		AC_MSG_RESULT([yes])
492	else
493		AC_MSG_RESULT([no])
494		PKG_CONFIG=""
495	fi
496
497fi[]dnl
498])# PKG_PROG_PKG_CONFIG
499
500# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
501#
502# Check to see whether a particular set of modules exists.  Similar
503# to PKG_CHECK_MODULES(), but does not set variables or print errors.
504#
505#
506# Similar to PKG_CHECK_MODULES, make sure that the first instance of
507# this or PKG_CHECK_MODULES is called, or make sure to call
508# PKG_CHECK_EXISTS manually
509# --------------------------------------------------------------
510AC_DEFUN([PKG_CHECK_EXISTS],
511[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
512if test -n "$PKG_CONFIG" && \
513    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
514  m4_ifval([$2], [$2], [:])
515m4_ifvaln([$3], [else
516  $3])dnl
517fi])
518
519
520# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
521# ---------------------------------------------
522m4_define([_PKG_CONFIG],
523[if test -n "$$1"; then
524    pkg_cv_[]$1="$$1"
525 elif test -n "$PKG_CONFIG"; then
526    PKG_CHECK_EXISTS([$3],
527                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
528		     [pkg_failed=yes])
529 else
530    pkg_failed=untried
531fi[]dnl
532])# _PKG_CONFIG
533
534# _PKG_SHORT_ERRORS_SUPPORTED
535# -----------------------------
536AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
537[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
538if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
539        _pkg_short_errors_supported=yes
540else
541        _pkg_short_errors_supported=no
542fi[]dnl
543])# _PKG_SHORT_ERRORS_SUPPORTED
544
545
546# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
547# [ACTION-IF-NOT-FOUND])
548#
549#
550# Note that if there is a possibility the first call to
551# PKG_CHECK_MODULES might not happen, you should be sure to include an
552# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
553#
554#
555# --------------------------------------------------------------
556AC_DEFUN([PKG_CHECK_MODULES],
557[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
558AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
559AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
560
561pkg_failed=no
562AC_MSG_CHECKING([for $1])
563
564_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
565_PKG_CONFIG([$1][_LIBS], [libs], [$2])
566
567m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
568and $1[]_LIBS to avoid the need to call pkg-config.
569See the pkg-config man page for more details.])
570
571if test $pkg_failed = yes; then
572        _PKG_SHORT_ERRORS_SUPPORTED
573        if test $_pkg_short_errors_supported = yes; then
574	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
575        else
576	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
577        fi
578	# Put the nasty error message in config.log where it belongs
579	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
580
581	ifelse([$4], , [AC_MSG_ERROR(dnl
582[Package requirements ($2) were not met:
583
584$$1_PKG_ERRORS
585
586Consider adjusting the PKG_CONFIG_PATH environment variable if you
587installed software in a non-standard prefix.
588
589_PKG_TEXT
590])],
591		[AC_MSG_RESULT([no])
592                $4])
593elif test $pkg_failed = untried; then
594	ifelse([$4], , [AC_MSG_FAILURE(dnl
595[The pkg-config script could not be found or is too old.  Make sure it
596is in your PATH or set the PKG_CONFIG environment variable to the full
597path to pkg-config.
598
599_PKG_TEXT
600
601To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
602		[$4])
603else
604	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
605	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
606        AC_MSG_RESULT([yes])
607	ifelse([$3], , :, [$3])
608fi[]dnl
609])# PKG_CHECK_MODULES
610
611# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
612#
613# This file is free software; the Free Software Foundation
614# gives unlimited permission to copy and/or distribute it,
615# with or without modifications, as long as this notice is preserved.
616
617# AM_AUTOMAKE_VERSION(VERSION)
618# ----------------------------
619# Automake X.Y traces this macro to ensure aclocal.m4 has been
620# generated from the m4 files accompanying Automake X.Y.
621# (This private macro should not be called outside this file.)
622AC_DEFUN([AM_AUTOMAKE_VERSION],
623[am__api_version='1.11'
624dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
625dnl require some minimum version.  Point them to the right macro.
626m4_if([$1], [1.11], [],
627      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
628])
629
630# _AM_AUTOCONF_VERSION(VERSION)
631# -----------------------------
632# aclocal traces this macro to find the Autoconf version.
633# This is a private macro too.  Using m4_define simplifies
634# the logic in aclocal, which can simply ignore this definition.
635m4_define([_AM_AUTOCONF_VERSION], [])
636
637# AM_SET_CURRENT_AUTOMAKE_VERSION
638# -------------------------------
639# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
640# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
641AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
642[AM_AUTOMAKE_VERSION([1.11])dnl
643m4_ifndef([AC_AUTOCONF_VERSION],
644  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
645_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
646
647# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
648
649# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
650#
651# This file is free software; the Free Software Foundation
652# gives unlimited permission to copy and/or distribute it,
653# with or without modifications, as long as this notice is preserved.
654
655# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
656# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
657# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
658#
659# Of course, Automake must honor this variable whenever it calls a
660# tool from the auxiliary directory.  The problem is that $srcdir (and
661# therefore $ac_aux_dir as well) can be either absolute or relative,
662# depending on how configure is run.  This is pretty annoying, since
663# it makes $ac_aux_dir quite unusable in subdirectories: in the top
664# source directory, any form will work fine, but in subdirectories a
665# relative path needs to be adjusted first.
666#
667# $ac_aux_dir/missing
668#    fails when called from a subdirectory if $ac_aux_dir is relative
669# $top_srcdir/$ac_aux_dir/missing
670#    fails if $ac_aux_dir is absolute,
671#    fails when called from a subdirectory in a VPATH build with
672#          a relative $ac_aux_dir
673#
674# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
675# are both prefixed by $srcdir.  In an in-source build this is usually
676# harmless because $srcdir is `.', but things will broke when you
677# start a VPATH build or use an absolute $srcdir.
678#
679# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
680# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
681#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
682# and then we would define $MISSING as
683#   MISSING="\${SHELL} $am_aux_dir/missing"
684# This will work as long as MISSING is not called from configure, because
685# unfortunately $(top_srcdir) has no meaning in configure.
686# However there are other variables, like CC, which are often used in
687# configure, and could therefore not use this "fixed" $ac_aux_dir.
688#
689# Another solution, used here, is to always expand $ac_aux_dir to an
690# absolute PATH.  The drawback is that using absolute paths prevent a
691# configured tree to be moved without reconfiguration.
692
693AC_DEFUN([AM_AUX_DIR_EXPAND],
694[dnl Rely on autoconf to set up CDPATH properly.
695AC_PREREQ([2.50])dnl
696# expand $ac_aux_dir to an absolute path
697am_aux_dir=`cd $ac_aux_dir && pwd`
698])
699
700
701# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2005
702# Free Software Foundation, Inc.
703#
704# This file is free software; the Free Software Foundation
705# gives unlimited permission to copy and/or distribute it,
706# with or without modifications, as long as this notice is preserved.
707
708# serial 4
709
710# This was merged into AC_PROG_CC in Autoconf.
711
712AU_DEFUN([AM_PROG_CC_STDC],
713[AC_PROG_CC
714AC_DIAGNOSE([obsolete], [$0:
715	your code should no longer depend upon `am_cv_prog_cc_stdc', but upon
716	`ac_cv_prog_cc_stdc'.  Remove this warning and the assignment when
717	you adjust the code.  You can also remove the above call to
718	AC_PROG_CC if you already called it elsewhere.])
719am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
720])
721AU_DEFUN([fp_PROG_CC_STDC])
722
723# AM_CONDITIONAL                                            -*- Autoconf -*-
724
725# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
726# Free Software Foundation, Inc.
727#
728# This file is free software; the Free Software Foundation
729# gives unlimited permission to copy and/or distribute it,
730# with or without modifications, as long as this notice is preserved.
731
732# serial 9
733
734# AM_CONDITIONAL(NAME, SHELL-CONDITION)
735# -------------------------------------
736# Define a conditional.
737AC_DEFUN([AM_CONDITIONAL],
738[AC_PREREQ(2.52)dnl
739 ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
740	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
741AC_SUBST([$1_TRUE])dnl
742AC_SUBST([$1_FALSE])dnl
743_AM_SUBST_NOTMAKE([$1_TRUE])dnl
744_AM_SUBST_NOTMAKE([$1_FALSE])dnl
745m4_define([_AM_COND_VALUE_$1], [$2])dnl
746if $2; then
747  $1_TRUE=
748  $1_FALSE='#'
749else
750  $1_TRUE='#'
751  $1_FALSE=
752fi
753AC_CONFIG_COMMANDS_PRE(
754[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
755  AC_MSG_ERROR([[conditional "$1" was never defined.
756Usually this means the macro was only invoked conditionally.]])
757fi])])
758
759# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
760# Free Software Foundation, Inc.
761#
762# This file is free software; the Free Software Foundation
763# gives unlimited permission to copy and/or distribute it,
764# with or without modifications, as long as this notice is preserved.
765
766# serial 10
767
768# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
769# written in clear, in which case automake, when reading aclocal.m4,
770# will think it sees a *use*, and therefore will trigger all it's
771# C support machinery.  Also note that it means that autoscan, seeing
772# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
773
774
775# _AM_DEPENDENCIES(NAME)
776# ----------------------
777# See how the compiler implements dependency checking.
778# NAME is "CC", "CXX", "GCJ", or "OBJC".
779# We try a few techniques and use that to set a single cache variable.
780#
781# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
782# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
783# dependency, and given that the user is not expected to run this macro,
784# just rely on AC_PROG_CC.
785AC_DEFUN([_AM_DEPENDENCIES],
786[AC_REQUIRE([AM_SET_DEPDIR])dnl
787AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
788AC_REQUIRE([AM_MAKE_INCLUDE])dnl
789AC_REQUIRE([AM_DEP_TRACK])dnl
790
791ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
792       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
793       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
794       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
795       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
796                   [depcc="$$1"   am_compiler_list=])
797
798AC_CACHE_CHECK([dependency style of $depcc],
799               [am_cv_$1_dependencies_compiler_type],
800[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
801  # We make a subdir and do the tests there.  Otherwise we can end up
802  # making bogus files that we don't know about and never remove.  For
803  # instance it was reported that on HP-UX the gcc test will end up
804  # making a dummy file named `D' -- because `-MD' means `put the output
805  # in D'.
806  mkdir conftest.dir
807  # Copy depcomp to subdir because otherwise we won't find it if we're
808  # using a relative directory.
809  cp "$am_depcomp" conftest.dir
810  cd conftest.dir
811  # We will build objects and dependencies in a subdirectory because
812  # it helps to detect inapplicable dependency modes.  For instance
813  # both Tru64's cc and ICC support -MD to output dependencies as a
814  # side effect of compilation, but ICC will put the dependencies in
815  # the current directory while Tru64 will put them in the object
816  # directory.
817  mkdir sub
818
819  am_cv_$1_dependencies_compiler_type=none
820  if test "$am_compiler_list" = ""; then
821     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
822  fi
823  am__universal=false
824  m4_case([$1], [CC],
825    [case " $depcc " in #(
826     *\ -arch\ *\ -arch\ *) am__universal=true ;;
827     esac],
828    [CXX],
829    [case " $depcc " in #(
830     *\ -arch\ *\ -arch\ *) am__universal=true ;;
831     esac])
832
833  for depmode in $am_compiler_list; do
834    # Setup a source with many dependencies, because some compilers
835    # like to wrap large dependency lists on column 80 (with \), and
836    # we should not choose a depcomp mode which is confused by this.
837    #
838    # We need to recreate these files for each test, as the compiler may
839    # overwrite some of them when testing with obscure command lines.
840    # This happens at least with the AIX C compiler.
841    : > sub/conftest.c
842    for i in 1 2 3 4 5 6; do
843      echo '#include "conftst'$i'.h"' >> sub/conftest.c
844      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
845      # Solaris 8's {/usr,}/bin/sh.
846      touch sub/conftst$i.h
847    done
848    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
849
850    # We check with `-c' and `-o' for the sake of the "dashmstdout"
851    # mode.  It turns out that the SunPro C++ compiler does not properly
852    # handle `-M -o', and we need to detect this.  Also, some Intel
853    # versions had trouble with output in subdirs
854    am__obj=sub/conftest.${OBJEXT-o}
855    am__minus_obj="-o $am__obj"
856    case $depmode in
857    gcc)
858      # This depmode causes a compiler race in universal mode.
859      test "$am__universal" = false || continue
860      ;;
861    nosideeffect)
862      # after this tag, mechanisms are not by side-effect, so they'll
863      # only be used when explicitly requested
864      if test "x$enable_dependency_tracking" = xyes; then
865	continue
866      else
867	break
868      fi
869      ;;
870    msvisualcpp | msvcmsys)
871      # This compiler won't grok `-c -o', but also, the minuso test has
872      # not run yet.  These depmodes are late enough in the game, and
873      # so weak that their functioning should not be impacted.
874      am__obj=conftest.${OBJEXT-o}
875      am__minus_obj=
876      ;;
877    none) break ;;
878    esac
879    if depmode=$depmode \
880       source=sub/conftest.c object=$am__obj \
881       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
882       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
883         >/dev/null 2>conftest.err &&
884       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
885       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
886       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
887       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
888      # icc doesn't choke on unknown options, it will just issue warnings
889      # or remarks (even with -Werror).  So we grep stderr for any message
890      # that says an option was ignored or not supported.
891      # When given -MP, icc 7.0 and 7.1 complain thusly:
892      #   icc: Command line warning: ignoring option '-M'; no argument required
893      # The diagnosis changed in icc 8.0:
894      #   icc: Command line remark: option '-MP' not supported
895      if (grep 'ignoring option' conftest.err ||
896          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
897        am_cv_$1_dependencies_compiler_type=$depmode
898        break
899      fi
900    fi
901  done
902
903  cd ..
904  rm -rf conftest.dir
905else
906  am_cv_$1_dependencies_compiler_type=none
907fi
908])
909AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
910AM_CONDITIONAL([am__fastdep$1], [
911  test "x$enable_dependency_tracking" != xno \
912  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
913])
914
915
916# AM_SET_DEPDIR
917# -------------
918# Choose a directory name for dependency files.
919# This macro is AC_REQUIREd in _AM_DEPENDENCIES
920AC_DEFUN([AM_SET_DEPDIR],
921[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
922AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
923])
924
925
926# AM_DEP_TRACK
927# ------------
928AC_DEFUN([AM_DEP_TRACK],
929[AC_ARG_ENABLE(dependency-tracking,
930[  --disable-dependency-tracking  speeds up one-time build
931  --enable-dependency-tracking   do not reject slow dependency extractors])
932if test "x$enable_dependency_tracking" != xno; then
933  am_depcomp="$ac_aux_dir/depcomp"
934  AMDEPBACKSLASH='\'
935fi
936AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
937AC_SUBST([AMDEPBACKSLASH])dnl
938_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
939])
940
941# Generate code to set up dependency tracking.              -*- Autoconf -*-
942
943# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
944# Free Software Foundation, Inc.
945#
946# This file is free software; the Free Software Foundation
947# gives unlimited permission to copy and/or distribute it,
948# with or without modifications, as long as this notice is preserved.
949
950#serial 5
951
952# _AM_OUTPUT_DEPENDENCY_COMMANDS
953# ------------------------------
954AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
955[{
956  # Autoconf 2.62 quotes --file arguments for eval, but not when files
957  # are listed without --file.  Let's play safe and only enable the eval
958  # if we detect the quoting.
959  case $CONFIG_FILES in
960  *\'*) eval set x "$CONFIG_FILES" ;;
961  *)   set x $CONFIG_FILES ;;
962  esac
963  shift
964  for mf
965  do
966    # Strip MF so we end up with the name of the file.
967    mf=`echo "$mf" | sed -e 's/:.*$//'`
968    # Check whether this is an Automake generated Makefile or not.
969    # We used to match only the files named `Makefile.in', but
970    # some people rename them; so instead we look at the file content.
971    # Grep'ing the first line is not enough: some people post-process
972    # each Makefile.in and add a new line on top of each file to say so.
973    # Grep'ing the whole file is not good either: AIX grep has a line
974    # limit of 2048, but all sed's we know have understand at least 4000.
975    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
976      dirpart=`AS_DIRNAME("$mf")`
977    else
978      continue
979    fi
980    # Extract the definition of DEPDIR, am__include, and am__quote
981    # from the Makefile without running `make'.
982    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
983    test -z "$DEPDIR" && continue
984    am__include=`sed -n 's/^am__include = //p' < "$mf"`
985    test -z "am__include" && continue
986    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
987    # When using ansi2knr, U may be empty or an underscore; expand it
988    U=`sed -n 's/^U = //p' < "$mf"`
989    # Find all dependency output files, they are included files with
990    # $(DEPDIR) in their names.  We invoke sed twice because it is the
991    # simplest approach to changing $(DEPDIR) to its actual value in the
992    # expansion.
993    for file in `sed -n "
994      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
995	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
996      # Make sure the directory exists.
997      test -f "$dirpart/$file" && continue
998      fdir=`AS_DIRNAME(["$file"])`
999      AS_MKDIR_P([$dirpart/$fdir])
1000      # echo "creating $dirpart/$file"
1001      echo '# dummy' > "$dirpart/$file"
1002    done
1003  done
1004}
1005])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1006
1007
1008# AM_OUTPUT_DEPENDENCY_COMMANDS
1009# -----------------------------
1010# This macro should only be invoked once -- use via AC_REQUIRE.
1011#
1012# This code is only required when automatic dependency tracking
1013# is enabled.  FIXME.  This creates each `.P' file that we will
1014# need in order to bootstrap the dependency handling code.
1015AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1016[AC_CONFIG_COMMANDS([depfiles],
1017     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1018     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1019])
1020
1021# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1022# Free Software Foundation, Inc.
1023#
1024# This file is free software; the Free Software Foundation
1025# gives unlimited permission to copy and/or distribute it,
1026# with or without modifications, as long as this notice is preserved.
1027
1028# serial 8
1029
1030# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
1031AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
1032
1033# Do all the work for Automake.                             -*- Autoconf -*-
1034
1035# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
1036# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
1037#
1038# This file is free software; the Free Software Foundation
1039# gives unlimited permission to copy and/or distribute it,
1040# with or without modifications, as long as this notice is preserved.
1041
1042# serial 16
1043
1044# This macro actually does too much.  Some checks are only needed if
1045# your package does certain things.  But this isn't really a big deal.
1046
1047# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1048# AM_INIT_AUTOMAKE([OPTIONS])
1049# -----------------------------------------------
1050# The call with PACKAGE and VERSION arguments is the old style
1051# call (pre autoconf-2.50), which is being phased out.  PACKAGE
1052# and VERSION should now be passed to AC_INIT and removed from
1053# the call to AM_INIT_AUTOMAKE.
1054# We support both call styles for the transition.  After
1055# the next Automake release, Autoconf can make the AC_INIT
1056# arguments mandatory, and then we can depend on a new Autoconf
1057# release and drop the old call support.
1058AC_DEFUN([AM_INIT_AUTOMAKE],
1059[AC_PREREQ([2.62])dnl
1060dnl Autoconf wants to disallow AM_ names.  We explicitly allow
1061dnl the ones we care about.
1062m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1063AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1064AC_REQUIRE([AC_PROG_INSTALL])dnl
1065if test "`cd $srcdir && pwd`" != "`pwd`"; then
1066  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1067  # is not polluted with repeated "-I."
1068  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1069  # test to see if srcdir already configured
1070  if test -f $srcdir/config.status; then
1071    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1072  fi
1073fi
1074
1075# test whether we have cygpath
1076if test -z "$CYGPATH_W"; then
1077  if (cygpath --version) >/dev/null 2>/dev/null; then
1078    CYGPATH_W='cygpath -w'
1079  else
1080    CYGPATH_W=echo
1081  fi
1082fi
1083AC_SUBST([CYGPATH_W])
1084
1085# Define the identity of the package.
1086dnl Distinguish between old-style and new-style calls.
1087m4_ifval([$2],
1088[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1089 AC_SUBST([PACKAGE], [$1])dnl
1090 AC_SUBST([VERSION], [$2])],
1091[_AM_SET_OPTIONS([$1])dnl
1092dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1093m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
1094  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1095 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1096 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1097
1098_AM_IF_OPTION([no-define],,
1099[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1100 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1101
1102# Some tools Automake needs.
1103AC_REQUIRE([AM_SANITY_CHECK])dnl
1104AC_REQUIRE([AC_ARG_PROGRAM])dnl
1105AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1106AM_MISSING_PROG(AUTOCONF, autoconf)
1107AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1108AM_MISSING_PROG(AUTOHEADER, autoheader)
1109AM_MISSING_PROG(MAKEINFO, makeinfo)
1110AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1111AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
1112AC_REQUIRE([AM_PROG_MKDIR_P])dnl
1113# We need awk for the "check" target.  The system "awk" is bad on
1114# some platforms.
1115AC_REQUIRE([AC_PROG_AWK])dnl
1116AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1117AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1118_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1119	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1120			     [_AM_PROG_TAR([v7])])])
1121_AM_IF_OPTION([no-dependencies],,
1122[AC_PROVIDE_IFELSE([AC_PROG_CC],
1123		  [_AM_DEPENDENCIES(CC)],
1124		  [define([AC_PROG_CC],
1125			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1126AC_PROVIDE_IFELSE([AC_PROG_CXX],
1127		  [_AM_DEPENDENCIES(CXX)],
1128		  [define([AC_PROG_CXX],
1129			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1130AC_PROVIDE_IFELSE([AC_PROG_OBJC],
1131		  [_AM_DEPENDENCIES(OBJC)],
1132		  [define([AC_PROG_OBJC],
1133			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
1134])
1135_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
1136dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
1137dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
1138dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
1139AC_CONFIG_COMMANDS_PRE(dnl
1140[m4_provide_if([_AM_COMPILER_EXEEXT],
1141  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
1142])
1143
1144dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
1145dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
1146dnl mangled by Autoconf and run in a shell conditional statement.
1147m4_define([_AC_COMPILER_EXEEXT],
1148m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1149
1150
1151# When config.status generates a header, we must update the stamp-h file.
1152# This file resides in the same directory as the config header
1153# that is generated.  The stamp files are numbered to have different names.
1154
1155# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1156# loop where config.status creates the headers, so we can generate
1157# our stamp files there.
1158AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1159[# Compute $1's index in $config_headers.
1160_am_arg=$1
1161_am_stamp_count=1
1162for _am_header in $config_headers :; do
1163  case $_am_header in
1164    $_am_arg | $_am_arg:* )
1165      break ;;
1166    * )
1167      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1168  esac
1169done
1170echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1171
1172# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
1173#
1174# This file is free software; the Free Software Foundation
1175# gives unlimited permission to copy and/or distribute it,
1176# with or without modifications, as long as this notice is preserved.
1177
1178# AM_PROG_INSTALL_SH
1179# ------------------
1180# Define $install_sh.
1181AC_DEFUN([AM_PROG_INSTALL_SH],
1182[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1183if test x"${install_sh}" != xset; then
1184  case $am_aux_dir in
1185  *\ * | *\	*)
1186    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
1187  *)
1188    install_sh="\${SHELL} $am_aux_dir/install-sh"
1189  esac
1190fi
1191AC_SUBST(install_sh)])
1192
1193# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
1194#
1195# This file is free software; the Free Software Foundation
1196# gives unlimited permission to copy and/or distribute it,
1197# with or without modifications, as long as this notice is preserved.
1198
1199# serial 2
1200
1201# Check whether the underlying file-system supports filenames
1202# with a leading dot.  For instance MS-DOS doesn't.
1203AC_DEFUN([AM_SET_LEADING_DOT],
1204[rm -rf .tst 2>/dev/null
1205mkdir .tst 2>/dev/null
1206if test -d .tst; then
1207  am__leading_dot=.
1208else
1209  am__leading_dot=_
1210fi
1211rmdir .tst 2>/dev/null
1212AC_SUBST([am__leading_dot])])
1213
1214# Check to see how 'make' treats includes.	            -*- Autoconf -*-
1215
1216# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
1217#
1218# This file is free software; the Free Software Foundation
1219# gives unlimited permission to copy and/or distribute it,
1220# with or without modifications, as long as this notice is preserved.
1221
1222# serial 4
1223
1224# AM_MAKE_INCLUDE()
1225# -----------------
1226# Check to see how make treats includes.
1227AC_DEFUN([AM_MAKE_INCLUDE],
1228[am_make=${MAKE-make}
1229cat > confinc << 'END'
1230am__doit:
1231	@echo this is the am__doit target
1232.PHONY: am__doit
1233END
1234# If we don't find an include directive, just comment out the code.
1235AC_MSG_CHECKING([for style of include used by $am_make])
1236am__include="#"
1237am__quote=
1238_am_result=none
1239# First try GNU make style include.
1240echo "include confinc" > confmf
1241# Ignore all kinds of additional output from `make'.
1242case `$am_make -s -f confmf 2> /dev/null` in #(
1243*the\ am__doit\ target*)
1244  am__include=include
1245  am__quote=
1246  _am_result=GNU
1247  ;;
1248esac
1249# Now try BSD make style include.
1250if test "$am__include" = "#"; then
1251   echo '.include "confinc"' > confmf
1252   case `$am_make -s -f confmf 2> /dev/null` in #(
1253   *the\ am__doit\ target*)
1254     am__include=.include
1255     am__quote="\""
1256     _am_result=BSD
1257     ;;
1258   esac
1259fi
1260AC_SUBST([am__include])
1261AC_SUBST([am__quote])
1262AC_MSG_RESULT([$_am_result])
1263rm -f confinc confmf
1264])
1265
1266# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1267
1268# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
1269# Free Software Foundation, Inc.
1270#
1271# This file is free software; the Free Software Foundation
1272# gives unlimited permission to copy and/or distribute it,
1273# with or without modifications, as long as this notice is preserved.
1274
1275# serial 6
1276
1277# AM_MISSING_PROG(NAME, PROGRAM)
1278# ------------------------------
1279AC_DEFUN([AM_MISSING_PROG],
1280[AC_REQUIRE([AM_MISSING_HAS_RUN])
1281$1=${$1-"${am_missing_run}$2"}
1282AC_SUBST($1)])
1283
1284
1285# AM_MISSING_HAS_RUN
1286# ------------------
1287# Define MISSING if not defined so far and test if it supports --run.
1288# If it does, set am_missing_run to use it, otherwise, to nothing.
1289AC_DEFUN([AM_MISSING_HAS_RUN],
1290[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1291AC_REQUIRE_AUX_FILE([missing])dnl
1292if test x"${MISSING+set}" != xset; then
1293  case $am_aux_dir in
1294  *\ * | *\	*)
1295    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
1296  *)
1297    MISSING="\${SHELL} $am_aux_dir/missing" ;;
1298  esac
1299fi
1300# Use eval to expand $SHELL
1301if eval "$MISSING --run true"; then
1302  am_missing_run="$MISSING --run "
1303else
1304  am_missing_run=
1305  AC_MSG_WARN([`missing' script is too old or missing])
1306fi
1307])
1308
1309# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
1310#
1311# This file is free software; the Free Software Foundation
1312# gives unlimited permission to copy and/or distribute it,
1313# with or without modifications, as long as this notice is preserved.
1314
1315# AM_PROG_MKDIR_P
1316# ---------------
1317# Check for `mkdir -p'.
1318AC_DEFUN([AM_PROG_MKDIR_P],
1319[AC_PREREQ([2.60])dnl
1320AC_REQUIRE([AC_PROG_MKDIR_P])dnl
1321dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
1322dnl while keeping a definition of mkdir_p for backward compatibility.
1323dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
1324dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
1325dnl Makefile.ins that do not define MKDIR_P, so we do our own
1326dnl adjustment using top_builddir (which is defined more often than
1327dnl MKDIR_P).
1328AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
1329case $mkdir_p in
1330  [[\\/$]]* | ?:[[\\/]]*) ;;
1331  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
1332esac
1333])
1334
1335# Helper functions for option handling.                     -*- Autoconf -*-
1336
1337# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
1338#
1339# This file is free software; the Free Software Foundation
1340# gives unlimited permission to copy and/or distribute it,
1341# with or without modifications, as long as this notice is preserved.
1342
1343# serial 4
1344
1345# _AM_MANGLE_OPTION(NAME)
1346# -----------------------
1347AC_DEFUN([_AM_MANGLE_OPTION],
1348[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1349
1350# _AM_SET_OPTION(NAME)
1351# ------------------------------
1352# Set option NAME.  Presently that only means defining a flag for this option.
1353AC_DEFUN([_AM_SET_OPTION],
1354[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1355
1356# _AM_SET_OPTIONS(OPTIONS)
1357# ----------------------------------
1358# OPTIONS is a space-separated list of Automake options.
1359AC_DEFUN([_AM_SET_OPTIONS],
1360[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1361
1362# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1363# -------------------------------------------
1364# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1365AC_DEFUN([_AM_IF_OPTION],
1366[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1367
1368# Check to make sure that the build environment is sane.    -*- Autoconf -*-
1369
1370# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
1371# Free Software Foundation, Inc.
1372#
1373# This file is free software; the Free Software Foundation
1374# gives unlimited permission to copy and/or distribute it,
1375# with or without modifications, as long as this notice is preserved.
1376
1377# serial 5
1378
1379# AM_SANITY_CHECK
1380# ---------------
1381AC_DEFUN([AM_SANITY_CHECK],
1382[AC_MSG_CHECKING([whether build environment is sane])
1383# Just in case
1384sleep 1
1385echo timestamp > conftest.file
1386# Reject unsafe characters in $srcdir or the absolute working directory
1387# name.  Accept space and tab only in the latter.
1388am_lf='
1389'
1390case `pwd` in
1391  *[[\\\"\#\$\&\'\`$am_lf]]*)
1392    AC_MSG_ERROR([unsafe absolute working directory name]);;
1393esac
1394case $srcdir in
1395  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
1396    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
1397esac
1398
1399# Do `set' in a subshell so we don't clobber the current shell's
1400# arguments.  Must try -L first in case configure is actually a
1401# symlink; some systems play weird games with the mod time of symlinks
1402# (eg FreeBSD returns the mod time of the symlink's containing
1403# directory).
1404if (
1405   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
1406   if test "$[*]" = "X"; then
1407      # -L didn't work.
1408      set X `ls -t "$srcdir/configure" conftest.file`
1409   fi
1410   rm -f conftest.file
1411   if test "$[*]" != "X $srcdir/configure conftest.file" \
1412      && test "$[*]" != "X conftest.file $srcdir/configure"; then
1413
1414      # If neither matched, then we have a broken ls.  This can happen
1415      # if, for instance, CONFIG_SHELL is bash and it inherits a
1416      # broken ls alias from the environment.  This has actually
1417      # happened.  Such a system could not be considered "sane".
1418      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1419alias in your environment])
1420   fi
1421
1422   test "$[2]" = conftest.file
1423   )
1424then
1425   # Ok.
1426   :
1427else
1428   AC_MSG_ERROR([newly created file is older than distributed files!
1429Check your system clock])
1430fi
1431AC_MSG_RESULT(yes)])
1432
1433# Copyright (C) 2009  Free Software Foundation, Inc.
1434#
1435# This file is free software; the Free Software Foundation
1436# gives unlimited permission to copy and/or distribute it,
1437# with or without modifications, as long as this notice is preserved.
1438
1439# serial 1
1440
1441# AM_SILENT_RULES([DEFAULT])
1442# --------------------------
1443# Enable less verbose build rules; with the default set to DEFAULT
1444# (`yes' being less verbose, `no' or empty being verbose).
1445AC_DEFUN([AM_SILENT_RULES],
1446[AC_ARG_ENABLE([silent-rules],
1447[  --enable-silent-rules          less verbose build output (undo: `make V=1')
1448  --disable-silent-rules         verbose build output (undo: `make V=0')])
1449case $enable_silent_rules in
1450yes) AM_DEFAULT_VERBOSITY=0;;
1451no)  AM_DEFAULT_VERBOSITY=1;;
1452*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
1453esac
1454AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1455AM_BACKSLASH='\'
1456AC_SUBST([AM_BACKSLASH])dnl
1457_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1458])
1459
1460# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1461#
1462# This file is free software; the Free Software Foundation
1463# gives unlimited permission to copy and/or distribute it,
1464# with or without modifications, as long as this notice is preserved.
1465
1466# AM_PROG_INSTALL_STRIP
1467# ---------------------
1468# One issue with vendor `install' (even GNU) is that you can't
1469# specify the program used to strip binaries.  This is especially
1470# annoying in cross-compiling environments, where the build's strip
1471# is unlikely to handle the host's binaries.
1472# Fortunately install-sh will honor a STRIPPROG variable, so we
1473# always use install-sh in `make install-strip', and initialize
1474# STRIPPROG with the value of the STRIP variable (set by the user).
1475AC_DEFUN([AM_PROG_INSTALL_STRIP],
1476[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1477# Installed binaries are usually stripped using `strip' when the user
1478# run `make install-strip'.  However `strip' might not be the right
1479# tool to use in cross-compilation environments, therefore Automake
1480# will honor the `STRIP' environment variable to overrule this program.
1481dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1482if test "$cross_compiling" != no; then
1483  AC_CHECK_TOOL([STRIP], [strip], :)
1484fi
1485INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1486AC_SUBST([INSTALL_STRIP_PROGRAM])])
1487
1488# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
1489#
1490# This file is free software; the Free Software Foundation
1491# gives unlimited permission to copy and/or distribute it,
1492# with or without modifications, as long as this notice is preserved.
1493
1494# serial 2
1495
1496# _AM_SUBST_NOTMAKE(VARIABLE)
1497# ---------------------------
1498# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1499# This macro is traced by Automake.
1500AC_DEFUN([_AM_SUBST_NOTMAKE])
1501
1502# AM_SUBST_NOTMAKE(VARIABLE)
1503# ---------------------------
1504# Public sister of _AM_SUBST_NOTMAKE.
1505AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1506
1507# Check how to create a tarball.                            -*- Autoconf -*-
1508
1509# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
1510#
1511# This file is free software; the Free Software Foundation
1512# gives unlimited permission to copy and/or distribute it,
1513# with or without modifications, as long as this notice is preserved.
1514
1515# serial 2
1516
1517# _AM_PROG_TAR(FORMAT)
1518# --------------------
1519# Check how to create a tarball in format FORMAT.
1520# FORMAT should be one of `v7', `ustar', or `pax'.
1521#
1522# Substitute a variable $(am__tar) that is a command
1523# writing to stdout a FORMAT-tarball containing the directory
1524# $tardir.
1525#     tardir=directory && $(am__tar) > result.tar
1526#
1527# Substitute a variable $(am__untar) that extract such
1528# a tarball read from stdin.
1529#     $(am__untar) < result.tar
1530AC_DEFUN([_AM_PROG_TAR],
1531[# Always define AMTAR for backward compatibility.
1532AM_MISSING_PROG([AMTAR], [tar])
1533m4_if([$1], [v7],
1534     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
1535     [m4_case([$1], [ustar],, [pax],,
1536              [m4_fatal([Unknown tar format])])
1537AC_MSG_CHECKING([how to create a $1 tar archive])
1538# Loop over all known methods to create a tar archive until one works.
1539_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1540_am_tools=${am_cv_prog_tar_$1-$_am_tools}
1541# Do not fold the above two line into one, because Tru64 sh and
1542# Solaris sh will not grok spaces in the rhs of `-'.
1543for _am_tool in $_am_tools
1544do
1545  case $_am_tool in
1546  gnutar)
1547    for _am_tar in tar gnutar gtar;
1548    do
1549      AM_RUN_LOG([$_am_tar --version]) && break
1550    done
1551    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1552    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1553    am__untar="$_am_tar -xf -"
1554    ;;
1555  plaintar)
1556    # Must skip GNU tar: if it does not support --format= it doesn't create
1557    # ustar tarball either.
1558    (tar --version) >/dev/null 2>&1 && continue
1559    am__tar='tar chf - "$$tardir"'
1560    am__tar_='tar chf - "$tardir"'
1561    am__untar='tar xf -'
1562    ;;
1563  pax)
1564    am__tar='pax -L -x $1 -w "$$tardir"'
1565    am__tar_='pax -L -x $1 -w "$tardir"'
1566    am__untar='pax -r'
1567    ;;
1568  cpio)
1569    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1570    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1571    am__untar='cpio -i -H $1 -d'
1572    ;;
1573  none)
1574    am__tar=false
1575    am__tar_=false
1576    am__untar=false
1577    ;;
1578  esac
1579
1580  # If the value was cached, stop now.  We just wanted to have am__tar
1581  # and am__untar set.
1582  test -n "${am_cv_prog_tar_$1}" && break
1583
1584  # tar/untar a dummy directory, and stop if the command works
1585  rm -rf conftest.dir
1586  mkdir conftest.dir
1587  echo GrepMe > conftest.dir/file
1588  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1589  rm -rf conftest.dir
1590  if test -s conftest.tar; then
1591    AM_RUN_LOG([$am__untar <conftest.tar])
1592    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1593  fi
1594done
1595rm -rf conftest.dir
1596
1597AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1598AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1599AC_SUBST([am__tar])
1600AC_SUBST([am__untar])
1601]) # _AM_PROG_TAR
1602
1603m4_include([build/autotools/as-compiler-flag.m4])
1604m4_include([build/autotools/gtk-doc.m4])
1605m4_include([build/autotools/introspection.m4])
1606m4_include([build/autotools/libtool.m4])
1607m4_include([build/autotools/ltoptions.m4])
1608m4_include([build/autotools/ltsugar.m4])
1609m4_include([build/autotools/ltversion.m4])
1610m4_include([build/autotools/lt~obsolete.m4])
1611