4a6824db8ac647ea45a277e002911dd51ab47341
[platform/upstream/automake.git] / tests / defs
1 # -*- ksh -*-
2 # Defines for Automake testing environment.
3 # Tom Tromey <tromey@cygnus.com>
4
5 # Ensure $srcdir set correctly.
6 test -f $srcdir/defs || {
7    echo "defs: installation error" 1>&2
8    exit 1
9 }
10
11 # Always use an absolute srcdir.  Otherwise symlinks made in subdirs
12 # of the test dir just won't work.
13 case "$srcdir" in
14  /*)
15     ;;
16
17  *)
18     srcdir=`CDPATH=: && cd "$srcdir" && pwd`
19     ;;
20 esac
21
22 chmod -R a+rwx testSubDir > /dev/null 2>&1
23 rm -rf testSubDir > /dev/null 2>&1
24 mkdir testSubDir
25 cd ./testSubDir
26
27 # Build appropriate environment in test directory.  Eg create
28 # configure.in, touch all necessary files, etc.
29 cat > configure.in << 'END'
30 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
31 PACKAGE=nonesuch
32 VERSION=nonesuch
33 AC_ARG_PROGRAM
34 AC_PROG_INSTALL
35 AC_PROG_MAKE_SET
36 AC_OUTPUT(Makefile)
37 END
38
39 : > install-sh
40 : > mkinstalldirs
41 : > missing
42
43 (cd .. && cp $srcdir/../depcomp testSubDir/depcomp) || exit 1
44
45 # See how redirections should work.  User can set VERBOSE to see all
46 # output.
47 test -z "$VERBOSE" && {
48    exec > /dev/null 2>&1
49 }
50
51 # User can set PERL to change the perl interpreter used.
52 test -z "$PERL" && PERL=perl
53
54 # User can set MAKE to choose which make to use.  Must use GNU make.
55 test -z "$MAKE" && MAKE=make
56
57 echo "=== Running test $0"
58
59 # See how Automake should be run.  We put --foreign as the default
60 # strictness to avoid having to create lots and lots of files.  A test
61 # can override this by specifying a different strictness.
62 AUTOMAKE="$PERL ../../automake --amdir=$srcdir/.. --foreign"
63
64 # See how aclocal should be run.
65 ACLOCAL="$PERL ../../aclocal --acdir=$srcdir/../m4"