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