summaryrefslogtreecommitdiff
path: root/telepathy-glib/Makefile.am
blob: 347c97c409180b53da8e7a9f5da62bade72ac792 (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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
tpgincludedir=$(includedir)/telepathy-1.0/telepathy-glib
genincludedir=$(tpgincludedir)/_gen

pkgconfigdir = ${libdir}/pkgconfig
pkgconfig_DATA = telepathy-glib.pc

ABI_LISTS = \
    versions/0.7.0.abi \
    versions/0.7.1.abi \
    versions/0.7.2.abi \
    versions/0.7.3.abi \
    versions/0.7.5.abi \
    versions/0.7.6.abi \
    versions/0.7.7.abi \
    versions/0.7.8.abi \
    versions/0.7.9.abi \
    versions/0.7.10.abi \
    versions/0.7.12.abi \
    versions/0.7.13.abi \
    versions/0.7.14.abi \
    versions/0.7.15.abi \
    versions/0.7.16.abi \
    versions/0.7.17.abi \
    versions/0.7.18.abi

EXTRA_DIST = \
    $(ABI_LISTS) \
    channel.xml \
    connection.xml \
    connection-manager.xml \
    dbus-daemon.xml \
    dbus-introspectable.xml \
    dbus-peer.xml \
    dbus-properties.xml \
    extra-gtkdoc.h \
    generic.xml \
    media-session-handler.xml \
    media-stream-handler.xml \
    stable-interfaces.xml

lib_LTLIBRARIES = libtelepathy-glib.la
noinst_LTLIBRARIES = libtelepathy-glib-internal.la

# libtelepathy-glib is just a shared version of libtelepathy-glib-internal.
# The static version is necessary because one of the tests wants to use
# internal symbols (_tp_debug) which are made invisible by GNU ld.

# The quoting here is unnecessary but harmless, and has the useful side-effect
# that vim quickfix mode (:make) doesn't interpret the libtool --mode=link
# command as an error message in a bizarrely named file
libtelepathy_glib_la_LDFLAGS = \
    -version-info "$(LT_CURRENT)":"$(LT_REVISION)":"$(LT_AGE)"
libtelepathy_glib_la_LIBADD = libtelepathy-glib-internal.la
nodist_libtelepathy_glib_la_SOURCES =
libtelepathy_glib_la_DEPENDENCIES = libtelepathy-glib-internal.la Makefile.am

if HAVE_LD_VERSION_SCRIPT
nodist_libtelepathy_glib_la_SOURCES += _gen/version-script.txt
libtelepathy_glib_la_DEPENDENCIES += _gen/version-script.txt _gen/abi.txt

if OFFICIAL_RELEASE
# don't allow undocumented ABI
MAKE_VERSION_SCRIPT_FLAGS =
else
# allow new ABI, and silently put it in a dummy version (which can be used to
# check whether binaries have been linked against unguaranteed ABI)
MAKE_VERSION_SCRIPT_FLAGS = \
    --unreleased-version=TELEPATHY_GLIB_@VERSION@_UNRELEASED
endif

_gen/version-script.txt: $(ABI_LISTS) _gen/abi.txt Makefile.am \
	$(top_srcdir)/tools/make-version-script.py
	$(PYTHON) $(top_srcdir)/tools/make-version-script.py \
		 --symbols=_gen/abi.txt $(MAKE_VERSION_SCRIPT_FLAGS) \
		 $(ABI_LISTS:%=$(srcdir)/%) > $@
	$(PYTHON) $(top_srcdir)/tools/make-version-script.py \
		 --symbols=_gen/abi.txt $(MAKE_VERSION_SCRIPT_FLAGS) \
		 --dpkg "libtelepathy-glib.so.0 libtelepathy-glib0 #MINVER#" \
		 --dpkg-build-depends-package "libtelepathy-glib-dev" \
		 $(ABI_LISTS:%=$(srcdir)/%) > _gen/libtelepathy-glib0.symbols
	sed -n -e "s/^[	 ]*\\(tp_.*\\);/\\1/p" < $@ > _gen/versioned-abi.tmp
	sort -u < _gen/versioned-abi.tmp > _gen/versioned-abi.txt
	: # the versioned API should always match the ^tp API
	diff -c _gen/versioned-abi.txt _gen/abi.txt

_gen/abi.txt: libtelepathy-glib-internal.la Makefile.am
	$(NM) .libs/libtelepathy-glib-internal.a > _gen/abi.nm
	grep " [DT] " < _gen/abi.nm > _gen/abi.funcs
	cut -d" " -f3 < _gen/abi.funcs > _gen/abi.funcnames
	grep "^tp" < _gen/abi.funcnames > _gen/abi.tpfuncnames
	sort -u < _gen/abi.tpfuncnames > $@

libtelepathy_glib_la_LDFLAGS += \
    $(VERSION_SCRIPT_ARG)=_gen/version-script.txt

else # !HAVE_LD_VERSION_SCRIPT

libtelepathy_glib_la_LDFLAGS += -export-symbols-regex '^tp'

endif # !HAVE_LD_VERSION_SCRIPT

tpginclude_HEADERS = \
    base-connection.h \
    base-connection-manager.h \
    channel.h \
    channel-iface.h \
    channel-factory-iface.h \
    channel-manager.h \
    media-interfaces.h \
    connection.h \
    connection-manager.h \
    contact.h \
    contacts-mixin.h \
    dbus.h \
    dbus-properties-mixin.h \
    defs.h \
    debug.h \
    debug-ansi.h \
    enums.h \
    errors.h \
    exportable-channel.h \
    group-mixin.h \
    gtypes.h \
    handle.h \
    handle-repo.h \
    handle-repo-static.h \
    handle-repo-dynamic.h \
    heap.h \
    interfaces.h \
    intset.h \
    media-interfaces.h \
    presence-mixin.h \
    properties-mixin.h \
    proxy.h \
    proxy-subclass.h \
    run.h \
    svc-channel.h \
    svc-connection.h \
    svc-connection-manager.h \
    svc-generic.h \
    svc-media-interfaces.h \
    svc-properties-interface.h \
    text-mixin.h \
    util.h

nodist_libtelepathy_glib_internal_la_SOURCES = \
    _gen/signals-marshal.c \
    _gen/signals-marshal.h \
    _gen/signals-marshal.list \
    _gen/telepathy-errors.c \
    _gen/tp-signals-marshal.list \
    _gen/interfaces-body.h \
    _gen/gtypes-body.h \
    _gen/register-dbus-glib-marshallers-body.h \
    _gen/tp-cli-channel-body.h \
    _gen/tp-cli-connection-body.h \
    _gen/tp-cli-connection-manager-body.h \
    _gen/tp-cli-dbus-daemon-body.h \
    _gen/tp-cli-generic-body.h \
    _gen/tp-cli-media-session-handler-body.h \
    _gen/tp-cli-media-stream-handler-body.h \
    _gen/tp-svc-channel.c \
    _gen/tp-svc-connection.c \
    _gen/tp-svc-connection-manager.c \
    _gen/tp-svc-generic.c \
    _gen/tp-svc-media-session-handler.c \
    _gen/tp-svc-media-stream-handler.c

nodist_geninclude_HEADERS = \
    _gen/telepathy-enums.h \
    _gen/telepathy-interfaces.h \
    _gen/telepathy-errors.h \
    _gen/gtypes.h \
    _gen/tp-cli-channel.h \
    _gen/tp-cli-connection.h \
    _gen/tp-cli-connection-manager.h \
    _gen/tp-cli-dbus-daemon.h \
    _gen/tp-cli-generic.h \
    _gen/tp-cli-media-session-handler.h \
    _gen/tp-cli-media-stream-handler.h \
    _gen/tp-svc-channel.h \
    _gen/tp-svc-connection.h \
    _gen/tp-svc-connection-manager.h \
    _gen/tp-svc-generic.h \
    _gen/tp-svc-media-session-handler.h \
    _gen/tp-svc-media-stream-handler.h

BUILT_SOURCES = \
    $(nodist_libtelepathy_glib_internal_la_SOURCES) \
    $(nodist_geninclude_HEADERS) \
    _gen/stable-spec.xml \
    _gen/spec-stamp \
    _gen/stable-stamp

CLEANFILES = \
    $(BUILT_SOURCES)

distclean-local:
	rm -rf _gen

check_c_sources = \
    $(tpginclude_HEADERS) \
    $(libtelepathy_glib_internal_la_SOURCES)

include $(top_srcdir)/tools/check-coding-style.mk
check-local: check-coding-style

libtelepathy_glib_internal_la_LIBADD = $(ALL_LIBS)
libtelepathy_glib_internal_la_SOURCES = \
    base-connection.c \
    base-connection-manager.c \
    channel.c \
    channel-group.c \
    channel-internal.h \
    channel-manager.c \
    connection.c \
    connection-internal.h \
    connection-handles.c \
    connection-manager.c \
    contact.c \
    contacts-mixin.c \
    dbus.c \
    dbus-internal.h \
    dbus-properties-mixin.c \
    debug.c \
    interfaces.c \
    debug-internal.h \
    errors.c \
    exportable-channel.c \
    group-mixin.c \
    gtypes.c \
    handle.c \
    handle-repo.c \
    handle-repo-dynamic.c \
    handle-repo-internal.h \
    handle-repo-static.c \
    handle-set.c \
    heap.c \
    intset.c \
    channel-iface.c \
    channel-factory-iface.c \
    media-interfaces.c \
    presence-mixin.c \
    properties-mixin.c \
    proxy.c \
    proxy-internal.h \
    proxy-methods.c \
    proxy-signals.c \
    run.c \
    signals-marshal.list \
    text-mixin.c \
    util.c

AM_CFLAGS = \
    -DG_LOG_DOMAIN=\"tp-glib\" \
    $(ERROR_CFLAGS) \
    @DBUS_CFLAGS@ \
    @GLIB_CFLAGS@ \
    @HANDLE_LEAK_DEBUG_CFLAGS@ \
    -I$(top_builddir) \
    -I$(top_srcdir)

ALL_LIBS = \
    @DBUS_LIBS@ \
    @GLIB_LIBS@

# Generated stuff

DROP_NAMESPACE = sed -e 's@xmlns:tp="http://telepathy\.freedesktop\.org/wiki/DbusSpec.extensions-v0"@@g'
XSLTPROCFLAGS = --nonet --novalid
tools_dir = $(top_srcdir)/tools

# Bootstrapping

_gen/spec-stamp: $(wildcard $(top_srcdir)/spec/*.xml)
	$(mkdir_p) _gen
	touch $@

_gen/stable-stamp: $(wildcard *.xml) _gen/spec-stamp
	touch $@

_gen/stable-spec.xml: stable-interfaces.xml _gen/stable-stamp
	$(XSLTPROC) --xinclude $(XSLTPROCFLAGS) \
		$(tools_dir)/identity.xsl \
		$< > $@

# Things generated from the whole spec at once

_gen/gtypes.h _gen/gtypes-body.h: _gen/stable-spec.xml \
	$(tools_dir)/glib-gtypes-generator.py
	$(PYTHON) $(tools_dir)/glib-gtypes-generator.py \
		_gen/stable-spec.xml \
		_gen/gtypes Tp

_gen/telepathy-enums.h: _gen/stable-spec.xml \
	$(tools_dir)/c-constants-gen.py
	$(PYTHON) $(tools_dir)/c-constants-gen.py \
		Tp \
		$< > $@

_gen/interfaces-body.h _gen/telepathy-interfaces.h: _gen/stable-spec.xml \
	$(tools_dir)/glib-interfaces-gen.py
	$(PYTHON) $(tools_dir)/glib-interfaces-gen.py \
		Tp _gen/interfaces-body.h _gen/telepathy-interfaces.h $<

_gen/telepathy-errors.c: _gen/stable-spec.xml \
	$(tools_dir)/glib-errors-enum-body-gen.py
	$(PYTHON) $(tools_dir)/glib-errors-enum-body-gen.py \
		$< > $@

_gen/telepathy-errors.h: _gen/stable-spec.xml \
	$(tools_dir)/glib-errors-enum-header-gen.py
	$(PYTHON) $(tools_dir)/glib-errors-enum-header-gen.py \
		$< > $@

_gen/register-dbus-glib-marshallers-body.h: _gen/stable-spec.xml \
	$(tools_dir)/glib-client-marshaller-gen.py
	$(PYTHON) $(tools_dir)/glib-client-marshaller-gen.py $< _tp > $@

_gen/tp-signals-marshal.list: $(tools_dir)/glib-signals-marshal-gen.py \
	_gen/stable-spec.xml
	$(PYTHON) $(tools_dir)/glib-signals-marshal-gen.py \
		_gen/stable-spec.xml > $@

_gen/signals-marshal.list: signals-marshal.list _gen/tp-signals-marshal.list
	sort -u $^ > $@

_gen/signals-marshal.h: _gen/signals-marshal.list Makefile.am
	$(GLIB_GENMARSHAL) --header --prefix=_tp_marshal $< > $@

_gen/signals-marshal.c: _gen/signals-marshal.list Makefile.am
	{ echo '#include "_gen/signals-marshal.h"' && \
	$(GLIB_GENMARSHAL) --body --prefix=_tp_marshal $< ; } > $@

# Things generated per interface

_gen/tp-spec-%.xml: %.xml $(tools_dir)/identity.xsl _gen/spec-stamp
	$(XSLTPROC) --xinclude $(XSLTPROCFLAGS) \
		$(tools_dir)/identity.xsl \
		$< > $@

_gen/tp-svc-%.c _gen/tp-svc-%.h: _gen/tp-spec-%.xml \
	$(tools_dir)/glib-ginterface-gen.py \
	Makefile.am
	$(PYTHON) $(tools_dir)/glib-ginterface-gen.py \
		--filename=_gen/tp-svc-$* \
		--signal-marshal-prefix=_tp \
		--include='<telepathy-glib/dbus.h>' \
		--include="\"_gen/signals-marshal.h\"" \
		--not-implemented-func='tp_dbus_g_method_return_not_implemented' \
		$< Tp_Svc_

_gen/tp-cli-%-body.h _gen/tp-cli-%.h: _gen/tp-spec-%.xml \
	$(tools_dir)/glib-client-gen.py \
	Makefile.am
	set -e; \
	subclass= ; \
	subclass_assert= ; \
	case $* in \
		channel) \
			subclass=--subclass=TpChannel; \
			subclass_assert=--subclass-assert=TP_IS_CHANNEL; \
			;; \
		connection-manager) \
			subclass=--subclass=TpConnectionManager; \
			subclass_assert=--subclass-assert=TP_IS_CONNECTION_MANAGER \
			;; \
		connection) \
			subclass=--subclass=TpConnection; \
			subclass_assert=--subclass-assert=TP_IS_CONNECTION; \
			;; \
		media-session-handler) \
			subclass=--subclass=TpMediaSessionHandler; \
			subclass_assert=--subclass-assert=TP_IS_MEDIA_SESSION_HANDLER; \
			;; \
		media-stream-handler) \
			subclass=--subclass=TpMediaStreamHandler; \
			subclass_assert=--subclass-assert=TP_IS_MEDIA_STREAM_HANDLER; \
			;; \
		dbus-daemon) \
			subclass=--subclass=TpDBusDaemon; \
			subclass_assert=--subclass-assert=TP_IS_DBUS_DAEMON; \
			;; \
	esac; \
	$(PYTHON) $(tools_dir)/glib-client-gen.py \
		$$subclass $$subclass_assert \
		--group `echo $* | tr - _` \
		--iface-quark-prefix=TP_IFACE_QUARK \
		--tp-proxy-api=0.7.6 \
		$< Tp_Cli _gen/tp-cli-$*