Revert Automake license to GPLv2+.
[platform/upstream/automake.git] / tests / vala3.test
1 #! /bin/sh
2 # Copyright (C) 1996, 2001, 2002, 2006, 2008, 2009
3 # Free Software Foundation, Inc.
4 #
5 # This file is part of GNU Automake.
6 #
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.
11 #
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.
16 #
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.
21
22 # Test to make sure compiling Vala code really works with non-recursive make.
23
24 required="libtool libtoolize pkg-config valac gcc GNUmake"
25 . ./defs || Exit 1
26
27 set -e
28
29 mkdir src
30
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_OUTPUT
38 END
39
40 cat > 'src/zardoz.vala' <<'END'
41 using GLib;
42
43 public class Zardoz {
44   public static void main () {
45     stdout.printf ("Zardoz!\n");
46   }
47 }
48 END
49
50 cat > 'Makefile.am' <<'END'
51 bin_PROGRAMS = src/zardoz
52 src_zardoz_CFLAGS = $(GOBJECT_CFLAGS)
53 src_zardoz_LDADD = $(GOBJECT_LIBS)
54 src_zardoz_SOURCES = src/zardoz.vala
55 END
56
57 libtoolize
58
59 $ACLOCAL
60 $AUTOCONF
61 $AUTOMAKE -a
62
63 ./configure || Exit 77
64 $MAKE
65 $MAKE distcheck
66 $MAKE distclean
67 mkdir build
68 cd build
69 ../configure
70 $MAKE
71 $MAKE distcheck
72
73 cd ..
74 rm -rf build
75
76 # Try again with subdir-objects.
77
78 cat > 'Makefile.am' <<'END'
79 AUTOMAKE_OPTIONS = subdir-objects
80
81 bin_PROGRAMS = src/zardoz
82 src_zardoz_CFLAGS = $(GOBJECT_CFLAGS)
83 src_zardoz_LDADD = $(GOBJECT_LIBS)
84 src_zardoz_SOURCES = src/zardoz.vala
85 END
86
87 libtoolize
88
89 $ACLOCAL
90 $AUTOCONF
91 $AUTOMAKE -a
92
93 ./configure || Exit 77
94 $MAKE
95 $MAKE distcheck
96 $MAKE distclean
97 mkdir build
98 cd build
99 ../configure
100 $MAKE
101 $MAKE distcheck
102
103