configure: ${#param} must be supported by the shell for the testsuite
[platform/upstream/automake.git] / defs-static.in
1 # -*- shell-script -*-
2 # @configure_input@
3 #
4 # Copyright (C) 1996-2012 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 <http://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 #   - This file should execute correctly with any system's /bin/sh
25 #     shell, not only with configure-time detected $SHELL and/or
26 #     $AM_TEST_RUNNER_SHELL.
27
28 # CDPATH is evil if exported in the environment.
29 CDPATH=; unset CDPATH
30
31 # Be more Bourne compatible.
32 # (Snippet inspired to configure's initialization in Autoconf 2.64)
33 DUALCASE=1; export DUALCASE # for MKS sh
34 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
35   emulate sh
36   NULLCMD=:
37   setopt NO_GLOB_SUBST
38   # If Zsh is not started directly in POSIX-compatibility mode, it has some
39   # incompatibilities in the handling of $0 that conflict with our usage;
40   # i.e., $0 inside a file sourced with the '.' builtin is temporarily set
41   # to the name of the sourced file.  Work around that.
42   # Note that a bug in some versions of Zsh prevents us from resetting $0
43   # in a sourced script, so the use of $argv0.  For more info see:
44   #   <http://www.zsh.org/mla/workers/2009/msg01140.html>
45   # The apparently useless 'eval' here is needed by at least dash 0.5.2,
46   # to prevent it from bailing out with an error like:
47   #   "Syntax error: Bad substitution".
48   eval 'argv0=${functrace[-1]%:*}' && test -f "$argv0" || {
49     echo "Cannot determine the path of running test script." >&2
50     echo "Your Zsh (version $ZSH_VERSION) is probably too old." >&2
51     exit 99
52   }
53 else
54   argv0=$0
55   # Avoid command substitution failure, for Tru64 sh -e and instspc*.test.
56   case `(set -o) 2>/dev/null || :` in *posix*) set -o posix;; esac
57 fi
58
59 # The name of the current test (without the '.sh' or '.tap' suffix).
60 me=${argv0##*/} # Strip all directory components.
61 case $me in     # Strip test suffix.
62    *.tap) me=${me%.tap};;
63     *.sh) me=${me%.sh} ;;
64  esac
65
66 # Check that the environment is properly sanitized.
67 # Having variables exported to the empty string is OK, since our code
68 # treats such variables as if they were unset.
69 for var in \
70   required \
71   am_using_tap \
72   am_serial_tests \
73   am_create_testdir \
74   am_tap_implementation \
75   am_test_prefer_config_shell \
76   am_original_AUTOMAKE \
77   am_original_ACLOCAL \
78 ; do
79   if eval "test x\"\$$var\" != x" && env | grep "^$var=" >/dev/null; then
80     echo "$me: variable '$var' is set in the environment:" \
81          "this is unsafe" >&2
82     exit 99
83   fi
84 done
85 unset var
86
87 # See whether the current test script is expected to use TAP or not.
88 # Use a sensible default, while allowing the scripts to override this
89 # check.
90 if test -z "$am_using_tap"; then
91   case $argv0 in *.tap) am_using_tap=yes;; *) am_using_tap=no;; esac
92 fi
93
94 am_rel_srcdir='@srcdir@'
95 am_top_srcdir='@abs_srcdir@'
96 am_top_builddir='@abs_builddir@'
97
98 # Where testsuite-related helper scripts, data files and shell libraries
99 # are placed.
100 am_testauxdir=$am_top_srcdir/t/ax
101
102 # Support for the "installcheck" target.
103 case ${am_running_installcheck:=no} in
104   yes)
105     am_amdir='@amdir@'
106     am_automake_acdir='@automake_acdir@'
107     am_bindir='@bindir@'
108     am_datadir='@datadir@'
109     am_docdir='@docdir@'
110     am_pkgvdatadir='@pkgvdatadir@'
111     am_scriptdir='@scriptdir@'
112     am_system_acdir='@system_acdir@'
113     ;;
114   no)
115     am_amdir=$am_top_srcdir/lib/am
116     am_automake_acdir=$am_top_srcdir/m4
117     am_bindir=$am_top_builddir/t/wrap
118     am_datadir=$am_top_srcdir
119     am_docdir=$am_top_srcdir/doc
120     am_pkgvdatadir=$am_top_srcdir/lib
121     am_scriptdir=$am_top_srcdir/lib
122     am_system_acdir=$am_top_srcdir/m4/acdir
123     ;;
124   *)
125     echo "$me: variable 'am_running_installcheck' has invalid"
126          "value '$am_running_installcheck'" >&2
127     exit 99
128     ;;
129 esac
130
131 APIVERSION='@APIVERSION@'
132 PATH_SEPARATOR='@PATH_SEPARATOR@'
133
134 host_alias=${host_alias-'@host_alias@'}; export host_alias
135 build_alias=${build_alias-'@build_alias@'}; export build_alias
136
137 # A concurrency-safe "mkdir -p" implementation.
138 MKDIR_P=${AM_TESTSUITE_MKDIR_P-'@MKDIR_P@'}
139
140 # The shell we use to run our own test scripts, determined at configure
141 # time.  It is required in the self tests, and most importantly for the
142 # automatic re-execution of test scripts.
143 AM_TEST_RUNNER_SHELL=${AM_TEST_RUNNER_SHELL-'@AM_TEST_RUNNER_SHELL@'}
144
145 # Make sure we override the user shell.  And do not read the value of
146 # $SHELL from the environment (think to the non-uncommon situation where
147 # e.g., $SHELL=/bin/tcsh).
148 SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}; export SHELL
149
150 # User can override various tools used.  Prefer overriding specific for
151 # that automake testsuite, if they are available.
152 AWK=${AM_TESTSUITE_AWK-${AWK-'@AWK@'}}
153 PERL=${AM_TESTSUITE_PERL-${PERL-'@PERL@'}}
154 MAKE=${AM_TESTSUITE_MAKE-${MAKE-'make'}}
155 YACC=${AM_TESTSUITE_YACC-${YACC-'@YACC@'}}
156 LEX=${AM_TESTSUITE_LEX-${LEX-'@LEX@'}}
157 AUTOCONF=${AM_TESTSUITE_AUTOCONF-${AUTOCONF-'@am_AUTOCONF@'}}
158 AUTOM4TE=${AM_TESTSUITE_AUTOM4TE-${AUTOM4TE-'@am_AUTOM4TE@'}}
159 AUTORECONF=${AM_TESTSUITE_AUTORECONF-${AUTORECONF-'@am_AUTORECONF@'}}
160 AUTOHEADER=${AM_TESTSUITE_AUTOHEADER-${AUTOHEADER-'@am_AUTOHEADER@'}}
161 AUTOUPDATE=${AM_TESTSUITE_AUTOUPDATE-${AUTOUPDATE-'@am_AUTOUPDATE@'}}
162
163 # Tests who want complete control over aclocal or automake command-line
164 # options should use $am_original_ACLOCAL or $am_original_AUTOMAKE.  The
165 # "test -z" tests take care not to re-initialize them if defs-static
166 # is re-sourced, as we want defs-static to remain really idempotent.
167 if test -z "$am_original_AUTOMAKE"; then
168   am_original_AUTOMAKE=${AM_TESTSUITE_AUTOMAKE-${AUTOMAKE-"automake-$APIVERSION"}}
169 fi
170 if test -z "$am_original_ACLOCAL"; then
171   am_original_ACLOCAL=${AM_TESTSUITE_ACLOCAL-${ACLOCAL-"aclocal-$APIVERSION"}}
172 fi
173
174 # Use -Werror because this also turns some Perl warnings into error.
175 # Tests for which this is inappropriate should use -Wno-error.
176 # Tests who want complete control over aclocal command-line options
177 # should use $am_original_ACLOCAL instead.
178 ACLOCAL="$am_original_ACLOCAL -Werror"
179
180 # See how Automake should be run.  We put --foreign as the default
181 # strictness to avoid having to create lots and lots of files.  A test
182 # can override this by specifying a different strictness.  Use -Wall
183 # -Werror by default.  Tests for which this is inappropriate (e.g. when
184 # testing that a warning is enabled by a specific switch) should use
185 # -Wnone or/and -Wno-error.
186 # Tests who want complete control over automake command-line options
187 # should use $am_original_AUTOMAKE instead.
188 AUTOMAKE="$am_original_AUTOMAKE --foreign -Werror -Wall"
189
190 # POSIX no longer requires 'egrep' and 'fgrep',
191 # but some hosts lack 'grep -E' and 'grep -F'.
192 EGREP=${AM_TESTSUITE_EGREP-'@EGREP@'}
193 FGREP=${AM_TESTSUITE_FGREP-'@FGREP@'}
194
195 # Compilers and their flags.  These can point to non-GNU compilers (and
196 # on non-Linux and non-BSD systems, they probably will).
197 CC=${AM_TESTSUITE_CC-${CC-'@CC@'}}
198 CXX=${AM_TESTSUITE_CXX-${CXX-'@CXX@'}}
199 F77=${AM_TESTSUITE_F77-${F77-'@F77@'}}
200 FC=${AM_TESTSUITE_FC-${FC-'@FC@'}}
201 CFLAGS=${AM_TESTSUITE_CFLAGS-${CFLAGS-'@CFLAGS@'}}
202 CXXFLAGS=${AM_TESTSUITE_CXXFLAGS-${CXXFLAGS-'@CXXFLAGS@'}}
203 FCFLAGS=${AM_TESTSUITE_FCFLAGS-${FCFLAGS-'@FCFLAGS@'}}
204 FFLAGS=${AM_TESTSUITE_FFLAGS-${FFLAGS-'@FFLAGS@'}}
205 CPPFLAGS=${AM_TESTSUITE_CPPFLAGS-${CPPFLAGS-'@CPPFLAGS@'}}
206
207 # GNU compilers and their flags.
208 GNU_CC=${AM_TESTSUITE_GNU_CC-${GNU_CC-'@GNU_CC@'}}
209 GNU_CXX=${AM_TESTSUITE_GNU_CXX-${GNU_CXX-'@GNU_CXX@'}}
210 GNU_F77=${AM_TESTSUITE_GNU_F77-${GNU_F77-'@GNU_F77@'}}
211 GNU_FC=${AM_TESTSUITE_GNU_FC-${GNU_FC-'@GNU_FC@'}}
212 GNU_FFLAGS=${AM_TESTSUITE_GNU_FFLAGS-${GNU_FFLAGS-'@GNU_FFLAGS@'}}
213 GNU_FCFLAGS=${AM_TESTSUITE_GNU_FCFLAGS-${GNU_FCFLAGS-'@GNU_FCFLAGS@'}}
214 GNU_CXXFLAGS=${AM_TESTSUITE_GNU_CXXFLAGS-${GNU_CXXFLAGS-'@GNU_CXXFLAGS@'}}
215 GNU_CFLAGS=${AM_TESTSUITE_GNU_CFLAGS-${GNU_CFLAGS-'@GNU_CFLAGS@'}}
216 GNU_GCJ=${AM_TESTSUITE_GNU_GCJ-${GNU_GCJ-'@GNU_GCJ@'}}
217 GNU_GCJFLAGS=${AM_TESTSUITE_GNU_GCJFLAGS-${GNU_GCJFLAGS-'@GNU_GCJFLAGS@'}}
218
219 # No all versions of Tex support '--version', so we use a configure
220 # check to decide if tex is available.  This decision is embodied in
221 # this variable.
222 TEX=${AM_TESTSUITE_TEX-'@TEX@'}
223
224 # The amount we should wait after modifying files depends on the platform.
225 # For instance, Windows '95, '98 and ME have 2-second granularity
226 # and can be up to 3 seconds in the future w.r.t. the system clock.
227 sleep='sleep @MODIFICATION_DELAY@'
228
229 # An old timestamp that can be given to a file, in "touch -t" format.
230 # The time stamp should be portable to all file systems of interest.
231 # Just for fun, choose the exact time of the announcement of the GNU project
232 # in UTC; see <http://www.gnu.org/gnu/initial-announcement.html>.
233 old_timestamp=198309271735.59
234
235 # Make our wrapper script (or installed scripts, if running under
236 # "installcheck") accessible by default.  And avoid to uselessly
237 # extend $PATH multiple times if this file is sourced multiple times.
238 case $PATH in
239   $am_bindir$PATH_SEPARATOR*) ;;
240   *) PATH=$am_bindir$PATH_SEPARATOR$PATH;;
241 esac
242
243 # Make our helper script accessible by default.
244 PATH=$am_testauxdir$PATH_SEPARATOR$PATH
245
246 export PATH