tests: avoid two spurious failures on FreeBSD
[automake.git] / t / extradep2.sh
blobeecf74fc2f2204c48ee4410f6ae46a2c4049f7e3
1 #! /bin/sh
2 # Copyright (C) 2010-2012 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 # Test EXTRA_*_DEPENDENCIES, libtool version; see 'extradep.sh'.
19 required='cc libtoolize'
20 . ./defs || exit 1
22 cat >> configure.ac << 'END'
23 AC_PROG_CC
24 AM_PROG_AR
25 AC_PROG_LIBTOOL
26 AC_SUBST([deps], [bardep])
27 AC_OUTPUT
28 END
30 cat > Makefile.am << 'END'
31 noinst_LTLIBRARIES = libfoo.la
32 EXTRA_libfoo_la_DEPENDENCIES = libfoodep
33 libfoodep:
34 @echo making $@
35 @: > $@
36 CLEANFILES = libfoodep
38 bin_PROGRAMS = bar
39 bar_LDADD = libfoo.la
40 EXTRA_bar_DEPENDENCIES = $(deps)
42 EXTRA_DIST = bardep
44 .PHONY: bar-has-been-updated
45 bar-has-been-updated:
46 is_newest bar$(EXEEXT) libfoo.la
47 END
49 cat >libfoo.c <<'END'
50 int libfoo () { return 0; }
51 END
53 cat >bar.c <<'END'
54 extern int libfoo ();
55 int main () { return libfoo (); }
56 END
58 libtoolize
59 $ACLOCAL
60 $AUTOMAKE --add-missing
61 $AUTOCONF
63 ./configure
65 # Hypothesis: EXTRA_*_DEPENDENCIES are honored.
67 : >foodep
68 : >foodep2
69 : >bardep
70 $MAKE >stdout || { cat stdout; exit 1; }
71 cat stdout
72 grep 'making libfoodep' stdout
74 rm -f bardep
75 $MAKE && exit 1
76 : >bardep
78 $MAKE
79 $sleep
80 touch libfoo.la
81 $MAKE
82 $MAKE bar-has-been-updated
84 $MAKE distcheck