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 # Test and that vapi files are correctly handled by Vala support.
19 required='valac cc GNUmake'
24 cat >> configure.ac <<'END'
27 AM_PROG_VALAC([0.7.3])
31 cat > Makefile.am <<'END'
33 AM_VALAFLAGS = --profile=posix
34 zardoz_SOURCES = zardoz.vala foo.vapi foo.h
37 cat > zardoz.vala <<'END'
40 stdout.printf (BARBAR);
45 echo '#define BARBAR "Zardoz!\n"' > foo.h
47 cat > foo.vapi <<'END'
48 [CCode (cprefix="", lower_case_cprefix="", cheader_filename="foo.h")]
49 public const string BARBAR;
52 if cross_compiling; then :; else
53 unindent >> Makefile.am <<'END'
58 ./zardoz | grep 'Zardoz!'
61 ./zardoz | grep 'Quux!'
69 ./configure --enable-dependency-tracking
72 ls -l # For debugging.
73 cat zardoz.c # Likewise.
74 grep 'BARBAR' zardoz.c
77 # Simple check on remake rules.
79 echo '#define BAZBAZ "Quux!\n"' > foo.h
80 sed 's/BARBAR/BAZBAZ/' zardoz.vala > t && mv -f t zardoz.vala || Exit 99
82 sed 's/BARBAR/BAZBAZ/' foo.vapi > t && mv -f t foo.vapi || Exit 99
84 cat zardoz.c # For debugging.
85 grep 'BAZBAZ' zardoz.c
88 # Check the distribution.