vala tests: don't use the 'posix' profile, it's no longer supported
[platform/upstream/automake.git] / t / vala3.sh
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="pkg-config valac gcc GNUmake"
20 . test-init.sh
21
22 mkdir src
23
24 cat >> 'configure.ac' << 'END'
25 AC_PROG_CC
26 AM_PROG_CC_C_O
27 AM_PROG_VALAC([0.7.0])
28 PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.4])
29 AC_OUTPUT
30 END
31
32 cat > 'src/zardoz.vala' <<'END'
33 using GLib;
34
35 public class Zardoz {
36   public static void main () {
37     stdout.printf ("Zardoz!\n");
38   }
39 }
40 END
41
42 cat > 'Makefile.am' <<'END'
43 bin_PROGRAMS = src/zardoz
44 src_zardoz_CFLAGS = $(GOBJECT_CFLAGS)
45 src_zardoz_LDADD = $(GOBJECT_LIBS)
46 src_zardoz_SOURCES = src/zardoz.vala
47 END
48
49 $ACLOCAL
50 $AUTOCONF
51 $AUTOMAKE -a
52
53 grep PKG_CHECK_MODULES configure && skip_ "pkg-config m4 macros not found"
54
55 ./configure
56 $MAKE
57 test -f src/zardoz.c
58 test -f src_zardoz_vala.stamp
59 $MAKE distcheck
60 $MAKE maintainer-clean
61 test ! -e src/zardoz.c
62 test ! -e src_zardoz_vala.stamp
63
64 mkdir build
65 cd build
66 ../configure
67 $MAKE
68 $MAKE distcheck
69
70 cd ..
71 rm -rf build
72
73 # Try again with subdir-objects.
74
75 cat > 'Makefile.am' <<'END'
76 AUTOMAKE_OPTIONS = subdir-objects
77
78 bin_PROGRAMS = src/zardoz
79 src_zardoz_CFLAGS = $(GOBJECT_CFLAGS)
80 src_zardoz_LDADD = $(GOBJECT_LIBS)
81 src_zardoz_SOURCES = src/zardoz.vala
82 END
83
84 $ACLOCAL
85 $AUTOCONF
86 $AUTOMAKE -a
87
88 ./configure || skip_ "configure failure"
89 $MAKE
90 $MAKE distcheck
91 $MAKE distclean
92 mkdir build
93 cd build
94 ../configure
95 $MAKE
96 $MAKE distcheck
97
98