Merge branch 'maint'
[platform/upstream/automake.git] / defs
1 # -*- shell-script -*-
2 #
3 # Copyright (C) 1996-2012 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18 # *** IMPORTANT NOTE ***
19 # This file should execute correctly with any system's /bin/sh (which
20 # might be just a Bourne shell, non POSIX-conforming, like on Solaris
21 # up to version 11 at least).
22
23 # Source the shell static setup and variable definitions.
24 . ./defs-static
25 test $? -eq 0 || exit 99
26
27 # Make sure we run with the shell detected at configure time or forced
28 # by the user (unless the user forbids it).  That is assumed to be a
29 # proper POSIX shell.
30 case ${AM_TESTS_REEXEC-yes} in
31   n|no|false|0)
32     ;;
33   *)
34     # Ensure we can find ourselves.
35     if test ! -f "$argv0"; then
36       echo "$argv0: unable to find myself" >&2
37       exit 99
38     fi
39     AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
40     # Cannot simply do "opts=$-", since the content of $- is not
41     # portable among different shells.  So try to propagate only
42     # the portable and interesting options.
43     case $- in
44       *x*v*|*v*x) opts=-vx;;
45       *v*) opts=-v;;
46       *x*) opts=-x;;
47       *) opts=;;
48     esac
49     echo exec $AM_TEST_RUNNER_SHELL $opts "$argv0" "$*"
50     exec $AM_TEST_RUNNER_SHELL $opts "$argv0" ${1+"$@"}
51     # This should be dead code, unless some strange error happened.
52     echo "$argv0: failed to re-execute with $AM_TEST_RUNNER_SHELL" >&2
53     exit 99
54     ;;
55 esac
56
57 # Source the actual test initialization and setup code, and return
58 # control to the test script that is sourcing us.
59 . "$am_testauxdir/test-init.sh"