2 # Copyright (C) 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)
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 # Vala sources, C and C++ sources and C and C++ headers in the same
18 # program. Functional test. See automake bug#10894.
20 required='valac cc c++ GNUmake'
23 cat >> configure.ac <<'END'
26 AM_PROG_VALAC([0.7.3])
30 cat > Makefile.am <<'END'
32 AM_VALAFLAGS = --profile=posix
33 zardoz_SOURCES = zardoz.vala foo.h bar.c baz.c zen.hh master.cxx
36 cat > zardoz.vala <<'END'
39 stdout.printf ("foo is alive\n");
52 int bar (void) { return foo + baz (); }
58 int baz (void) { return 0; }
65 cat > master.cxx <<'END'
67 void chatty (void) { std::cout << "Hello, stranger!\n"; }
74 # Do not reject slower dependency extractors.
75 ./configure --enable-dependency-tracking
78 ls -l # For debugging.
80 have_generated_files ()
82 test -f zardoz_vala.stamp
86 # Our vala-related rules must create stamp files and intermediate
90 # Remake rules are not uselessly triggered.
92 $MAKE -n | $FGREP vala.stamp && exit 1
94 # But are triggered when they should.
95 for file in zardoz.vala foo.h bar.c baz.c zen.hh master.cxx; do
97 echo '& choke me !' >> $file
105 # Check the distribution.
108 # Stamp files and intermediate C files should *not* be removed
111 ls -l # For debugging.
114 # But stamp files should be removed by "maintainer-clean" (the
115 # behaviour w.r.t. intermediate C files is still unclear, and
116 # better left undefined for the moment).
117 $MAKE maintainer-clean
118 ls *vala*.stamp | grep . && exit 1