"Fossies" - the Fresh Open Source Software Archive 
Member "automake-1.16.3/t/vala-libs-distcheck.sh" (19 Nov 2020, 3745 Bytes) of package /linux/misc/automake-1.16.3.tar.xz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 #! /bin/sh
2 # Copyright (C) 2012-2020 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 # Building libraries (libtool and static) from Vala sources.
18 # And use of vapi files to call C code from Vala.
19
20 required="valac cc pkg-config libtoolize GNUmake"
21 am_create_testdir=empty
22 . test-init.sh
23
24 cat >> configure.ac << 'END'
25 AC_INIT([atest],[0.1])
26 AC_CONFIG_SRCDIR([data/atest.pc.in])
27 AC_SUBST([API_VERSION],[0])
28
29 AM_INIT_AUTOMAKE
30 AM_MAINTAINER_MODE([enable])
31 AM_PROG_AR
32 LT_INIT
33
34 AC_PROG_CC
35 AC_PROG_INSTALL
36 PKG_PROG_PKG_CONFIG([0.22])
37 AM_PROG_VALAC([0.32])
38
39 PKG_CHECK_MODULES(ATEST, [gio-2.0])
40
41 AC_CONFIG_FILES([
42 Makefile
43
44 src/Makefile
45
46 src/atest-$API_VERSION.deps:src/atest.deps.in
47
48 data/Makefile
49 data/atest-$API_VERSION.pc:data/atest.pc.in
50
51 ],[],
52 [API_VERSION='$API_VERSION'])
53 AC_OUTPUT
54 END
55
56
57 cat > Makefile.am << 'END'
58 SUBDIRS=data src
59 END
60
61 mkdir data
62
63 cat > data/atest.pc.in << 'END'
64 prefix=@prefix@
65 exec_prefix=@exec_prefix@
66 libdir=@libdir@
67 datarootdir=@datarootdir@
68 datadir=@datadir@
69 includedir=@includedir@
70
71 Name: atest-@API_VERSION@
72 Description: atest library
73 Version: @VERSION@
74 Requires: glib-2.0 gobject-2.0
75 Libs: -L${libdir} -latest-@API_VERSION@
76 Cflags: -I${includedir}/atest-@API_VERSION@
77 END
78
79
80 cat > data/Makefile.am << 'END'
81 # pkg-config data
82 # Note that the template file is called atest.pc.in, but generates a
83 # versioned .pc file using some magic in AC_CONFIG_FILES.
84 pkgconfigdir = $(libdir)/pkgconfig
85 pkgconfig_DATA = atest-$(API_VERSION).pc
86
87 DISTCLEANFILES = $(pkgconfig_DATA)
88 EXTRA_DIST = atest.pc.in
89 END
90
91 mkdir src
92
93 cat > src/atest.deps.in << 'END'
94 glib-2.0
95 END
96
97
98 cat > src/atest.vala << 'END'
99 using GLib;
100
101 namespace Atest {
102 public class A {
103 public bool foo() { return false; }
104 }
105 }
106 END
107
108 cat > src/Makefile.am << 'END'
109 lib_LTLIBRARIES = libatest-@API_VERSION@.la
110
111 libatest_@API_VERSION@_la_SOURCES = \
112 atest.vala \
113 cservice.c \
114 cservice.h \
115 $(NULL)
116
117
118 libatest_@API_VERSION@_la_CPPFLAGS = \
119 -DOKOKIMDEFINED=1 \
120 $(NULL)
121
122 libatest_@API_VERSION@_la_CFLAGS = \
123 $(ATEST_CFLAGS) \
124 $(WARN_CFLAGS) \
125 $(NULL)
126
127 libatest_@API_VERSION@_la_LIBADD = \
128 $(ATEST_LIBS) \
129 $(NULL)
130
131 libatest_@API_VERSION@_la_LDFLAGS = \
132 $(WARN_LDFLAGS) \
133 $(NULL)
134
135 libatest_@API_VERSION@_la_VALAFLAGS = \
136 --vapidir=$(VAPIDIR) \
137 --vapidir=$(srcdir) \
138 --pkg cservice \
139 --thread \
140 --target-glib=2.44 \
141 --pkg glib-2.0 \
142 -H atest.h \
143 --library atest-@API_VERSION@ \
144 $(NULL)
145
146 header_DATA=atest.h
147 headerdir=$(includedir)/atest-@API_VERSION@/atest
148
149 atest-@API_VERSION@.deps:
150 cp atest.deps atest-@API_VERSION@.deps
151
152 vapi_DATA=atest-@API_VERSION@.vapi atest-@API_VERSION@.deps
153 vapidir=$(VAPIDIR)
154
155 CLEANFILES = atest-@API_VERSION@.deps
156 END
157
158
159 cat > src/cservice.c << 'END'
160 #include "cservice.h"
161 int c_service_mu_call (void)
162 {
163 return OKOKIMDEFINED;
164 }
165 END
166
167 cat > src/cservice.h << 'END'
168 int c_service_mu (void);
169 END
170
171 cat > src/cservice.vapi <<'END'
172 namespace CService {
173 public class Mu {
174 [CCode (cheader_filename = "cservice.h", cname = "c_service_mu_call")]
175 public int call ();
176 }
177 }
178 END
179
180 libtoolize
181 $ACLOCAL
182 $AUTOCONF
183 $AUTOMAKE -a
184
185 ./configure
186
187 $MAKE
188 test -f src/libatest_0_la_vala.stamp
189 test -f src/libatest-0.la
190
191 $MAKE distcheck
192
193 :