aclocal.m4 revision f591e195
1f591e195Smrg# generated automatically by aclocal 1.14 -*- Autoconf -*-
2f591e195Smrg
3f591e195Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4d4401354Smrg
5d4401354Smrg# This file is free software; the Free Software Foundation
6d4401354Smrg# gives unlimited permission to copy and/or distribute it,
7d4401354Smrg# with or without modifications, as long as this notice is preserved.
8d4401354Smrg
9d4401354Smrg# This program is distributed in the hope that it will be useful,
10d4401354Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11d4401354Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12d4401354Smrg# PARTICULAR PURPOSE.
13d4401354Smrg
14f591e195Smrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15d4401354Smrgm4_ifndef([AC_AUTOCONF_VERSION],
16d4401354Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17986c8b3dSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18986c8b3dSmrg[m4_warning([this file was generated for autoconf 2.69.
19d4401354SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20d4401354SmrgIf you have problems, you may need to regenerate the build system entirely.
21f591e195SmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22d4401354Smrg
23f591e195Smrg# Copyright (C) 2002-2013 Free Software Foundation, Inc.
24d4401354Smrg#
25d4401354Smrg# This file is free software; the Free Software Foundation
26d4401354Smrg# gives unlimited permission to copy and/or distribute it,
27d4401354Smrg# with or without modifications, as long as this notice is preserved.
28d4401354Smrg
29d4401354Smrg# AM_AUTOMAKE_VERSION(VERSION)
30d4401354Smrg# ----------------------------
31d4401354Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
32d4401354Smrg# generated from the m4 files accompanying Automake X.Y.
33d4401354Smrg# (This private macro should not be called outside this file.)
34d4401354SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
35f591e195Smrg[am__api_version='1.14'
36d4401354Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
37d4401354Smrgdnl require some minimum version.  Point them to the right macro.
38f591e195Smrgm4_if([$1], [1.14], [],
39d4401354Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
40d4401354Smrg])
41d4401354Smrg
42d4401354Smrg# _AM_AUTOCONF_VERSION(VERSION)
43d4401354Smrg# -----------------------------
44d4401354Smrg# aclocal traces this macro to find the Autoconf version.
45d4401354Smrg# This is a private macro too.  Using m4_define simplifies
46d4401354Smrg# the logic in aclocal, which can simply ignore this definition.
47d4401354Smrgm4_define([_AM_AUTOCONF_VERSION], [])
48d4401354Smrg
49d4401354Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
50d4401354Smrg# -------------------------------
51d4401354Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
52d4401354Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
53d4401354SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
54f591e195Smrg[AM_AUTOMAKE_VERSION([1.14])dnl
55d4401354Smrgm4_ifndef([AC_AUTOCONF_VERSION],
56d4401354Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
57d4401354Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
58d4401354Smrg
59d4401354Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
60d4401354Smrg
61f591e195Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
62d4401354Smrg#
63d4401354Smrg# This file is free software; the Free Software Foundation
64d4401354Smrg# gives unlimited permission to copy and/or distribute it,
65d4401354Smrg# with or without modifications, as long as this notice is preserved.
66d4401354Smrg
67d4401354Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
68f591e195Smrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
69f591e195Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
70d4401354Smrg#
71d4401354Smrg# Of course, Automake must honor this variable whenever it calls a
72d4401354Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
73d4401354Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
74d4401354Smrg# depending on how configure is run.  This is pretty annoying, since
75d4401354Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
76d4401354Smrg# source directory, any form will work fine, but in subdirectories a
77d4401354Smrg# relative path needs to be adjusted first.
78d4401354Smrg#
79d4401354Smrg# $ac_aux_dir/missing
80d4401354Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
81d4401354Smrg# $top_srcdir/$ac_aux_dir/missing
82d4401354Smrg#    fails if $ac_aux_dir is absolute,
83d4401354Smrg#    fails when called from a subdirectory in a VPATH build with
84d4401354Smrg#          a relative $ac_aux_dir
85d4401354Smrg#
86d4401354Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
87d4401354Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
88f591e195Smrg# harmless because $srcdir is '.', but things will broke when you
89d4401354Smrg# start a VPATH build or use an absolute $srcdir.
90d4401354Smrg#
91d4401354Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
92d4401354Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
93d4401354Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
94d4401354Smrg# and then we would define $MISSING as
95d4401354Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
96d4401354Smrg# This will work as long as MISSING is not called from configure, because
97d4401354Smrg# unfortunately $(top_srcdir) has no meaning in configure.
98d4401354Smrg# However there are other variables, like CC, which are often used in
99d4401354Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
100d4401354Smrg#
101d4401354Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
102d4401354Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
103d4401354Smrg# configured tree to be moved without reconfiguration.
104d4401354Smrg
105d4401354SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
106d4401354Smrg[dnl Rely on autoconf to set up CDPATH properly.
107d4401354SmrgAC_PREREQ([2.50])dnl
108d4401354Smrg# expand $ac_aux_dir to an absolute path
109d4401354Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
110d4401354Smrg])
111d4401354Smrg
112d4401354Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
113d4401354Smrg
114f591e195Smrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
115d4401354Smrg#
116d4401354Smrg# This file is free software; the Free Software Foundation
117d4401354Smrg# gives unlimited permission to copy and/or distribute it,
118d4401354Smrg# with or without modifications, as long as this notice is preserved.
119d4401354Smrg
120d4401354Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
121d4401354Smrg# -------------------------------------
122d4401354Smrg# Define a conditional.
123d4401354SmrgAC_DEFUN([AM_CONDITIONAL],
124f591e195Smrg[AC_PREREQ([2.52])dnl
125f591e195Smrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
126f591e195Smrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
127d4401354SmrgAC_SUBST([$1_TRUE])dnl
128d4401354SmrgAC_SUBST([$1_FALSE])dnl
129d4401354Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
130d4401354Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
131d4401354Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
132d4401354Smrgif $2; then
133d4401354Smrg  $1_TRUE=
134d4401354Smrg  $1_FALSE='#'
135d4401354Smrgelse
136d4401354Smrg  $1_TRUE='#'
137d4401354Smrg  $1_FALSE=
138d4401354Smrgfi
139d4401354SmrgAC_CONFIG_COMMANDS_PRE(
140d4401354Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
141d4401354Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
142d4401354SmrgUsually this means the macro was only invoked conditionally.]])
143d4401354Smrgfi])])
144d4401354Smrg
145d4401354Smrg# Do all the work for Automake.                             -*- Autoconf -*-
146d4401354Smrg
147f591e195Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
148d4401354Smrg#
149d4401354Smrg# This file is free software; the Free Software Foundation
150d4401354Smrg# gives unlimited permission to copy and/or distribute it,
151d4401354Smrg# with or without modifications, as long as this notice is preserved.
152d4401354Smrg
153d4401354Smrg# This macro actually does too much.  Some checks are only needed if
154d4401354Smrg# your package does certain things.  But this isn't really a big deal.
155d4401354Smrg
156f591e195Smrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
157f591e195Smrgm4_define([AC_PROG_CC],
158f591e195Smrgm4_defn([AC_PROG_CC])
159f591e195Smrg[_AM_PROG_CC_C_O
160f591e195Smrg])
161f591e195Smrg
162d4401354Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
163d4401354Smrg# AM_INIT_AUTOMAKE([OPTIONS])
164d4401354Smrg# -----------------------------------------------
165d4401354Smrg# The call with PACKAGE and VERSION arguments is the old style
166d4401354Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
167d4401354Smrg# and VERSION should now be passed to AC_INIT and removed from
168d4401354Smrg# the call to AM_INIT_AUTOMAKE.
169d4401354Smrg# We support both call styles for the transition.  After
170d4401354Smrg# the next Automake release, Autoconf can make the AC_INIT
171d4401354Smrg# arguments mandatory, and then we can depend on a new Autoconf
172d4401354Smrg# release and drop the old call support.
173d4401354SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
174f591e195Smrg[AC_PREREQ([2.65])dnl
175d4401354Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
176d4401354Smrgdnl the ones we care about.
177d4401354Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
178d4401354SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
179d4401354SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
180d4401354Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
181d4401354Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
182d4401354Smrg  # is not polluted with repeated "-I."
183d4401354Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
184d4401354Smrg  # test to see if srcdir already configured
185d4401354Smrg  if test -f $srcdir/config.status; then
186d4401354Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
187d4401354Smrg  fi
188d4401354Smrgfi
189d4401354Smrg
190d4401354Smrg# test whether we have cygpath
191d4401354Smrgif test -z "$CYGPATH_W"; then
192d4401354Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
193d4401354Smrg    CYGPATH_W='cygpath -w'
194d4401354Smrg  else
195d4401354Smrg    CYGPATH_W=echo
196d4401354Smrg  fi
197d4401354Smrgfi
198d4401354SmrgAC_SUBST([CYGPATH_W])
199d4401354Smrg
200d4401354Smrg# Define the identity of the package.
201d4401354Smrgdnl Distinguish between old-style and new-style calls.
202d4401354Smrgm4_ifval([$2],
203f591e195Smrg[AC_DIAGNOSE([obsolete],
204f591e195Smrg             [$0: two- and three-arguments forms are deprecated.])
205f591e195Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
206d4401354Smrg AC_SUBST([PACKAGE], [$1])dnl
207d4401354Smrg AC_SUBST([VERSION], [$2])],
208d4401354Smrg[_AM_SET_OPTIONS([$1])dnl
209d4401354Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
210f591e195Smrgm4_if(
211f591e195Smrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
212f591e195Smrg  [ok:ok],,
213d4401354Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
214d4401354Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
215d4401354Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
216d4401354Smrg
217d4401354Smrg_AM_IF_OPTION([no-define],,
218f591e195Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
219f591e195Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
220d4401354Smrg
221d4401354Smrg# Some tools Automake needs.
222d4401354SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
223d4401354SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
224f591e195SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
225f591e195SmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
226f591e195SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
227f591e195SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
228f591e195SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
229d4401354SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
230d4401354SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
231f591e195SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
232f591e195Smrg# For better backward compatibility.  To be removed once Automake 1.9.x
233f591e195Smrg# dies out for good.  For more background, see:
234f591e195Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
235f591e195Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
236f591e195SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
237d4401354Smrg# We need awk for the "check" target.  The system "awk" is bad on
238d4401354Smrg# some platforms.
239d4401354SmrgAC_REQUIRE([AC_PROG_AWK])dnl
240d4401354SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
241d4401354SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
242d4401354Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
243d4401354Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
244d4401354Smrg			     [_AM_PROG_TAR([v7])])])
245d4401354Smrg_AM_IF_OPTION([no-dependencies],,
246d4401354Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
247f591e195Smrg		  [_AM_DEPENDENCIES([CC])],
248f591e195Smrg		  [m4_define([AC_PROG_CC],
249f591e195Smrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
250d4401354SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
251f591e195Smrg		  [_AM_DEPENDENCIES([CXX])],
252f591e195Smrg		  [m4_define([AC_PROG_CXX],
253f591e195Smrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
254d4401354SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
255f591e195Smrg		  [_AM_DEPENDENCIES([OBJC])],
256f591e195Smrg		  [m4_define([AC_PROG_OBJC],
257f591e195Smrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
258f591e195SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
259f591e195Smrg		  [_AM_DEPENDENCIES([OBJCXX])],
260f591e195Smrg		  [m4_define([AC_PROG_OBJCXX],
261f591e195Smrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
262d4401354Smrg])
263f591e195SmrgAC_REQUIRE([AM_SILENT_RULES])dnl
264f591e195Smrgdnl The testsuite driver may need to know about EXEEXT, so add the
265f591e195Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
266f591e195Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
267d4401354SmrgAC_CONFIG_COMMANDS_PRE(dnl
268d4401354Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
269d4401354Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
270d4401354Smrg
271f591e195Smrg# POSIX will say in a future version that running "rm -f" with no argument
272f591e195Smrg# is OK; and we want to be able to make that assumption in our Makefile
273f591e195Smrg# recipes.  So use an aggressive probe to check that the usage we want is
274f591e195Smrg# actually supported "in the wild" to an acceptable degree.
275f591e195Smrg# See automake bug#10828.
276f591e195Smrg# To make any issue more visible, cause the running configure to be aborted
277f591e195Smrg# by default if the 'rm' program in use doesn't match our expectations; the
278f591e195Smrg# user can still override this though.
279f591e195Smrgif rm -f && rm -fr && rm -rf; then : OK; else
280f591e195Smrg  cat >&2 <<'END'
281f591e195SmrgOops!
282f591e195Smrg
283f591e195SmrgYour 'rm' program seems unable to run without file operands specified
284f591e195Smrgon the command line, even when the '-f' option is present.  This is contrary
285f591e195Smrgto the behaviour of most rm programs out there, and not conforming with
286f591e195Smrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
287f591e195Smrg
288f591e195SmrgPlease tell bug-automake@gnu.org about your system, including the value
289f591e195Smrgof your $PATH and any error possibly output before this message.  This
290f591e195Smrgcan help us improve future automake versions.
291f591e195Smrg
292f591e195SmrgEND
293f591e195Smrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
294f591e195Smrg    echo 'Configuration will proceed anyway, since you have set the' >&2
295f591e195Smrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
296f591e195Smrg    echo >&2
297f591e195Smrg  else
298f591e195Smrg    cat >&2 <<'END'
299f591e195SmrgAborting the configuration process, to ensure you take notice of the issue.
300f591e195Smrg
301f591e195SmrgYou can download and install GNU coreutils to get an 'rm' implementation
302f591e195Smrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
303f591e195Smrg
304f591e195SmrgIf you want to complete the configuration process using your problematic
305f591e195Smrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
306f591e195Smrgto "yes", and re-run configure.
307f591e195Smrg
308f591e195SmrgEND
309f591e195Smrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
310f591e195Smrg  fi
311f591e195Smrgfi])
312f591e195Smrg
313f591e195Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
314d4401354Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
315d4401354Smrgdnl mangled by Autoconf and run in a shell conditional statement.
316d4401354Smrgm4_define([_AC_COMPILER_EXEEXT],
317d4401354Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
318d4401354Smrg
319d4401354Smrg# When config.status generates a header, we must update the stamp-h file.
320d4401354Smrg# This file resides in the same directory as the config header
321d4401354Smrg# that is generated.  The stamp files are numbered to have different names.
322d4401354Smrg
323d4401354Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
324d4401354Smrg# loop where config.status creates the headers, so we can generate
325d4401354Smrg# our stamp files there.
326d4401354SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
327d4401354Smrg[# Compute $1's index in $config_headers.
328d4401354Smrg_am_arg=$1
329d4401354Smrg_am_stamp_count=1
330d4401354Smrgfor _am_header in $config_headers :; do
331d4401354Smrg  case $_am_header in
332d4401354Smrg    $_am_arg | $_am_arg:* )
333d4401354Smrg      break ;;
334d4401354Smrg    * )
335d4401354Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
336d4401354Smrg  esac
337d4401354Smrgdone
338d4401354Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
339d4401354Smrg
340f591e195Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
341d4401354Smrg#
342d4401354Smrg# This file is free software; the Free Software Foundation
343d4401354Smrg# gives unlimited permission to copy and/or distribute it,
344d4401354Smrg# with or without modifications, as long as this notice is preserved.
345d4401354Smrg
346d4401354Smrg# AM_PROG_INSTALL_SH
347d4401354Smrg# ------------------
348d4401354Smrg# Define $install_sh.
349d4401354SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
350d4401354Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
351d4401354Smrgif test x"${install_sh}" != xset; then
352d4401354Smrg  case $am_aux_dir in
353d4401354Smrg  *\ * | *\	*)
354d4401354Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
355d4401354Smrg  *)
356d4401354Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
357d4401354Smrg  esac
358d4401354Smrgfi
359f591e195SmrgAC_SUBST([install_sh])])
360d4401354Smrg
361f591e195Smrg# Copyright (C) 2003-2013 Free Software Foundation, Inc.
362d4401354Smrg#
363d4401354Smrg# This file is free software; the Free Software Foundation
364d4401354Smrg# gives unlimited permission to copy and/or distribute it,
365d4401354Smrg# with or without modifications, as long as this notice is preserved.
366d4401354Smrg
367d4401354Smrg# Check whether the underlying file-system supports filenames
368d4401354Smrg# with a leading dot.  For instance MS-DOS doesn't.
369d4401354SmrgAC_DEFUN([AM_SET_LEADING_DOT],
370d4401354Smrg[rm -rf .tst 2>/dev/null
371d4401354Smrgmkdir .tst 2>/dev/null
372d4401354Smrgif test -d .tst; then
373d4401354Smrg  am__leading_dot=.
374d4401354Smrgelse
375d4401354Smrg  am__leading_dot=_
376d4401354Smrgfi
377d4401354Smrgrmdir .tst 2>/dev/null
378d4401354SmrgAC_SUBST([am__leading_dot])])
379d4401354Smrg
380d4401354Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
381d4401354Smrg
382f591e195Smrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
383d4401354Smrg#
384d4401354Smrg# This file is free software; the Free Software Foundation
385d4401354Smrg# gives unlimited permission to copy and/or distribute it,
386d4401354Smrg# with or without modifications, as long as this notice is preserved.
387d4401354Smrg
388d4401354Smrg# AM_MISSING_PROG(NAME, PROGRAM)
389d4401354Smrg# ------------------------------
390d4401354SmrgAC_DEFUN([AM_MISSING_PROG],
391d4401354Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
392d4401354Smrg$1=${$1-"${am_missing_run}$2"}
393d4401354SmrgAC_SUBST($1)])
394d4401354Smrg
395d4401354Smrg# AM_MISSING_HAS_RUN
396d4401354Smrg# ------------------
397f591e195Smrg# Define MISSING if not defined so far and test if it is modern enough.
398f591e195Smrg# If it is, set am_missing_run to use it, otherwise, to nothing.
399d4401354SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
400d4401354Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
401d4401354SmrgAC_REQUIRE_AUX_FILE([missing])dnl
402d4401354Smrgif test x"${MISSING+set}" != xset; then
403d4401354Smrg  case $am_aux_dir in
404d4401354Smrg  *\ * | *\	*)
405d4401354Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
406d4401354Smrg  *)
407d4401354Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
408d4401354Smrg  esac
409d4401354Smrgfi
410d4401354Smrg# Use eval to expand $SHELL
411f591e195Smrgif eval "$MISSING --is-lightweight"; then
412f591e195Smrg  am_missing_run="$MISSING "
413d4401354Smrgelse
414d4401354Smrg  am_missing_run=
415f591e195Smrg  AC_MSG_WARN(['missing' script is too old or missing])
416d4401354Smrgfi
417d4401354Smrg])
418d4401354Smrg
419d4401354Smrg# Helper functions for option handling.                     -*- Autoconf -*-
420d4401354Smrg
421f591e195Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
422d4401354Smrg#
423d4401354Smrg# This file is free software; the Free Software Foundation
424d4401354Smrg# gives unlimited permission to copy and/or distribute it,
425d4401354Smrg# with or without modifications, as long as this notice is preserved.
426d4401354Smrg
427d4401354Smrg# _AM_MANGLE_OPTION(NAME)
428d4401354Smrg# -----------------------
429d4401354SmrgAC_DEFUN([_AM_MANGLE_OPTION],
430d4401354Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
431d4401354Smrg
432d4401354Smrg# _AM_SET_OPTION(NAME)
433986c8b3dSmrg# --------------------
434d4401354Smrg# Set option NAME.  Presently that only means defining a flag for this option.
435d4401354SmrgAC_DEFUN([_AM_SET_OPTION],
436f591e195Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
437d4401354Smrg
438d4401354Smrg# _AM_SET_OPTIONS(OPTIONS)
439986c8b3dSmrg# ------------------------
440d4401354Smrg# OPTIONS is a space-separated list of Automake options.
441d4401354SmrgAC_DEFUN([_AM_SET_OPTIONS],
442d4401354Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
443d4401354Smrg
444d4401354Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
445d4401354Smrg# -------------------------------------------
446d4401354Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
447d4401354SmrgAC_DEFUN([_AM_IF_OPTION],
448d4401354Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
449d4401354Smrg
450f591e195Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
451d4401354Smrg#
452d4401354Smrg# This file is free software; the Free Software Foundation
453d4401354Smrg# gives unlimited permission to copy and/or distribute it,
454d4401354Smrg# with or without modifications, as long as this notice is preserved.
455d4401354Smrg
456986c8b3dSmrg
457d4401354Smrg# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
458d4401354Smrg# ---------------------------------------------------------------------------
459d4401354Smrg# Adds support for distributing Python modules and packages.  To
460d4401354Smrg# install modules, copy them to $(pythondir), using the python_PYTHON
461d4401354Smrg# automake variable.  To install a package with the same name as the
462d4401354Smrg# automake package, install to $(pkgpythondir), or use the
463d4401354Smrg# pkgpython_PYTHON automake variable.
464d4401354Smrg#
465d4401354Smrg# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
466d4401354Smrg# locations to install python extension modules (shared libraries).
467d4401354Smrg# Another macro is required to find the appropriate flags to compile
468d4401354Smrg# extension modules.
469d4401354Smrg#
470d4401354Smrg# If your package is configured with a different prefix to python,
471d4401354Smrg# users will have to add the install directory to the PYTHONPATH
472d4401354Smrg# environment variable, or create a .pth file (see the python
473d4401354Smrg# documentation for details).
474d4401354Smrg#
475d4401354Smrg# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
476d4401354Smrg# cause an error if the version of python installed on the system
477d4401354Smrg# doesn't meet the requirement.  MINIMUM-VERSION should consist of
478d4401354Smrg# numbers and dots only.
479d4401354SmrgAC_DEFUN([AM_PATH_PYTHON],
480d4401354Smrg [
481d4401354Smrg  dnl Find a Python interpreter.  Python versions prior to 2.0 are not
482d4401354Smrg  dnl supported. (2.0 was released on October 16, 2000).
483d4401354Smrg  m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
484f591e195Smrg[python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7 dnl
485986c8b3dSmrg python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0])
486986c8b3dSmrg
487986c8b3dSmrg  AC_ARG_VAR([PYTHON], [the Python interpreter])
488d4401354Smrg
489d4401354Smrg  m4_if([$1],[],[
490d4401354Smrg    dnl No version check is needed.
491d4401354Smrg    # Find any Python interpreter.
492d4401354Smrg    if test -z "$PYTHON"; then
493d4401354Smrg      AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
494d4401354Smrg    fi
495d4401354Smrg    am_display_PYTHON=python
496d4401354Smrg  ], [
497d4401354Smrg    dnl A version check is needed.
498d4401354Smrg    if test -n "$PYTHON"; then
499d4401354Smrg      # If the user set $PYTHON, use it and don't search something else.
500f591e195Smrg      AC_MSG_CHECKING([whether $PYTHON version is >= $1])
501d4401354Smrg      AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
502f591e195Smrg			      [AC_MSG_RESULT([yes])],
503f591e195Smrg			      [AC_MSG_RESULT([no])
504f591e195Smrg			       AC_MSG_ERROR([Python interpreter is too old])])
505d4401354Smrg      am_display_PYTHON=$PYTHON
506d4401354Smrg    else
507d4401354Smrg      # Otherwise, try each interpreter until we find one that satisfies
508d4401354Smrg      # VERSION.
509d4401354Smrg      AC_CACHE_CHECK([for a Python interpreter with version >= $1],
510d4401354Smrg	[am_cv_pathless_PYTHON],[
511d4401354Smrg	for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
512d4401354Smrg	  test "$am_cv_pathless_PYTHON" = none && break
513d4401354Smrg	  AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
514d4401354Smrg	done])
515d4401354Smrg      # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
516d4401354Smrg      if test "$am_cv_pathless_PYTHON" = none; then
517d4401354Smrg	PYTHON=:
518d4401354Smrg      else
519d4401354Smrg        AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
520d4401354Smrg      fi
521d4401354Smrg      am_display_PYTHON=$am_cv_pathless_PYTHON
522d4401354Smrg    fi
523d4401354Smrg  ])
524d4401354Smrg
525d4401354Smrg  if test "$PYTHON" = :; then
526d4401354Smrg  dnl Run any user-specified action, or abort.
527d4401354Smrg    m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
528d4401354Smrg  else
529d4401354Smrg
530d4401354Smrg  dnl Query Python for its version number.  Getting [:3] seems to be
531d4401354Smrg  dnl the best way to do this; it's what "site.py" does in the standard
532d4401354Smrg  dnl library.
533d4401354Smrg
534d4401354Smrg  AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
535d4401354Smrg    [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
536d4401354Smrg  AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
537d4401354Smrg
538d4401354Smrg  dnl Use the values of $prefix and $exec_prefix for the corresponding
539d4401354Smrg  dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX.  These are made
540d4401354Smrg  dnl distinct variables so they can be overridden if need be.  However,
541d4401354Smrg  dnl general consensus is that you shouldn't need this ability.
542d4401354Smrg
543d4401354Smrg  AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
544d4401354Smrg  AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
545d4401354Smrg
546d4401354Smrg  dnl At times (like when building shared libraries) you may want
547d4401354Smrg  dnl to know which OS platform Python thinks this is.
548d4401354Smrg
549d4401354Smrg  AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
550d4401354Smrg    [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`])
551d4401354Smrg  AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
552d4401354Smrg
553f591e195Smrg  # Just factor out some code duplication.
554f591e195Smrg  am_python_setup_sysconfig="\
555f591e195Smrgimport sys
556f591e195Smrg# Prefer sysconfig over distutils.sysconfig, for better compatibility
557f591e195Smrg# with python 3.x.  See automake bug#10227.
558f591e195Smrgtry:
559f591e195Smrg    import sysconfig
560f591e195Smrgexcept ImportError:
561f591e195Smrg    can_use_sysconfig = 0
562f591e195Smrgelse:
563f591e195Smrg    can_use_sysconfig = 1
564f591e195Smrg# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
565f591e195Smrg# <https://github.com/pypa/virtualenv/issues/118>
566f591e195Smrgtry:
567f591e195Smrg    from platform import python_implementation
568f591e195Smrg    if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7':
569f591e195Smrg        can_use_sysconfig = 0
570f591e195Smrgexcept ImportError:
571f591e195Smrg    pass"
572d4401354Smrg
573d4401354Smrg  dnl Set up 4 directories:
574d4401354Smrg
575d4401354Smrg  dnl pythondir -- where to install python scripts.  This is the
576d4401354Smrg  dnl   site-packages directory, not the python standard library
577d4401354Smrg  dnl   directory like in previous automake betas.  This behavior
578d4401354Smrg  dnl   is more consistent with lispdir.m4 for example.
579986c8b3dSmrg  dnl Query distutils for this directory.
580d4401354Smrg  AC_CACHE_CHECK([for $am_display_PYTHON script directory],
581d4401354Smrg    [am_cv_python_pythondir],
582d4401354Smrg    [if test "x$prefix" = xNONE
583d4401354Smrg     then
584d4401354Smrg       am_py_prefix=$ac_default_prefix
585d4401354Smrg     else
586d4401354Smrg       am_py_prefix=$prefix
587d4401354Smrg     fi
588f591e195Smrg     am_cv_python_pythondir=`$PYTHON -c "
589f591e195Smrg$am_python_setup_sysconfig
590f591e195Smrgif can_use_sysconfig:
591f591e195Smrg    sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
592f591e195Smrgelse:
593f591e195Smrg    from distutils import sysconfig
594f591e195Smrg    sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
595f591e195Smrgsys.stdout.write(sitedir)"`
596d4401354Smrg     case $am_cv_python_pythondir in
597d4401354Smrg     $am_py_prefix*)
598d4401354Smrg       am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
599d4401354Smrg       am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"`
600d4401354Smrg       ;;
601986c8b3dSmrg     *)
602986c8b3dSmrg       case $am_py_prefix in
603986c8b3dSmrg         /usr|/System*) ;;
604986c8b3dSmrg         *)
605986c8b3dSmrg	  am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
606986c8b3dSmrg	  ;;
607986c8b3dSmrg       esac
608986c8b3dSmrg       ;;
609d4401354Smrg     esac
610d4401354Smrg    ])
611d4401354Smrg  AC_SUBST([pythondir], [$am_cv_python_pythondir])
612d4401354Smrg
613d4401354Smrg  dnl pkgpythondir -- $PACKAGE directory under pythondir.  Was
614d4401354Smrg  dnl   PYTHON_SITE_PACKAGE in previous betas, but this naming is
615d4401354Smrg  dnl   more consistent with the rest of automake.
616d4401354Smrg
617d4401354Smrg  AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
618d4401354Smrg
619d4401354Smrg  dnl pyexecdir -- directory for installing python extension modules
620d4401354Smrg  dnl   (shared libraries)
621986c8b3dSmrg  dnl Query distutils for this directory.
622d4401354Smrg  AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
623d4401354Smrg    [am_cv_python_pyexecdir],
624d4401354Smrg    [if test "x$exec_prefix" = xNONE
625d4401354Smrg     then
626d4401354Smrg       am_py_exec_prefix=$am_py_prefix
627d4401354Smrg     else
628d4401354Smrg       am_py_exec_prefix=$exec_prefix
629d4401354Smrg     fi
630f591e195Smrg     am_cv_python_pyexecdir=`$PYTHON -c "
631f591e195Smrg$am_python_setup_sysconfig
632f591e195Smrgif can_use_sysconfig:
633f591e195Smrg    sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
634f591e195Smrgelse:
635f591e195Smrg    from distutils import sysconfig
636f591e195Smrg    sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
637f591e195Smrgsys.stdout.write(sitedir)"`
638d4401354Smrg     case $am_cv_python_pyexecdir in
639d4401354Smrg     $am_py_exec_prefix*)
640d4401354Smrg       am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
641d4401354Smrg       am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
642d4401354Smrg       ;;
643986c8b3dSmrg     *)
644986c8b3dSmrg       case $am_py_exec_prefix in
645986c8b3dSmrg         /usr|/System*) ;;
646986c8b3dSmrg         *)
647986c8b3dSmrg	   am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
648986c8b3dSmrg	   ;;
649986c8b3dSmrg       esac
650986c8b3dSmrg       ;;
651d4401354Smrg     esac
652d4401354Smrg    ])
653d4401354Smrg  AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
654d4401354Smrg
655d4401354Smrg  dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
656d4401354Smrg
657d4401354Smrg  AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
658d4401354Smrg
659d4401354Smrg  dnl Run any user-specified action.
660d4401354Smrg  $2
661d4401354Smrg  fi
662d4401354Smrg
663d4401354Smrg])
664d4401354Smrg
665d4401354Smrg
666d4401354Smrg# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
667d4401354Smrg# ---------------------------------------------------------------------------
668d4401354Smrg# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
669d4401354Smrg# Run ACTION-IF-FALSE otherwise.
670d4401354Smrg# This test uses sys.hexversion instead of the string equivalent (first
671d4401354Smrg# word of sys.version), in order to cope with versions such as 2.2c1.
672d4401354Smrg# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
673d4401354SmrgAC_DEFUN([AM_PYTHON_CHECK_VERSION],
674d4401354Smrg [prog="import sys
675d4401354Smrg# split strings by '.' and convert to numeric.  Append some zeros
676d4401354Smrg# because we need at least 4 digits for the hex conversion.
677d4401354Smrg# map returns an iterator in Python 3.0 and a list in 2.x
678d4401354Smrgminver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
679d4401354Smrgminverhex = 0
680d4401354Smrg# xrange is not present in Python 3.0 and range returns an iterator
681d4401354Smrgfor i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
682d4401354Smrgsys.exit(sys.hexversion < minverhex)"
683d4401354Smrg  AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
684d4401354Smrg
685f591e195Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
686d4401354Smrg#
687d4401354Smrg# This file is free software; the Free Software Foundation
688d4401354Smrg# gives unlimited permission to copy and/or distribute it,
689d4401354Smrg# with or without modifications, as long as this notice is preserved.
690d4401354Smrg
691d4401354Smrg# AM_RUN_LOG(COMMAND)
692d4401354Smrg# -------------------
693d4401354Smrg# Run COMMAND, save the exit status in ac_status, and log it.
694d4401354Smrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
695d4401354SmrgAC_DEFUN([AM_RUN_LOG],
696d4401354Smrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
697d4401354Smrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
698d4401354Smrg   ac_status=$?
699d4401354Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
700d4401354Smrg   (exit $ac_status); }])
701d4401354Smrg
702d4401354Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
703d4401354Smrg
704f591e195Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
705d4401354Smrg#
706d4401354Smrg# This file is free software; the Free Software Foundation
707d4401354Smrg# gives unlimited permission to copy and/or distribute it,
708d4401354Smrg# with or without modifications, as long as this notice is preserved.
709d4401354Smrg
710d4401354Smrg# AM_SANITY_CHECK
711d4401354Smrg# ---------------
712d4401354SmrgAC_DEFUN([AM_SANITY_CHECK],
713d4401354Smrg[AC_MSG_CHECKING([whether build environment is sane])
714d4401354Smrg# Reject unsafe characters in $srcdir or the absolute working directory
715d4401354Smrg# name.  Accept space and tab only in the latter.
716d4401354Smrgam_lf='
717d4401354Smrg'
718d4401354Smrgcase `pwd` in
719d4401354Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
720d4401354Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
721d4401354Smrgesac
722d4401354Smrgcase $srcdir in
723d4401354Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
724f591e195Smrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
725d4401354Smrgesac
726d4401354Smrg
727f591e195Smrg# Do 'set' in a subshell so we don't clobber the current shell's
728d4401354Smrg# arguments.  Must try -L first in case configure is actually a
729d4401354Smrg# symlink; some systems play weird games with the mod time of symlinks
730d4401354Smrg# (eg FreeBSD returns the mod time of the symlink's containing
731d4401354Smrg# directory).
732d4401354Smrgif (
733f591e195Smrg   am_has_slept=no
734f591e195Smrg   for am_try in 1 2; do
735f591e195Smrg     echo "timestamp, slept: $am_has_slept" > conftest.file
736f591e195Smrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
737f591e195Smrg     if test "$[*]" = "X"; then
738f591e195Smrg	# -L didn't work.
739f591e195Smrg	set X `ls -t "$srcdir/configure" conftest.file`
740f591e195Smrg     fi
741f591e195Smrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
742f591e195Smrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
743f591e195Smrg
744f591e195Smrg	# If neither matched, then we have a broken ls.  This can happen
745f591e195Smrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
746f591e195Smrg	# broken ls alias from the environment.  This has actually
747f591e195Smrg	# happened.  Such a system could not be considered "sane".
748f591e195Smrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
749f591e195Smrg  alias in your environment])
750f591e195Smrg     fi
751f591e195Smrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
752f591e195Smrg       break
753f591e195Smrg     fi
754f591e195Smrg     # Just in case.
755f591e195Smrg     sleep 1
756f591e195Smrg     am_has_slept=yes
757f591e195Smrg   done
758d4401354Smrg   test "$[2]" = conftest.file
759d4401354Smrg   )
760d4401354Smrgthen
761d4401354Smrg   # Ok.
762d4401354Smrg   :
763d4401354Smrgelse
764d4401354Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
765d4401354SmrgCheck your system clock])
766d4401354Smrgfi
767f591e195SmrgAC_MSG_RESULT([yes])
768f591e195Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and
769f591e195Smrg# generated files are strictly newer.
770f591e195Smrgam_sleep_pid=
771f591e195Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
772f591e195Smrg  ( sleep 1 ) &
773f591e195Smrg  am_sleep_pid=$!
774f591e195Smrgfi
775f591e195SmrgAC_CONFIG_COMMANDS_PRE(
776f591e195Smrg  [AC_MSG_CHECKING([that generated files are newer than configure])
777f591e195Smrg   if test -n "$am_sleep_pid"; then
778f591e195Smrg     # Hide warnings about reused PIDs.
779f591e195Smrg     wait $am_sleep_pid 2>/dev/null
780f591e195Smrg   fi
781f591e195Smrg   AC_MSG_RESULT([done])])
782f591e195Smrgrm -f conftest.file
783f591e195Smrg])
784d4401354Smrg
785f591e195Smrg# Copyright (C) 2009-2013 Free Software Foundation, Inc.
786d4401354Smrg#
787d4401354Smrg# This file is free software; the Free Software Foundation
788d4401354Smrg# gives unlimited permission to copy and/or distribute it,
789d4401354Smrg# with or without modifications, as long as this notice is preserved.
790d4401354Smrg
791f591e195Smrg# AM_SILENT_RULES([DEFAULT])
792f591e195Smrg# --------------------------
793f591e195Smrg# Enable less verbose build rules; with the default set to DEFAULT
794f591e195Smrg# ("yes" being less verbose, "no" or empty being verbose).
795f591e195SmrgAC_DEFUN([AM_SILENT_RULES],
796f591e195Smrg[AC_ARG_ENABLE([silent-rules], [dnl
797f591e195SmrgAS_HELP_STRING(
798f591e195Smrg  [--enable-silent-rules],
799f591e195Smrg  [less verbose build output (undo: "make V=1")])
800f591e195SmrgAS_HELP_STRING(
801f591e195Smrg  [--disable-silent-rules],
802f591e195Smrg  [verbose build output (undo: "make V=0")])dnl
803f591e195Smrg])
804f591e195Smrgcase $enable_silent_rules in @%:@ (((
805f591e195Smrg  yes) AM_DEFAULT_VERBOSITY=0;;
806f591e195Smrg   no) AM_DEFAULT_VERBOSITY=1;;
807f591e195Smrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
808f591e195Smrgesac
809f591e195Smrgdnl
810f591e195Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
811f591e195Smrgdnl do not support nested variable expansions.
812f591e195Smrgdnl See automake bug#9928 and bug#10237.
813f591e195Smrgam_make=${MAKE-make}
814f591e195SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
815f591e195Smrg   [am_cv_make_support_nested_variables],
816f591e195Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
817f591e195SmrgBAR0=false
818f591e195SmrgBAR1=true
819f591e195SmrgV=1
820f591e195Smrgam__doit:
821f591e195Smrg	@$(TRUE)
822f591e195Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
823f591e195Smrg  am_cv_make_support_nested_variables=yes
824f591e195Smrgelse
825f591e195Smrg  am_cv_make_support_nested_variables=no
826f591e195Smrgfi])
827f591e195Smrgif test $am_cv_make_support_nested_variables = yes; then
828f591e195Smrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
829f591e195Smrg  AM_V='$(V)'
830f591e195Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
831f591e195Smrgelse
832f591e195Smrg  AM_V=$AM_DEFAULT_VERBOSITY
833f591e195Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
834f591e195Smrgfi
835f591e195SmrgAC_SUBST([AM_V])dnl
836f591e195SmrgAM_SUBST_NOTMAKE([AM_V])dnl
837f591e195SmrgAC_SUBST([AM_DEFAULT_V])dnl
838f591e195SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
839f591e195SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
840f591e195SmrgAM_BACKSLASH='\'
841f591e195SmrgAC_SUBST([AM_BACKSLASH])dnl
842f591e195Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
843f591e195Smrg])
844f591e195Smrg
845f591e195Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
846f591e195Smrg#
847f591e195Smrg# This file is free software; the Free Software Foundation
848f591e195Smrg# gives unlimited permission to copy and/or distribute it,
849f591e195Smrg# with or without modifications, as long as this notice is preserved.
850986c8b3dSmrg
851d4401354Smrg# AM_PROG_INSTALL_STRIP
852d4401354Smrg# ---------------------
853f591e195Smrg# One issue with vendor 'install' (even GNU) is that you can't
854d4401354Smrg# specify the program used to strip binaries.  This is especially
855d4401354Smrg# annoying in cross-compiling environments, where the build's strip
856d4401354Smrg# is unlikely to handle the host's binaries.
857d4401354Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
858f591e195Smrg# always use install-sh in "make install-strip", and initialize
859d4401354Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
860d4401354SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
861d4401354Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
862f591e195Smrg# Installed binaries are usually stripped using 'strip' when the user
863f591e195Smrg# run "make install-strip".  However 'strip' might not be the right
864d4401354Smrg# tool to use in cross-compilation environments, therefore Automake
865f591e195Smrg# will honor the 'STRIP' environment variable to overrule this program.
866f591e195Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
867d4401354Smrgif test "$cross_compiling" != no; then
868d4401354Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
869d4401354Smrgfi
870d4401354SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
871d4401354SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
872d4401354Smrg
873f591e195Smrg# Copyright (C) 2006-2013 Free Software Foundation, Inc.
874d4401354Smrg#
875d4401354Smrg# This file is free software; the Free Software Foundation
876d4401354Smrg# gives unlimited permission to copy and/or distribute it,
877d4401354Smrg# with or without modifications, as long as this notice is preserved.
878d4401354Smrg
879d4401354Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
880d4401354Smrg# ---------------------------
881d4401354Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
882d4401354Smrg# This macro is traced by Automake.
883d4401354SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
884d4401354Smrg
885d4401354Smrg# AM_SUBST_NOTMAKE(VARIABLE)
886986c8b3dSmrg# --------------------------
887d4401354Smrg# Public sister of _AM_SUBST_NOTMAKE.
888d4401354SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
889d4401354Smrg
890d4401354Smrg# Check how to create a tarball.                            -*- Autoconf -*-
891d4401354Smrg
892f591e195Smrg# Copyright (C) 2004-2013 Free Software Foundation, Inc.
893d4401354Smrg#
894d4401354Smrg# This file is free software; the Free Software Foundation
895d4401354Smrg# gives unlimited permission to copy and/or distribute it,
896d4401354Smrg# with or without modifications, as long as this notice is preserved.
897d4401354Smrg
898d4401354Smrg# _AM_PROG_TAR(FORMAT)
899d4401354Smrg# --------------------
900d4401354Smrg# Check how to create a tarball in format FORMAT.
901f591e195Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
902d4401354Smrg#
903d4401354Smrg# Substitute a variable $(am__tar) that is a command
904d4401354Smrg# writing to stdout a FORMAT-tarball containing the directory
905d4401354Smrg# $tardir.
906d4401354Smrg#     tardir=directory && $(am__tar) > result.tar
907d4401354Smrg#
908d4401354Smrg# Substitute a variable $(am__untar) that extract such
909d4401354Smrg# a tarball read from stdin.
910d4401354Smrg#     $(am__untar) < result.tar
911f591e195Smrg#
912d4401354SmrgAC_DEFUN([_AM_PROG_TAR],
913986c8b3dSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
914986c8b3dSmrg# in the wild :-(  We should find a proper way to deprecate it ...
915986c8b3dSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
916d4401354Smrg
917f591e195Smrg# We'll loop over all known methods to create a tar archive until one works.
918f591e195Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
919d4401354Smrg
920f591e195Smrgm4_if([$1], [v7],
921f591e195Smrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
922f591e195Smrg
923f591e195Smrg  [m4_case([$1],
924f591e195Smrg    [ustar],
925f591e195Smrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
926f591e195Smrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
927f591e195Smrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
928f591e195Smrg      # and bug#13588).
929f591e195Smrg      am_max_uid=2097151 # 2^21 - 1
930f591e195Smrg      am_max_gid=$am_max_uid
931f591e195Smrg      # The $UID and $GID variables are not portable, so we need to resort
932f591e195Smrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
933f591e195Smrg      # below are definitely unexpected, so allow the users to see them
934f591e195Smrg      # (that is, avoid stderr redirection).
935f591e195Smrg      am_uid=`id -u || echo unknown`
936f591e195Smrg      am_gid=`id -g || echo unknown`
937f591e195Smrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
938f591e195Smrg      if test $am_uid -le $am_max_uid; then
939f591e195Smrg         AC_MSG_RESULT([yes])
940f591e195Smrg      else
941f591e195Smrg         AC_MSG_RESULT([no])
942f591e195Smrg         _am_tools=none
943f591e195Smrg      fi
944f591e195Smrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
945f591e195Smrg      if test $am_gid -le $am_max_gid; then
946f591e195Smrg         AC_MSG_RESULT([yes])
947f591e195Smrg      else
948f591e195Smrg        AC_MSG_RESULT([no])
949f591e195Smrg        _am_tools=none
950f591e195Smrg      fi],
951f591e195Smrg
952f591e195Smrg  [pax],
953f591e195Smrg    [],
954f591e195Smrg
955f591e195Smrg  [m4_fatal([Unknown tar format])])
956f591e195Smrg
957f591e195Smrg  AC_MSG_CHECKING([how to create a $1 tar archive])
958f591e195Smrg
959f591e195Smrg  # Go ahead even if we have the value already cached.  We do so because we
960f591e195Smrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
961f591e195Smrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
962f591e195Smrg
963f591e195Smrg  for _am_tool in $_am_tools; do
964f591e195Smrg    case $_am_tool in
965f591e195Smrg    gnutar)
966f591e195Smrg      for _am_tar in tar gnutar gtar; do
967f591e195Smrg        AM_RUN_LOG([$_am_tar --version]) && break
968f591e195Smrg      done
969f591e195Smrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
970f591e195Smrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
971f591e195Smrg      am__untar="$_am_tar -xf -"
972f591e195Smrg      ;;
973f591e195Smrg    plaintar)
974f591e195Smrg      # Must skip GNU tar: if it does not support --format= it doesn't create
975f591e195Smrg      # ustar tarball either.
976f591e195Smrg      (tar --version) >/dev/null 2>&1 && continue
977f591e195Smrg      am__tar='tar chf - "$$tardir"'
978f591e195Smrg      am__tar_='tar chf - "$tardir"'
979f591e195Smrg      am__untar='tar xf -'
980f591e195Smrg      ;;
981f591e195Smrg    pax)
982f591e195Smrg      am__tar='pax -L -x $1 -w "$$tardir"'
983f591e195Smrg      am__tar_='pax -L -x $1 -w "$tardir"'
984f591e195Smrg      am__untar='pax -r'
985f591e195Smrg      ;;
986f591e195Smrg    cpio)
987f591e195Smrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
988f591e195Smrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
989f591e195Smrg      am__untar='cpio -i -H $1 -d'
990f591e195Smrg      ;;
991f591e195Smrg    none)
992f591e195Smrg      am__tar=false
993f591e195Smrg      am__tar_=false
994f591e195Smrg      am__untar=false
995f591e195Smrg      ;;
996f591e195Smrg    esac
997f591e195Smrg
998f591e195Smrg    # If the value was cached, stop now.  We just wanted to have am__tar
999f591e195Smrg    # and am__untar set.
1000f591e195Smrg    test -n "${am_cv_prog_tar_$1}" && break
1001f591e195Smrg
1002f591e195Smrg    # tar/untar a dummy directory, and stop if the command works.
1003f591e195Smrg    rm -rf conftest.dir
1004f591e195Smrg    mkdir conftest.dir
1005f591e195Smrg    echo GrepMe > conftest.dir/file
1006f591e195Smrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1007f591e195Smrg    rm -rf conftest.dir
1008f591e195Smrg    if test -s conftest.tar; then
1009f591e195Smrg      AM_RUN_LOG([$am__untar <conftest.tar])
1010f591e195Smrg      AM_RUN_LOG([cat conftest.dir/file])
1011f591e195Smrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1012f591e195Smrg    fi
1013f591e195Smrg  done
1014d4401354Smrg  rm -rf conftest.dir
1015d4401354Smrg
1016f591e195Smrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1017f591e195Smrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1018f591e195Smrg
1019d4401354SmrgAC_SUBST([am__tar])
1020d4401354SmrgAC_SUBST([am__untar])
1021d4401354Smrg]) # _AM_PROG_TAR
1022d4401354Smrg
1023