338ca600848b78d2e9918532a74cab5473b316f7
[platform/upstream/automake.git] / tests / vala3.test
1 #! /bin/sh
2 # Copyright (C) 1996, 2001, 2002, 2006, 2008, 2009, 2011 Free Software
3 # Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18 # Test to make sure compiling Vala code really works with non-recursive make.
19
20 required="libtool libtoolize pkg-config valac gcc GNUmake"
21 . ./defs || Exit 1
22
23 mkdir src
24
25 cat >> 'configure.in' << 'END'
26 AC_PROG_CC
27 AM_PROG_CC_C_O
28 AC_PROG_LIBTOOL
29 AM_PROG_VALAC([0.7.0])
30 PKG_CHECK_MODULES([GOBJECT],[gobject-2.0 >= 2.10])
31 AC_OUTPUT
32 END
33
34 cat > 'src/zardoz.vala' <<'END'
35 using GLib;
36
37 public class Zardoz {
38   public static void main () {
39     stdout.printf ("Zardoz!\n");
40   }
41 }
42 END
43
44 cat > 'Makefile.am' <<'END'
45 bin_PROGRAMS = src/zardoz
46 src_zardoz_CFLAGS = $(GOBJECT_CFLAGS)
47 src_zardoz_LDADD = $(GOBJECT_LIBS)
48 src_zardoz_SOURCES = src/zardoz.vala
49 END
50
51 libtoolize
52
53 $ACLOCAL
54 $AUTOCONF
55 $AUTOMAKE -a
56
57 ./configure || skip_ "configure failure"
58 $MAKE
59 $MAKE distcheck
60 $MAKE distclean
61 mkdir build
62 cd build
63 ../configure
64 $MAKE
65 $MAKE distcheck
66
67 cd ..
68 rm -rf build
69
70 # Try again with subdir-objects.
71
72 cat > 'Makefile.am' <<'END'
73 AUTOMAKE_OPTIONS = subdir-objects
74
75 bin_PROGRAMS = src/zardoz
76 src_zardoz_CFLAGS = $(GOBJECT_CFLAGS)
77 src_zardoz_LDADD = $(GOBJECT_LIBS)
78 src_zardoz_SOURCES = src/zardoz.vala
79 END
80
81 libtoolize
82
83 $ACLOCAL
84 $AUTOCONF
85 $AUTOMAKE -a
86
87 ./configure || skip_ "configure failure"
88 $MAKE
89 $MAKE distcheck
90 $MAKE distclean
91 mkdir build
92 cd build
93 ../configure
94 $MAKE
95 $MAKE distcheck
96
97