aclocal.m4 revision 986c8b3d
1986c8b3dSmrg# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
2d4401354Smrg
3d4401354Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4986c8b3dSmrg# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
5986c8b3dSmrg# Inc.
6d4401354Smrg# This file is free software; the Free Software Foundation
7d4401354Smrg# gives unlimited permission to copy and/or distribute it,
8d4401354Smrg# with or without modifications, as long as this notice is preserved.
9d4401354Smrg
10d4401354Smrg# This program is distributed in the hope that it will be useful,
11d4401354Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12d4401354Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13d4401354Smrg# PARTICULAR PURPOSE.
14d4401354Smrg
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.
21d4401354SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
22d4401354Smrg
23986c8b3dSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
24986c8b3dSmrg# Foundation, Inc.
25d4401354Smrg#
26d4401354Smrg# This file is free software; the Free Software Foundation
27d4401354Smrg# gives unlimited permission to copy and/or distribute it,
28d4401354Smrg# with or without modifications, as long as this notice is preserved.
29d4401354Smrg
30986c8b3dSmrg# serial 1
31986c8b3dSmrg
32d4401354Smrg# AM_AUTOMAKE_VERSION(VERSION)
33d4401354Smrg# ----------------------------
34d4401354Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
35d4401354Smrg# generated from the m4 files accompanying Automake X.Y.
36d4401354Smrg# (This private macro should not be called outside this file.)
37d4401354SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
38d4401354Smrg[am__api_version='1.11'
39d4401354Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
40d4401354Smrgdnl require some minimum version.  Point them to the right macro.
41986c8b3dSmrgm4_if([$1], [1.11.6], [],
42d4401354Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
43d4401354Smrg])
44d4401354Smrg
45d4401354Smrg# _AM_AUTOCONF_VERSION(VERSION)
46d4401354Smrg# -----------------------------
47d4401354Smrg# aclocal traces this macro to find the Autoconf version.
48d4401354Smrg# This is a private macro too.  Using m4_define simplifies
49d4401354Smrg# the logic in aclocal, which can simply ignore this definition.
50d4401354Smrgm4_define([_AM_AUTOCONF_VERSION], [])
51d4401354Smrg
52d4401354Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
53d4401354Smrg# -------------------------------
54d4401354Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
55d4401354Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
56d4401354SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
57986c8b3dSmrg[AM_AUTOMAKE_VERSION([1.11.6])dnl
58d4401354Smrgm4_ifndef([AC_AUTOCONF_VERSION],
59d4401354Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
60d4401354Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
61d4401354Smrg
62d4401354Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
63d4401354Smrg
64986c8b3dSmrg# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
65d4401354Smrg#
66d4401354Smrg# This file is free software; the Free Software Foundation
67d4401354Smrg# gives unlimited permission to copy and/or distribute it,
68d4401354Smrg# with or without modifications, as long as this notice is preserved.
69d4401354Smrg
70986c8b3dSmrg# serial 1
71986c8b3dSmrg
72d4401354Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
73d4401354Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
74d4401354Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
75d4401354Smrg#
76d4401354Smrg# Of course, Automake must honor this variable whenever it calls a
77d4401354Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
78d4401354Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
79d4401354Smrg# depending on how configure is run.  This is pretty annoying, since
80d4401354Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
81d4401354Smrg# source directory, any form will work fine, but in subdirectories a
82d4401354Smrg# relative path needs to be adjusted first.
83d4401354Smrg#
84d4401354Smrg# $ac_aux_dir/missing
85d4401354Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
86d4401354Smrg# $top_srcdir/$ac_aux_dir/missing
87d4401354Smrg#    fails if $ac_aux_dir is absolute,
88d4401354Smrg#    fails when called from a subdirectory in a VPATH build with
89d4401354Smrg#          a relative $ac_aux_dir
90d4401354Smrg#
91d4401354Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
92d4401354Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
93d4401354Smrg# harmless because $srcdir is `.', but things will broke when you
94d4401354Smrg# start a VPATH build or use an absolute $srcdir.
95d4401354Smrg#
96d4401354Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
97d4401354Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
98d4401354Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
99d4401354Smrg# and then we would define $MISSING as
100d4401354Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
101d4401354Smrg# This will work as long as MISSING is not called from configure, because
102d4401354Smrg# unfortunately $(top_srcdir) has no meaning in configure.
103d4401354Smrg# However there are other variables, like CC, which are often used in
104d4401354Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
105d4401354Smrg#
106d4401354Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
107d4401354Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
108d4401354Smrg# configured tree to be moved without reconfiguration.
109d4401354Smrg
110d4401354SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
111d4401354Smrg[dnl Rely on autoconf to set up CDPATH properly.
112d4401354SmrgAC_PREREQ([2.50])dnl
113d4401354Smrg# expand $ac_aux_dir to an absolute path
114d4401354Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
115d4401354Smrg])
116d4401354Smrg
117d4401354Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
118d4401354Smrg
119d4401354Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
120d4401354Smrg# Free Software Foundation, Inc.
121d4401354Smrg#
122d4401354Smrg# This file is free software; the Free Software Foundation
123d4401354Smrg# gives unlimited permission to copy and/or distribute it,
124d4401354Smrg# with or without modifications, as long as this notice is preserved.
125d4401354Smrg
126d4401354Smrg# serial 9
127d4401354Smrg
128d4401354Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
129d4401354Smrg# -------------------------------------
130d4401354Smrg# Define a conditional.
131d4401354SmrgAC_DEFUN([AM_CONDITIONAL],
132d4401354Smrg[AC_PREREQ(2.52)dnl
133d4401354Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
134d4401354Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
135d4401354SmrgAC_SUBST([$1_TRUE])dnl
136d4401354SmrgAC_SUBST([$1_FALSE])dnl
137d4401354Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
138d4401354Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
139d4401354Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
140d4401354Smrgif $2; then
141d4401354Smrg  $1_TRUE=
142d4401354Smrg  $1_FALSE='#'
143d4401354Smrgelse
144d4401354Smrg  $1_TRUE='#'
145d4401354Smrg  $1_FALSE=
146d4401354Smrgfi
147d4401354SmrgAC_CONFIG_COMMANDS_PRE(
148d4401354Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
149d4401354Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
150d4401354SmrgUsually this means the macro was only invoked conditionally.]])
151d4401354Smrgfi])])
152d4401354Smrg
153d4401354Smrg# Do all the work for Automake.                             -*- Autoconf -*-
154d4401354Smrg
155d4401354Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
156d4401354Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
157d4401354Smrg#
158d4401354Smrg# This file is free software; the Free Software Foundation
159d4401354Smrg# gives unlimited permission to copy and/or distribute it,
160d4401354Smrg# with or without modifications, as long as this notice is preserved.
161d4401354Smrg
162d4401354Smrg# serial 16
163d4401354Smrg
164d4401354Smrg# This macro actually does too much.  Some checks are only needed if
165d4401354Smrg# your package does certain things.  But this isn't really a big deal.
166d4401354Smrg
167d4401354Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
168d4401354Smrg# AM_INIT_AUTOMAKE([OPTIONS])
169d4401354Smrg# -----------------------------------------------
170d4401354Smrg# The call with PACKAGE and VERSION arguments is the old style
171d4401354Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
172d4401354Smrg# and VERSION should now be passed to AC_INIT and removed from
173d4401354Smrg# the call to AM_INIT_AUTOMAKE.
174d4401354Smrg# We support both call styles for the transition.  After
175d4401354Smrg# the next Automake release, Autoconf can make the AC_INIT
176d4401354Smrg# arguments mandatory, and then we can depend on a new Autoconf
177d4401354Smrg# release and drop the old call support.
178d4401354SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
179d4401354Smrg[AC_PREREQ([2.62])dnl
180d4401354Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
181d4401354Smrgdnl the ones we care about.
182d4401354Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
183d4401354SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
184d4401354SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
185d4401354Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
186d4401354Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
187d4401354Smrg  # is not polluted with repeated "-I."
188d4401354Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
189d4401354Smrg  # test to see if srcdir already configured
190d4401354Smrg  if test -f $srcdir/config.status; then
191d4401354Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
192d4401354Smrg  fi
193d4401354Smrgfi
194d4401354Smrg
195d4401354Smrg# test whether we have cygpath
196d4401354Smrgif test -z "$CYGPATH_W"; then
197d4401354Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
198d4401354Smrg    CYGPATH_W='cygpath -w'
199d4401354Smrg  else
200d4401354Smrg    CYGPATH_W=echo
201d4401354Smrg  fi
202d4401354Smrgfi
203d4401354SmrgAC_SUBST([CYGPATH_W])
204d4401354Smrg
205d4401354Smrg# Define the identity of the package.
206d4401354Smrgdnl Distinguish between old-style and new-style calls.
207d4401354Smrgm4_ifval([$2],
208d4401354Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
209d4401354Smrg AC_SUBST([PACKAGE], [$1])dnl
210d4401354Smrg AC_SUBST([VERSION], [$2])],
211d4401354Smrg[_AM_SET_OPTIONS([$1])dnl
212d4401354Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
213d4401354Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
214d4401354Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
215d4401354Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
216d4401354Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
217d4401354Smrg
218d4401354Smrg_AM_IF_OPTION([no-define],,
219d4401354Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
220d4401354Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
221d4401354Smrg
222d4401354Smrg# Some tools Automake needs.
223d4401354SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
224d4401354SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
225d4401354SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
226d4401354SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
227d4401354SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
228d4401354SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
229d4401354SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
230d4401354SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
231d4401354SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
232d4401354SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
233d4401354Smrg# We need awk for the "check" target.  The system "awk" is bad on
234d4401354Smrg# some platforms.
235d4401354SmrgAC_REQUIRE([AC_PROG_AWK])dnl
236d4401354SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
237d4401354SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
238d4401354Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
239d4401354Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
240d4401354Smrg			     [_AM_PROG_TAR([v7])])])
241d4401354Smrg_AM_IF_OPTION([no-dependencies],,
242d4401354Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
243d4401354Smrg		  [_AM_DEPENDENCIES(CC)],
244d4401354Smrg		  [define([AC_PROG_CC],
245d4401354Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
246d4401354SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
247d4401354Smrg		  [_AM_DEPENDENCIES(CXX)],
248d4401354Smrg		  [define([AC_PROG_CXX],
249d4401354Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
250d4401354SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
251d4401354Smrg		  [_AM_DEPENDENCIES(OBJC)],
252d4401354Smrg		  [define([AC_PROG_OBJC],
253d4401354Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
254d4401354Smrg])
255d4401354Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
256d4401354Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
257d4401354Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
258d4401354Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
259d4401354SmrgAC_CONFIG_COMMANDS_PRE(dnl
260d4401354Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
261d4401354Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
262d4401354Smrg])
263d4401354Smrg
264d4401354Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
265d4401354Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
266d4401354Smrgdnl mangled by Autoconf and run in a shell conditional statement.
267d4401354Smrgm4_define([_AC_COMPILER_EXEEXT],
268d4401354Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
269d4401354Smrg
270d4401354Smrg
271d4401354Smrg# When config.status generates a header, we must update the stamp-h file.
272d4401354Smrg# This file resides in the same directory as the config header
273d4401354Smrg# that is generated.  The stamp files are numbered to have different names.
274d4401354Smrg
275d4401354Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
276d4401354Smrg# loop where config.status creates the headers, so we can generate
277d4401354Smrg# our stamp files there.
278d4401354SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
279d4401354Smrg[# Compute $1's index in $config_headers.
280d4401354Smrg_am_arg=$1
281d4401354Smrg_am_stamp_count=1
282d4401354Smrgfor _am_header in $config_headers :; do
283d4401354Smrg  case $_am_header in
284d4401354Smrg    $_am_arg | $_am_arg:* )
285d4401354Smrg      break ;;
286d4401354Smrg    * )
287d4401354Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
288d4401354Smrg  esac
289d4401354Smrgdone
290d4401354Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
291d4401354Smrg
292986c8b3dSmrg# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
293986c8b3dSmrg# Inc.
294d4401354Smrg#
295d4401354Smrg# This file is free software; the Free Software Foundation
296d4401354Smrg# gives unlimited permission to copy and/or distribute it,
297d4401354Smrg# with or without modifications, as long as this notice is preserved.
298d4401354Smrg
299986c8b3dSmrg# serial 1
300986c8b3dSmrg
301d4401354Smrg# AM_PROG_INSTALL_SH
302d4401354Smrg# ------------------
303d4401354Smrg# Define $install_sh.
304d4401354SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
305d4401354Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
306d4401354Smrgif test x"${install_sh}" != xset; then
307d4401354Smrg  case $am_aux_dir in
308d4401354Smrg  *\ * | *\	*)
309d4401354Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
310d4401354Smrg  *)
311d4401354Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
312d4401354Smrg  esac
313d4401354Smrgfi
314d4401354SmrgAC_SUBST(install_sh)])
315d4401354Smrg
316d4401354Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
317d4401354Smrg#
318d4401354Smrg# This file is free software; the Free Software Foundation
319d4401354Smrg# gives unlimited permission to copy and/or distribute it,
320d4401354Smrg# with or without modifications, as long as this notice is preserved.
321d4401354Smrg
322d4401354Smrg# serial 2
323d4401354Smrg
324d4401354Smrg# Check whether the underlying file-system supports filenames
325d4401354Smrg# with a leading dot.  For instance MS-DOS doesn't.
326d4401354SmrgAC_DEFUN([AM_SET_LEADING_DOT],
327d4401354Smrg[rm -rf .tst 2>/dev/null
328d4401354Smrgmkdir .tst 2>/dev/null
329d4401354Smrgif test -d .tst; then
330d4401354Smrg  am__leading_dot=.
331d4401354Smrgelse
332d4401354Smrg  am__leading_dot=_
333d4401354Smrgfi
334d4401354Smrgrmdir .tst 2>/dev/null
335d4401354SmrgAC_SUBST([am__leading_dot])])
336d4401354Smrg
337d4401354Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
338d4401354Smrg
339d4401354Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
340d4401354Smrg# 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# serial 6
347d4401354Smrg
348d4401354Smrg# AM_MISSING_PROG(NAME, PROGRAM)
349d4401354Smrg# ------------------------------
350d4401354SmrgAC_DEFUN([AM_MISSING_PROG],
351d4401354Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
352d4401354Smrg$1=${$1-"${am_missing_run}$2"}
353d4401354SmrgAC_SUBST($1)])
354d4401354Smrg
355d4401354Smrg
356d4401354Smrg# AM_MISSING_HAS_RUN
357d4401354Smrg# ------------------
358d4401354Smrg# Define MISSING if not defined so far and test if it supports --run.
359d4401354Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
360d4401354SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
361d4401354Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
362d4401354SmrgAC_REQUIRE_AUX_FILE([missing])dnl
363d4401354Smrgif test x"${MISSING+set}" != xset; then
364d4401354Smrg  case $am_aux_dir in
365d4401354Smrg  *\ * | *\	*)
366d4401354Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
367d4401354Smrg  *)
368d4401354Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
369d4401354Smrg  esac
370d4401354Smrgfi
371d4401354Smrg# Use eval to expand $SHELL
372d4401354Smrgif eval "$MISSING --run true"; then
373d4401354Smrg  am_missing_run="$MISSING --run "
374d4401354Smrgelse
375d4401354Smrg  am_missing_run=
376d4401354Smrg  AC_MSG_WARN([`missing' script is too old or missing])
377d4401354Smrgfi
378d4401354Smrg])
379d4401354Smrg
380986c8b3dSmrg# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
381986c8b3dSmrg# Inc.
382d4401354Smrg#
383d4401354Smrg# This file is free software; the Free Software Foundation
384d4401354Smrg# gives unlimited permission to copy and/or distribute it,
385d4401354Smrg# with or without modifications, as long as this notice is preserved.
386d4401354Smrg
387986c8b3dSmrg# serial 1
388986c8b3dSmrg
389d4401354Smrg# AM_PROG_MKDIR_P
390d4401354Smrg# ---------------
391d4401354Smrg# Check for `mkdir -p'.
392d4401354SmrgAC_DEFUN([AM_PROG_MKDIR_P],
393d4401354Smrg[AC_PREREQ([2.60])dnl
394d4401354SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
395d4401354Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
396d4401354Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
397d4401354Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
398d4401354Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
399d4401354Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
400d4401354Smrgdnl adjustment using top_builddir (which is defined more often than
401d4401354Smrgdnl MKDIR_P).
402d4401354SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
403d4401354Smrgcase $mkdir_p in
404d4401354Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
405d4401354Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
406d4401354Smrgesac
407d4401354Smrg])
408d4401354Smrg
409d4401354Smrg# Helper functions for option handling.                     -*- Autoconf -*-
410d4401354Smrg
411986c8b3dSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
412986c8b3dSmrg# Foundation, Inc.
413d4401354Smrg#
414d4401354Smrg# This file is free software; the Free Software Foundation
415d4401354Smrg# gives unlimited permission to copy and/or distribute it,
416d4401354Smrg# with or without modifications, as long as this notice is preserved.
417d4401354Smrg
418986c8b3dSmrg# serial 5
419d4401354Smrg
420d4401354Smrg# _AM_MANGLE_OPTION(NAME)
421d4401354Smrg# -----------------------
422d4401354SmrgAC_DEFUN([_AM_MANGLE_OPTION],
423d4401354Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
424d4401354Smrg
425d4401354Smrg# _AM_SET_OPTION(NAME)
426986c8b3dSmrg# --------------------
427d4401354Smrg# Set option NAME.  Presently that only means defining a flag for this option.
428d4401354SmrgAC_DEFUN([_AM_SET_OPTION],
429d4401354Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
430d4401354Smrg
431d4401354Smrg# _AM_SET_OPTIONS(OPTIONS)
432986c8b3dSmrg# ------------------------
433d4401354Smrg# OPTIONS is a space-separated list of Automake options.
434d4401354SmrgAC_DEFUN([_AM_SET_OPTIONS],
435d4401354Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
436d4401354Smrg
437d4401354Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
438d4401354Smrg# -------------------------------------------
439d4401354Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
440d4401354SmrgAC_DEFUN([_AM_IF_OPTION],
441d4401354Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
442d4401354Smrg
443986c8b3dSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009,
444986c8b3dSmrg# 2011 Free Software Foundation, Inc.
445d4401354Smrg#
446d4401354Smrg# This file is free software; the Free Software Foundation
447d4401354Smrg# gives unlimited permission to copy and/or distribute it,
448d4401354Smrg# with or without modifications, as long as this notice is preserved.
449d4401354Smrg
450986c8b3dSmrg# serial 2
451986c8b3dSmrg
452d4401354Smrg# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
453d4401354Smrg# ---------------------------------------------------------------------------
454d4401354Smrg# Adds support for distributing Python modules and packages.  To
455d4401354Smrg# install modules, copy them to $(pythondir), using the python_PYTHON
456d4401354Smrg# automake variable.  To install a package with the same name as the
457d4401354Smrg# automake package, install to $(pkgpythondir), or use the
458d4401354Smrg# pkgpython_PYTHON automake variable.
459d4401354Smrg#
460d4401354Smrg# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
461d4401354Smrg# locations to install python extension modules (shared libraries).
462d4401354Smrg# Another macro is required to find the appropriate flags to compile
463d4401354Smrg# extension modules.
464d4401354Smrg#
465d4401354Smrg# If your package is configured with a different prefix to python,
466d4401354Smrg# users will have to add the install directory to the PYTHONPATH
467d4401354Smrg# environment variable, or create a .pth file (see the python
468d4401354Smrg# documentation for details).
469d4401354Smrg#
470d4401354Smrg# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
471d4401354Smrg# cause an error if the version of python installed on the system
472d4401354Smrg# doesn't meet the requirement.  MINIMUM-VERSION should consist of
473d4401354Smrg# numbers and dots only.
474d4401354SmrgAC_DEFUN([AM_PATH_PYTHON],
475d4401354Smrg [
476d4401354Smrg  dnl Find a Python interpreter.  Python versions prior to 2.0 are not
477d4401354Smrg  dnl supported. (2.0 was released on October 16, 2000).
478d4401354Smrg  m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
479986c8b3dSmrg[python python2 python3 python3.2 python3.1 python3.0 python2.7 dnl
480986c8b3dSmrg python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0])
481986c8b3dSmrg
482986c8b3dSmrg  AC_ARG_VAR([PYTHON], [the Python interpreter])
483d4401354Smrg
484d4401354Smrg  m4_if([$1],[],[
485d4401354Smrg    dnl No version check is needed.
486d4401354Smrg    # Find any Python interpreter.
487d4401354Smrg    if test -z "$PYTHON"; then
488d4401354Smrg      AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
489d4401354Smrg    fi
490d4401354Smrg    am_display_PYTHON=python
491d4401354Smrg  ], [
492d4401354Smrg    dnl A version check is needed.
493d4401354Smrg    if test -n "$PYTHON"; then
494d4401354Smrg      # If the user set $PYTHON, use it and don't search something else.
495d4401354Smrg      AC_MSG_CHECKING([whether $PYTHON version >= $1])
496d4401354Smrg      AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
497d4401354Smrg			      [AC_MSG_RESULT(yes)],
498d4401354Smrg			      [AC_MSG_ERROR(too old)])
499d4401354Smrg      am_display_PYTHON=$PYTHON
500d4401354Smrg    else
501d4401354Smrg      # Otherwise, try each interpreter until we find one that satisfies
502d4401354Smrg      # VERSION.
503d4401354Smrg      AC_CACHE_CHECK([for a Python interpreter with version >= $1],
504d4401354Smrg	[am_cv_pathless_PYTHON],[
505d4401354Smrg	for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
506d4401354Smrg	  test "$am_cv_pathless_PYTHON" = none && break
507d4401354Smrg	  AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
508d4401354Smrg	done])
509d4401354Smrg      # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
510d4401354Smrg      if test "$am_cv_pathless_PYTHON" = none; then
511d4401354Smrg	PYTHON=:
512d4401354Smrg      else
513d4401354Smrg        AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
514d4401354Smrg      fi
515d4401354Smrg      am_display_PYTHON=$am_cv_pathless_PYTHON
516d4401354Smrg    fi
517d4401354Smrg  ])
518d4401354Smrg
519d4401354Smrg  if test "$PYTHON" = :; then
520d4401354Smrg  dnl Run any user-specified action, or abort.
521d4401354Smrg    m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
522d4401354Smrg  else
523d4401354Smrg
524d4401354Smrg  dnl Query Python for its version number.  Getting [:3] seems to be
525d4401354Smrg  dnl the best way to do this; it's what "site.py" does in the standard
526d4401354Smrg  dnl library.
527d4401354Smrg
528d4401354Smrg  AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
529d4401354Smrg    [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
530d4401354Smrg  AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
531d4401354Smrg
532d4401354Smrg  dnl Use the values of $prefix and $exec_prefix for the corresponding
533d4401354Smrg  dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX.  These are made
534d4401354Smrg  dnl distinct variables so they can be overridden if need be.  However,
535d4401354Smrg  dnl general consensus is that you shouldn't need this ability.
536d4401354Smrg
537d4401354Smrg  AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
538d4401354Smrg  AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
539d4401354Smrg
540d4401354Smrg  dnl At times (like when building shared libraries) you may want
541d4401354Smrg  dnl to know which OS platform Python thinks this is.
542d4401354Smrg
543d4401354Smrg  AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
544d4401354Smrg    [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`])
545d4401354Smrg  AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
546d4401354Smrg
547d4401354Smrg
548d4401354Smrg  dnl Set up 4 directories:
549d4401354Smrg
550d4401354Smrg  dnl pythondir -- where to install python scripts.  This is the
551d4401354Smrg  dnl   site-packages directory, not the python standard library
552d4401354Smrg  dnl   directory like in previous automake betas.  This behavior
553d4401354Smrg  dnl   is more consistent with lispdir.m4 for example.
554986c8b3dSmrg  dnl Query distutils for this directory.
555d4401354Smrg  AC_CACHE_CHECK([for $am_display_PYTHON script directory],
556d4401354Smrg    [am_cv_python_pythondir],
557d4401354Smrg    [if test "x$prefix" = xNONE
558d4401354Smrg     then
559d4401354Smrg       am_py_prefix=$ac_default_prefix
560d4401354Smrg     else
561d4401354Smrg       am_py_prefix=$prefix
562d4401354Smrg     fi
563986c8b3dSmrg     am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null`
564d4401354Smrg     case $am_cv_python_pythondir in
565d4401354Smrg     $am_py_prefix*)
566d4401354Smrg       am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
567d4401354Smrg       am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"`
568d4401354Smrg       ;;
569986c8b3dSmrg     *)
570986c8b3dSmrg       case $am_py_prefix in
571986c8b3dSmrg         /usr|/System*) ;;
572986c8b3dSmrg         *)
573986c8b3dSmrg	  am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
574986c8b3dSmrg	  ;;
575986c8b3dSmrg       esac
576986c8b3dSmrg       ;;
577d4401354Smrg     esac
578d4401354Smrg    ])
579d4401354Smrg  AC_SUBST([pythondir], [$am_cv_python_pythondir])
580d4401354Smrg
581d4401354Smrg  dnl pkgpythondir -- $PACKAGE directory under pythondir.  Was
582d4401354Smrg  dnl   PYTHON_SITE_PACKAGE in previous betas, but this naming is
583d4401354Smrg  dnl   more consistent with the rest of automake.
584d4401354Smrg
585d4401354Smrg  AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
586d4401354Smrg
587d4401354Smrg  dnl pyexecdir -- directory for installing python extension modules
588d4401354Smrg  dnl   (shared libraries)
589986c8b3dSmrg  dnl Query distutils for this directory.
590d4401354Smrg  AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
591d4401354Smrg    [am_cv_python_pyexecdir],
592d4401354Smrg    [if test "x$exec_prefix" = xNONE
593d4401354Smrg     then
594d4401354Smrg       am_py_exec_prefix=$am_py_prefix
595d4401354Smrg     else
596d4401354Smrg       am_py_exec_prefix=$exec_prefix
597d4401354Smrg     fi
598986c8b3dSmrg     am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null`
599d4401354Smrg     case $am_cv_python_pyexecdir in
600d4401354Smrg     $am_py_exec_prefix*)
601d4401354Smrg       am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
602d4401354Smrg       am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
603d4401354Smrg       ;;
604986c8b3dSmrg     *)
605986c8b3dSmrg       case $am_py_exec_prefix in
606986c8b3dSmrg         /usr|/System*) ;;
607986c8b3dSmrg         *)
608986c8b3dSmrg	   am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
609986c8b3dSmrg	   ;;
610986c8b3dSmrg       esac
611986c8b3dSmrg       ;;
612d4401354Smrg     esac
613d4401354Smrg    ])
614d4401354Smrg  AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
615d4401354Smrg
616d4401354Smrg  dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
617d4401354Smrg
618d4401354Smrg  AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
619d4401354Smrg
620d4401354Smrg  dnl Run any user-specified action.
621d4401354Smrg  $2
622d4401354Smrg  fi
623d4401354Smrg
624d4401354Smrg])
625d4401354Smrg
626d4401354Smrg
627d4401354Smrg# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
628d4401354Smrg# ---------------------------------------------------------------------------
629d4401354Smrg# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
630d4401354Smrg# Run ACTION-IF-FALSE otherwise.
631d4401354Smrg# This test uses sys.hexversion instead of the string equivalent (first
632d4401354Smrg# word of sys.version), in order to cope with versions such as 2.2c1.
633d4401354Smrg# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
634d4401354SmrgAC_DEFUN([AM_PYTHON_CHECK_VERSION],
635d4401354Smrg [prog="import sys
636d4401354Smrg# split strings by '.' and convert to numeric.  Append some zeros
637d4401354Smrg# because we need at least 4 digits for the hex conversion.
638d4401354Smrg# map returns an iterator in Python 3.0 and a list in 2.x
639d4401354Smrgminver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
640d4401354Smrgminverhex = 0
641d4401354Smrg# xrange is not present in Python 3.0 and range returns an iterator
642d4401354Smrgfor i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
643d4401354Smrgsys.exit(sys.hexversion < minverhex)"
644d4401354Smrg  AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
645d4401354Smrg
646986c8b3dSmrg# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
647d4401354Smrg#
648d4401354Smrg# This file is free software; the Free Software Foundation
649d4401354Smrg# gives unlimited permission to copy and/or distribute it,
650d4401354Smrg# with or without modifications, as long as this notice is preserved.
651d4401354Smrg
652986c8b3dSmrg# serial 1
653986c8b3dSmrg
654d4401354Smrg# AM_RUN_LOG(COMMAND)
655d4401354Smrg# -------------------
656d4401354Smrg# Run COMMAND, save the exit status in ac_status, and log it.
657d4401354Smrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
658d4401354SmrgAC_DEFUN([AM_RUN_LOG],
659d4401354Smrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
660d4401354Smrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
661d4401354Smrg   ac_status=$?
662d4401354Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
663d4401354Smrg   (exit $ac_status); }])
664d4401354Smrg
665d4401354Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
666d4401354Smrg
667d4401354Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
668d4401354Smrg# Free Software Foundation, Inc.
669d4401354Smrg#
670d4401354Smrg# This file is free software; the Free Software Foundation
671d4401354Smrg# gives unlimited permission to copy and/or distribute it,
672d4401354Smrg# with or without modifications, as long as this notice is preserved.
673d4401354Smrg
674d4401354Smrg# serial 5
675d4401354Smrg
676d4401354Smrg# AM_SANITY_CHECK
677d4401354Smrg# ---------------
678d4401354SmrgAC_DEFUN([AM_SANITY_CHECK],
679d4401354Smrg[AC_MSG_CHECKING([whether build environment is sane])
680d4401354Smrg# Just in case
681d4401354Smrgsleep 1
682d4401354Smrgecho timestamp > conftest.file
683d4401354Smrg# Reject unsafe characters in $srcdir or the absolute working directory
684d4401354Smrg# name.  Accept space and tab only in the latter.
685d4401354Smrgam_lf='
686d4401354Smrg'
687d4401354Smrgcase `pwd` in
688d4401354Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
689d4401354Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
690d4401354Smrgesac
691d4401354Smrgcase $srcdir in
692d4401354Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
693d4401354Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
694d4401354Smrgesac
695d4401354Smrg
696d4401354Smrg# Do `set' in a subshell so we don't clobber the current shell's
697d4401354Smrg# arguments.  Must try -L first in case configure is actually a
698d4401354Smrg# symlink; some systems play weird games with the mod time of symlinks
699d4401354Smrg# (eg FreeBSD returns the mod time of the symlink's containing
700d4401354Smrg# directory).
701d4401354Smrgif (
702d4401354Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
703d4401354Smrg   if test "$[*]" = "X"; then
704d4401354Smrg      # -L didn't work.
705d4401354Smrg      set X `ls -t "$srcdir/configure" conftest.file`
706d4401354Smrg   fi
707d4401354Smrg   rm -f conftest.file
708d4401354Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
709d4401354Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
710d4401354Smrg
711d4401354Smrg      # If neither matched, then we have a broken ls.  This can happen
712d4401354Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
713d4401354Smrg      # broken ls alias from the environment.  This has actually
714d4401354Smrg      # happened.  Such a system could not be considered "sane".
715d4401354Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
716d4401354Smrgalias in your environment])
717d4401354Smrg   fi
718d4401354Smrg
719d4401354Smrg   test "$[2]" = conftest.file
720d4401354Smrg   )
721d4401354Smrgthen
722d4401354Smrg   # Ok.
723d4401354Smrg   :
724d4401354Smrgelse
725d4401354Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
726d4401354SmrgCheck your system clock])
727d4401354Smrgfi
728d4401354SmrgAC_MSG_RESULT(yes)])
729d4401354Smrg
730986c8b3dSmrg# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
731d4401354Smrg#
732d4401354Smrg# This file is free software; the Free Software Foundation
733d4401354Smrg# gives unlimited permission to copy and/or distribute it,
734d4401354Smrg# with or without modifications, as long as this notice is preserved.
735d4401354Smrg
736986c8b3dSmrg# serial 1
737986c8b3dSmrg
738d4401354Smrg# AM_PROG_INSTALL_STRIP
739d4401354Smrg# ---------------------
740d4401354Smrg# One issue with vendor `install' (even GNU) is that you can't
741d4401354Smrg# specify the program used to strip binaries.  This is especially
742d4401354Smrg# annoying in cross-compiling environments, where the build's strip
743d4401354Smrg# is unlikely to handle the host's binaries.
744d4401354Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
745d4401354Smrg# always use install-sh in `make install-strip', and initialize
746d4401354Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
747d4401354SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
748d4401354Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
749d4401354Smrg# Installed binaries are usually stripped using `strip' when the user
750d4401354Smrg# run `make install-strip'.  However `strip' might not be the right
751d4401354Smrg# tool to use in cross-compilation environments, therefore Automake
752d4401354Smrg# will honor the `STRIP' environment variable to overrule this program.
753d4401354Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
754d4401354Smrgif test "$cross_compiling" != no; then
755d4401354Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
756d4401354Smrgfi
757d4401354SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
758d4401354SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
759d4401354Smrg
760986c8b3dSmrg# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
761d4401354Smrg#
762d4401354Smrg# This file is free software; the Free Software Foundation
763d4401354Smrg# gives unlimited permission to copy and/or distribute it,
764d4401354Smrg# with or without modifications, as long as this notice is preserved.
765d4401354Smrg
766986c8b3dSmrg# serial 3
767d4401354Smrg
768d4401354Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
769d4401354Smrg# ---------------------------
770d4401354Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
771d4401354Smrg# This macro is traced by Automake.
772d4401354SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
773d4401354Smrg
774d4401354Smrg# AM_SUBST_NOTMAKE(VARIABLE)
775986c8b3dSmrg# --------------------------
776d4401354Smrg# Public sister of _AM_SUBST_NOTMAKE.
777d4401354SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
778d4401354Smrg
779d4401354Smrg# Check how to create a tarball.                            -*- Autoconf -*-
780d4401354Smrg
781986c8b3dSmrg# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
782d4401354Smrg#
783d4401354Smrg# This file is free software; the Free Software Foundation
784d4401354Smrg# gives unlimited permission to copy and/or distribute it,
785d4401354Smrg# with or without modifications, as long as this notice is preserved.
786d4401354Smrg
787d4401354Smrg# serial 2
788d4401354Smrg
789d4401354Smrg# _AM_PROG_TAR(FORMAT)
790d4401354Smrg# --------------------
791d4401354Smrg# Check how to create a tarball in format FORMAT.
792d4401354Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
793d4401354Smrg#
794d4401354Smrg# Substitute a variable $(am__tar) that is a command
795d4401354Smrg# writing to stdout a FORMAT-tarball containing the directory
796d4401354Smrg# $tardir.
797d4401354Smrg#     tardir=directory && $(am__tar) > result.tar
798d4401354Smrg#
799d4401354Smrg# Substitute a variable $(am__untar) that extract such
800d4401354Smrg# a tarball read from stdin.
801d4401354Smrg#     $(am__untar) < result.tar
802d4401354SmrgAC_DEFUN([_AM_PROG_TAR],
803986c8b3dSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
804986c8b3dSmrg# in the wild :-(  We should find a proper way to deprecate it ...
805986c8b3dSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
806d4401354Smrgm4_if([$1], [v7],
807986c8b3dSmrg     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
808d4401354Smrg     [m4_case([$1], [ustar],, [pax],,
809d4401354Smrg              [m4_fatal([Unknown tar format])])
810d4401354SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
811d4401354Smrg# Loop over all known methods to create a tar archive until one works.
812d4401354Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
813d4401354Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
814d4401354Smrg# Do not fold the above two line into one, because Tru64 sh and
815d4401354Smrg# Solaris sh will not grok spaces in the rhs of `-'.
816d4401354Smrgfor _am_tool in $_am_tools
817d4401354Smrgdo
818d4401354Smrg  case $_am_tool in
819d4401354Smrg  gnutar)
820d4401354Smrg    for _am_tar in tar gnutar gtar;
821d4401354Smrg    do
822d4401354Smrg      AM_RUN_LOG([$_am_tar --version]) && break
823d4401354Smrg    done
824d4401354Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
825d4401354Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
826d4401354Smrg    am__untar="$_am_tar -xf -"
827d4401354Smrg    ;;
828d4401354Smrg  plaintar)
829d4401354Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
830d4401354Smrg    # ustar tarball either.
831d4401354Smrg    (tar --version) >/dev/null 2>&1 && continue
832d4401354Smrg    am__tar='tar chf - "$$tardir"'
833d4401354Smrg    am__tar_='tar chf - "$tardir"'
834d4401354Smrg    am__untar='tar xf -'
835d4401354Smrg    ;;
836d4401354Smrg  pax)
837d4401354Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
838d4401354Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
839d4401354Smrg    am__untar='pax -r'
840d4401354Smrg    ;;
841d4401354Smrg  cpio)
842d4401354Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
843d4401354Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
844d4401354Smrg    am__untar='cpio -i -H $1 -d'
845d4401354Smrg    ;;
846d4401354Smrg  none)
847d4401354Smrg    am__tar=false
848d4401354Smrg    am__tar_=false
849d4401354Smrg    am__untar=false
850d4401354Smrg    ;;
851d4401354Smrg  esac
852d4401354Smrg
853d4401354Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
854d4401354Smrg  # and am__untar set.
855d4401354Smrg  test -n "${am_cv_prog_tar_$1}" && break
856d4401354Smrg
857d4401354Smrg  # tar/untar a dummy directory, and stop if the command works
858d4401354Smrg  rm -rf conftest.dir
859d4401354Smrg  mkdir conftest.dir
860d4401354Smrg  echo GrepMe > conftest.dir/file
861d4401354Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
862d4401354Smrg  rm -rf conftest.dir
863d4401354Smrg  if test -s conftest.tar; then
864d4401354Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
865d4401354Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
866d4401354Smrg  fi
867d4401354Smrgdone
868d4401354Smrgrm -rf conftest.dir
869d4401354Smrg
870d4401354SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
871d4401354SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
872d4401354SmrgAC_SUBST([am__tar])
873d4401354SmrgAC_SUBST([am__untar])
874d4401354Smrg]) # _AM_PROG_TAR
875d4401354Smrg
876