2 # Copyright (C) 1996-2018 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 # Test per-target flags in vala support.
19 required
="pkg-config valac gcc GNUmake"
24 cat >> configure.ac
<<'END'
26 AM_PROG_VALAC([0.7.0])
27 PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.4])
28 AC_CONFIG_FILES([src/Makefile])
32 cat > Makefile.am
<<'END'
36 cat > src
/Makefile.am
<<'END'
37 bin_PROGRAMS = foo bar
38 foo_CFLAGS = $(GOBJECT_CFLAGS)
39 foo_LDADD = $(GOBJECT_LIBS)
40 foo_SOURCES = xfoo.vala
41 bar_SOURCES = xbar.vala
42 bar_VALAFLAGS = -D BAR
43 bar_CFLAGS = $(GOBJECT_CFLAGS)
44 bar_LDADD = $(GOBJECT_LIBS)
47 cat > src
/xfoo.vala
<<'END'
50 stdout.printf ("foo\n");
55 cat > src
/xbar.vala
<<'END'
59 stdout.printf ("bar\n");
61 stdout.oops_an_invalid_method ();
73 if ! cross_compiling
; then
76 test "$(./src/foo)" = foo
77 test "$(./src/bar)" = bar
82 cp config.status config.sav
93 mv config.sav config.status
96 $MAKE maintainer-clean