Revert Automake license to GPLv2+.
[automake.git] / tests / subdirbuiltsources.test
blob8fe506aaca30e5f2908c079f45ad7b61231c9066
1 #! /bin/sh
2 # Copyright (C) 2001, 2002 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Make sure when using SUBDIR that all BUILT_SOURCES are built.
18 # A bug occurred where subdirs do not have all-recursive or
19 # all-recursive-am which depended on BUILT_SOURCES.
21 . ./defs || Exit 1
23 set -e
25 mkdir lib
27 cat > configure.in << 'END'
28 AC_INIT
29 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
30 AC_PROG_RANLIB
31 AC_PROG_CC
32 AC_OUTPUT(Makefile lib/Makefile)
33 END
35 # Files required because we are using `--gnu'.
36 : > INSTALL
37 : > NEWS
38 : > README
39 : > COPYING
40 : > AUTHORS
41 : > ChangeLog
43 cat > Makefile.am << 'END'
44 SUBDIRS = lib
45 END
47 cat > lib/Makefile.am << 'END'
48 pkgdata_DATA =
49 noinst_LIBRARIES = libfoo.a
50 libfoo_a_SOURCES = foo.c
51 BUILT_SOURCES=foo.h
52 foo.h:
53 echo \#define FOO_DEFINE 1 >$@
54 END
56 cat > lib/foo.c << 'END'
57 #include <foo.h>
58 int foo () { return !FOO_DEFINE;}
59 END
62 $ACLOCAL
64 $AUTOCONF
66 $AUTOMAKE --include-deps --copy --force-missing --add-missing --gnu
68 ./configure
70 # Remove the comment to get a successful test.
71 # $MAKE -C lib foo.h
72 $MAKE
74 Exit 0