1# generated automatically by aclocal 1.11.1 -*- 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.65],,
17[m4_warning([this file was generated for autoconf 2.65.
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# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
23#
24# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
25#
26# This program is free software; you can redistribute it and/or modify
27# it under the terms of the GNU General Public License as published by
28# the Free Software Foundation; either version 2 of the License, or
29# (at your option) any later version.
30#
31# This program is distributed in the hope that it will be useful, but
32# WITHOUT ANY WARRANTY; without even the implied warranty of
33# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
34# General Public License for more details.
35#
36# You should have received a copy of the GNU General Public License
37# along with this program; if not, write to the Free Software
38# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
39#
40# As a special exception to the GNU General Public License, if you
41# distribute this file as part of a program that contains a
42# configuration script generated by Autoconf, you may include it under
43# the same distribution terms that you use for the rest of that program.
44
45# PKG_PROG_PKG_CONFIG([MIN-VERSION])
46# ----------------------------------
47AC_DEFUN([PKG_PROG_PKG_CONFIG],
48[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
49m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
50AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
51if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
52	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
53fi
54if test -n "$PKG_CONFIG"; then
55	_pkg_min_version=m4_default([$1], [0.9.0])
56	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
57	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
58		AC_MSG_RESULT([yes])
59	else
60		AC_MSG_RESULT([no])
61		PKG_CONFIG=""
62	fi
63
64fi[]dnl
65])# PKG_PROG_PKG_CONFIG
66
67# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
68#
69# Check to see whether a particular set of modules exists.  Similar
70# to PKG_CHECK_MODULES(), but does not set variables or print errors.
71#
72#
73# Similar to PKG_CHECK_MODULES, make sure that the first instance of
74# this or PKG_CHECK_MODULES is called, or make sure to call
75# PKG_CHECK_EXISTS manually
76# --------------------------------------------------------------
77AC_DEFUN([PKG_CHECK_EXISTS],
78[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
79if test -n "$PKG_CONFIG" && \
80    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
81  m4_ifval([$2], [$2], [:])
82m4_ifvaln([$3], [else
83  $3])dnl
84fi])
85
86
87# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
88# ---------------------------------------------
89m4_define([_PKG_CONFIG],
90[if test -n "$PKG_CONFIG"; then
91    if test -n "$$1"; then
92        pkg_cv_[]$1="$$1"
93    else
94        PKG_CHECK_EXISTS([$3],
95                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
96			 [pkg_failed=yes])
97    fi
98else
99	pkg_failed=untried
100fi[]dnl
101])# _PKG_CONFIG
102
103# _PKG_SHORT_ERRORS_SUPPORTED
104# -----------------------------
105AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
106[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
107if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
108        _pkg_short_errors_supported=yes
109else
110        _pkg_short_errors_supported=no
111fi[]dnl
112])# _PKG_SHORT_ERRORS_SUPPORTED
113
114
115# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
116# [ACTION-IF-NOT-FOUND])
117#
118#
119# Note that if there is a possibility the first call to
120# PKG_CHECK_MODULES might not happen, you should be sure to include an
121# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
122#
123#
124# --------------------------------------------------------------
125AC_DEFUN([PKG_CHECK_MODULES],
126[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
127AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
128AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
129
130pkg_failed=no
131AC_MSG_CHECKING([for $1])
132
133_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
134_PKG_CONFIG([$1][_LIBS], [libs], [$2])
135
136m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
137and $1[]_LIBS to avoid the need to call pkg-config.
138See the pkg-config man page for more details.])
139
140if test $pkg_failed = yes; then
141        _PKG_SHORT_ERRORS_SUPPORTED
142        if test $_pkg_short_errors_supported = yes; then
143	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
144        else
145	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
146        fi
147	# Put the nasty error message in config.log where it belongs
148	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
149
150	ifelse([$4], , [AC_MSG_ERROR(dnl
151[Package requirements ($2) were not met:
152
153$$1_PKG_ERRORS
154
155Consider adjusting the PKG_CONFIG_PATH environment variable if you
156installed software in a non-standard prefix.
157
158_PKG_TEXT
159])],
160		[AC_MSG_RESULT([no])
161                $4])
162elif test $pkg_failed = untried; then
163	ifelse([$4], , [AC_MSG_FAILURE(dnl
164[The pkg-config script could not be found or is too old.  Make sure it
165is in your PATH or set the PKG_CONFIG environment variable to the full
166path to pkg-config.
167
168_PKG_TEXT
169
170To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
171		[$4])
172else
173	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
174	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
175        AC_MSG_RESULT([yes])
176	ifelse([$3], , :, [$3])
177fi[]dnl
178])# PKG_CHECK_MODULES
179
180# Configure paths for SDL
181# Sam Lantinga 9/21/99
182# stolen from Manish Singh
183# stolen back from Frank Belew
184# stolen from Manish Singh
185# Shamelessly stolen from Owen Taylor
186
187dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
188dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
189dnl
190AC_DEFUN([AM_PATH_SDL],
191[dnl
192dnl Get the cflags and libraries from the sdl-config script
193dnl
194AC_ARG_WITH(sdl-prefix,[  --with-sdl-prefix=PFX   Prefix where SDL is installed (optional)],
195            sdl_prefix="$withval", sdl_prefix="")
196AC_ARG_WITH(sdl-exec-prefix,[  --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
197            sdl_exec_prefix="$withval", sdl_exec_prefix="")
198AC_ARG_ENABLE(sdltest, [  --disable-sdltest       Do not try to compile and run a test SDL program],
199		    , enable_sdltest=yes)
200
201  if test x$sdl_exec_prefix != x ; then
202    sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
203    if test x${SDL_CONFIG+set} != xset ; then
204      SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
205    fi
206  fi
207  if test x$sdl_prefix != x ; then
208    sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
209    if test x${SDL_CONFIG+set} != xset ; then
210      SDL_CONFIG=$sdl_prefix/bin/sdl-config
211    fi
212  fi
213
214  if test "x$prefix" != xNONE; then
215    PATH="$prefix/bin:$prefix/usr/bin:$PATH"
216  fi
217  AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
218  min_sdl_version=ifelse([$1], ,0.11.0,$1)
219  AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
220  no_sdl=""
221  if test "$SDL_CONFIG" = "no" ; then
222    no_sdl=yes
223  else
224    SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags`
225    SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
226
227    sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \
228           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
229    sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \
230           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
231    sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
232           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
233    if test "x$enable_sdltest" = "xyes" ; then
234      ac_save_CFLAGS="$CFLAGS"
235      ac_save_CXXFLAGS="$CXXFLAGS"
236      ac_save_LIBS="$LIBS"
237      CFLAGS="$CFLAGS $SDL_CFLAGS"
238      CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
239      LIBS="$LIBS $SDL_LIBS"
240dnl
241dnl Now check if the installed SDL is sufficiently new. (Also sanity
242dnl checks the results of sdl-config to some extent
243dnl
244      rm -f conf.sdltest
245      AC_TRY_RUN([
246#include <stdio.h>
247#include <stdlib.h>
248#include <string.h>
249#include "SDL.h"
250
251char*
252my_strdup (char *str)
253{
254  char *new_str;
255
256  if (str)
257    {
258      new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
259      strcpy (new_str, str);
260    }
261  else
262    new_str = NULL;
263
264  return new_str;
265}
266
267int main (int argc, char *argv[])
268{
269  int major, minor, micro;
270  char *tmp_version;
271
272  /* This hangs on some systems (?)
273  system ("touch conf.sdltest");
274  */
275  { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
276
277  /* HP/UX 9 (%@#!) writes to sscanf strings */
278  tmp_version = my_strdup("$min_sdl_version");
279  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
280     printf("%s, bad version string\n", "$min_sdl_version");
281     exit(1);
282   }
283
284   if (($sdl_major_version > major) ||
285      (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
286      (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
287    {
288      return 0;
289    }
290  else
291    {
292      printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
293      printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
294      printf("*** best to upgrade to the required version.\n");
295      printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
296      printf("*** to point to the correct copy of sdl-config, and remove the file\n");
297      printf("*** config.cache before re-running configure\n");
298      return 1;
299    }
300}
301
302],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
303       CFLAGS="$ac_save_CFLAGS"
304       CXXFLAGS="$ac_save_CXXFLAGS"
305       LIBS="$ac_save_LIBS"
306     fi
307  fi
308  if test "x$no_sdl" = x ; then
309     AC_MSG_RESULT(yes)
310     ifelse([$2], , :, [$2])
311  else
312     AC_MSG_RESULT(no)
313     if test "$SDL_CONFIG" = "no" ; then
314       echo "*** The sdl-config script installed by SDL could not be found"
315       echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
316       echo "*** your path, or set the SDL_CONFIG environment variable to the"
317       echo "*** full path to sdl-config."
318     else
319       if test -f conf.sdltest ; then
320        :
321       else
322          echo "*** Could not run SDL test program, checking why..."
323          CFLAGS="$CFLAGS $SDL_CFLAGS"
324          CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
325          LIBS="$LIBS $SDL_LIBS"
326          AC_TRY_LINK([
327#include <stdio.h>
328#include "SDL.h"
329
330int main(int argc, char *argv[])
331{ return 0; }
332#undef  main
333#define main K_and_R_C_main
334],      [ return 0; ],
335        [ echo "*** The test program compiled, but did not run. This usually means"
336          echo "*** that the run-time linker is not finding SDL or finding the wrong"
337          echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
338          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
339          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
340          echo "*** is required on your system"
341	  echo "***"
342          echo "*** If you have an old version installed, it is best to remove it, although"
343          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
344        [ echo "*** The test program failed to compile or link. See the file config.log for the"
345          echo "*** exact error that occured. This usually means SDL was incorrectly installed"
346          echo "*** or that you have moved SDL since it was installed. In the latter case, you"
347          echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
348          CFLAGS="$ac_save_CFLAGS"
349          CXXFLAGS="$ac_save_CXXFLAGS"
350          LIBS="$ac_save_LIBS"
351       fi
352     fi
353     SDL_CFLAGS=""
354     SDL_LIBS=""
355     ifelse([$3], , :, [$3])
356  fi
357  AC_SUBST(SDL_CFLAGS)
358  AC_SUBST(SDL_LIBS)
359  rm -f conf.sdltest
360])
361
362# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
363#
364# This file is free software; the Free Software Foundation
365# gives unlimited permission to copy and/or distribute it,
366# with or without modifications, as long as this notice is preserved.
367
368# AM_AUTOMAKE_VERSION(VERSION)
369# ----------------------------
370# Automake X.Y traces this macro to ensure aclocal.m4 has been
371# generated from the m4 files accompanying Automake X.Y.
372# (This private macro should not be called outside this file.)
373AC_DEFUN([AM_AUTOMAKE_VERSION],
374[am__api_version='1.11'
375dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
376dnl require some minimum version.  Point them to the right macro.
377m4_if([$1], [1.11.1], [],
378      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
379])
380
381# _AM_AUTOCONF_VERSION(VERSION)
382# -----------------------------
383# aclocal traces this macro to find the Autoconf version.
384# This is a private macro too.  Using m4_define simplifies
385# the logic in aclocal, which can simply ignore this definition.
386m4_define([_AM_AUTOCONF_VERSION], [])
387
388# AM_SET_CURRENT_AUTOMAKE_VERSION
389# -------------------------------
390# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
391# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
392AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
393[AM_AUTOMAKE_VERSION([1.11.1])dnl
394m4_ifndef([AC_AUTOCONF_VERSION],
395  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
396_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
397
398# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
399
400# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
401#
402# This file is free software; the Free Software Foundation
403# gives unlimited permission to copy and/or distribute it,
404# with or without modifications, as long as this notice is preserved.
405
406# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
407# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
408# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
409#
410# Of course, Automake must honor this variable whenever it calls a
411# tool from the auxiliary directory.  The problem is that $srcdir (and
412# therefore $ac_aux_dir as well) can be either absolute or relative,
413# depending on how configure is run.  This is pretty annoying, since
414# it makes $ac_aux_dir quite unusable in subdirectories: in the top
415# source directory, any form will work fine, but in subdirectories a
416# relative path needs to be adjusted first.
417#
418# $ac_aux_dir/missing
419#    fails when called from a subdirectory if $ac_aux_dir is relative
420# $top_srcdir/$ac_aux_dir/missing
421#    fails if $ac_aux_dir is absolute,
422#    fails when called from a subdirectory in a VPATH build with
423#          a relative $ac_aux_dir
424#
425# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
426# are both prefixed by $srcdir.  In an in-source build this is usually
427# harmless because $srcdir is `.', but things will broke when you
428# start a VPATH build or use an absolute $srcdir.
429#
430# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
431# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
432#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
433# and then we would define $MISSING as
434#   MISSING="\${SHELL} $am_aux_dir/missing"
435# This will work as long as MISSING is not called from configure, because
436# unfortunately $(top_srcdir) has no meaning in configure.
437# However there are other variables, like CC, which are often used in
438# configure, and could therefore not use this "fixed" $ac_aux_dir.
439#
440# Another solution, used here, is to always expand $ac_aux_dir to an
441# absolute PATH.  The drawback is that using absolute paths prevent a
442# configured tree to be moved without reconfiguration.
443
444AC_DEFUN([AM_AUX_DIR_EXPAND],
445[dnl Rely on autoconf to set up CDPATH properly.
446AC_PREREQ([2.50])dnl
447# expand $ac_aux_dir to an absolute path
448am_aux_dir=`cd $ac_aux_dir && pwd`
449])
450
451# AM_CONDITIONAL                                            -*- Autoconf -*-
452
453# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
454# Free Software Foundation, Inc.
455#
456# This file is free software; the Free Software Foundation
457# gives unlimited permission to copy and/or distribute it,
458# with or without modifications, as long as this notice is preserved.
459
460# serial 9
461
462# AM_CONDITIONAL(NAME, SHELL-CONDITION)
463# -------------------------------------
464# Define a conditional.
465AC_DEFUN([AM_CONDITIONAL],
466[AC_PREREQ(2.52)dnl
467 ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
468	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
469AC_SUBST([$1_TRUE])dnl
470AC_SUBST([$1_FALSE])dnl
471_AM_SUBST_NOTMAKE([$1_TRUE])dnl
472_AM_SUBST_NOTMAKE([$1_FALSE])dnl
473m4_define([_AM_COND_VALUE_$1], [$2])dnl
474if $2; then
475  $1_TRUE=
476  $1_FALSE='#'
477else
478  $1_TRUE='#'
479  $1_FALSE=
480fi
481AC_CONFIG_COMMANDS_PRE(
482[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
483  AC_MSG_ERROR([[conditional "$1" was never defined.
484Usually this means the macro was only invoked conditionally.]])
485fi])])
486
487# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
488# Free Software Foundation, Inc.
489#
490# This file is free software; the Free Software Foundation
491# gives unlimited permission to copy and/or distribute it,
492# with or without modifications, as long as this notice is preserved.
493
494# serial 10
495
496# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
497# written in clear, in which case automake, when reading aclocal.m4,
498# will think it sees a *use*, and therefore will trigger all it's
499# C support machinery.  Also note that it means that autoscan, seeing
500# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
501
502
503# _AM_DEPENDENCIES(NAME)
504# ----------------------
505# See how the compiler implements dependency checking.
506# NAME is "CC", "CXX", "GCJ", or "OBJC".
507# We try a few techniques and use that to set a single cache variable.
508#
509# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
510# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
511# dependency, and given that the user is not expected to run this macro,
512# just rely on AC_PROG_CC.
513AC_DEFUN([_AM_DEPENDENCIES],
514[AC_REQUIRE([AM_SET_DEPDIR])dnl
515AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
516AC_REQUIRE([AM_MAKE_INCLUDE])dnl
517AC_REQUIRE([AM_DEP_TRACK])dnl
518
519ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
520       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
521       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
522       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
523       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
524                   [depcc="$$1"   am_compiler_list=])
525
526AC_CACHE_CHECK([dependency style of $depcc],
527               [am_cv_$1_dependencies_compiler_type],
528[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
529  # We make a subdir and do the tests there.  Otherwise we can end up
530  # making bogus files that we don't know about and never remove.  For
531  # instance it was reported that on HP-UX the gcc test will end up
532  # making a dummy file named `D' -- because `-MD' means `put the output
533  # in D'.
534  mkdir conftest.dir
535  # Copy depcomp to subdir because otherwise we won't find it if we're
536  # using a relative directory.
537  cp "$am_depcomp" conftest.dir
538  cd conftest.dir
539  # We will build objects and dependencies in a subdirectory because
540  # it helps to detect inapplicable dependency modes.  For instance
541  # both Tru64's cc and ICC support -MD to output dependencies as a
542  # side effect of compilation, but ICC will put the dependencies in
543  # the current directory while Tru64 will put them in the object
544  # directory.
545  mkdir sub
546
547  am_cv_$1_dependencies_compiler_type=none
548  if test "$am_compiler_list" = ""; then
549     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
550  fi
551  am__universal=false
552  m4_case([$1], [CC],
553    [case " $depcc " in #(
554     *\ -arch\ *\ -arch\ *) am__universal=true ;;
555     esac],
556    [CXX],
557    [case " $depcc " in #(
558     *\ -arch\ *\ -arch\ *) am__universal=true ;;
559     esac])
560
561  for depmode in $am_compiler_list; do
562    # Setup a source with many dependencies, because some compilers
563    # like to wrap large dependency lists on column 80 (with \), and
564    # we should not choose a depcomp mode which is confused by this.
565    #
566    # We need to recreate these files for each test, as the compiler may
567    # overwrite some of them when testing with obscure command lines.
568    # This happens at least with the AIX C compiler.
569    : > sub/conftest.c
570    for i in 1 2 3 4 5 6; do
571      echo '#include "conftst'$i'.h"' >> sub/conftest.c
572      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
573      # Solaris 8's {/usr,}/bin/sh.
574      touch sub/conftst$i.h
575    done
576    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
577
578    # We check with `-c' and `-o' for the sake of the "dashmstdout"
579    # mode.  It turns out that the SunPro C++ compiler does not properly
580    # handle `-M -o', and we need to detect this.  Also, some Intel
581    # versions had trouble with output in subdirs
582    am__obj=sub/conftest.${OBJEXT-o}
583    am__minus_obj="-o $am__obj"
584    case $depmode in
585    gcc)
586      # This depmode causes a compiler race in universal mode.
587      test "$am__universal" = false || continue
588      ;;
589    nosideeffect)
590      # after this tag, mechanisms are not by side-effect, so they'll
591      # only be used when explicitly requested
592      if test "x$enable_dependency_tracking" = xyes; then
593	continue
594      else
595	break
596      fi
597      ;;
598    msvisualcpp | msvcmsys)
599      # This compiler won't grok `-c -o', but also, the minuso test has
600      # not run yet.  These depmodes are late enough in the game, and
601      # so weak that their functioning should not be impacted.
602      am__obj=conftest.${OBJEXT-o}
603      am__minus_obj=
604      ;;
605    none) break ;;
606    esac
607    if depmode=$depmode \
608       source=sub/conftest.c object=$am__obj \
609       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
610       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
611         >/dev/null 2>conftest.err &&
612       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
613       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
614       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
615       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
616      # icc doesn't choke on unknown options, it will just issue warnings
617      # or remarks (even with -Werror).  So we grep stderr for any message
618      # that says an option was ignored or not supported.
619      # When given -MP, icc 7.0 and 7.1 complain thusly:
620      #   icc: Command line warning: ignoring option '-M'; no argument required
621      # The diagnosis changed in icc 8.0:
622      #   icc: Command line remark: option '-MP' not supported
623      if (grep 'ignoring option' conftest.err ||
624          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
625        am_cv_$1_dependencies_compiler_type=$depmode
626        break
627      fi
628    fi
629  done
630
631  cd ..
632  rm -rf conftest.dir
633else
634  am_cv_$1_dependencies_compiler_type=none
635fi
636])
637AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
638AM_CONDITIONAL([am__fastdep$1], [
639  test "x$enable_dependency_tracking" != xno \
640  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
641])
642
643
644# AM_SET_DEPDIR
645# -------------
646# Choose a directory name for dependency files.
647# This macro is AC_REQUIREd in _AM_DEPENDENCIES
648AC_DEFUN([AM_SET_DEPDIR],
649[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
650AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
651])
652
653
654# AM_DEP_TRACK
655# ------------
656AC_DEFUN([AM_DEP_TRACK],
657[AC_ARG_ENABLE(dependency-tracking,
658[  --disable-dependency-tracking  speeds up one-time build
659  --enable-dependency-tracking   do not reject slow dependency extractors])
660if test "x$enable_dependency_tracking" != xno; then
661  am_depcomp="$ac_aux_dir/depcomp"
662  AMDEPBACKSLASH='\'
663fi
664AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
665AC_SUBST([AMDEPBACKSLASH])dnl
666_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
667])
668
669# Generate code to set up dependency tracking.              -*- Autoconf -*-
670
671# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
672# Free Software Foundation, Inc.
673#
674# This file is free software; the Free Software Foundation
675# gives unlimited permission to copy and/or distribute it,
676# with or without modifications, as long as this notice is preserved.
677
678#serial 5
679
680# _AM_OUTPUT_DEPENDENCY_COMMANDS
681# ------------------------------
682AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
683[{
684  # Autoconf 2.62 quotes --file arguments for eval, but not when files
685  # are listed without --file.  Let's play safe and only enable the eval
686  # if we detect the quoting.
687  case $CONFIG_FILES in
688  *\'*) eval set x "$CONFIG_FILES" ;;
689  *)   set x $CONFIG_FILES ;;
690  esac
691  shift
692  for mf
693  do
694    # Strip MF so we end up with the name of the file.
695    mf=`echo "$mf" | sed -e 's/:.*$//'`
696    # Check whether this is an Automake generated Makefile or not.
697    # We used to match only the files named `Makefile.in', but
698    # some people rename them; so instead we look at the file content.
699    # Grep'ing the first line is not enough: some people post-process
700    # each Makefile.in and add a new line on top of each file to say so.
701    # Grep'ing the whole file is not good either: AIX grep has a line
702    # limit of 2048, but all sed's we know have understand at least 4000.
703    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
704      dirpart=`AS_DIRNAME("$mf")`
705    else
706      continue
707    fi
708    # Extract the definition of DEPDIR, am__include, and am__quote
709    # from the Makefile without running `make'.
710    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
711    test -z "$DEPDIR" && continue
712    am__include=`sed -n 's/^am__include = //p' < "$mf"`
713    test -z "am__include" && continue
714    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
715    # When using ansi2knr, U may be empty or an underscore; expand it
716    U=`sed -n 's/^U = //p' < "$mf"`
717    # Find all dependency output files, they are included files with
718    # $(DEPDIR) in their names.  We invoke sed twice because it is the
719    # simplest approach to changing $(DEPDIR) to its actual value in the
720    # expansion.
721    for file in `sed -n "
722      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
723	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
724      # Make sure the directory exists.
725      test -f "$dirpart/$file" && continue
726      fdir=`AS_DIRNAME(["$file"])`
727      AS_MKDIR_P([$dirpart/$fdir])
728      # echo "creating $dirpart/$file"
729      echo '# dummy' > "$dirpart/$file"
730    done
731  done
732}
733])# _AM_OUTPUT_DEPENDENCY_COMMANDS
734
735
736# AM_OUTPUT_DEPENDENCY_COMMANDS
737# -----------------------------
738# This macro should only be invoked once -- use via AC_REQUIRE.
739#
740# This code is only required when automatic dependency tracking
741# is enabled.  FIXME.  This creates each `.P' file that we will
742# need in order to bootstrap the dependency handling code.
743AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
744[AC_CONFIG_COMMANDS([depfiles],
745     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
746     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
747])
748
749# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
750# Free Software Foundation, Inc.
751#
752# This file is free software; the Free Software Foundation
753# gives unlimited permission to copy and/or distribute it,
754# with or without modifications, as long as this notice is preserved.
755
756# serial 8
757
758# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
759AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
760
761# Do all the work for Automake.                             -*- Autoconf -*-
762
763# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
764# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
765#
766# This file is free software; the Free Software Foundation
767# gives unlimited permission to copy and/or distribute it,
768# with or without modifications, as long as this notice is preserved.
769
770# serial 16
771
772# This macro actually does too much.  Some checks are only needed if
773# your package does certain things.  But this isn't really a big deal.
774
775# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
776# AM_INIT_AUTOMAKE([OPTIONS])
777# -----------------------------------------------
778# The call with PACKAGE and VERSION arguments is the old style
779# call (pre autoconf-2.50), which is being phased out.  PACKAGE
780# and VERSION should now be passed to AC_INIT and removed from
781# the call to AM_INIT_AUTOMAKE.
782# We support both call styles for the transition.  After
783# the next Automake release, Autoconf can make the AC_INIT
784# arguments mandatory, and then we can depend on a new Autoconf
785# release and drop the old call support.
786AC_DEFUN([AM_INIT_AUTOMAKE],
787[AC_PREREQ([2.62])dnl
788dnl Autoconf wants to disallow AM_ names.  We explicitly allow
789dnl the ones we care about.
790m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
791AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
792AC_REQUIRE([AC_PROG_INSTALL])dnl
793if test "`cd $srcdir && pwd`" != "`pwd`"; then
794  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
795  # is not polluted with repeated "-I."
796  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
797  # test to see if srcdir already configured
798  if test -f $srcdir/config.status; then
799    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
800  fi
801fi
802
803# test whether we have cygpath
804if test -z "$CYGPATH_W"; then
805  if (cygpath --version) >/dev/null 2>/dev/null; then
806    CYGPATH_W='cygpath -w'
807  else
808    CYGPATH_W=echo
809  fi
810fi
811AC_SUBST([CYGPATH_W])
812
813# Define the identity of the package.
814dnl Distinguish between old-style and new-style calls.
815m4_ifval([$2],
816[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
817 AC_SUBST([PACKAGE], [$1])dnl
818 AC_SUBST([VERSION], [$2])],
819[_AM_SET_OPTIONS([$1])dnl
820dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
821m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
822  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
823 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
824 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
825
826_AM_IF_OPTION([no-define],,
827[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
828 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
829
830# Some tools Automake needs.
831AC_REQUIRE([AM_SANITY_CHECK])dnl
832AC_REQUIRE([AC_ARG_PROGRAM])dnl
833AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
834AM_MISSING_PROG(AUTOCONF, autoconf)
835AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
836AM_MISSING_PROG(AUTOHEADER, autoheader)
837AM_MISSING_PROG(MAKEINFO, makeinfo)
838AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
839AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
840AC_REQUIRE([AM_PROG_MKDIR_P])dnl
841# We need awk for the "check" target.  The system "awk" is bad on
842# some platforms.
843AC_REQUIRE([AC_PROG_AWK])dnl
844AC_REQUIRE([AC_PROG_MAKE_SET])dnl
845AC_REQUIRE([AM_SET_LEADING_DOT])dnl
846_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
847	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
848			     [_AM_PROG_TAR([v7])])])
849_AM_IF_OPTION([no-dependencies],,
850[AC_PROVIDE_IFELSE([AC_PROG_CC],
851		  [_AM_DEPENDENCIES(CC)],
852		  [define([AC_PROG_CC],
853			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
854AC_PROVIDE_IFELSE([AC_PROG_CXX],
855		  [_AM_DEPENDENCIES(CXX)],
856		  [define([AC_PROG_CXX],
857			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
858AC_PROVIDE_IFELSE([AC_PROG_OBJC],
859		  [_AM_DEPENDENCIES(OBJC)],
860		  [define([AC_PROG_OBJC],
861			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
862])
863_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
864dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
865dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
866dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
867AC_CONFIG_COMMANDS_PRE(dnl
868[m4_provide_if([_AM_COMPILER_EXEEXT],
869  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
870])
871
872dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
873dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
874dnl mangled by Autoconf and run in a shell conditional statement.
875m4_define([_AC_COMPILER_EXEEXT],
876m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
877
878
879# When config.status generates a header, we must update the stamp-h file.
880# This file resides in the same directory as the config header
881# that is generated.  The stamp files are numbered to have different names.
882
883# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
884# loop where config.status creates the headers, so we can generate
885# our stamp files there.
886AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
887[# Compute $1's index in $config_headers.
888_am_arg=$1
889_am_stamp_count=1
890for _am_header in $config_headers :; do
891  case $_am_header in
892    $_am_arg | $_am_arg:* )
893      break ;;
894    * )
895      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
896  esac
897done
898echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
899
900# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
901#
902# This file is free software; the Free Software Foundation
903# gives unlimited permission to copy and/or distribute it,
904# with or without modifications, as long as this notice is preserved.
905
906# AM_PROG_INSTALL_SH
907# ------------------
908# Define $install_sh.
909AC_DEFUN([AM_PROG_INSTALL_SH],
910[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
911if test x"${install_sh}" != xset; then
912  case $am_aux_dir in
913  *\ * | *\	*)
914    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
915  *)
916    install_sh="\${SHELL} $am_aux_dir/install-sh"
917  esac
918fi
919AC_SUBST(install_sh)])
920
921# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
922#
923# This file is free software; the Free Software Foundation
924# gives unlimited permission to copy and/or distribute it,
925# with or without modifications, as long as this notice is preserved.
926
927# serial 2
928
929# Check whether the underlying file-system supports filenames
930# with a leading dot.  For instance MS-DOS doesn't.
931AC_DEFUN([AM_SET_LEADING_DOT],
932[rm -rf .tst 2>/dev/null
933mkdir .tst 2>/dev/null
934if test -d .tst; then
935  am__leading_dot=.
936else
937  am__leading_dot=_
938fi
939rmdir .tst 2>/dev/null
940AC_SUBST([am__leading_dot])])
941
942# Check to see how 'make' treats includes.	            -*- Autoconf -*-
943
944# Copyright (C) 2001, 2002, 2003, 2005, 2009  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 4
951
952# AM_MAKE_INCLUDE()
953# -----------------
954# Check to see how make treats includes.
955AC_DEFUN([AM_MAKE_INCLUDE],
956[am_make=${MAKE-make}
957cat > confinc << 'END'
958am__doit:
959	@echo this is the am__doit target
960.PHONY: am__doit
961END
962# If we don't find an include directive, just comment out the code.
963AC_MSG_CHECKING([for style of include used by $am_make])
964am__include="#"
965am__quote=
966_am_result=none
967# First try GNU make style include.
968echo "include confinc" > confmf
969# Ignore all kinds of additional output from `make'.
970case `$am_make -s -f confmf 2> /dev/null` in #(
971*the\ am__doit\ target*)
972  am__include=include
973  am__quote=
974  _am_result=GNU
975  ;;
976esac
977# Now try BSD make style include.
978if test "$am__include" = "#"; then
979   echo '.include "confinc"' > confmf
980   case `$am_make -s -f confmf 2> /dev/null` in #(
981   *the\ am__doit\ target*)
982     am__include=.include
983     am__quote="\""
984     _am_result=BSD
985     ;;
986   esac
987fi
988AC_SUBST([am__include])
989AC_SUBST([am__quote])
990AC_MSG_RESULT([$_am_result])
991rm -f confinc confmf
992])
993
994# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
995
996# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
997# Free Software Foundation, Inc.
998#
999# This file is free software; the Free Software Foundation
1000# gives unlimited permission to copy and/or distribute it,
1001# with or without modifications, as long as this notice is preserved.
1002
1003# serial 6
1004
1005# AM_MISSING_PROG(NAME, PROGRAM)
1006# ------------------------------
1007AC_DEFUN([AM_MISSING_PROG],
1008[AC_REQUIRE([AM_MISSING_HAS_RUN])
1009$1=${$1-"${am_missing_run}$2"}
1010AC_SUBST($1)])
1011
1012
1013# AM_MISSING_HAS_RUN
1014# ------------------
1015# Define MISSING if not defined so far and test if it supports --run.
1016# If it does, set am_missing_run to use it, otherwise, to nothing.
1017AC_DEFUN([AM_MISSING_HAS_RUN],
1018[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1019AC_REQUIRE_AUX_FILE([missing])dnl
1020if test x"${MISSING+set}" != xset; then
1021  case $am_aux_dir in
1022  *\ * | *\	*)
1023    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
1024  *)
1025    MISSING="\${SHELL} $am_aux_dir/missing" ;;
1026  esac
1027fi
1028# Use eval to expand $SHELL
1029if eval "$MISSING --run true"; then
1030  am_missing_run="$MISSING --run "
1031else
1032  am_missing_run=
1033  AC_MSG_WARN([`missing' script is too old or missing])
1034fi
1035])
1036
1037# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
1038#
1039# This file is free software; the Free Software Foundation
1040# gives unlimited permission to copy and/or distribute it,
1041# with or without modifications, as long as this notice is preserved.
1042
1043# AM_PROG_MKDIR_P
1044# ---------------
1045# Check for `mkdir -p'.
1046AC_DEFUN([AM_PROG_MKDIR_P],
1047[AC_PREREQ([2.60])dnl
1048AC_REQUIRE([AC_PROG_MKDIR_P])dnl
1049dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
1050dnl while keeping a definition of mkdir_p for backward compatibility.
1051dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
1052dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
1053dnl Makefile.ins that do not define MKDIR_P, so we do our own
1054dnl adjustment using top_builddir (which is defined more often than
1055dnl MKDIR_P).
1056AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
1057case $mkdir_p in
1058  [[\\/$]]* | ?:[[\\/]]*) ;;
1059  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
1060esac
1061])
1062
1063# Helper functions for option handling.                     -*- Autoconf -*-
1064
1065# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
1066#
1067# This file is free software; the Free Software Foundation
1068# gives unlimited permission to copy and/or distribute it,
1069# with or without modifications, as long as this notice is preserved.
1070
1071# serial 4
1072
1073# _AM_MANGLE_OPTION(NAME)
1074# -----------------------
1075AC_DEFUN([_AM_MANGLE_OPTION],
1076[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1077
1078# _AM_SET_OPTION(NAME)
1079# ------------------------------
1080# Set option NAME.  Presently that only means defining a flag for this option.
1081AC_DEFUN([_AM_SET_OPTION],
1082[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1083
1084# _AM_SET_OPTIONS(OPTIONS)
1085# ----------------------------------
1086# OPTIONS is a space-separated list of Automake options.
1087AC_DEFUN([_AM_SET_OPTIONS],
1088[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1089
1090# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1091# -------------------------------------------
1092# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1093AC_DEFUN([_AM_IF_OPTION],
1094[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1095
1096# Check to make sure that the build environment is sane.    -*- Autoconf -*-
1097
1098# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
1099# Free Software Foundation, Inc.
1100#
1101# This file is free software; the Free Software Foundation
1102# gives unlimited permission to copy and/or distribute it,
1103# with or without modifications, as long as this notice is preserved.
1104
1105# serial 5
1106
1107# AM_SANITY_CHECK
1108# ---------------
1109AC_DEFUN([AM_SANITY_CHECK],
1110[AC_MSG_CHECKING([whether build environment is sane])
1111# Just in case
1112sleep 1
1113echo timestamp > conftest.file
1114# Reject unsafe characters in $srcdir or the absolute working directory
1115# name.  Accept space and tab only in the latter.
1116am_lf='
1117'
1118case `pwd` in
1119  *[[\\\"\#\$\&\'\`$am_lf]]*)
1120    AC_MSG_ERROR([unsafe absolute working directory name]);;
1121esac
1122case $srcdir in
1123  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
1124    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
1125esac
1126
1127# Do `set' in a subshell so we don't clobber the current shell's
1128# arguments.  Must try -L first in case configure is actually a
1129# symlink; some systems play weird games with the mod time of symlinks
1130# (eg FreeBSD returns the mod time of the symlink's containing
1131# directory).
1132if (
1133   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
1134   if test "$[*]" = "X"; then
1135      # -L didn't work.
1136      set X `ls -t "$srcdir/configure" conftest.file`
1137   fi
1138   rm -f conftest.file
1139   if test "$[*]" != "X $srcdir/configure conftest.file" \
1140      && test "$[*]" != "X conftest.file $srcdir/configure"; then
1141
1142      # If neither matched, then we have a broken ls.  This can happen
1143      # if, for instance, CONFIG_SHELL is bash and it inherits a
1144      # broken ls alias from the environment.  This has actually
1145      # happened.  Such a system could not be considered "sane".
1146      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1147alias in your environment])
1148   fi
1149
1150   test "$[2]" = conftest.file
1151   )
1152then
1153   # Ok.
1154   :
1155else
1156   AC_MSG_ERROR([newly created file is older than distributed files!
1157Check your system clock])
1158fi
1159AC_MSG_RESULT(yes)])
1160
1161# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1162#
1163# This file is free software; the Free Software Foundation
1164# gives unlimited permission to copy and/or distribute it,
1165# with or without modifications, as long as this notice is preserved.
1166
1167# AM_PROG_INSTALL_STRIP
1168# ---------------------
1169# One issue with vendor `install' (even GNU) is that you can't
1170# specify the program used to strip binaries.  This is especially
1171# annoying in cross-compiling environments, where the build's strip
1172# is unlikely to handle the host's binaries.
1173# Fortunately install-sh will honor a STRIPPROG variable, so we
1174# always use install-sh in `make install-strip', and initialize
1175# STRIPPROG with the value of the STRIP variable (set by the user).
1176AC_DEFUN([AM_PROG_INSTALL_STRIP],
1177[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1178# Installed binaries are usually stripped using `strip' when the user
1179# run `make install-strip'.  However `strip' might not be the right
1180# tool to use in cross-compilation environments, therefore Automake
1181# will honor the `STRIP' environment variable to overrule this program.
1182dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1183if test "$cross_compiling" != no; then
1184  AC_CHECK_TOOL([STRIP], [strip], :)
1185fi
1186INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1187AC_SUBST([INSTALL_STRIP_PROGRAM])])
1188
1189# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
1190#
1191# This file is free software; the Free Software Foundation
1192# gives unlimited permission to copy and/or distribute it,
1193# with or without modifications, as long as this notice is preserved.
1194
1195# serial 2
1196
1197# _AM_SUBST_NOTMAKE(VARIABLE)
1198# ---------------------------
1199# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1200# This macro is traced by Automake.
1201AC_DEFUN([_AM_SUBST_NOTMAKE])
1202
1203# AM_SUBST_NOTMAKE(VARIABLE)
1204# ---------------------------
1205# Public sister of _AM_SUBST_NOTMAKE.
1206AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1207
1208# Check how to create a tarball.                            -*- Autoconf -*-
1209
1210# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
1211#
1212# This file is free software; the Free Software Foundation
1213# gives unlimited permission to copy and/or distribute it,
1214# with or without modifications, as long as this notice is preserved.
1215
1216# serial 2
1217
1218# _AM_PROG_TAR(FORMAT)
1219# --------------------
1220# Check how to create a tarball in format FORMAT.
1221# FORMAT should be one of `v7', `ustar', or `pax'.
1222#
1223# Substitute a variable $(am__tar) that is a command
1224# writing to stdout a FORMAT-tarball containing the directory
1225# $tardir.
1226#     tardir=directory && $(am__tar) > result.tar
1227#
1228# Substitute a variable $(am__untar) that extract such
1229# a tarball read from stdin.
1230#     $(am__untar) < result.tar
1231AC_DEFUN([_AM_PROG_TAR],
1232[# Always define AMTAR for backward compatibility.
1233AM_MISSING_PROG([AMTAR], [tar])
1234m4_if([$1], [v7],
1235     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
1236     [m4_case([$1], [ustar],, [pax],,
1237              [m4_fatal([Unknown tar format])])
1238AC_MSG_CHECKING([how to create a $1 tar archive])
1239# Loop over all known methods to create a tar archive until one works.
1240_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1241_am_tools=${am_cv_prog_tar_$1-$_am_tools}
1242# Do not fold the above two line into one, because Tru64 sh and
1243# Solaris sh will not grok spaces in the rhs of `-'.
1244for _am_tool in $_am_tools
1245do
1246  case $_am_tool in
1247  gnutar)
1248    for _am_tar in tar gnutar gtar;
1249    do
1250      AM_RUN_LOG([$_am_tar --version]) && break
1251    done
1252    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1253    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1254    am__untar="$_am_tar -xf -"
1255    ;;
1256  plaintar)
1257    # Must skip GNU tar: if it does not support --format= it doesn't create
1258    # ustar tarball either.
1259    (tar --version) >/dev/null 2>&1 && continue
1260    am__tar='tar chf - "$$tardir"'
1261    am__tar_='tar chf - "$tardir"'
1262    am__untar='tar xf -'
1263    ;;
1264  pax)
1265    am__tar='pax -L -x $1 -w "$$tardir"'
1266    am__tar_='pax -L -x $1 -w "$tardir"'
1267    am__untar='pax -r'
1268    ;;
1269  cpio)
1270    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1271    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1272    am__untar='cpio -i -H $1 -d'
1273    ;;
1274  none)
1275    am__tar=false
1276    am__tar_=false
1277    am__untar=false
1278    ;;
1279  esac
1280
1281  # If the value was cached, stop now.  We just wanted to have am__tar
1282  # and am__untar set.
1283  test -n "${am_cv_prog_tar_$1}" && break
1284
1285  # tar/untar a dummy directory, and stop if the command works
1286  rm -rf conftest.dir
1287  mkdir conftest.dir
1288  echo GrepMe > conftest.dir/file
1289  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1290  rm -rf conftest.dir
1291  if test -s conftest.tar; then
1292    AM_RUN_LOG([$am__untar <conftest.tar])
1293    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1294  fi
1295done
1296rm -rf conftest.dir
1297
1298AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1299AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1300AC_SUBST([am__tar])
1301AC_SUBST([am__untar])
1302]) # _AM_PROG_TAR
1303
1304m4_include([config/m4/codeset.m4])
1305m4_include([config/m4/gettext.m4])
1306m4_include([config/m4/glibc2.m4])
1307m4_include([config/m4/glibc21.m4])
1308m4_include([config/m4/iconv.m4])
1309m4_include([config/m4/intdiv0.m4])
1310m4_include([config/m4/intl.m4])
1311m4_include([config/m4/intlmacosx.m4])
1312m4_include([config/m4/intmax.m4])
1313m4_include([config/m4/inttypes-pri.m4])
1314m4_include([config/m4/inttypes_h.m4])
1315m4_include([config/m4/lcmessage.m4])
1316m4_include([config/m4/lib-ld.m4])
1317m4_include([config/m4/lib-link.m4])
1318m4_include([config/m4/lib-prefix.m4])
1319m4_include([config/m4/lock.m4])
1320m4_include([config/m4/longlong.m4])
1321m4_include([config/m4/nls.m4])
1322m4_include([config/m4/po.m4])
1323m4_include([config/m4/printf-posix.m4])
1324m4_include([config/m4/progtest.m4])
1325m4_include([config/m4/size_max.m4])
1326m4_include([config/m4/stdint_h.m4])
1327m4_include([config/m4/uintmax_t.m4])
1328m4_include([config/m4/visibility.m4])
1329m4_include([config/m4/wchar_t.m4])
1330m4_include([config/m4/wint_t.m4])
1331m4_include([config/m4/xsize.m4])
1332