1# -*- shell-script -*-
2# @configure_input@
3#
4# Copyright (C) 1996-2021 Free Software Foundation, Inc.
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2, or (at your option)
9# any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program.  If not, see <https://www.gnu.org/licenses/>.
18
19# Defines and minimal setup for Automake testing environment.
20
21# IMPORTANT NOTES AND REQUIREMENTS
22#   - Multiple inclusions of this file should be idempotent.
23#   - This code has to be 'set -e' clean.
24
25# See whether the current test script is expected to use TAP or not.
26# Use a sensible default, while allowing the scripts to override this
27# check.
28if test -z "$am_test_protocol"; then
29  case $argv0 in
30    *.tap) am_test_protocol=tap;;
31        *) am_test_protocol=none;;
32  esac
33fi
34
35am_rel_srcdir='@srcdir@'
36am_top_srcdir='@abs_srcdir@'
37am_top_builddir='@abs_builddir@'
38
39# Where testsuite-related helper scripts, data files and shell libraries
40# are placed.
41am_testaux_srcdir=$am_top_srcdir/t/ax
42am_testaux_builddir=$am_top_builddir/t/ax
43
44# Support for the "installcheck" target.
45case ${am_running_installcheck:=no} in
46  yes)
47    am_amdir='@amdir@'
48    am_automake_acdir='@automake_acdir@'
49    am_bindir='@bindir@'
50    am_datadir='@datadir@'
51    am_docdir='@docdir@'
52    am_pkgvdatadir='@pkgvdatadir@'
53    am_scriptdir='@scriptdir@'
54    am_system_acdir='@system_acdir@'
55    ;;
56  no)
57    am_amdir=$am_top_srcdir/lib/am
58    am_automake_acdir=""
59    am_bindir=$am_top_builddir/bin
60    am_datadir=$am_top_srcdir
61    am_docdir=$am_top_srcdir/doc
62    am_pkgvdatadir=$am_top_srcdir/lib
63    am_scriptdir=$am_top_srcdir/lib
64    am_system_acdir=""
65    ;;
66  *)
67    echo "$me: variable 'am_running_installcheck' has invalid"
68         "value '$am_running_installcheck'" >&2
69    exit 99
70    ;;
71esac
72
73APIVERSION='@APIVERSION@'
74PATH_SEPARATOR='@PATH_SEPARATOR@'
75
76host_alias=${host_alias-'@host_alias@'}; export host_alias
77build_alias=${build_alias-'@build_alias@'}; export build_alias
78
79# Whether the testsuite is being run by faking the presence of a C
80# compiler that doesn't grasp the '-c' and '-o' flags together.  By
81# default, of course, it isn't.
82: "${AM_TESTSUITE_SIMULATING_NO_CC_C_O:=no}"
83
84# A concurrency-safe "mkdir -p" implementation.
85MKDIR_P=${AM_TESTSUITE_MKDIR_P-'@MKDIR_P@'}
86
87# The shell we use to run our own test scripts, determined at configure
88# time.  It is required in the self tests, and most importantly for the
89# automatic re-execution of test scripts.
90AM_TEST_RUNNER_SHELL=${AM_TEST_RUNNER_SHELL-'@AM_TEST_RUNNER_SHELL@'}
91
92# Make sure we override the user shell.  And do not read the value of
93# $SHELL from the environment (think to the non-uncommon situation where
94# e.g., $SHELL=/bin/tcsh).
95SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}; export SHELL
96
97# User can override various tools used.  Prefer overriding specific for
98# that automake testsuite, if they are available.
99AWK=${AM_TESTSUITE_AWK-${AWK-'@AWK@'}}
100PERL=${AM_TESTSUITE_PERL-${PERL-'@PERL@'}}
101MAKE=${AM_TESTSUITE_MAKE-${MAKE-'make'}}
102YACC=${AM_TESTSUITE_YACC-${YACC-'@YACC@'}}
103LEX=${AM_TESTSUITE_LEX-${LEX-'@LEX@'}}
104AUTOCONF=${AM_TESTSUITE_AUTOCONF-${AUTOCONF-'@am_AUTOCONF@'}}
105AUTOM4TE=${AM_TESTSUITE_AUTOM4TE-${AUTOM4TE-'@am_AUTOM4TE@'}}
106AUTORECONF=${AM_TESTSUITE_AUTORECONF-${AUTORECONF-'@am_AUTORECONF@'}}
107AUTOHEADER=${AM_TESTSUITE_AUTOHEADER-${AUTOHEADER-'@am_AUTOHEADER@'}}
108AUTOUPDATE=${AM_TESTSUITE_AUTOUPDATE-${AUTOUPDATE-'@am_AUTOUPDATE@'}}
109
110# Tests which want complete control over aclocal or automake command-line
111# options should use $am_original_ACLOCAL or $am_original_AUTOMAKE.  The
112# "test -z" tests take care not to re-initialize them if 'test-defs.sh'
113# is re-sourced, as we want that file to remain really idempotent.
114if test -z "$am_original_AUTOMAKE"; then
115  am_original_AUTOMAKE=${AM_TESTSUITE_AUTOMAKE-${AUTOMAKE-"automake-$APIVERSION"}}
116fi
117if test -z "$am_original_ACLOCAL"; then
118  am_original_ACLOCAL=${AM_TESTSUITE_ACLOCAL-${ACLOCAL-"aclocal-$APIVERSION"}}
119fi
120
121# Use -Werror by default.  Tests for which this is inappropriate should
122# use -Wno-error.
123# Tests which want complete control over aclocal command-line options
124# should use $am_original_ACLOCAL instead.
125ACLOCAL="$am_original_ACLOCAL -Werror"
126
127# See how Automake should be run.  We put --foreign as the default
128# strictness to avoid having to create lots and lots of files.  A test
129# can override this by specifying a different strictness.  Use -Wall
130# -Werror by default.  Tests for which this is inappropriate (e.g. when
131# testing that a warning is enabled by a specific switch) should use
132# -Wnone or/and -Wno-error.
133# Tests who want complete control over automake command-line options
134# should use $am_original_AUTOMAKE instead.
135AUTOMAKE="$am_original_AUTOMAKE --foreign -Werror -Wall"
136
137# POSIX no longer requires 'egrep' and 'fgrep',
138# but some hosts lack 'grep -E' and 'grep -F'.
139EGREP=${AM_TESTSUITE_EGREP-'@EGREP@'}
140FGREP=${AM_TESTSUITE_FGREP-'@FGREP@'}
141
142# Compilers and their flags.  These can point to non-GNU compilers (and
143# on non-Linux and non-BSD systems, they probably will).
144if test $AM_TESTSUITE_SIMULATING_NO_CC_C_O = no; then
145  CC=${AM_TESTSUITE_CC-${CC-'@CC@'}}
146else
147  CC=$am_testaux_builddir/cc-no-c-o
148fi
149CXX=${AM_TESTSUITE_CXX-${CXX-'@CXX@'}}
150F77=${AM_TESTSUITE_F77-${F77-'@F77@'}}
151FC=${AM_TESTSUITE_FC-${FC-'@FC@'}}
152CFLAGS=${AM_TESTSUITE_CFLAGS-${CFLAGS-'@CFLAGS@'}}
153CXXFLAGS=${AM_TESTSUITE_CXXFLAGS-${CXXFLAGS-'@CXXFLAGS@'}}
154FCFLAGS=${AM_TESTSUITE_FCFLAGS-${FCFLAGS-'@FCFLAGS@'}}
155FFLAGS=${AM_TESTSUITE_FFLAGS-${FFLAGS-'@FFLAGS@'}}
156CPPFLAGS=${AM_TESTSUITE_CPPFLAGS-${CPPFLAGS-'@CPPFLAGS@'}}
157
158# GNU compilers and their flags.
159if test $AM_TESTSUITE_SIMULATING_NO_CC_C_O = no; then
160  GNU_CC=${AM_TESTSUITE_GNU_CC-${GNU_CC-'@GNU_CC@'}}
161else
162  GNU_CC=$am_testaux_builddir/cc-no-c-o
163fi
164GNU_CC=${AM_TESTSUITE_GNU_CC-${GNU_CC-'@GNU_CC@'}}
165GNU_CXX=${AM_TESTSUITE_GNU_CXX-${GNU_CXX-'@GNU_CXX@'}}
166GNU_F77=${AM_TESTSUITE_GNU_F77-${GNU_F77-'@GNU_F77@'}}
167GNU_FC=${AM_TESTSUITE_GNU_FC-${GNU_FC-'@GNU_FC@'}}
168GNU_FFLAGS=${AM_TESTSUITE_GNU_FFLAGS-${GNU_FFLAGS-'@GNU_FFLAGS@'}}
169GNU_FCFLAGS=${AM_TESTSUITE_GNU_FCFLAGS-${GNU_FCFLAGS-'@GNU_FCFLAGS@'}}
170GNU_CXXFLAGS=${AM_TESTSUITE_GNU_CXXFLAGS-${GNU_CXXFLAGS-'@GNU_CXXFLAGS@'}}
171GNU_CFLAGS=${AM_TESTSUITE_GNU_CFLAGS-${GNU_CFLAGS-'@GNU_CFLAGS@'}}
172GNU_GCJ=${AM_TESTSUITE_GNU_GCJ-${GNU_GCJ-'@GNU_GCJ@'}}
173GNU_GCJFLAGS=${AM_TESTSUITE_GNU_GCJFLAGS-${GNU_GCJFLAGS-'@GNU_GCJFLAGS@'}}
174
175# No all versions of Tex support '--version', so we use a configure
176# check to decide if tex is available.  This decision is embodied in
177# this variable.
178TEX=${AM_TESTSUITE_TEX-'@TEX@'}
179
180# The amount we should wait after modifying files depends on the platform.
181# For instance, Windows '95, '98 and ME have 2-second granularity
182# and can be up to 3 seconds in the future w.r.t. the system clock.
183# The creative quoting is to avoid spuriously triggering a failure in
184# the maintainer checks,
185sleep='sleep ''@MODIFICATION_DELAY@'
186
187# An old timestamp that can be given to a file, in "touch -t" format.
188# The time stamp should be portable to all file systems of interest.
189# Just for fun, choose the exact time of the announcement of the GNU project
190# in UTC; see <https://www.gnu.org/gnu/initial-announcement.html>.
191old_timestamp=198309271735.59
192
193# Make our wrapper script (or installed scripts, if running under
194# "installcheck") accessible by default.  And avoid to uselessly
195# extend $PATH multiple times if this file is sourced multiple times.
196case $PATH in
197  $am_bindir$PATH_SEPARATOR*) ;;
198  *) PATH=$am_bindir$PATH_SEPARATOR$PATH;;
199esac
200
201export PATH
202