blob: f2dee100e73559bd73718c0a63c3445c66fe1039 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
|
include $(top_srcdir)/common.mk
BUILT_GIRSOURCES =
CLEANFILES =
EXTRA_DIST =
BASE_GIRSOURCES = \
cairo-1.0.gir \
fontconfig-2.0.gir \
freetype2-2.0.gir \
GL-1.0.gir \
libxml2-2.0.gir \
xft-2.0.gir \
xlib-2.0.gir \
xfixes-4.0.gir
EXTRA_DIST += $(BASE_GIRSOURCES)
# glib
GLIB_INCLUDEDIR=`pkg-config --variable=includedir glib-2.0`/glib-2.0
GLIB_LIBDIR=`pkg-config --variable=libdir glib-2.0`
if OS_WIN32
GLIB_LIBRARY=libglib-2.0-0
else
GLIB_LIBRARY=glib-2.0
endif
GLib-2.0.gir: $(SCANNER_BIN) $(SCANNER_LIBS) Makefile glib-2.0.c
$(SCANNER) \
--namespace GLib --nsversion=2.0 \
--noclosure \
--output $@ \
--strip-prefix=g \
--libtool="$(LIBTOOL)" \
--c-include="glib.h" \
--library=$(GLIB_LIBRARY) \
--pkg glib-2.0 \
$(CPPFLAGS) \
-I$(GLIB_INCLUDEDIR) \
-I$(GLIB_LIBDIR)/glib-2.0/include \
-DGETTEXT_PACKAGE=Dummy \
-D__G_I18N_LIB_H__ \
$(GLIB_LIBDIR)/glib-2.0/include/glibconfig.h \
$(srcdir)/glib-2.0.c \
$(GLIB_INCLUDEDIR)/glib/*.h
$(SCANNER) $(SCANNER_ARGS) \
--xpath-assertions=$(srcdir)/GLib-2.0.xpath GLib-2.0.gir
BUILT_GIRSOURCES += GLib-2.0.gir
EXTRA_DIST += glib-2.0.c GLib-2.0.xpath
# gobject
GOBJECT_INCLUDEDIR=`pkg-config --variable=includedir gobject-2.0`/glib-2.0
GOBJECT_LIBDIR=`pkg-config --variable=libdir gobject-2.0`
if OS_WIN32
GOBJECT_LIBRARY=libgobject-2.0-0
else
GOBJECT_LIBRARY=gobject-2.0
endif
GObject-2.0.gir: GLib-2.0.gir $(SCANNER_BIN) $(SCANNER_LIBS) Makefile
$(SCANNER) \
--namespace GObject --nsversion=2.0 \
--noclosure \
--output $@ \
--strip-prefix=g \
--libtool="$(LIBTOOL)" \
--c-include="glib-object.h" \
--include=GLib-2.0 \
--library=$(GOBJECT_LIBRARY) \
-I$(GOBJECT_INCLUDEDIR) \
-I$(GOBJECT_LIBDIR)/glib-2.0/include \
-DGOBJECT_COMPILATION \
--pkg gobject-2.0 \
$(GLIB_INCLUDEDIR)/gobject/*.h
$(SCANNER) $(SCANNER_ARGS) \
--xpath-assertions=$(srcdir)/GObject-2.0.xpath GObject-2.0.gir
BUILT_GIRSOURCES += GObject-2.0.gir
# gmodule
GMODULE_INCLUDEDIR=`pkg-config --variable=includedir gmodule-2.0`/glib-2.0
GMODULE_LIBDIR=`pkg-config --variable=libdir gmodule-2.0`
if OS_WIN32
GMODULE_LIBRARY=libgmodule-2.0-0
else
GMODULE_LIBRARY=gmodule-2.0
endif
GModule-2.0.gir: GLib-2.0.gir $(SCANNER_BIN) $(SCANNER_LIBS)
$(SCANNER) \
--namespace GModule --nsversion=2.0 \
--add-include-path=. \
--noclosure \
--output $@ \
--strip-prefix=g \
--libtool="$(LIBTOOL)" \
--c-include="gmodule.h" \
--include=GLib-2.0 \
--library=$(GMODULE_LIBRARY) \
-I$(GMODULE_INCLUDEDIR) \
-I$(GMODULE_LIBDIR)/glib-2.0/include \
--pkg gmodule-2.0 \
$(GLIB_INCLUDEDIR)/gmodule.h
BUILT_GIRSOURCES += GModule-2.0.gir
# gio
GIO_INCLUDEDIR=`pkg-config --variable=includedir gio-2.0`/glib-2.0
GIO_LIBDIR=`pkg-config --variable=libdir gio-2.0`
if OS_WIN32
GIO_LIBRARY=libgio-2.0-0
else
GIO_LIBRARY=gio-2.0
endif
if HAVE_GIO_UNIX
GIO_UNIX_HDRS=`pkg-config --variable=includedir gio-unix-2.0`/gio-unix-2.0/gio/*.h
else
GIO_UNIX_HDRS=
endif
Gio-2.0.gir: GObject-2.0.gir $(SCANNER_BIN) $(SCANNER_LIBS) Makefile $(srcdir)/gio-2.0.c
$(SCANNER) \
--namespace Gio --nsversion=2.0 \
--add-include-path=. \
--noclosure \
--output $@ \
--strip-prefix=g \
--libtool="$(LIBTOOL)" \
--c-include="gio/gio.h" \
--include=GObject-2.0 \
--library=$(GIO_LIBRARY) \
-I$(GIO_INCLUDEDIR) \
-I$(GIO_LIBDIR)/glib-2.0/include \
-DGIO_COMPILATION \
--pkg gio-2.0 \
$(srcdir)/gio-2.0.c \
$(GLIB_INCLUDEDIR)/gio/*.h \
$(GIO_UNIX_HDRS)
BUILT_GIRSOURCES += Gio-2.0.gir
EXTRA_DIST += gio-2.0.c
# girepository
GIREPOSITORY_FILES = \
$(top_srcdir)/girepository/girepository.c \
$(top_srcdir)/girepository/girepository.h
GIRepository-2.0.gir: GObject-2.0.gir $(SCANNER_BIN) $(SCANNER_LIBS) $(GIREPOSITORY_FILES)
$(SCANNER) \
--namespace GIRepository --nsversion=2.0 \
--noclosure \
--output $@ \
--strip-prefix=g \
--libtool="$(LIBTOOL)" \
--c-include="girepository.h" \
--include=GObject-2.0 \
--library=girepository-1.0 \
-I$(srcdir)/girepository \
--pkg glib-2.0 \
--pkg gobject-2.0 \
$(GIREPOSITORY_FILES)
BUILT_GIRSOURCES += GIRepository-2.0.gir
# Generic rules
CLEANFILES += $(BUILT_GIRSOURCES)
GIRSOURCES = \
$(BASE_GIRSOURCES) \
$(BUILT_GIRSOURCES)
girdir = $(datadir)/gir-1.0
dist_gir_DATA = $(GIRSOURCES)
%.typelib: %.gir $(top_builddir)/tools/g-ir-compiler$(EXEEXT)
LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}:$(top_builddir)/girepository/.libs $(DEBUG) $(top_builddir)/tools/g-ir-compiler$(EXEEXT) --includedir=. $(G_IR_COMPILER_OPTS) $< -o $@
typelibsdir = $(libdir)/girepository-1.0
typelibs_DATA = $(GIRSOURCES:.gir=.typelib) $(GIRSOURCES:.gir=.typelib)
CLEANFILES += $(typelibs_DATA)
# Check that typelib -> gir -> typelib transformation is lossless.
# Comparing gir files is relatively fragile (whitespace, attribute default
# values, etc.) but the typelibs should identical as long as the gir files are
# semantically equivalent.
%.test.gir: %.typelib $(top_builddir)/tools/g-ir-generate$(EXEEXT)
$(DEBUG) $(top_builddir)/tools/g-ir-generate$(EXEEXT) --includedir=. $< -o $@
testlib-%: %.test.gir $(top_builddir)/tools/g-ir-generate$(EXEEXT)
$(DEBUG) $(top_builddir)/tools/g-ir-compiler$(EXEEXT) --includedir=. $(G_IR_COMPILER_OPTS) $< -o $*.test.typelib
cmp $*.typelib $*.test.typelib && rm $*.test.typelib
testgir-%: %.test.gir
diff -u $*.gir $< && rm $<
CLEANFILES += $(typelibs_DATA:%.typelib=%.test.gir)
CLEANFILES += $(typelibs_DATA:%.typelib=%.test.typelib)
#check-local: $(typelibs_DATA:%.typelib=testlib-%)
check-gir: $(typelibs_DATA:%.typelib=testgir-%)
|