tests: make 'lzip.test' executable
[automake.git] / tests / vala2.test
blobe559540d66991e61d385f18e44fdbc2997a0fe07
1 #! /bin/sh
2 # Copyright (C) 1996, 2001, 2002, 2006, 2008, 2009
3 # Free Software Foundation, Inc.
5 # This file is part of GNU Automake.
7 # GNU Automake is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
12 # GNU Automake is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with Automake; see the file COPYING. If not, write to
19 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 # Boston, MA 02110-1301, USA.
22 # Test to make sure compiling Vala code really works with recursive make.
24 required="libtool libtoolize pkg-config valac gcc GNUmake"
25 . ./defs || Exit 1
27 set -e
29 mkdir src
31 cat >> 'configure.in' << 'END'
32 AC_PROG_CC
33 AM_PROG_CC_C_O
34 AC_PROG_LIBTOOL
35 AM_PROG_VALAC([0.7.0])
36 PKG_CHECK_MODULES([GOBJECT],[gobject-2.0 >= 2.10])
37 AC_CONFIG_FILES([src/Makefile])
38 AC_OUTPUT
39 END
41 cat > 'Makefile.am' <<'END'
42 SUBDIRS = src
43 END
45 cat > 'src/Makefile.am' <<'END'
46 bin_PROGRAMS = zardoz
47 zardoz_VALAFLAGS = -H zardoz.h
48 zardoz_CFLAGS = $(GOBJECT_CFLAGS)
49 zardoz_LDADD = $(GOBJECT_LIBS)
50 zardoz_SOURCES = zardoz.vala
51 END
53 cat > 'src/zardoz.vala' <<'END'
54 using GLib;
56 public class Zardoz {
57 public static void main () {
58 stdout.printf ("Zardoz!\n");
61 END
63 libtoolize
65 $ACLOCAL
66 $AUTOCONF
67 $AUTOMAKE -a
69 ./configure || Exit 77
70 $MAKE
72 # test rebuild rules
73 rm -f src/zardoz.h
74 $MAKE -C src zardoz.h
76 $MAKE distcheck
77 $MAKE distclean
78 mkdir build
79 cd build
80 ../configure
81 $MAKE
82 $MAKE distcheck
84 # test rebuild rules from builddir
85 touch ../src/zardoz.vala
86 $MAKE