tests: Let 'ltorder.sh' run successfully with Guix dynamic loader
[automake.git] / t / vala-headers.sh
blob3e61bbfac664bbb6997d2a7ddb28032c31e97620
1 #! /bin/sh
2 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
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.
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.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
17 # Test to make sure compiling Vala code really works with recursive make.
19 required="pkg-config valac gcc GNUmake"
20 . test-init.sh
22 cat >> configure.ac << 'END'
23 AC_PROG_CC
24 AM_PROG_VALAC([0.7.0])
25 PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.4])
26 AC_OUTPUT
27 END
29 cat > Makefile.am << 'END'
30 bin_PROGRAMS = zardoz quux
32 zardoz_SOURCES = zardoz.vala
33 quux_SOURCES = quux.vala
34 quux.vala: zardoz.vala
35 sed 's/Zardoz/Quux/' <zardoz.vala >quux.vala
37 quux_VALAFLAGS = \
38 --header HDR.h \
39 --vapi hello.vapi
41 zardoz_VALAFLAGS = \
42 -H foo.h \
43 --internal-header foo2.h \
44 --internal-vapi foo3.vapi
46 AM_CFLAGS = $(GOBJECT_CFLAGS)
47 LDADD = $(GOBJECT_LIBS)
48 END
50 headers='HDR.h hello.vapi foo.h foo2.h foo3.vapi'
52 cat > zardoz.vala << 'END'
53 using GLib;
54 public class Zardoz {
55 public static void main () {
56 stdout.printf ("Zardoz!\n");
59 END
61 $ACLOCAL
62 $AUTOCONF
63 $AUTOMAKE -a
65 ./configure
66 $MAKE
68 # Test rebuild rules.
70 for h in $headers; do
71 rm -f $h
72 $MAKE $h
73 test -f $h
74 done
76 rm -f $headers
77 $MAKE $headers
78 for h in $headers; do test -f $h; done
80 $MAKE distcheck
82 $MAKE maintainer-clean
83 for h in $headers; do test ! -e $h; done