Use sed 1q, not `head -n 1'.
[platform/upstream/automake.git] / tests / installsh.test
1 #! /bin/sh
2
3 # Test for this bug:
4 # automake: Makefile.am: required file "../../install-sh" not found; installing
5 # This also makes sure that install-sh is created in the correct directory.
6
7 . $srcdir/defs || exit 1
8
9 : > Makefile.am
10 rm -f install-sh
11
12 # Since the default path includes '../..', we must run this test in
13 # yet another subdir.
14 mkdir frob
15 mv Makefile.am configure.in mkinstalldirs frob/
16 cd frob
17
18 # If srcdir is relative, we need to modify it.
19 case "$srcdir" in
20  [\\/]* | ?:[\\/]*)
21     ;;
22
23  *)
24     srcdir="../$srcdir"
25     ;;
26 esac
27
28 AUTOMAKE="$PERL ../../../automake --libdir=$srcdir/../lib --foreign --Werror"
29 ACLOCAL="$PERL ../../../aclocal -I ../../../m4 --acdir=$srcdir/../m4"
30
31 # Now we proceed with the test
32 $ACLOCAL || exit 1
33 $AUTOMAKE --add-missing > output 2>&1 \
34    || exit 1
35
36 # Only one `/' should appear in the output.
37 grep '/.*/' output \
38    && exit 1
39
40 test -f install-sh