1 | #! /bin/sh
|
---|
2 |
|
---|
3 | # Test that automatically generated dependencies are correctly
|
---|
4 | # rewritten into distribution Makefiles. This test is set up to look
|
---|
5 | # like a C program was built in a subdir of the distribution.
|
---|
6 |
|
---|
7 | . $srcdir/defs || exit 1
|
---|
8 |
|
---|
9 | cat > configure.in << 'END'
|
---|
10 | PACKAGE=nonesuch
|
---|
11 | VERSION=nonesuch
|
---|
12 | AC_ARG_PROGRAM
|
---|
13 | AC_PROG_MAKE_SET
|
---|
14 | AC_PROG_INSTALL
|
---|
15 | AC_PROG_CC
|
---|
16 | AC_OUTPUT(Makefile src/Makefile)
|
---|
17 | END
|
---|
18 |
|
---|
19 | cat > Makefile.am << 'END'
|
---|
20 | SUBDIRS = src
|
---|
21 | END
|
---|
22 |
|
---|
23 | mkdir src
|
---|
24 | cat > src/Makefile.am << 'END'
|
---|
25 | bin_PROGRAMS = copyin
|
---|
26 | END
|
---|
27 |
|
---|
28 | : > src/copyin.c
|
---|
29 |
|
---|
30 | mkdir build
|
---|
31 | mkdir build/src
|
---|
32 | mkdir build/src/.deps
|
---|
33 |
|
---|
34 | : > build/src/.deps/.P
|
---|
35 |
|
---|
36 | cat > build/src/.deps/copyin.P << 'END'
|
---|
37 | copyin.o: ../../src/copyin.c ../config.h /usr/include/stdio.h \
|
---|
38 | /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/libio.h \
|
---|
39 | /usr/local/lib/gcc-lib/i586-unknown-linuxaout/cygnus-2.7.1-951112/../../../../i586-unknown-linuxaout/include/_G_config.h \
|
---|
40 | /usr/include/sys/types.h /usr/include/linux/types.h \
|
---|
41 | /usr/include/asm/types.h /usr/include/sys/stat.h \
|
---|
42 | /usr/include/linux/stat.h ../../lib/filetypes.h ../../src/system.h \
|
---|
43 | /usr/include/string.h \
|
---|
44 | /usr/local/lib/gcc-lib/i586-unknown-linuxaout/cygnus-2.7.1-951112/include/stddef.h \
|
---|
45 | /usr/include/time.h /usr/include/stdlib.h /usr/include/errno.h \
|
---|
46 | /usr/include/linux/errno.h \
|
---|
47 | /usr/local/lib/gcc-lib/i586-unknown-linuxaout/cygnus-2.7.1-951112/include/float.h \
|
---|
48 | /usr/include/alloca.h /usr/include/unistd.h /usr/include/posix_opt.h \
|
---|
49 | /usr/include/gnu/types.h /usr/include/confname.h \
|
---|
50 | /usr/include/sys/sysmacros.h /usr/include/fcntl.h \
|
---|
51 | /usr/include/linux/fcntl.h /usr/include/utime.h \
|
---|
52 | /usr/include/linux/utime.h /usr/include/dirent.h \
|
---|
53 | /usr/include/linux/limits.h /usr/include/linux/dirent.h \
|
---|
54 | /usr/include/posix1_lim.h ../../src/cpiohdr.h ../../src/cpio.h \
|
---|
55 | ../../src/extern.h \
|
---|
56 | /usr/local/lib/gcc-lib/i586-unknown-linuxaout/cygnus-2.7.1-951112/../../../../include/libintl.h \
|
---|
57 | /usr/include/locale.h ../../lib/ansidecl.h ../../lib/dstring.h \
|
---|
58 | ../../lib/error.h ../../src/defer.h ../../src/rmt.h \
|
---|
59 | ../../lib/fnmatch.h
|
---|
60 | END
|
---|
61 |
|
---|
62 | mkdir outdir
|
---|
63 |
|
---|
64 | $AUTOMAKE --include-deps --build-dir=`pwd`/build --srcdir-name=../.. \
|
---|
65 | --output-dir=`pwd`/outdir src/Makefile || exit 1
|
---|
66 |
|
---|
67 | # The buggy output contains this string.
|
---|
68 | fgrep '../../lib/filetypes.h' outdir/src/Makefile.in && exit 1
|
---|
69 |
|
---|
70 | # Also make sure that filetypes.h is mentioned at all.
|
---|
71 | fgrep filetypes.h outdir/src/Makefile.in
|
---|