* configure.ac, NEWS: Bump version to 1.8b.
[automake.git] / tests / aclocal4.test
blob634a90c001afbab472c33c7ac4d82d331b5e61d1
1 #! /bin/sh
2 # Copyright (C) 2003 Free Software Foundation, Inc.
4 # This file is part of GNU Automake.
6 # GNU Automake is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
9 # any later version.
11 # GNU Automake is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with Automake; see the file COPYING. If not, write to
18 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 # Boston, MA 02111-1307, USA.
21 # Make sure dependencies on aclocal.m4 are set correctly.
22 # Report from Jim Meyering.
24 # We need GNU make for the `rebuild rules' to be triggered.
25 required=GNUmake
26 . ./defs || exit 1
28 set -e
30 cat >>configure.in <<EOF
31 AC_PROG_RANLIB
32 AC_PROG_CC
33 MY_MACRO
34 AC_CONFIG_FILES([lib/Makefile])
35 AC_OUTPUT
36 EOF
38 mkdir m4
39 cat >m4/mymacro.m4 <<EOF
40 AC_DEFUN([MY_MACRO], [])
41 EOF
43 mkdir lib
44 : > lib/foo.c
45 : > lib/bar.c
46 cat >lib/Makefile.am <<'EOF'
47 noinst_LIBRARIES = liberi.a
48 liberi_a_SOURCES = bar.c
49 liberi_a_LIBADD = $(LIBOBJS)
50 EOF
52 cat >Makefile.am <<'EOF'
53 SUBDIRS = lib
54 EXTRA_DIST = m4/mymacro.m4
55 ACLOCAL_AMFLAGS = -I m4
56 check-foo: distdir
57 test -f $(distdir)/lib/foo.c
58 test -f $(distdir)/lib/bar.c
60 check-not-foo: distdir
61 test ! -f $(distdir)/lib/foo.c
62 test -f $(distdir)/lib/bar.c
63 EOF
65 $ACLOCAL -I m4
66 $AUTOCONF
67 $AUTOMAKE
68 ./configure
69 $MAKE check-not-foo
71 # Update one of the macros. This should cause ./configure, Makefile.in,
72 # Makefile, lib/Makefile.in, and lib/Makfile to be updated. This assumes
73 # GNU make.
75 cat >m4/mymacro.m4 <<'EOF'
76 AC_DEFUN([MY_MACRO], [AC_LIBOBJ([foo])])
77 EOF
79 $MAKE check-foo