blob: 40599acfd937910fd7f392caa70d4986a9cfa2cb (
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
|
include $(top_srcdir)/common.mk
BUILT_SOURCES =
EXTRA_DIST =
# 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 \
--library=$(GLIB_LIBRARY) \
$(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_SOURCES += 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 \
--include=GLib-2.0 \
--library=$(GOBJECT_LIBRARY) \
-I$(GOBJECT_INCLUDEDIR) \
-I$(GOBJECT_LIBDIR)/glib-2.0/include \
-DGOBJECT_COMPILATION \
--pkg glib-2.0 \
$(GLIB_INCLUDEDIR)/gobject/*.h
BUILT_SOURCES += 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 \
--include=GLib-2.0 \
--library=$(GMODULE_LIBRARY) \
-I$(GMODULE_INCLUDEDIR) \
-I$(GMODULE_LIBDIR)/glib-2.0/include \
--pkg glib-2.0 \
$(GLIB_INCLUDEDIR)/gmodule.h
BUILT_SOURCES += 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
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 \
--include=GObject-2.0 \
--library=$(GIO_LIBRARY) \
-I$(GIO_INCLUDEDIR) \
-I$(GIO_LIBDIR)/glib-2.0/include \
-DGIO_COMPILATION \
--pkg glib-2.0 \
--pkg gobject-2.0 \
$(srcdir)/gio-2.0.c \
$(GLIB_INCLUDEDIR)/gio/*.h
BUILT_SOURCES += 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 \
--include=GObject-2.0 \
--library=girepository \
-I$(srcdir)/girepository \
--pkg glib-2.0 \
--pkg gobject-2.0 \
$(GIREPOSITORY_FILES)
BUILT_SOURCES += GIRepository-2.0.gir
# Generic rules
CLEANFILES = $(BUILT_SOURCES)
girdir=$(datadir)/gir
dist_gir_DATA = $(BUILT_SOURCES)
%.typelib: %.gir $(top_builddir)/tools/g-ir-compiler$(EXEEXT)
$(DEBUG) $(top_builddir)/tools/g-ir-compiler$(EXEEXT) --includedir=. $(G_IR_COMPILER_OPTS) $< -o $@
typelibsdir = $(libdir)/girepository
typelibs_DATA = \
GLib-2.0.typelib \
GModule-2.0.typelib \
GObject-2.0.typelib \
Gio-2.0.typelib \
GIRepository-2.0.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-%)
|