2 # Copyright (C) 1996, 2001, 2002, 2006, 2008, 2009, 2012 Free Software
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)
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 # Basic "grepping" test on vala support.
28 # So that we won't require libtool macros.
29 cat > acinclude.m4 <<'END'
30 AC_DEFUN([AC_PROG_LIBTOOL],
31 [AC_SUBST([LIBTOOL], [:])])
34 cat >> configure.in <<'END'
40 AC_CONFIG_FILES([sub/Makefile])
44 cat > Makefile.am <<'END'
48 zardoz_SOURCES = zardoz.vala
49 zardoz_VALAFLAGS = --debug
51 lib_LTLIBRARIES = libzardoz.la
52 libzardoz_la_SOURCES = zardoz-foo.vala zardoz-bar.vala
57 cat > sub/Makefile.am <<'END'
59 foo_SOURCES = bar.vala baz.vala mu.c zap.cxx
69 grep '\$(VALAC).* \$(AM_VALAFLAGS) \$(VALAFLAGS) ' Makefile.in
70 grep '\$(VALAC).* \$(zardoz_VALAFLAGS) \$(VALAFLAGS) ' Makefile.in
71 $FGREP 'am_zardoz_OBJECTS' Makefile.in
72 $FGREP 'am_libzardoz_la_OBJECTS' Makefile.in
73 $FGREP 'zardoz_vala.stamp:' Makefile.in
74 $FGREP 'libzardoz_la_vala.stamp:' Makefile.in
75 test `$FGREP -c '.stamp:' Makefile.in` -eq 2
76 $FGREP 'zardoz.c' Makefile.in
77 $FGREP 'zardoz-foo.c' Makefile.in
78 $FGREP 'zardoz-bar.c' Makefile.in
80 grep '\$(VALAC).* \$(AM_VALAFLAGS) \$(VALAFLAGS) ' sub/Makefile.in
81 $FGREP 'foo_VALAFLAGS' sub/Makefile.in && Exit 1
82 $FGREP 'am_foo_OBJECTS' sub/Makefile.in
83 $FGREP 'bar.c' sub/Makefile.in
84 $FGREP 'baz.c' sub/Makefile.in
85 $FGREP 'foo_vala.stamp:' sub/Makefile.in
86 test `$FGREP -c '.stamp:' sub/Makefile.in` -eq 1
88 # Check against regression for weird bug due to unescaped '@'
89 # characters used in a "..." perl string when writing the vala
90 # rules from automake.in.
91 grep '\$[0-9][0-9]*t' Makefile.in sub/Makefile.in && Exit 1