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