maint: run "make update-copyright"
[platform/upstream/automake.git] / tests / vala3.test
1 #! /bin/sh
2 # Copyright (C) 1996-2012 Free Software Foundation, Inc.
3 #
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)
7 # any later version.
8 #
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.
13 #
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/>.
16
17 # Test to make sure compiling Vala code really works with non-recursive make.
18
19 required="libtool libtoolize pkg-config valac gcc GNUmake"
20 . ./defs || Exit 1
21
22 mkdir src
23
24 cat >> 'configure.in' << 'END'
25 AC_PROG_CC
26 AM_PROG_CC_C_O
27 AC_PROG_LIBTOOL
28 AM_PROG_VALAC([0.7.0])
29 PKG_CHECK_MODULES([GOBJECT],[gobject-2.0 >= 2.10])
30 AC_OUTPUT
31 END
32
33 cat > 'src/zardoz.vala' <<'END'
34 using GLib;
35
36 public class Zardoz {
37   public static void main () {
38     stdout.printf ("Zardoz!\n");
39   }
40 }
41 END
42
43 cat > 'Makefile.am' <<'END'
44 bin_PROGRAMS = src/zardoz
45 src_zardoz_CFLAGS = $(GOBJECT_CFLAGS)
46 src_zardoz_LDADD = $(GOBJECT_LIBS)
47 src_zardoz_SOURCES = src/zardoz.vala
48 END
49
50 libtoolize
51
52 $ACLOCAL
53 $AUTOCONF
54 $AUTOMAKE -a
55
56 ./configure || skip_ "configure failure"
57 $MAKE
58 $MAKE distcheck
59 $MAKE distclean
60 mkdir build
61 cd build
62 ../configure
63 $MAKE
64 $MAKE distcheck
65
66 cd ..
67 rm -rf build
68
69 # Try again with subdir-objects.
70
71 cat > 'Makefile.am' <<'END'
72 AUTOMAKE_OPTIONS = subdir-objects
73
74 bin_PROGRAMS = src/zardoz
75 src_zardoz_CFLAGS = $(GOBJECT_CFLAGS)
76 src_zardoz_LDADD = $(GOBJECT_LIBS)
77 src_zardoz_SOURCES = src/zardoz.vala
78 END
79
80 libtoolize
81
82 $ACLOCAL
83 $AUTOCONF
84 $AUTOMAKE -a
85
86 ./configure || skip_ "configure failure"
87 $MAKE
88 $MAKE distcheck
89 $MAKE distclean
90 mkdir build
91 cd build
92 ../configure
93 $MAKE
94 $MAKE distcheck
95
96