summaryrefslogtreecommitdiff
path: root/src/Makefile.am
blob: 61de2bde6d171871c6fd0357c2370f721a2cc12f (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
INCLUDES = \
	   $(TELEPATHY_CFLAGS) \
	   $(DBUS_CFLAGS) \
	   $(GLIB_CFLAGS) \
	   $(NETWORK_MANAGER_CFLAGS) \
	   $(CONNMAN_CFLAGS) \
	   -DG_LOG_DOMAIN=\"mcd\" \
	   -DMCD_PLUGIN_LOADER_DIR=\"@libdir@/mission-control-plugins.@MCP_ABI_VERSION@\" \
	   -DMC_DISABLE_DEPRECATED -I$(top_srcdir)

AM_CFLAGS = $(ERROR_CFLAGS)

if ENABLE_GNOME_KEYRING
INCLUDES += $(GNOME_KEYRING_CFLAGS)
endif

mc_headers = \
	mcd-account.h \
	mcd-account-conditions.h \
	mcd-account-manager.h \
	mcd-account-manager-default.h \
	mcd-debug.h \
	mcd-mission.h \
	mcd-operation.h \
	mcd-master.h \
	mcd-controller.h \
	mcd-manager.h \
	mcd-connection.h \
	mcd-connection-plugin.h \
	mcd-connection-service-points.h \
	mcd-plugin.h \
	mcd-channel.h \
	mcd-proxy.h \
	mcd-dispatcher.h \
	mcd-dispatcher-context.h \
	mcd-service.h \
	mcd-transport.h \
	mcd-provisioning.h \
	mcd-provisioning-factory.h \
	mcd-storage.h

if ENABLE_LIBACCOUNTS_SSO
mc_headers += \
	mcd-account-manager-sso.h \
	$(NULL)

if ENABLE_LIBACCOUNTS_GLIB_HIDDEN
mc_headers += \
	mcd-storage-ag-hidden.h \
	$(NULL)
endif

endif

mc_gen_headers = \
	_gen/cli-Connection_Manager_Interface_Account_Storage.h \
	_gen/enums.h \
	_gen/gtypes.h \
	_gen/interfaces.h \
	_gen/svc-Account_Interface_Addressing.h \
	_gen/svc-Account_Interface_Compat.h \
	_gen/svc-Account_Interface_Conditions.h \
	_gen/svc-Account_Interface_External_Password_Storage.h \
	_gen/svc-Account_Interface_Hidden.h \
	_gen/svc-Account_Manager_Interface_Hidden.h \
	_gen/svc-Account_Manager_Interface_Query.h \
	_gen/svc-dispatcher.h

nodist_libmcd_convenience_la_SOURCES = \
	_gen/cli-Connection_Manager_Interface_Account_Storage-body.h \
	_gen/gtypes-body.h \
	_gen/interfaces-body.h \
	_gen/register-dbus-glib-marshallers-body.h \
	_gen/signals-marshal.c \
	_gen/signals-marshal.h \
	_gen/signals-marshal.list \
	_gen/svc-Account_Interface_Addressing.c \
	_gen/svc-Account_Interface_Compat.c \
	_gen/svc-Account_Interface_Conditions.c \
	_gen/svc-Account_Interface_External_Password_Storage.c \
	_gen/svc-Account_Interface_Hidden.c \
	_gen/svc-Account_Manager_Interface_Query.c \
	_gen/svc-Account_Manager_Interface_Hidden.c \
	_gen/svc-dispatcher.c \
	mcd-enum-types.c \
	mcd-enum-types.h \
	mcd-signals-marshal.c \
	mcd-signals-marshal.h \
	$(mc_gen_headers)

BUILT_SOURCES = \
	_gen/mcd.xml \
	stamp-mcd-enum-types.h \
	$(nodist_libmcd_convenience_la_SOURCES)

CLEANFILES = $(BUILT_SOURCES)

libmcd_convenience_la_LIBADD = \
	$(top_builddir)/mission-control-plugins/libmission-control-plugins.la \
	$(TELEPATHY_LIBS) \
	$(DBUS_LIBS) \
	$(GLIB_LIBS) \
	$(NETWORK_MANAGER_LIBS) \
	$(CONNMAN_LIBS)

if ENABLE_GNOME_KEYRING
libmcd_convenience_la_LIBADD += $(GNOME_KEYRING_LIBS)
endif

if ENABLE_LIBACCOUNTS_SSO
libmcd_convenience_la_LIBADD += $(LIBACCOUNTS_SSO_LIBS)
INCLUDES += $(LIBACCOUNTS_SSO_CFLAGS)
endif

if ENABLE_AEGIS
libmcd_convenience_la_LIBADD += $(top_builddir)/plugins/libmcp-aegis.la
endif

noinst_LTLIBRARIES = libmcd-convenience.la

if ENABLE_MCD_PLUGINS
# When this older plugin API is enabled, libmissioncontrol-server.la is a
# shared library that wraps the convenience library
lib_LTLIBRARIES = libmissioncontrol-server.la
libmissioncontrol_server_la_SOURCES =
libmissioncontrol_server_la_LIBADD = libmcd-convenience.la

libmissioncontrol_server_la_LDFLAGS = \
	-export-symbols-regex '^((mc_)|(mcd_)|(mission_control_))'

if ENABLE_MC_SERVER_SO6
# the redundant quoting here is to prevent the libtool command line from
# looking like an error message in an oddly named file
libmissioncontrol_server_la_LDFLAGS += -version-info "10":"0":"4"
else
libmissioncontrol_server_la_LDFLAGS += -release $(VERSION)
endif

mission_control_includedir = $(includedir)/mission-control
mission_control_include_HEADERS = $(mc_headers)

genincludedir = $(mission_control_includedir)/_gen
nodist_geninclude_HEADERS = $(mc_gen_headers)

INCLUDES += \
	-DMCD_DEFAULT_FILTER_PLUGIN_DIR=\"@pluginlibdir@\"
else # ! ENABLE_MCD_PLUGINS
# When this older plugin API is not enabled, libmissioncontrol-server.la is
# just a copy of the convenience library
noinst_LTLIBRARIES += libmissioncontrol-server.la
libmissioncontrol_server_la_SOURCES =
libmissioncontrol_server_la_LIBADD = libmcd-convenience.la
endif # ! ENABLE_MCD_PLUGINS

libmcd_convenience_la_SOURCES = \
	mcd-account.c \
	mcd-account-addressing.h \
	mcd-account-compat.c \
	mcd-account-conditions.c \
	mcd-account-config.h \
	mcd-account-connection.c \
	mcd-account-requests.c \
	mcd-account-addressing.c \
	mcd-account-manager.c \
	mcd-account-manager-priv.h \
	mcd-account-manager-query.c \
	mcd-account-manager-default.c \
	mcd-account-priv.h \
	mcd-client.c \
	mcd-client-priv.h \
	channel-utils.c \
	channel-utils.h \
	client-registry.c \
	client-registry.h \
	connectivity-monitor.c \
	connectivity-monitor.h \
	gtypes.c \
	kludge-transport.c \
	kludge-transport.h \
	mcd-dbusprop.c \
	mcd-dbusprop.h \
	mcd-debug.c \
	mcd-dispatch-operation.c \
	mcd-dispatch-operation-priv.h \
	mcd-handler-map.c \
	mcd-handler-map-priv.h \
	mcd-misc.c \
	mcd-misc.h \
	mcd-mission.c \
	mcd-mission-priv.h \
	mcd-operation.c \
	mcd-controller.c \
	mcd-master.c \
	mcd-master-priv.h \
	mcd-manager.c \
	mcd-manager-priv.h \
	mcd-connection.c \
	mcd-connection-service-points.c \
	mcd-connection-priv.h \
	mcd-dispatcher.c \
	mcd-dispatcher-priv.h \
	mcd-channel.c \
	mcd-channel-priv.h \
	mcd-service.c \
	mcd-slacker.c \
	mcd-slacker.h \
	mcd-proxy.c \
	mcd-transport.c \
	mcd-provisioning.c \
	mcd-provisioning-factory.c \
	mcd-storage.c \
	mcd-storage.h \
	mcd-storage-priv.h \
	plugin-dispatch-operation.c \
	plugin-dispatch-operation.h \
	plugin-loader.c \
	plugin-loader.h \
	plugin-request.c \
	plugin-request.h \
	plugin-account.c \
	plugin-account.h \
	request.c \
	request.h \
	sp_timestamp.h \
	$(mc_headers)

if ENABLE_LIBACCOUNTS_SSO
libmcd_convenience_la_SOURCES += \
	mcd-account-manager-sso.c \
	$(NULL)

if ENABLE_LIBACCOUNTS_GLIB_HIDDEN
libmcd_convenience_la_SOURCES += \
	mcd-storage-ag-hidden.c \
	$(NULL)
endif

endif

%-signals-marshal.h: %-signals-marshal.list Makefile
	$(AM_V_GEN)glib-genmarshal --header --prefix=_$(subst -,_,$*)_marshal $< > $*-signals-marshal.h

%-signals-marshal.c: %-signals-marshal.list Makefile
	$(AM_V_GEN){ echo '#include "$*-signals-marshal.h"' && \
	glib-genmarshal --body --prefix=_$(subst -,_,$*)_marshal $<; } \
	> $*-signals-marshal.c

mcd-enum-types.h: stamp-mcd-enum-types.h
	$(AM_V_GEN)true
stamp-mcd-enum-types.h: Makefile $(mc_headers) mcd-enum-types.c
	$(AM_V_GEN)( cd $(srcdir) && glib-mkenums \
		--fhead "#ifndef __MCD_ENUM_TYPES_H__\n#define __MCD_ENUM_TYPES_H__\n\n#include \"mcd-mission.h\"\n#include \"mcd-channel.h\"\n#include \"mcd-provisioning.h\"\n#include \"mcd-transport.h\"\n\nG_BEGIN_DECLS\n" \
		--fprod "/* enumerations from \"@filename@\" */\n" \
		--vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define MCD_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
		--ftail "G_END_DECLS\n\n#endif /* __MCD_ENUM_TYPES_H__ */" \
	    $(mc_headers) ) >> xgen-geth \
	&& (cmp -s xgen-geth mcd-enum-types.h || cp xgen-geth mcd-enum-types.h ) \
	&& rm -f xgen-geth \
	&& echo timestamp > $(@F)

mcd-enum-types.c: Makefile $(mc_headers)
	$(AM_V_GEN)( cd $(srcdir) && glib-mkenums \
		--fhead "#include \"mcd-enum-types.h\"\n#define g_intern_static_string(s) (s)\n" \
		--fprod "\n/* enumerations from \"@filename@\" */" \
		--ftail "\n#define __MCD_ENUM_TYPES_C__\n" \
		--vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G@Type@Value values[] = {" \
		--vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
		--vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n  }\n  return etype;\n}\n" \
	    $(mc_headers) ) > xgen-getc \
	&& cp xgen-getc mcd-enum-types.c  \
	&& rm -f xgen-getc

EXTRA_DIST = \
	mcd.xml \
	dispatcher.xml \
	mcd-signals-marshal.list \
	stamp-mcd-enum-types.h

# ---- telepathy-glib-style code generation ----

tools_dir = $(top_srcdir)/tools

_gen/mcd.xml: mcd.xml $(wildcard $(top_srcdir)/xml/*.xml)
	$(AM_V_at)$(mkdir_p) _gen
	$(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \
		$< > $@

_gen/%.xml: $(top_srcdir)/xml/%.xml $(wildcard $(top_srcdir)/xml/*.xml)
	$(AM_V_at)$(mkdir_p) _gen
	$(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \
		$< > $@

# Generated files which can be done for all "classes" at once

_gen/signals-marshal.list: _gen/mcd.xml \
	$(tools_dir)/glib-signals-marshal-gen.py
	$(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-signals-marshal-gen.py $< > $@

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

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

_gen/register-dbus-glib-marshallers-body.h: _gen/mcd.xml \
	$(tools_dir)/glib-client-marshaller-gen.py Makefile.am
	$(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-client-marshaller-gen.py $< \
		_mcd_ext > $@

_gen/enums.h: _gen/mcd.xml $(tools_dir)/c-constants-generator.xsl
	$(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) \
		--stringparam mixed-case-prefix mc \
		$(tools_dir)/c-constants-generator.xsl \
		$< > $@

_gen/interfaces.h: _gen/mcd.xml \
	$(tools_dir)/glib-interfaces-generator.xsl \
	$(tools_dir)/c-interfaces-generator.xsl
	$(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) \
		--stringparam mixed-case-prefix mc \
		$(tools_dir)/glib-interfaces-generator.xsl \
		$< > $@

_gen/interfaces-body.h: _gen/mcd.xml \
	$(tools_dir)/glib-interfaces-body-generator.xsl \
	$(tools_dir)/c-interfaces-generator.xsl
	$(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) \
		--stringparam mixed-case-prefix mc \
		$(tools_dir)/glib-interfaces-body-generator.xsl \
		$< > $@

_gen/gtypes.h _gen/gtypes-body.h: _gen/mcd.xml \
	$(top_srcdir)/tools/glib-gtypes-generator.py
	$(AM_V_GEN)$(PYTHON) $(top_srcdir)/tools/glib-gtypes-generator.py \
		$< _gen/gtypes mc



# Generated files which must be generated per "class".
# (Currently the only "class" is nmc4, but the new API will need "classes"
# like account, account-manager, ...)

_gen/%.xml: $(top_srcdir)/xml/%.xml $(wildcard $(top_srcdir)/xml/*.xml) Makefile.am
	$(AM_V_at)$(mkdir_p) _gen
	$(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \
		$< > $@

_gen/%.xml: %.xml $(wildcard $(top_srcdir)/xml/*.xml) Makefile.am
	$(AM_V_at)$(mkdir_p) _gen
	$(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \
		$< > $@

_gen/cli-%-body.h _gen/cli-%.h: _gen/%.xml \
	$(tools_dir)/glib-client-gen.py Makefile.am
	$(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-client-gen.py \
		--group=`echo $* | tr x- x_` \
		--iface-quark-prefix=MC_IFACE_QUARK \
		--tp-proxy-api=0.7.6 \
		$< Mc_Cli _gen/cli-$*

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

include ../tools/header-checks.am

check-local: header-decl-macro-check