2 # Copyright (C) 2012-2024 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 <https://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++ pkg-config GNUmake'
23 cat >> configure.ac
<<'END'
26 AM_PROG_VALAC([0.7.3])
27 PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.4])
31 cat > Makefile.am
<<'END'
33 AM_CFLAGS = $(GOBJECT_CFLAGS)
34 zardoz_LDADD = $(GOBJECT_LIBS)
35 zardoz_SOURCES = zardoz.vala foo.h bar.c baz.c zen.hh master.cxx
38 cat > zardoz.vala
<<'END'
41 stdout.printf ("foo is alive\n");
54 int bar (void) { return foo + baz (); }
60 int baz (void) { return 0; }
67 cat > master.cxx
<<'END'
69 void chatty (void) { std::cout << "Hello, stranger!\n"; }
76 # Do not reject slower dependency extractors.
77 .
/configure
--enable-dependency-tracking
80 ls -l # For debugging.
82 have_generated_files
()
84 test -f zardoz_vala.stamp
88 # Our vala-related rules must create stamp files and intermediate
92 # Remake rules are not uselessly triggered.
94 $MAKE -n |
$FGREP vala.stamp
&& exit 1
96 # But are triggered when they should.
97 for file in zardoz.vala foo.h bar.c baz.c zen.hh master.cxx
; do
99 echo '& choke me !' >> $file
107 # Check the distribution.
110 # Stamp files and intermediate C files should *not* be removed
113 ls -l # For debugging.
116 # But stamp files should be removed by "maintainer-clean" (the
117 # behavior w.r.t. intermediate C files is still unclear, and
118 # better left undefined for the moment).
119 $MAKE maintainer-clean
120 ls *vala
*.stamp |
grep .
&& exit 1