1# generated automatically by aclocal 1.10 -*- Autoconf -*-
2
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4# 2005, 2006  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_if(m4_PACKAGE_VERSION, [2.61],,
15[m4_fatal([this file was generated for autoconf 2.61.
16You have another version of autoconf.  If you want to use that,
17you should regenerate the build system entirely.], [63])])
18
19# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
20#
21# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
22#
23# This program is free software; you can redistribute it and/or modify
24# it under the terms of the GNU General Public License as published by
25# the Free Software Foundation; either version 2 of the License, or
26# (at your option) any later version.
27#
28# This program is distributed in the hope that it will be useful, but
29# WITHOUT ANY WARRANTY; without even the implied warranty of
30# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
31# General Public License for more details.
32#
33# You should have received a copy of the GNU General Public License
34# along with this program; if not, write to the Free Software
35# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
36#
37# As a special exception to the GNU General Public License, if you
38# distribute this file as part of a program that contains a
39# configuration script generated by Autoconf, you may include it under
40# the same distribution terms that you use for the rest of that program.
41
42# PKG_PROG_PKG_CONFIG([MIN-VERSION])
43# ----------------------------------
44AC_DEFUN([PKG_PROG_PKG_CONFIG],
45[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
46m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
47AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
48if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
49	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
50fi
51if test -n "$PKG_CONFIG"; then
52	_pkg_min_version=m4_default([$1], [0.9.0])
53	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
54	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
55		AC_MSG_RESULT([yes])
56	else
57		AC_MSG_RESULT([no])
58		PKG_CONFIG=""
59	fi
60
61fi[]dnl
62])# PKG_PROG_PKG_CONFIG
63
64# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
65#
66# Check to see whether a particular set of modules exists.  Similar
67# to PKG_CHECK_MODULES(), but does not set variables or print errors.
68#
69#
70# Similar to PKG_CHECK_MODULES, make sure that the first instance of
71# this or PKG_CHECK_MODULES is called, or make sure to call
72# PKG_CHECK_EXISTS manually
73# --------------------------------------------------------------
74AC_DEFUN([PKG_CHECK_EXISTS],
75[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
76if test -n "$PKG_CONFIG" && \
77    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
78  m4_ifval([$2], [$2], [:])
79m4_ifvaln([$3], [else
80  $3])dnl
81fi])
82
83
84# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
85# ---------------------------------------------
86m4_define([_PKG_CONFIG],
87[if test -n "$$1"; then
88    pkg_cv_[]$1="$$1"
89 elif test -n "$PKG_CONFIG"; then
90    PKG_CHECK_EXISTS([$3],
91                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
92		     [pkg_failed=yes])
93 else
94    pkg_failed=untried
95fi[]dnl
96])# _PKG_CONFIG
97
98# _PKG_SHORT_ERRORS_SUPPORTED
99# -----------------------------
100AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
101[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
102if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
103        _pkg_short_errors_supported=yes
104else
105        _pkg_short_errors_supported=no
106fi[]dnl
107])# _PKG_SHORT_ERRORS_SUPPORTED
108
109
110# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
111# [ACTION-IF-NOT-FOUND])
112#
113#
114# Note that if there is a possibility the first call to
115# PKG_CHECK_MODULES might not happen, you should be sure to include an
116# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
117#
118#
119# --------------------------------------------------------------
120AC_DEFUN([PKG_CHECK_MODULES],
121[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
122AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
123AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
124
125pkg_failed=no
126AC_MSG_CHECKING([for $1])
127
128_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
129_PKG_CONFIG([$1][_LIBS], [libs], [$2])
130
131m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
132and $1[]_LIBS to avoid the need to call pkg-config.
133See the pkg-config man page for more details.])
134
135if test $pkg_failed = yes; then
136        _PKG_SHORT_ERRORS_SUPPORTED
137        if test $_pkg_short_errors_supported = yes; then
138	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
139        else
140	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
141        fi
142	# Put the nasty error message in config.log where it belongs
143	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
144
145	ifelse([$4], , [AC_MSG_ERROR(dnl
146[Package requirements ($2) were not met:
147
148$$1_PKG_ERRORS
149
150Consider adjusting the PKG_CONFIG_PATH environment variable if you
151installed software in a non-standard prefix.
152
153_PKG_TEXT
154])],
155		[AC_MSG_RESULT([no])
156                $4])
157elif test $pkg_failed = untried; then
158	ifelse([$4], , [AC_MSG_FAILURE(dnl
159[The pkg-config script could not be found or is too old.  Make sure it
160is in your PATH or set the PKG_CONFIG environment variable to the full
161path to pkg-config.
162
163_PKG_TEXT
164
165To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
166		[$4])
167else
168	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
169	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
170        AC_MSG_RESULT([yes])
171	ifelse([$3], , :, [$3])
172fi[]dnl
173])# PKG_CHECK_MODULES
174
175# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
176#
177# This file is free software; the Free Software Foundation
178# gives unlimited permission to copy and/or distribute it,
179# with or without modifications, as long as this notice is preserved.
180
181# AM_AUTOMAKE_VERSION(VERSION)
182# ----------------------------
183# Automake X.Y traces this macro to ensure aclocal.m4 has been
184# generated from the m4 files accompanying Automake X.Y.
185# (This private macro should not be called outside this file.)
186AC_DEFUN([AM_AUTOMAKE_VERSION],
187[am__api_version='1.10'
188dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
189dnl require some minimum version.  Point them to the right macro.
190m4_if([$1], [1.10], [],
191      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
192])
193
194# _AM_AUTOCONF_VERSION(VERSION)
195# -----------------------------
196# aclocal traces this macro to find the Autoconf version.
197# This is a private macro too.  Using m4_define simplifies
198# the logic in aclocal, which can simply ignore this definition.
199m4_define([_AM_AUTOCONF_VERSION], [])
200
201# AM_SET_CURRENT_AUTOMAKE_VERSION
202# -------------------------------
203# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
204# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
205AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
206[AM_AUTOMAKE_VERSION([1.10])dnl
207_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
208
209# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
210
211# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
212#
213# This file is free software; the Free Software Foundation
214# gives unlimited permission to copy and/or distribute it,
215# with or without modifications, as long as this notice is preserved.
216
217# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
218# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
219# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
220#
221# Of course, Automake must honor this variable whenever it calls a
222# tool from the auxiliary directory.  The problem is that $srcdir (and
223# therefore $ac_aux_dir as well) can be either absolute or relative,
224# depending on how configure is run.  This is pretty annoying, since
225# it makes $ac_aux_dir quite unusable in subdirectories: in the top
226# source directory, any form will work fine, but in subdirectories a
227# relative path needs to be adjusted first.
228#
229# $ac_aux_dir/missing
230#    fails when called from a subdirectory if $ac_aux_dir is relative
231# $top_srcdir/$ac_aux_dir/missing
232#    fails if $ac_aux_dir is absolute,
233#    fails when called from a subdirectory in a VPATH build with
234#          a relative $ac_aux_dir
235#
236# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
237# are both prefixed by $srcdir.  In an in-source build this is usually
238# harmless because $srcdir is `.', but things will broke when you
239# start a VPATH build or use an absolute $srcdir.
240#
241# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
242# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
243#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
244# and then we would define $MISSING as
245#   MISSING="\${SHELL} $am_aux_dir/missing"
246# This will work as long as MISSING is not called from configure, because
247# unfortunately $(top_srcdir) has no meaning in configure.
248# However there are other variables, like CC, which are often used in
249# configure, and could therefore not use this "fixed" $ac_aux_dir.
250#
251# Another solution, used here, is to always expand $ac_aux_dir to an
252# absolute PATH.  The drawback is that using absolute paths prevent a
253# configured tree to be moved without reconfiguration.
254
255AC_DEFUN([AM_AUX_DIR_EXPAND],
256[dnl Rely on autoconf to set up CDPATH properly.
257AC_PREREQ([2.50])dnl
258# expand $ac_aux_dir to an absolute path
259am_aux_dir=`cd $ac_aux_dir && pwd`
260])
261
262# AM_CONDITIONAL                                            -*- Autoconf -*-
263
264# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
265# Free Software Foundation, Inc.
266#
267# This file is free software; the Free Software Foundation
268# gives unlimited permission to copy and/or distribute it,
269# with or without modifications, as long as this notice is preserved.
270
271# serial 8
272
273# AM_CONDITIONAL(NAME, SHELL-CONDITION)
274# -------------------------------------
275# Define a conditional.
276AC_DEFUN([AM_CONDITIONAL],
277[AC_PREREQ(2.52)dnl
278 ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
279	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
280AC_SUBST([$1_TRUE])dnl
281AC_SUBST([$1_FALSE])dnl
282_AM_SUBST_NOTMAKE([$1_TRUE])dnl
283_AM_SUBST_NOTMAKE([$1_FALSE])dnl
284if $2; then
285  $1_TRUE=
286  $1_FALSE='#'
287else
288  $1_TRUE='#'
289  $1_FALSE=
290fi
291AC_CONFIG_COMMANDS_PRE(
292[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
293  AC_MSG_ERROR([[conditional "$1" was never defined.
294Usually this means the macro was only invoked conditionally.]])
295fi])])
296
297# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
298# Free Software Foundation, Inc.
299#
300# This file is free software; the Free Software Foundation
301# gives unlimited permission to copy and/or distribute it,
302# with or without modifications, as long as this notice is preserved.
303
304# serial 9
305
306# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
307# written in clear, in which case automake, when reading aclocal.m4,
308# will think it sees a *use*, and therefore will trigger all it's
309# C support machinery.  Also note that it means that autoscan, seeing
310# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
311
312
313# _AM_DEPENDENCIES(NAME)
314# ----------------------
315# See how the compiler implements dependency checking.
316# NAME is "CC", "CXX", "GCJ", or "OBJC".
317# We try a few techniques and use that to set a single cache variable.
318#
319# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
320# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
321# dependency, and given that the user is not expected to run this macro,
322# just rely on AC_PROG_CC.
323AC_DEFUN([_AM_DEPENDENCIES],
324[AC_REQUIRE([AM_SET_DEPDIR])dnl
325AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
326AC_REQUIRE([AM_MAKE_INCLUDE])dnl
327AC_REQUIRE([AM_DEP_TRACK])dnl
328
329ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
330       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
331       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
332       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
333       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
334                   [depcc="$$1"   am_compiler_list=])
335
336AC_CACHE_CHECK([dependency style of $depcc],
337               [am_cv_$1_dependencies_compiler_type],
338[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
339  # We make a subdir and do the tests there.  Otherwise we can end up
340  # making bogus files that we don't know about and never remove.  For
341  # instance it was reported that on HP-UX the gcc test will end up
342  # making a dummy file named `D' -- because `-MD' means `put the output
343  # in D'.
344  mkdir conftest.dir
345  # Copy depcomp to subdir because otherwise we won't find it if we're
346  # using a relative directory.
347  cp "$am_depcomp" conftest.dir
348  cd conftest.dir
349  # We will build objects and dependencies in a subdirectory because
350  # it helps to detect inapplicable dependency modes.  For instance
351  # both Tru64's cc and ICC support -MD to output dependencies as a
352  # side effect of compilation, but ICC will put the dependencies in
353  # the current directory while Tru64 will put them in the object
354  # directory.
355  mkdir sub
356
357  am_cv_$1_dependencies_compiler_type=none
358  if test "$am_compiler_list" = ""; then
359     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
360  fi
361  for depmode in $am_compiler_list; do
362    # Setup a source with many dependencies, because some compilers
363    # like to wrap large dependency lists on column 80 (with \), and
364    # we should not choose a depcomp mode which is confused by this.
365    #
366    # We need to recreate these files for each test, as the compiler may
367    # overwrite some of them when testing with obscure command lines.
368    # This happens at least with the AIX C compiler.
369    : > sub/conftest.c
370    for i in 1 2 3 4 5 6; do
371      echo '#include "conftst'$i'.h"' >> sub/conftest.c
372      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
373      # Solaris 8's {/usr,}/bin/sh.
374      touch sub/conftst$i.h
375    done
376    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
377
378    case $depmode in
379    nosideeffect)
380      # after this tag, mechanisms are not by side-effect, so they'll
381      # only be used when explicitly requested
382      if test "x$enable_dependency_tracking" = xyes; then
383	continue
384      else
385	break
386      fi
387      ;;
388    none) break ;;
389    esac
390    # We check with `-c' and `-o' for the sake of the "dashmstdout"
391    # mode.  It turns out that the SunPro C++ compiler does not properly
392    # handle `-M -o', and we need to detect this.
393    if depmode=$depmode \
394       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
395       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
396       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
397         >/dev/null 2>conftest.err &&
398       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
399       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
400       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
401       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
402      # icc doesn't choke on unknown options, it will just issue warnings
403      # or remarks (even with -Werror).  So we grep stderr for any message
404      # that says an option was ignored or not supported.
405      # When given -MP, icc 7.0 and 7.1 complain thusly:
406      #   icc: Command line warning: ignoring option '-M'; no argument required
407      # The diagnosis changed in icc 8.0:
408      #   icc: Command line remark: option '-MP' not supported
409      if (grep 'ignoring option' conftest.err ||
410          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
411        am_cv_$1_dependencies_compiler_type=$depmode
412        break
413      fi
414    fi
415  done
416
417  cd ..
418  rm -rf conftest.dir
419else
420  am_cv_$1_dependencies_compiler_type=none
421fi
422])
423AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
424AM_CONDITIONAL([am__fastdep$1], [
425  test "x$enable_dependency_tracking" != xno \
426  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
427])
428
429
430# AM_SET_DEPDIR
431# -------------
432# Choose a directory name for dependency files.
433# This macro is AC_REQUIREd in _AM_DEPENDENCIES
434AC_DEFUN([AM_SET_DEPDIR],
435[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
436AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
437])
438
439
440# AM_DEP_TRACK
441# ------------
442AC_DEFUN([AM_DEP_TRACK],
443[AC_ARG_ENABLE(dependency-tracking,
444[  --disable-dependency-tracking  speeds up one-time build
445  --enable-dependency-tracking   do not reject slow dependency extractors])
446if test "x$enable_dependency_tracking" != xno; then
447  am_depcomp="$ac_aux_dir/depcomp"
448  AMDEPBACKSLASH='\'
449fi
450AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
451AC_SUBST([AMDEPBACKSLASH])dnl
452_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
453])
454
455# Generate code to set up dependency tracking.              -*- Autoconf -*-
456
457# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
458# Free Software Foundation, Inc.
459#
460# This file is free software; the Free Software Foundation
461# gives unlimited permission to copy and/or distribute it,
462# with or without modifications, as long as this notice is preserved.
463
464#serial 3
465
466# _AM_OUTPUT_DEPENDENCY_COMMANDS
467# ------------------------------
468AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
469[for mf in $CONFIG_FILES; do
470  # Strip MF so we end up with the name of the file.
471  mf=`echo "$mf" | sed -e 's/:.*$//'`
472  # Check whether this is an Automake generated Makefile or not.
473  # We used to match only the files named `Makefile.in', but
474  # some people rename them; so instead we look at the file content.
475  # Grep'ing the first line is not enough: some people post-process
476  # each Makefile.in and add a new line on top of each file to say so.
477  # Grep'ing the whole file is not good either: AIX grep has a line
478  # limit of 2048, but all sed's we know have understand at least 4000.
479  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
480    dirpart=`AS_DIRNAME("$mf")`
481  else
482    continue
483  fi
484  # Extract the definition of DEPDIR, am__include, and am__quote
485  # from the Makefile without running `make'.
486  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
487  test -z "$DEPDIR" && continue
488  am__include=`sed -n 's/^am__include = //p' < "$mf"`
489  test -z "am__include" && continue
490  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
491  # When using ansi2knr, U may be empty or an underscore; expand it
492  U=`sed -n 's/^U = //p' < "$mf"`
493  # Find all dependency output files, they are included files with
494  # $(DEPDIR) in their names.  We invoke sed twice because it is the
495  # simplest approach to changing $(DEPDIR) to its actual value in the
496  # expansion.
497  for file in `sed -n "
498    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
499       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
500    # Make sure the directory exists.
501    test -f "$dirpart/$file" && continue
502    fdir=`AS_DIRNAME(["$file"])`
503    AS_MKDIR_P([$dirpart/$fdir])
504    # echo "creating $dirpart/$file"
505    echo '# dummy' > "$dirpart/$file"
506  done
507done
508])# _AM_OUTPUT_DEPENDENCY_COMMANDS
509
510
511# AM_OUTPUT_DEPENDENCY_COMMANDS
512# -----------------------------
513# This macro should only be invoked once -- use via AC_REQUIRE.
514#
515# This code is only required when automatic dependency tracking
516# is enabled.  FIXME.  This creates each `.P' file that we will
517# need in order to bootstrap the dependency handling code.
518AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
519[AC_CONFIG_COMMANDS([depfiles],
520     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
521     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
522])
523
524# Do all the work for Automake.                             -*- Autoconf -*-
525
526# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
527# 2005, 2006 Free Software Foundation, Inc.
528#
529# This file is free software; the Free Software Foundation
530# gives unlimited permission to copy and/or distribute it,
531# with or without modifications, as long as this notice is preserved.
532
533# serial 12
534
535# This macro actually does too much.  Some checks are only needed if
536# your package does certain things.  But this isn't really a big deal.
537
538# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
539# AM_INIT_AUTOMAKE([OPTIONS])
540# -----------------------------------------------
541# The call with PACKAGE and VERSION arguments is the old style
542# call (pre autoconf-2.50), which is being phased out.  PACKAGE
543# and VERSION should now be passed to AC_INIT and removed from
544# the call to AM_INIT_AUTOMAKE.
545# We support both call styles for the transition.  After
546# the next Automake release, Autoconf can make the AC_INIT
547# arguments mandatory, and then we can depend on a new Autoconf
548# release and drop the old call support.
549AC_DEFUN([AM_INIT_AUTOMAKE],
550[AC_PREREQ([2.60])dnl
551dnl Autoconf wants to disallow AM_ names.  We explicitly allow
552dnl the ones we care about.
553m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
554AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
555AC_REQUIRE([AC_PROG_INSTALL])dnl
556if test "`cd $srcdir && pwd`" != "`pwd`"; then
557  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
558  # is not polluted with repeated "-I."
559  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
560  # test to see if srcdir already configured
561  if test -f $srcdir/config.status; then
562    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
563  fi
564fi
565
566# test whether we have cygpath
567if test -z "$CYGPATH_W"; then
568  if (cygpath --version) >/dev/null 2>/dev/null; then
569    CYGPATH_W='cygpath -w'
570  else
571    CYGPATH_W=echo
572  fi
573fi
574AC_SUBST([CYGPATH_W])
575
576# Define the identity of the package.
577dnl Distinguish between old-style and new-style calls.
578m4_ifval([$2],
579[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
580 AC_SUBST([PACKAGE], [$1])dnl
581 AC_SUBST([VERSION], [$2])],
582[_AM_SET_OPTIONS([$1])dnl
583dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
584m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
585  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
586 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
587 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
588
589_AM_IF_OPTION([no-define],,
590[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
591 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
592
593# Some tools Automake needs.
594AC_REQUIRE([AM_SANITY_CHECK])dnl
595AC_REQUIRE([AC_ARG_PROGRAM])dnl
596AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
597AM_MISSING_PROG(AUTOCONF, autoconf)
598AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
599AM_MISSING_PROG(AUTOHEADER, autoheader)
600AM_MISSING_PROG(MAKEINFO, makeinfo)
601AM_PROG_INSTALL_SH
602AM_PROG_INSTALL_STRIP
603AC_REQUIRE([AM_PROG_MKDIR_P])dnl
604# We need awk for the "check" target.  The system "awk" is bad on
605# some platforms.
606AC_REQUIRE([AC_PROG_AWK])dnl
607AC_REQUIRE([AC_PROG_MAKE_SET])dnl
608AC_REQUIRE([AM_SET_LEADING_DOT])dnl
609_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
610              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
611	      		     [_AM_PROG_TAR([v7])])])
612_AM_IF_OPTION([no-dependencies],,
613[AC_PROVIDE_IFELSE([AC_PROG_CC],
614                  [_AM_DEPENDENCIES(CC)],
615                  [define([AC_PROG_CC],
616                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
617AC_PROVIDE_IFELSE([AC_PROG_CXX],
618                  [_AM_DEPENDENCIES(CXX)],
619                  [define([AC_PROG_CXX],
620                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
621AC_PROVIDE_IFELSE([AC_PROG_OBJC],
622                  [_AM_DEPENDENCIES(OBJC)],
623                  [define([AC_PROG_OBJC],
624                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
625])
626])
627
628
629# When config.status generates a header, we must update the stamp-h file.
630# This file resides in the same directory as the config header
631# that is generated.  The stamp files are numbered to have different names.
632
633# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
634# loop where config.status creates the headers, so we can generate
635# our stamp files there.
636AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
637[# Compute $1's index in $config_headers.
638_am_stamp_count=1
639for _am_header in $config_headers :; do
640  case $_am_header in
641    $1 | $1:* )
642      break ;;
643    * )
644      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
645  esac
646done
647echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
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# AM_PROG_INSTALL_SH
656# ------------------
657# Define $install_sh.
658AC_DEFUN([AM_PROG_INSTALL_SH],
659[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
660install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
661AC_SUBST(install_sh)])
662
663# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
664#
665# This file is free software; the Free Software Foundation
666# gives unlimited permission to copy and/or distribute it,
667# with or without modifications, as long as this notice is preserved.
668
669# serial 2
670
671# Check whether the underlying file-system supports filenames
672# with a leading dot.  For instance MS-DOS doesn't.
673AC_DEFUN([AM_SET_LEADING_DOT],
674[rm -rf .tst 2>/dev/null
675mkdir .tst 2>/dev/null
676if test -d .tst; then
677  am__leading_dot=.
678else
679  am__leading_dot=_
680fi
681rmdir .tst 2>/dev/null
682AC_SUBST([am__leading_dot])])
683
684# Check to see how 'make' treats includes.	            -*- Autoconf -*-
685
686# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
687#
688# This file is free software; the Free Software Foundation
689# gives unlimited permission to copy and/or distribute it,
690# with or without modifications, as long as this notice is preserved.
691
692# serial 3
693
694# AM_MAKE_INCLUDE()
695# -----------------
696# Check to see how make treats includes.
697AC_DEFUN([AM_MAKE_INCLUDE],
698[am_make=${MAKE-make}
699cat > confinc << 'END'
700am__doit:
701	@echo done
702.PHONY: am__doit
703END
704# If we don't find an include directive, just comment out the code.
705AC_MSG_CHECKING([for style of include used by $am_make])
706am__include="#"
707am__quote=
708_am_result=none
709# First try GNU make style include.
710echo "include confinc" > confmf
711# We grep out `Entering directory' and `Leaving directory'
712# messages which can occur if `w' ends up in MAKEFLAGS.
713# In particular we don't look at `^make:' because GNU make might
714# be invoked under some other name (usually "gmake"), in which
715# case it prints its new name instead of `make'.
716if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
717   am__include=include
718   am__quote=
719   _am_result=GNU
720fi
721# Now try BSD make style include.
722if test "$am__include" = "#"; then
723   echo '.include "confinc"' > confmf
724   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
725      am__include=.include
726      am__quote="\""
727      _am_result=BSD
728   fi
729fi
730AC_SUBST([am__include])
731AC_SUBST([am__quote])
732AC_MSG_RESULT([$_am_result])
733rm -f confinc confmf
734])
735
736# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
737
738# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
739# Free Software Foundation, Inc.
740#
741# This file is free software; the Free Software Foundation
742# gives unlimited permission to copy and/or distribute it,
743# with or without modifications, as long as this notice is preserved.
744
745# serial 5
746
747# AM_MISSING_PROG(NAME, PROGRAM)
748# ------------------------------
749AC_DEFUN([AM_MISSING_PROG],
750[AC_REQUIRE([AM_MISSING_HAS_RUN])
751$1=${$1-"${am_missing_run}$2"}
752AC_SUBST($1)])
753
754
755# AM_MISSING_HAS_RUN
756# ------------------
757# Define MISSING if not defined so far and test if it supports --run.
758# If it does, set am_missing_run to use it, otherwise, to nothing.
759AC_DEFUN([AM_MISSING_HAS_RUN],
760[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
761AC_REQUIRE_AUX_FILE([missing])dnl
762test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
763# Use eval to expand $SHELL
764if eval "$MISSING --run true"; then
765  am_missing_run="$MISSING --run "
766else
767  am_missing_run=
768  AC_MSG_WARN([`missing' script is too old or missing])
769fi
770])
771
772# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
773#
774# This file is free software; the Free Software Foundation
775# gives unlimited permission to copy and/or distribute it,
776# with or without modifications, as long as this notice is preserved.
777
778# AM_PROG_MKDIR_P
779# ---------------
780# Check for `mkdir -p'.
781AC_DEFUN([AM_PROG_MKDIR_P],
782[AC_PREREQ([2.60])dnl
783AC_REQUIRE([AC_PROG_MKDIR_P])dnl
784dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
785dnl while keeping a definition of mkdir_p for backward compatibility.
786dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
787dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
788dnl Makefile.ins that do not define MKDIR_P, so we do our own
789dnl adjustment using top_builddir (which is defined more often than
790dnl MKDIR_P).
791AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
792case $mkdir_p in
793  [[\\/$]]* | ?:[[\\/]]*) ;;
794  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
795esac
796])
797
798# Helper functions for option handling.                     -*- Autoconf -*-
799
800# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
801#
802# This file is free software; the Free Software Foundation
803# gives unlimited permission to copy and/or distribute it,
804# with or without modifications, as long as this notice is preserved.
805
806# serial 3
807
808# _AM_MANGLE_OPTION(NAME)
809# -----------------------
810AC_DEFUN([_AM_MANGLE_OPTION],
811[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
812
813# _AM_SET_OPTION(NAME)
814# ------------------------------
815# Set option NAME.  Presently that only means defining a flag for this option.
816AC_DEFUN([_AM_SET_OPTION],
817[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
818
819# _AM_SET_OPTIONS(OPTIONS)
820# ----------------------------------
821# OPTIONS is a space-separated list of Automake options.
822AC_DEFUN([_AM_SET_OPTIONS],
823[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
824
825# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
826# -------------------------------------------
827# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
828AC_DEFUN([_AM_IF_OPTION],
829[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
830
831# Check to make sure that the build environment is sane.    -*- Autoconf -*-
832
833# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
834# Free Software Foundation, Inc.
835#
836# This file is free software; the Free Software Foundation
837# gives unlimited permission to copy and/or distribute it,
838# with or without modifications, as long as this notice is preserved.
839
840# serial 4
841
842# AM_SANITY_CHECK
843# ---------------
844AC_DEFUN([AM_SANITY_CHECK],
845[AC_MSG_CHECKING([whether build environment is sane])
846# Just in case
847sleep 1
848echo timestamp > conftest.file
849# Do `set' in a subshell so we don't clobber the current shell's
850# arguments.  Must try -L first in case configure is actually a
851# symlink; some systems play weird games with the mod time of symlinks
852# (eg FreeBSD returns the mod time of the symlink's containing
853# directory).
854if (
855   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
856   if test "$[*]" = "X"; then
857      # -L didn't work.
858      set X `ls -t $srcdir/configure conftest.file`
859   fi
860   rm -f conftest.file
861   if test "$[*]" != "X $srcdir/configure conftest.file" \
862      && test "$[*]" != "X conftest.file $srcdir/configure"; then
863
864      # If neither matched, then we have a broken ls.  This can happen
865      # if, for instance, CONFIG_SHELL is bash and it inherits a
866      # broken ls alias from the environment.  This has actually
867      # happened.  Such a system could not be considered "sane".
868      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
869alias in your environment])
870   fi
871
872   test "$[2]" = conftest.file
873   )
874then
875   # Ok.
876   :
877else
878   AC_MSG_ERROR([newly created file is older than distributed files!
879Check your system clock])
880fi
881AC_MSG_RESULT(yes)])
882
883# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
884#
885# This file is free software; the Free Software Foundation
886# gives unlimited permission to copy and/or distribute it,
887# with or without modifications, as long as this notice is preserved.
888
889# AM_PROG_INSTALL_STRIP
890# ---------------------
891# One issue with vendor `install' (even GNU) is that you can't
892# specify the program used to strip binaries.  This is especially
893# annoying in cross-compiling environments, where the build's strip
894# is unlikely to handle the host's binaries.
895# Fortunately install-sh will honor a STRIPPROG variable, so we
896# always use install-sh in `make install-strip', and initialize
897# STRIPPROG with the value of the STRIP variable (set by the user).
898AC_DEFUN([AM_PROG_INSTALL_STRIP],
899[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
900# Installed binaries are usually stripped using `strip' when the user
901# run `make install-strip'.  However `strip' might not be the right
902# tool to use in cross-compilation environments, therefore Automake
903# will honor the `STRIP' environment variable to overrule this program.
904dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
905if test "$cross_compiling" != no; then
906  AC_CHECK_TOOL([STRIP], [strip], :)
907fi
908INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
909AC_SUBST([INSTALL_STRIP_PROGRAM])])
910
911# Copyright (C) 2006  Free Software Foundation, Inc.
912#
913# This file is free software; the Free Software Foundation
914# gives unlimited permission to copy and/or distribute it,
915# with or without modifications, as long as this notice is preserved.
916
917# _AM_SUBST_NOTMAKE(VARIABLE)
918# ---------------------------
919# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
920# This macro is traced by Automake.
921AC_DEFUN([_AM_SUBST_NOTMAKE])
922
923# Check how to create a tarball.                            -*- Autoconf -*-
924
925# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
926#
927# This file is free software; the Free Software Foundation
928# gives unlimited permission to copy and/or distribute it,
929# with or without modifications, as long as this notice is preserved.
930
931# serial 2
932
933# _AM_PROG_TAR(FORMAT)
934# --------------------
935# Check how to create a tarball in format FORMAT.
936# FORMAT should be one of `v7', `ustar', or `pax'.
937#
938# Substitute a variable $(am__tar) that is a command
939# writing to stdout a FORMAT-tarball containing the directory
940# $tardir.
941#     tardir=directory && $(am__tar) > result.tar
942#
943# Substitute a variable $(am__untar) that extract such
944# a tarball read from stdin.
945#     $(am__untar) < result.tar
946AC_DEFUN([_AM_PROG_TAR],
947[# Always define AMTAR for backward compatibility.
948AM_MISSING_PROG([AMTAR], [tar])
949m4_if([$1], [v7],
950     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
951     [m4_case([$1], [ustar],, [pax],,
952              [m4_fatal([Unknown tar format])])
953AC_MSG_CHECKING([how to create a $1 tar archive])
954# Loop over all known methods to create a tar archive until one works.
955_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
956_am_tools=${am_cv_prog_tar_$1-$_am_tools}
957# Do not fold the above two line into one, because Tru64 sh and
958# Solaris sh will not grok spaces in the rhs of `-'.
959for _am_tool in $_am_tools
960do
961  case $_am_tool in
962  gnutar)
963    for _am_tar in tar gnutar gtar;
964    do
965      AM_RUN_LOG([$_am_tar --version]) && break
966    done
967    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
968    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
969    am__untar="$_am_tar -xf -"
970    ;;
971  plaintar)
972    # Must skip GNU tar: if it does not support --format= it doesn't create
973    # ustar tarball either.
974    (tar --version) >/dev/null 2>&1 && continue
975    am__tar='tar chf - "$$tardir"'
976    am__tar_='tar chf - "$tardir"'
977    am__untar='tar xf -'
978    ;;
979  pax)
980    am__tar='pax -L -x $1 -w "$$tardir"'
981    am__tar_='pax -L -x $1 -w "$tardir"'
982    am__untar='pax -r'
983    ;;
984  cpio)
985    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
986    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
987    am__untar='cpio -i -H $1 -d'
988    ;;
989  none)
990    am__tar=false
991    am__tar_=false
992    am__untar=false
993    ;;
994  esac
995
996  # If the value was cached, stop now.  We just wanted to have am__tar
997  # and am__untar set.
998  test -n "${am_cv_prog_tar_$1}" && break
999
1000  # tar/untar a dummy directory, and stop if the command works
1001  rm -rf conftest.dir
1002  mkdir conftest.dir
1003  echo GrepMe > conftest.dir/file
1004  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1005  rm -rf conftest.dir
1006  if test -s conftest.tar; then
1007    AM_RUN_LOG([$am__untar <conftest.tar])
1008    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1009  fi
1010done
1011rm -rf conftest.dir
1012
1013AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1014AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1015AC_SUBST([am__tar])
1016AC_SUBST([am__untar])
1017]) # _AM_PROG_TAR
1018
1019