Makefile.am 105.6 KB
Newer Older
D
Daniel Veillard 已提交
1 2
## Process this file with automake to produce Makefile.in

3
## Copyright (C) 2005-2016 Red Hat, Inc.
E
Eric Blake 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16 17
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library.  If not, see
## <http://www.gnu.org/licenses/>.
18

19 20
# old automake does not provide abs_{src,build}dir variables
abs_builddir = $(shell pwd)
21
abs_topbuilddir = $(shell cd .. && pwd)
22
abs_srcdir = $(shell cd $(srcdir) && pwd)
M
Michal Privoznik 已提交
23
abs_topsrcdir = $(shell cd $(top_srcdir) && pwd)
24

25 26
# No libraries with the exception of LIBXML should be listed
# here. List them against the individual XXX_la_CFLAGS targets
27
# that actually use them. Also keep GETTEXT_CPPFLAGS at the end.
28 29
INCLUDES =	-I../gnulib/lib					\
		-I$(top_srcdir)/gnulib/lib			\
30
		-I$(top_srcdir)					\
31
		-I../include					\
32
		-I$(top_srcdir)/include				\
33
		-I$(srcdir)/util				\
A
Andrea Bolognani 已提交
34
		-I./util					\
35
		-DIN_LIBVIRT					\
36
		-Dabs_topbuilddir="\"$(abs_topbuilddir)\""	\
37
		-Dabs_topsrcdir="\"$(abs_topsrcdir)\""		\
38
		$(GETTEXT_CPPFLAGS)
E
Eric Blake 已提交
39

40 41
WARN_CFLAGS += $(STRICT_FRAME_LIMIT_CFLAGS)

42
AM_CFLAGS =	$(LIBXML_CFLAGS)				\
43
		$(WARN_CFLAGS)					\
E
Eric Blake 已提交
44 45 46
		$(LOCK_CHECKING_CFLAGS)				\
		$(WIN32_EXTRA_CFLAGS)				\
		$(COVERAGE_CFLAGS)
47
AM_LDFLAGS =	$(DRIVER_MODULES_LDFLAGS)			\
G
Guido Günther 已提交
48 49
		$(COVERAGE_LDFLAGS)				\
		$(RELRO_LDFLAGS)				\
50
		$(NO_INDIRECT_LDFLAGS)				\
51 52
		$(CYGWIN_EXTRA_LDFLAGS) 			\
		$(MINGW_EXTRA_LDFLAGS)				\
G
Guido Günther 已提交
53
		$(NULL)
54

L
Lai Jiangshan 已提交
55
EXTRA_DIST = $(conf_DATA) util/keymaps.csv
56

57
BUILT_SOURCES =
58 59 60
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
61
nodist_conf_DATA =
62

E
Eric Blake 已提交
63 64
THREAD_LIBS = $(LIB_PTHREAD) $(LTLIBMULTITHREAD)

J
Jim Fehlig 已提交
65
SECDRIVER_CFLAGS =
66 67
SECDRIVER_LIBS =
if WITH_SECDRIVER_SELINUX
J
Jim Fehlig 已提交
68
SECDRIVER_CFLAGS += $(SELINUX_CFLAGS)
69
SECDRIVER_LIBS += $(SELINUX_LIBS)
70
endif WITH_SECDRIVER_SELINUX
71
if WITH_SECDRIVER_APPARMOR
J
Jim Fehlig 已提交
72
SECDRIVER_CFLAGS += $(APPARMOR_CFLAGS)
73
SECDRIVER_LIBS += $(APPARMOR_LIBS)
74
endif WITH_SECDRIVER_APPARMOR
75

76 77
if WITH_NETWORK
UUID=$(shell uuidgen 2>/dev/null)
78
endif WITH_NETWORK
79

80
lib_LTLIBRARIES = libvirt.la libvirt-qemu.la libvirt-lxc.la
81

82
moddir = $(libdir)/libvirt/connection-driver
83 84
mod_LTLIBRARIES =

A
Amy Griffis 已提交
85
confdir = $(sysconfdir)/libvirt
86
conf_DATA = libvirt.conf libvirt-admin.conf
87

88 89 90 91 92 93
augeasdir = $(datadir)/augeas/lenses
augeas_DATA =

augeastestdir = $(datadir)/augeas/lenses/tests
augeastest_DATA =

94 95
# These files are not related to driver APIs. Simply generic
# helper APIs for various purposes
96
UTIL_SOURCES =							\
97
		util/viralloc.c util/viralloc.h			\
98
		util/virarch.h util/virarch.c			\
99
		util/viratomic.h util/viratomic.c		\
100
		util/viraudit.c util/viraudit.h			\
101
		util/virauth.c util/virauth.h			\
102
		util/virauthconfig.c util/virauthconfig.h	\
103
		util/virbitmap.c util/virbitmap.h		\
104
		util/virbuffer.c util/virbuffer.h		\
105
		util/virperf.c util/virperf.h			\
106
		util/vircgroup.c util/vircgroup.h util/vircgrouppriv.h	\
107
		util/virclosecallbacks.c util/virclosecallbacks.h		\
108
		util/vircommand.c util/vircommand.h util/vircommandpriv.h \
109
		util/virconf.c util/virconf.h			\
110
		util/vircrypto.c util/vircrypto.h		\
L
Laine Stump 已提交
111
		util/virdbus.c util/virdbus.h util/virdbuspriv.h	\
112
		util/virdnsmasq.c util/virdnsmasq.h		\
113
		util/virebtables.c util/virebtables.h		\
E
Eric Blake 已提交
114
		util/virendian.h				\
115
		util/virerror.c util/virerror.h			\
116
		util/virevent.c util/virevent.h			\
117
		util/vireventpoll.c util/vireventpoll.h		\
118
		util/virfdstream.c util/virfdstream.h		\
E
Eric Blake 已提交
119
		util/virfile.c util/virfile.h			\
120 121
		util/virfirewall.c util/virfirewall.h		\
		util/virfirewallpriv.h				\
122
		util/virfirmware.c util/virfirmware.h		\
123
		util/virgettext.c util/virgettext.h		\
124
		util/virgic.c util/virgic.h			\
125 126
		util/virhash.c util/virhash.h			\
		util/virhashcode.c util/virhashcode.h		\
127
		util/virhook.c util/virhook.h			\
128
		util/virhostcpu.c util/virhostcpu.h util/virhostcpupriv.h \
129
		util/virhostdev.c util/virhostdev.h		\
130
		util/virhostmem.c util/virhostmem.h		\
131
		util/viridentity.c util/viridentity.h		\
132
		util/virinitctl.c util/virinitctl.h		\
133
		util/viriptables.c util/viriptables.h		\
134
		util/viriscsi.c util/viriscsi.h			\
135
		util/virjson.c util/virjson.h			\
L
Lai Jiangshan 已提交
136
		util/virkeycode.c util/virkeycode.h		\
137
		util/virkeyfile.c util/virkeyfile.h		\
138
		util/virkeymaps.h				\
139
		util/virlease.c util/virlease.h			\
140
		util/virlockspace.c util/virlockspace.h		\
141
		util/virlog.c util/virlog.h			\
142
		util/virmacaddr.h util/virmacaddr.c		\
143
		util/virmacmap.h util/virmacmap.c		\
144
		util/virnetdev.h util/virnetdev.c		\
145
		util/virnetdevbandwidth.h util/virnetdevbandwidth.c \
146
		util/virnetdevbridge.h util/virnetdevbridge.c	\
147
		util/virnetdevip.h util/virnetdevip.c		\
148
		util/virnetdevmacvlan.c util/virnetdevmacvlan.h	\
149
		util/virnetdevmidonet.h util/virnetdevmidonet.c \
A
Ansis Atteka 已提交
150
		util/virnetdevopenvswitch.h util/virnetdevopenvswitch.c \
151
		util/virnetdevtap.h util/virnetdevtap.c		\
152 153
		util/virnetdevveth.h util/virnetdevveth.c	\
		util/virnetdevvlan.h util/virnetdevvlan.c	\
154
		util/virnetdevvportprofile.h util/virnetdevvportprofile.c \
155
		util/virnetlink.c util/virnetlink.h		\
156
		util/virnodesuspend.c util/virnodesuspend.h	\
157
		util/virkmod.c util/virkmod.h                   \
158
		util/virnuma.c util/virnuma.h			\
159 160 161
		util/virobject.c util/virobject.h		\
		util/virpci.c util/virpci.h			\
		util/virpidfile.c util/virpidfile.h		\
162
		util/virpolkit.c util/virpolkit.h               \
D
Daniel P. Berrange 已提交
163
		util/virportallocator.c util/virportallocator.h \
164
		util/virprobe.h					\
165
		util/virprocess.c util/virprocess.h		\
166
		util/virqemu.c util/virqemu.h			\
167
		util/virrandom.h util/virrandom.c		\
168
		util/virrotatingfile.h util/virrotatingfile.c   \
169
		util/virscsi.c util/virscsi.h			\
170
		util/virscsihost.c util/virscsihost.h		\
171
		util/virscsivhost.c util/virscsivhost.h		\
172
		util/virseclabel.c util/virseclabel.h		\
173
		util/virsecret.c util/virsecret.h		\
174 175
		util/virsexpr.c util/virsexpr.h			\
		util/virsocketaddr.h util/virsocketaddr.c	\
176
		util/virstorageencryption.c util/virstorageencryption.h \
177 178
		util/virstoragefile.c util/virstoragefile.h	\
		util/virstring.h util/virstring.c		\
179
		util/virsysfs.c util/virsysfs.h util/virsysfspriv.h \
180
		util/virsysinfo.c util/virsysinfo.h util/virsysinfopriv.h		\
181
		util/virsystemd.c util/virsystemd.h util/virsystemdpriv.h \
182
		util/virthread.c util/virthread.h		\
P
Pavel Hrdina 已提交
183
		util/virthreadjob.c util/virthreadjob.h		\
184 185
		util/virthreadpool.c util/virthreadpool.h	\
		util/virtime.h util/virtime.c			\
186
		util/virtpm.h util/virtpm.c			\
187
		util/virtypedparam.c util/virtypedparam.h	\
188
		util/virusb.c util/virusb.h			\
189 190
		util/viruri.h util/viruri.c			\
		util/virutil.c util/virutil.h			\
191
		util/viruuid.c util/viruuid.h			\
192
		util/virvhba.c util/virvhba.h			\
193
		util/virxdrdefs.h                               \
194
		util/virxml.c util/virxml.h			\
195
		util/virmdev.c util/virmdev.h			\
196
		$(NULL)
L
Lai Jiangshan 已提交
197

198
EXTRA_DIST += $(srcdir)/util/keymaps.csv $(srcdir)/util/virkeycode-mapgen.py
L
Lai Jiangshan 已提交
199

E
Eric Blake 已提交
200
BUILT_SOURCES += util/virkeymaps.h
201
MAINTAINERCLEANFILES += util/virkeymaps.h
202

E
Eric Blake 已提交
203
util/virkeymaps.h: $(srcdir)/util/keymaps.csv	\
L
Lai Jiangshan 已提交
204
		$(srcdir)/util/virkeycode-mapgen.py
205
	$(MKDIR_P) util/
206
	$(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py \
207
	  <$(srcdir)/util/keymaps.csv >util/virkeymaps.h
L
Lai Jiangshan 已提交
208

209
# Internal generic driver infrastructure
O
Osier Yang 已提交
210 211 212
DATATYPES_SOURCES = datatypes.h datatypes.c
DRIVER_SOURCES =							\
		driver.c driver.h					\
213 214 215 216 217 218 219 220 221
		driver-hypervisor.h					\
		driver-interface.h					\
		driver-network.h					\
		driver-nodedev.h					\
		driver-nwfilter.h					\
		driver-secret.h						\
		driver-state.h						\
		driver-storage.h					\
		driver-stream.h						\
O
Osier Yang 已提交
222 223 224
		internal.h						\
		$(DATATYPES_SOURCES)					\
		libvirt.c libvirt_internal.h				\
225
		libvirt-domain.c 					\
226
		libvirt-domain-snapshot.c 				\
227
		libvirt-host.c 						\
228
		libvirt-interface.c	 				\
229
		libvirt-network.c	 				\
230
		libvirt-nodedev.c	 				\
231
		libvirt-nwfilter.c	 				\
232
		libvirt-secret.c	 				\
233
		libvirt-storage.c	 				\
234
		libvirt-stream.c	 				\
O
Osier Yang 已提交
235 236 237
		locking/lock_manager.c locking/lock_manager.h		\
		locking/lock_driver.h					\
		locking/lock_driver_nop.h locking/lock_driver_nop.c	\
238 239 240
		locking/domain_lock.h locking/domain_lock.c		\
		logging/log_manager.c logging/log_manager.h		\
		$(NULL)
241

242 243 244
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

245 246
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
247

248
LOCK_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
249 250
		locking/lock_protocol.h \
		locking/lock_protocol.c \
251 252
		$(NULL)

253 254 255
LOCK_PROTOCOL = $(srcdir)/locking/lock_protocol.x
EXTRA_DIST += $(LOCK_PROTOCOL) \
	$(LOCK_PROTOCOL_GENERATED)
256 257 258
BUILT_SOURCES += $(LOCK_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(LOCK_PROTOCOL_GENERATED)

259
LOCK_DAEMON_GENERATED = \
260
		locking/lock_daemon_dispatch_stubs.h
261 262 263
		$(NULL)

BUILT_SOURCES += $(LOCK_DAEMON_GENERATED)
264
EXTRA_DIST += $(LOCK_DAEMON_GENERATED)
265 266
MAINTAINERCLEANFILES += $(LOCK_DAEMON_GENERATED)

267 268
LOCK_DRIVER_LOCKD_SOURCES = \
		locking/lock_driver_lockd.c \
269
		locking/lock_driver_lockd.h \
270 271
		$(NULL)

272 273 274 275 276
LOCK_DAEMON_SOURCES = \
		locking/lock_daemon.h \
		locking/lock_daemon.c \
		locking/lock_daemon_config.h \
		locking/lock_daemon_config.c \
277 278
		locking/lock_daemon_dispatch.c \
		locking/lock_daemon_dispatch.h \
279 280
		$(NULL)

E
Eric Blake 已提交
281
locking/lock_daemon_dispatch_stubs.h: $(LOCK_PROTOCOL) \
282
		$(srcdir)/rpc/gendispatch.pl Makefile.am
283 284
	$(AM_V_GEN)perl -w $(srcdir)/rpc/gendispatch.pl --mode=server \
	    virLockSpaceProtocol VIR_LOCK_SPACE_PROTOCOL \
E
Eric Blake 已提交
285
	    $(LOCK_PROTOCOL) > $(srcdir)/locking/lock_daemon_dispatch_stubs.h
286 287


288 289 290 291 292
LOG_PROTOCOL_GENERATED = \
		logging/log_protocol.h \
		logging/log_protocol.c \
		$(NULL)

293 294
DRIVER_SOURCES += $(LOG_PROTOCOL_GENERATED)

295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
LOG_PROTOCOL = $(srcdir)/logging/log_protocol.x
EXTRA_DIST += $(LOG_PROTOCOL) \
	$(LOG_PROTOCOL_GENERATED)
BUILT_SOURCES += $(LOG_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(LOG_PROTOCOL_GENERATED)

LOG_DAEMON_GENERATED = \
		logging/log_daemon_dispatch_stubs.h
		$(NULL)

BUILT_SOURCES += $(LOG_DAEMON_GENERATED)
EXTRA_DIST += $(LOG_DAEMON_GENERATED)
MAINTAINERCLEANFILES += $(LOG_DAEMON_GENERATED)

LOG_DAEMON_SOURCES = \
		logging/log_daemon.h \
		logging/log_daemon.c \
		logging/log_daemon_config.h \
		logging/log_daemon_config.c \
		logging/log_daemon_dispatch.c \
		logging/log_daemon_dispatch.h \
316 317
		logging/log_handler.c \
		logging/log_handler.h \
318 319 320 321 322 323 324 325 326
		$(NULL)

logging/log_daemon_dispatch_stubs.h: $(LOG_PROTOCOL) \
		$(srcdir)/rpc/gendispatch.pl Makefile.am
	$(AM_V_GEN)perl -w $(srcdir)/rpc/gendispatch.pl --mode=server \
	    virLogManagerProtocol VIR_LOG_MANAGER_PROTOCOL \
	    $(LOG_PROTOCOL) > $(srcdir)/logging/log_daemon_dispatch_stubs.h


327 328
NETDEV_CONF_SOURCES =						\
		conf/netdev_bandwidth_conf.h conf/netdev_bandwidth_conf.c \
329 330
		conf/netdev_vport_profile_conf.h conf/netdev_vport_profile_conf.c \
		conf/netdev_vlan_conf.h conf/netdev_vlan_conf.c
331

332
# XML configuration format handling sources
333 334
# Domain driver generic impl APIs
DOMAIN_CONF_SOURCES =						\
335
		conf/capabilities.c conf/capabilities.h		\
336
		conf/domain_addr.c conf/domain_addr.h		\
M
Michal Privoznik 已提交
337
		conf/domain_capabilities.c conf/domain_capabilities.h	\
338
		conf/domain_conf.c conf/domain_conf.h		\
339
		conf/domain_audit.c conf/domain_audit.h		\
340
		conf/domain_nwfilter.c conf/domain_nwfilter.h	\
341
		conf/snapshot_conf.c conf/snapshot_conf.h	\
342 343
		conf/numa_conf.c conf/numa_conf.h	\
		conf/virdomainobjlist.c conf/virdomainobjlist.h
344

345 346 347 348
OBJECT_EVENT_SOURCES =						\
		conf/object_event.c conf/object_event.h \
		conf/object_event_private.h

349 350
DOMAIN_EVENT_SOURCES =						\
		conf/domain_event.c conf/domain_event.h
351

352 353 354
NETWORK_EVENT_SOURCES =						\
		conf/network_event.c conf/network_event.h

355 356 357
STORAGE_EVENT_SOURCES =						\
                conf/storage_event.c conf/storage_event.h

358 359 360
NODE_DEVICE_EVENT_SOURCES =					\
                conf/node_device_event.c conf/node_device_event.h

361 362 363
SECRET_EVENT_SOURCES =					\
                conf/secret_event.c conf/secret_event.h

364
# Network driver generic impl APIs
365
NETWORK_CONF_SOURCES =						\
366 367
		conf/network_conf.c conf/network_conf.h \
		conf/networkcommon_conf.c conf/networkcommon_conf.h
368

369 370
# Network filter driver generic impl APIs
NWFILTER_PARAM_CONF_SOURCES =					\
371
		conf/nwfilter_params.c conf/nwfilter_params.h	\
372 373
		conf/nwfilter_ipaddrmap.c			\
		conf/nwfilter_ipaddrmap.h			\
J
John Ferlan 已提交
374 375
		conf/nwfilter_conf.h                            \
		conf/virnwfilterobj.h
376

377
NWFILTER_CONF_SOURCES =						\
378
		$(NWFILTER_PARAM_CONF_SOURCES)			\
J
John Ferlan 已提交
379 380
		conf/nwfilter_conf.c conf/nwfilter_conf.h	\
		conf/virnwfilterobj.c conf/virnwfilterobj.h
381

382
# Storage driver generic impl APIs
383
STORAGE_CONF_SOURCES =                                         \
384
		conf/storage_adapter_conf.h conf/storage_adapter_conf.c \
J
John Ferlan 已提交
385 386
		conf/storage_conf.h conf/storage_conf.c        \
		conf/virstorageobj.h conf/virstorageobj.c
387

388
# Interface driver generic impl APIs
389
INTERFACE_CONF_SOURCES =                                       \
J
John Ferlan 已提交
390 391
		conf/interface_conf.c conf/interface_conf.h    \
		conf/virinterfaceobj.c conf/virinterfaceobj.h
392

393
# Secret driver generic impl APIs
394
SECRET_CONF_SOURCES =                                          \
395 396
		conf/secret_conf.h conf/secret_conf.c          \
		conf/virsecretobj.h conf/virsecretobj.c
397 398 399

# Network driver generic impl APIs
NODE_DEVICE_CONF_SOURCES =                                     \
J
John Ferlan 已提交
400 401
		conf/node_device_conf.c conf/node_device_conf.h \
		conf/virnodedeviceobj.c conf/virnodedeviceobj.h
402

403 404
CPU_CONF_SOURCES =						\
		conf/cpu_conf.c conf/cpu_conf.h
405

406 407
# Safe character device handling helper APIs
CHRDEV_CONF_SOURCES =						\
408
		conf/virchrdev.c conf/virchrdev.h
409

410 411 412 413
# Device Helper APIs
DEVICE_CONF_SOURCES =                                           \
		conf/device_conf.c conf/device_conf.h

414
CONF_SOURCES =							\
415
		$(NETDEV_CONF_SOURCES)				\
416
		$(DOMAIN_CONF_SOURCES)				\
417
		$(OBJECT_EVENT_SOURCES)				\
418
		$(DOMAIN_EVENT_SOURCES)				\
419
		$(NETWORK_EVENT_SOURCES)			\
420
		$(STORAGE_EVENT_SOURCES)			\
421
		$(NODE_DEVICE_EVENT_SOURCES)			\
422
		$(SECRET_EVENT_SOURCES)				\
423
		$(NETWORK_CONF_SOURCES)				\
424
		$(NWFILTER_CONF_SOURCES)			\
425 426 427
		$(NODE_DEVICE_CONF_SOURCES)			\
		$(STORAGE_CONF_SOURCES)				\
		$(INTERFACE_CONF_SOURCES)			\
428
		$(SECRET_CONF_SOURCES)				\
429
		$(CPU_CONF_SOURCES)				\
430
		$(CHRDEV_CONF_SOURCES)				\
431
		$(DEVICE_CONF_SOURCES)
432

433
# The remote RPC driver, covering domains, storage, networks, etc
434
REMOTE_DRIVER_GENERATED = \
E
Eric Blake 已提交
435 436 437 438 439 440 441 442 443 444
		remote/remote_protocol.c		\
		remote/remote_protocol.h		\
		remote/remote_client_bodies.h		\
		remote/lxc_protocol.c			\
		remote/lxc_protocol.h			\
		remote/lxc_client_bodies.h		\
		remote/qemu_protocol.c			\
		remote/qemu_protocol.h			\
		remote/qemu_client_bodies.h		\
		$(NULL)
E
Eric Blake 已提交
445 446

REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x
447
LXC_PROTOCOL = $(srcdir)/remote/lxc_protocol.x
E
Eric Blake 已提交
448
QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x
449
REMOTE_DRIVER_PROTOCOL = $(REMOTE_PROTOCOL) $(QEMU_PROTOCOL) $(LXC_PROTOCOL)
450

E
Eric Blake 已提交
451
remote/remote_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
452
		$(REMOTE_PROTOCOL) Makefile.am
453
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
454 455
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/remote/remote_client_bodies.h
456

E
Eric Blake 已提交
457
remote/lxc_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
458
		$(LXC_PROTOCOL) Makefile.am
459
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
460 461
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/remote/lxc_client_bodies.h
462

E
Eric Blake 已提交
463
remote/qemu_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
464
		$(QEMU_PROTOCOL) Makefile.am
465
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
466 467
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/remote/qemu_client_bodies.h
468 469 470 471

REMOTE_DRIVER_SOURCES =						\
		remote/remote_driver.c remote/remote_driver.h	\
		$(REMOTE_DRIVER_GENERATED)
472

473
EXTRA_DIST +=  $(REMOTE_DRIVER_PROTOCOL) \
474
		$(REMOTE_DRIVER_GENERATED)
475

M
Martin Kletzander 已提交
476 477 478 479
ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x

ADMIN_PROTOCOL_GENERATED = \
		admin/admin_protocol.c	\
480 481 482 483 484 485 486 487
		admin/admin_protocol.h	\
		admin/admin_client.h

admin/admin_client.h: $(srcdir)/rpc/gendispatch.pl \
		$(ADMIN_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
	  admin ADMIN $(ADMIN_PROTOCOL) \
	  > $(srcdir)/admin/admin_client.h
M
Martin Kletzander 已提交
488 489 490 491 492

EXTRA_DIST += $(ADMIN_PROTOCOL) $(ADMIN_PROTOCOL_GENERATED)
BUILT_SOURCES += $(ADMIN_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(ADMIN_PROTOCOL_GENERATED)

493 494 495 496 497 498 499 500 501 502
# Ensure that we don't change the struct or member names or member ordering
# in remote_protocol.x  The embedded perl below needs a few comments, and
# presumes you know what pdwtags output looks like:
# * use -0777 -n to slurp the entire file into $_.
# * the "split" splits on the /* DD */ comments, so that $p iterates
#     through the struct definitions.
# * process only "struct remote_..." entries
# * remove comments and preceding TAB throughout
# * remove empty lines throughout
# * remove white space at end of buffer
503 504 505 506

# With pdwtags 1.8, --verbose output includes separators like these:
# /* 93 */
# /* <0> (null):0 */
507 508
# with the second line omitted for intrinsic types.
# Whereas with pdwtags 1.3, they look like this:
509
# /* <2d2> /usr/include/libio.h:180 */
510 511
# The alternation of the following regexps matches both cases.
r1 = /\* \d+ \*/
512
r2 = /\* <[[:xdigit:]]+> \S+:\d+ \*/
M
Martin Kletzander 已提交
513 514 515
libs_prefix = remote_|qemu_|lxc_|admin_
other_prefix = keepalive|vir(Net|LockSpace|LXCMonitor)
struct_prefix = ($(libs_prefix)|$(other_prefix))
516

517
# Depending on configure options, libtool creates one or both of
E
Eric Blake 已提交
518 519
# remote/{,.libs/}libvirt_driver_remote_la-remote_protocol.o.  We want
# the newest of the two, in case configure options changed and a stale
520
# file is left around from an earlier build.
521
PDWTAGS = \
522
	$(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then		\
E
Eric Blake 已提交
523 524
	  o=`ls -t $(<:.lo=.$(OBJEXT))					\
	     $(subst /,/.libs/,$(<:.lo=.$(OBJEXT)))			\
525 526 527
	    2>/dev/null | sed -n 1p`;					\
	  test -f "$$o" || { echo ".o for $< not found" >&2; exit 1; };	\
	  pdwtags --verbose $$o > $(@F)-t1 2> $(@F)-t2;			\
E
Eric Blake 已提交
528
	  if test ! -s $(@F)-t1 && test -s $(@F)-t2; then		\
529 530 531
	    rm -rf $(@F)-t?;						\
	    echo 'WARNING: pdwtags appears broken; skipping the $@ test' >&2;\
	  else								\
532
	    $(PERL) -0777 -n						\
533
		-e 'foreach my $$p (split m!\n*(?:$(r1)|$(r2))\n!) {'	\
534
		-e '  if ($$p =~ /^(struct|enum) $(struct_prefix)/ ||'	\
535
		-e '      $$p =~ /^enum \{/) {'				\
536 537 538
		-e '    $$p =~ s!\t*/\*.*?\*/!!sg;'			\
		-e '    $$p =~ s!\s+\n!\n!sg;'				\
		-e '    $$p =~ s!\s+$$!!;'				\
539
		-e '    $$p =~ s!\t!        !g;'			\
540 541 542 543
		-e '    print "$$p\n";'					\
		-e '    $$n++;'						\
		-e '  }'						\
		-e '}'							\
544 545 546
		-e 'BEGIN {'						\
		-e '  print "/* -*- c -*- */\n";'			\
		-e '}'							\
547
		-e 'END {'						\
548
		-e '  if ($$n < 1) {'					\
549 550 551 552 553 554
		-e '    warn "WARNING: your pdwtags program is too old\n";' \
		-e '    warn "WARNING: skipping the $@ test\n";'	\
		-e '    warn "WARNING: install dwarves-1.3 or newer\n";' \
		-e '    exit 8;'					\
		-e '  }'						\
		-e '}'							\
555 556
		< $(@F)-t1 > $(@F)-t3;					\
	    case $$? in 8) rm -f $(@F)-t?; exit 0;; 0) ;; *) exit 1;; esac;\
557
	    diff -u $(@)s $(@F)-t3; st=$$?; rm -f $(@F)-t?; exit $$st;	\
558
	  fi;								\
559
	else								\
560 561
	  echo 'WARNING: you lack pdwtags; skipping the $@ test' >&2;	\
	  echo 'WARNING: install the dwarves package to get pdwtags' >&2; \
562
	fi
563

564
# .libs/libvirt.so is built by libtool as a side-effect of the Makefile
565 566
# rule for libvirt.la.  However, checking symbols relies on Linux ELF layout
if WITH_LINUX
567 568 569
check-symfile: libvirt.syms libvirt.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt.syms \
	  .libs/libvirt.so
570 571 572
check-admin-symfile: libvirt_admin.syms libvirt-admin.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt_admin.syms \
	  .libs/libvirt-admin.so
573
else ! WITH_LINUX
574
check-symfile:
575
check-admin-symfile:
576
endif ! WITH_LINUX
577
check-symsorting:
578
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
579
		$(srcdir) $(SYM_FILES)
580 581 582
check-admin-symsorting:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
		$(srcdir) $(ADMIN_SYM_FILES)
J
Jiri Denemark 已提交
583
EXTRA_DIST += check-symfile.pl check-symsorting.pl
584

E
Eric Blake 已提交
585
# Keep this list synced with RPC_PROBE_FILES
586 587
PROTOCOL_STRUCTS = \
	$(srcdir)/remote_protocol-structs \
588
	$(srcdir)/lxc_protocol-structs \
589
	$(srcdir)/qemu_protocol-structs \
J
Jiri Denemark 已提交
590
	$(srcdir)/virnetprotocol-structs \
E
Eric Blake 已提交
591 592 593
	$(srcdir)/virkeepaliveprotocol-structs \
	$(srcdir)/lxc_monitor_protocol-structs \
	$(srcdir)/lock_protocol-structs \
M
Martin Kletzander 已提交
594
	$(srcdir)/admin_protocol-structs \
E
Eric Blake 已提交
595 596
	$(NULL)

597
if WITH_REMOTE
598 599
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)

600 601
# The .o file that pdwtags parses is created as a side effect of running
# libtool; but from make's perspective we depend on the .lo file.
602 603 604
$(srcdir)/remote_protocol-struct \
	$(srcdir)/qemu_protocol-struct \
	$(srcdir)/lxc_protocol-struct: \
E
Eric Blake 已提交
605
		$(srcdir)/%-struct: remote/libvirt_driver_remote_la-%.lo
606
	$(PDWTAGS)
607
$(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \
E
Eric Blake 已提交
608
		$(srcdir)/%-struct: rpc/libvirt_net_rpc_la-%.lo
609
	$(PDWTAGS)
E
Eric Blake 已提交
610
$(srcdir)/lxc_monitor_protocol-struct: \
E
Eric Blake 已提交
611
		$(srcdir)/%-struct: lxc/libvirt_driver_lxc_impl_la-%.lo
E
Eric Blake 已提交
612 613
	$(PDWTAGS)
$(srcdir)/lock_protocol-struct: \
E
Eric Blake 已提交
614
		$(srcdir)/%-struct: locking/lockd_la-%.lo
E
Eric Blake 已提交
615
	$(PDWTAGS)
M
Martin Kletzander 已提交
616 617 618
$(srcdir)/admin_protocol-struct: \
		$(srcdir)/%-struct: admin/libvirt_admin_la-%.lo
	$(PDWTAGS)
E
Eric Blake 已提交
619

620
else !WITH_REMOTE
621 622 623
# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be
# re-generated when configured --without-remote.
check-protocol:
624
endif !WITH_REMOTE
J
Jiri Denemark 已提交
625
EXTRA_DIST += $(PROTOCOL_STRUCTS)
626 627 628 629 630

check-drivername:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-drivername.pl \
		$(srcdir)/driver.h \
		$(srcdir)/libvirt_public.syms \
631
		$(srcdir)/libvirt_admin_public.syms \
632 633 634 635 636
		$(srcdir)/libvirt_qemu.syms \
		$(srcdir)/libvirt_lxc.syms

EXTRA_DIST += check-drivername.pl

637
DRIVER_SOURCE_FILES = \
638 639 640 641 642 643 644 645 646 647 648
	$(ESX_DRIVER_SOURCES) \
	$(HYPERV_DRIVER_SORUCES) \
	$(INTERFACE_DRIVER_SOURCES) \
	$(LIBXL_DRIVER_SOURCES) \
	$(LXC_DRIVER_SOURCES) \
	$(NETWORK_DRIVER_SOURCES) \
	$(NODE_DEVICE_DRIVER_SOURCES) \
	$(NODE_DEVICE_DRIVER_HAL_SOURCES) \
	$(NODE_DEVICE_DRIVER_UDEV_SOURCES) \
	$(NWFILTER_DRIVER_SOURCES) \
	$(OPENVZ_DRIVER_SOURCES) \
649
	$(VZ_DRIVER_SOURCES) \
650 651 652 653 654 655 656 657
	$(PHYP_DRIVER_SOURCES) \
	$(QEMU_DRIVER_SOURCES) \
	$(REMOTE_DRIVER_SOURCES) \
	$(SECRET_DRIVER_SOURCES) \
	$(STORAGE_DRIVER_SOURCES) \
	$(TEST_DRIVER_SOURCES) \
	$(UML_DRIVER_SOURCES) \
	$(VBOX_DRIVER_SOURCES) \
658
	vbox/vbox_tmpl.c \
659 660 661
	$(VMWARE_DRIVER_SOURCES) \
	$(XEN_DRIVER_SOURCES) \
	$(XENAPI_DRIVER_SOURCES) \
662 663
	$(NULL)

664
STATEFUL_DRIVER_SOURCE_FILES = \
R
Roman Bogorodskiy 已提交
665
	$(BHYVE_DRIVER_SOURCES) \
666 667 668 669 670 671 672 673 674 675 676
	$(INTERFACE_DRIVER_SOURCES) \
	$(LIBXL_DRIVER_SOURCES) \
	$(LXC_DRIVER_SOURCES) \
	$(NETWORK_DRIVER_SOURCES) \
	$(NODE_DEVICE_DRIVER_SOURCES) \
	$(NWFILTER_DRIVER_SOURCES) \
	$(QEMU_DRIVER_SOURCES) \
	$(SECRET_DRIVER_SOURCES) \
	$(STORAGE_DRIVER_SOURCES) \
	$(UML_DRIVER_SOURCES) \
	$(XEN_DRIVER_SOURCES) \
677
	$(VZ_DRIVER_SOURCES) \
678 679
	$(NULL)

680 681 682

check-driverimpls:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-driverimpls.pl \
683
		$(filter /%,$(DRIVER_SOURCE_FILES)) \
E
Eric Blake 已提交
684 685 686
		$(filter $(srcdir)/%,$(DRIVER_SOURCE_FILES)) \
		$(addprefix $(srcdir)/,$(filter-out $(srcdir)/%, \
			$(filter-out /%,$(DRIVER_SOURCE_FILES))))
687

688 689
check-aclrules:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclrules.pl \
E
Eric Blake 已提交
690
		$(REMOTE_PROTOCOL) \
691
		$(addprefix $(srcdir)/,$(filter-out /%,$(STATEFUL_DRIVER_SOURCE_FILES)))
692

693 694 695 696 697
check-aclperms:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclperms.pl \
		$(srcdir)/access/viraccessperm.h \
		$(srcdir)/access/viraccessperm.c

G
Guido Günther 已提交
698
EXTRA_DIST += check-driverimpls.pl check-aclrules.pl check-aclperms.pl
699

700
check-local: check-protocol check-symfile check-symsorting \
701
	check-drivername check-driverimpls check-aclrules \
702
	check-aclperms check-admin-symfile check-admin-symsorting
703
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
704

705 706
# Mock driver, covering domains, storage, networks, etc
TEST_DRIVER_SOURCES =						\
707
		test/test_driver.c test/test_driver.h
D
Daniel P. Berrange 已提交
708
TEST_DRIVER_ASSETS = test/test-screenshot.png
709 710 711

# Now the Hypervisor specific drivers
XEN_DRIVER_SOURCES =						\
712 713 714 715 716 717
		xen/block_stats.c xen/block_stats.h		\
		xen/xen_hypervisor.c xen/xen_hypervisor.h	\
		xen/xen_driver.c xen/xen_driver.h		\
		xen/xend_internal.c xen/xend_internal.h		\
		xen/xm_internal.c xen/xm_internal.h		\
		xen/xs_internal.c xen/xs_internal.h
718
if WITH_XEN_INOTIFY
719
XEN_DRIVER_SOURCES += xen/xen_inotify.c xen/xen_inotify.h
720
endif WITH_XEN_INOTIFY
721

722
LXC_MONITOR_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
723 724
	lxc/lxc_monitor_protocol.h \
	lxc/lxc_monitor_protocol.c \
725 726 727
	$(NULL)

LXC_MONITOR_GENERATED = \
E
Eric Blake 已提交
728
	lxc/lxc_monitor_dispatch.h \
729 730 731
	$(NULL)

LXC_CONTROLLER_GENERATED = \
E
Eric Blake 已提交
732
	lxc/lxc_controller_dispatch.h \
733 734 735
	$(NULL)

LXC_GENERATED = \
736
	$(LXC_MONITOR_PROTOCOL_GENERATED) \
737 738 739 740
	$(LXC_MONITOR_GENERATED) \
	$(LXC_CONTROLLER_GENERATED) \
	$(NULL)

741
LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x
742

E
Eric Blake 已提交
743
lxc/lxc_monitor_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
744
		$(LXC_MONITOR_PROTOCOL) Makefile.am
745
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
746 747
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_monitor_dispatch.h
748

E
Eric Blake 已提交
749
lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
750
		$(REMOTE_PROTOCOL) Makefile.am
751
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \
E
Eric Blake 已提交
752 753
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_controller_dispatch.h
754 755

EXTRA_DIST += \
756
	$(LXC_MONITOR_PROTOCOL) \
757 758 759 760 761
	$(LXC_GENERATED) \
	$(NULL)

BUILT_SOURCES += $(LXC_GENERATED)

762 763
CLEANFILES += $(LXC_GENERATED)

764
LXC_DRIVER_SOURCES =						\
765
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
766
		$(LXC_MONITOR_GENERATED)			\
767 768
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
769
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
770
		lxc/lxc_domain.c lxc/lxc_domain.h		\
771
		lxc/lxc_hostdev.c lxc/lxc_hostdev.h		\
772
		lxc/lxc_monitor.c lxc/lxc_monitor.h		\
773
		lxc/lxc_process.c lxc/lxc_process.h		\
G
Gao feng 已提交
774
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
775
		lxc/lxc_native.c lxc/lxc_native.h		\
776
		lxc/lxc_driver.c lxc/lxc_driver.h
777

778
LXC_CONTROLLER_SOURCES =					\
779
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
780
		$(LXC_CONTROLLER_GENERATED)			\
781 782
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
783
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
784
		lxc/lxc_domain.c lxc/lxc_domain.h		\
G
Gao feng 已提交
785
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
786
		lxc/lxc_controller.c
787

J
Jamie Strandboge 已提交
788
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES =			\
E
Eric Blake 已提交
789
		$(DATATYPES_SOURCES)				\
J
Jamie Strandboge 已提交
790 791
		security/virt-aa-helper.c

792 793 794
PHYP_DRIVER_SOURCES =						\
		phyp/phyp_driver.c phyp/phyp_driver.h

795
OPENVZ_DRIVER_SOURCES =						\
796
		openvz/openvz_conf.c openvz/openvz_conf.h	\
797 798
		openvz/openvz_driver.c openvz/openvz_driver.h   \
		openvz/openvz_util.c openvz/openvz_util.h
799

E
Eric Blake 已提交
800
VMWARE_DRIVER_SOURCES =						\
801
		vmware/vmware_driver.c vmware/vmware_driver.h	\
802 803
		vmware/vmware_conf.c vmware/vmware_conf.h

804
VBOX_DRIVER_SOURCES =						\
E
Eric Blake 已提交
805 806
	vbox/vbox_glue.c vbox/vbox_glue.h			\
	vbox/vbox_driver.c vbox/vbox_driver.h			\
T
Taowei 已提交
807
	vbox/vbox_snapshot_conf.c vbox/vbox_snapshot_conf.h     \
808
	vbox/vbox_V4_0.c vbox/vbox_CAPI_v4_0.h			\
809
	vbox/vbox_V4_1.c vbox/vbox_CAPI_v4_1.h			\
R
Ryota Ozaki 已提交
810
	vbox/vbox_V4_2.c vbox/vbox_CAPI_v4_2.h			\
T
Taowei 已提交
811
	vbox/vbox_V4_2_20.c vbox/vbox_CAPI_v4_2_20.h		\
812
	vbox/vbox_V4_3.c vbox/vbox_CAPI_v4_3.h			\
T
Taowei 已提交
813
	vbox/vbox_V4_3_4.c vbox/vbox_CAPI_v4_3_4.h              \
M
Martin Pietsch 已提交
814
	vbox/vbox_V5_0.c vbox/vbox_CAPI_v5_0.h			\
815
	vbox/vbox_V5_1.c vbox/vbox_CAPI_v5_1.h			\
T
Taowei 已提交
816 817
	vbox/vbox_common.c vbox/vbox_common.h                   \
	vbox/vbox_uniformed_api.h                               \
818 819 820
	vbox/vbox_get_driver.h					\
	vbox/vbox_network.c					\
	vbox/vbox_storage.c
T
Taowei Luo 已提交
821

E
Eric Blake 已提交
822
VBOX_DRIVER_EXTRA_DIST =					\
823 824 825
		vbox/vbox_tmpl.c vbox/README			\
		vbox/vbox_MSCOMGlue.c vbox/vbox_MSCOMGlue.h	\
		vbox/vbox_XPCOMCGlue.c vbox/vbox_XPCOMCGlue.h
826

O
Osier Yang 已提交
827 828
QEMU_DRIVER_SOURCES =							\
		qemu/qemu_agent.c qemu/qemu_agent.h			\
829
		qemu/qemu_alias.c qemu/qemu_alias.h			\
830
		qemu/qemu_block.c qemu/qemu_block.h			\
831
		qemu/qemu_blockjob.c qemu/qemu_blockjob.h		\
O
Osier Yang 已提交
832 833
		qemu/qemu_capabilities.c qemu/qemu_capabilities.h	\
		qemu/qemu_command.c qemu/qemu_command.h			\
834
		qemu/qemu_parse_command.c qemu/qemu_parse_command.h	\
O
Osier Yang 已提交
835
		qemu/qemu_domain.c qemu/qemu_domain.h			\
836
		qemu/qemu_domain_address.c qemu/qemu_domain_address.h	\
O
Osier Yang 已提交
837 838 839
		qemu/qemu_cgroup.c qemu/qemu_cgroup.h			\
		qemu/qemu_hostdev.c qemu/qemu_hostdev.h			\
		qemu/qemu_hotplug.c qemu/qemu_hotplug.h			\
840
		qemu/qemu_hotplugpriv.h					\
O
Osier Yang 已提交
841 842
		qemu/qemu_conf.c qemu/qemu_conf.h			\
		qemu/qemu_process.c qemu/qemu_process.h			\
843
		qemu/qemu_processpriv.h					\
O
Osier Yang 已提交
844
		qemu/qemu_migration.c qemu/qemu_migration.h		\
845
		qemu/qemu_migration_cookie.c qemu/qemu_migration_cookie.h \
O
Osier Yang 已提交
846 847 848 849 850
		qemu/qemu_monitor.c qemu/qemu_monitor.h			\
		qemu/qemu_monitor_text.c				\
		qemu/qemu_monitor_text.h				\
		qemu/qemu_monitor_json.c				\
		qemu/qemu_monitor_json.h				\
851
		qemu/qemu_driver.c qemu/qemu_driver.h	\
852
		qemu/qemu_interface.c qemu/qemu_interface.h		\
853 854
		qemu/qemu_capspriv.h					\
		qemu/qemu_security.c qemu/qemu_security.h
R
Richard W.M. Jones 已提交
855

O
Osier Yang 已提交
856
XENAPI_DRIVER_SOURCES =						\
857
		xenapi/xenapi_driver.c xenapi/xenapi_driver.h	\
O
Osier Yang 已提交
858
		xenapi/xenapi_driver_private.h			\
859 860
		xenapi/xenapi_utils.c xenapi/xenapi_utils.h

861 862 863 864 865
LIBXL_DRIVER_SOURCES =							\
		libxl/libxl_conf.c libxl/libxl_conf.h			\
		libxl/libxl_capabilities.c libxl/libxl_capabilities.h	\
		libxl/libxl_domain.c libxl/libxl_domain.h       	\
		libxl/libxl_driver.c libxl/libxl_driver.h       	\
866
		libxl/libxl_logger.c libxl/libxl_logger.h           \
J
Jim Fehlig 已提交
867
		libxl/libxl_migration.c libxl/libxl_migration.h
J
Jim Fehlig 已提交
868

869
UML_DRIVER_SOURCES =						\
D
Daniel P. Berrange 已提交
870 871
		uml/uml_conf.c uml/uml_conf.h			\
		uml/uml_driver.c uml/uml_driver.h
872

O
Osier Yang 已提交
873 874 875 876 877 878
ESX_DRIVER_SOURCES =							\
		esx/esx_private.h					\
		esx/esx_driver.c esx/esx_driver.h			\
		esx/esx_interface_driver.c esx/esx_interface_driver.h	\
		esx/esx_network_driver.c esx/esx_network_driver.h	\
		esx/esx_storage_driver.c esx/esx_storage_driver.h	\
879
		esx/esx_storage_backend_vmfs.c esx/esx_storage_backend_vmfs.h	\
880
		esx/esx_storage_backend_iscsi.c esx/esx_storage_backend_iscsi.h	\
881
		esx/esx_stream.c esx/esx_stream.h			\
O
Osier Yang 已提交
882 883 884
		esx/esx_util.c esx/esx_util.h				\
		esx/esx_vi.c esx/esx_vi.h				\
		esx/esx_vi_methods.c esx/esx_vi_methods.h		\
885
		esx/esx_vi_types.c esx/esx_vi_types.h
886

887
ESX_DRIVER_GENERATED =							\
888 889
		esx/esx_vi_methods.generated.c				\
		esx/esx_vi_methods.generated.h				\
890
		esx/esx_vi_methods.generated.macro			\
891 892 893 894 895
		esx/esx_vi_types.generated.c				\
		esx/esx_vi_types.generated.h				\
		esx/esx_vi_types.generated.typedef			\
		esx/esx_vi_types.generated.typeenum			\
		esx/esx_vi_types.generated.typetostring			\
896 897 898
		esx/esx_vi_types.generated.typefromstring		\
		esx/esx_vi.generated.c					\
		esx/esx_vi.generated.h
899

O
Osier Yang 已提交
900
ESX_DRIVER_EXTRA_DIST =							\
901 902 903 904 905
		esx/README						\
		esx/esx_vi_generator.input				\
		esx/esx_vi_generator.py					\
		$(ESX_DRIVER_GENERATED)

O
Osier Yang 已提交
906
HYPERV_DRIVER_SOURCES =									\
M
Matthias Bolte 已提交
907 908
		hyperv/hyperv_private.h							\
		hyperv/hyperv_driver.c hyperv/hyperv_driver.h				\
909
		hyperv/hyperv_util.c hyperv/hyperv_util.h				\
910 911 912 913 914 915 916 917 918 919 920 921 922 923
		hyperv/hyperv_wmi.c hyperv/hyperv_wmi.h					\
		hyperv/hyperv_wmi_classes.c hyperv/hyperv_wmi_classes.h			\
		hyperv/openwsman.h

HYPERV_DRIVER_GENERATED =							\
		hyperv/hyperv_wmi_classes.generated.c				\
		hyperv/hyperv_wmi_classes.generated.h				\
		hyperv/hyperv_wmi_classes.generated.typedef

HYPERV_DRIVER_EXTRA_DIST =							\
		hyperv/hyperv_wmi_generator.input				\
		hyperv/hyperv_wmi_generator.py					\
		$(HYPERV_DRIVER_GENERATED)

924
VZ_DRIVER_SOURCES =				\
925 926 927 928 929 930
		vz/vz_driver.h			\
		vz/vz_driver.c			\
		vz/vz_utils.c			\
		vz/vz_utils.h			\
		vz/vz_sdk.h			\
		vz/vz_sdk.c
D
Dmitry Guryanov 已提交
931

R
Roman Bogorodskiy 已提交
932
BHYVE_DRIVER_SOURCES =						\
933 934
		bhyve/bhyve_capabilities.c			\
		bhyve/bhyve_capabilities.h			\
R
Roman Bogorodskiy 已提交
935 936
		bhyve/bhyve_command.c				\
		bhyve/bhyve_command.h				\
937 938
		bhyve/bhyve_conf.c				\
		bhyve/bhyve_conf.h				\
939 940
		bhyve/bhyve_parse_command.c			\
		bhyve/bhyve_parse_command.h			\
941 942 943 944
		bhyve/bhyve_device.c				\
		bhyve/bhyve_device.h				\
		bhyve/bhyve_domain.c				\
		bhyve/bhyve_domain.h				\
R
Roman Bogorodskiy 已提交
945 946
		bhyve/bhyve_driver.h				\
		bhyve/bhyve_driver.c				\
947 948
		bhyve/bhyve_monitor.c				\
		bhyve/bhyve_monitor.h				\
R
Roman Bogorodskiy 已提交
949 950 951 952 953
		bhyve/bhyve_process.c				\
		bhyve/bhyve_process.h				\
		bhyve/bhyve_utils.h				\
		$(NULL)

954
NETWORK_DRIVER_SOURCES =					\
955 956 957 958 959
		network/bridge_driver.h network/bridge_driver.c \
		network/bridge_driver_platform.h 		\
		network/bridge_driver_platform.c		\
		$(NULL)
EXTRA_DIST += network/bridge_driver_linux.c network/bridge_driver_nop.c
960

961 962 963 964
INTERFACE_DRIVER_SOURCES =

if WITH_INTERFACE
INTERFACE_DRIVER_SOURCES +=					\
965 966
		interface/interface_driver.h        \
		interface/interface_driver.c
967 968 969 970

if WITH_NETCF
INTERFACE_DRIVER_SOURCES +=					\
		interface/interface_backend_netcf.c
971
endif WITH_NETCF
972
if WITH_UDEV
973 974
INTERFACE_DRIVER_SOURCES +=					\
		interface/interface_backend_udev.c
975 976
endif WITH_UDEV
endif WITH_INTERFACE
977

978 979 980
SECRET_UTIL_SOURCES =						\
		secret/secret_util.h secret/secret_util.c

981
SECRET_DRIVER_SOURCES =						\
982
		secret/secret_driver.h secret/secret_driver.c
983

984
# Storage backend specific impls
985 986 987
STORAGE_DRIVER_BACKEND_SOURCES = \
		storage/storage_backend.h storage/storage_backend.c

O
Osier Yang 已提交
988 989
STORAGE_DRIVER_SOURCES =						\
		storage/storage_driver.h storage/storage_driver.c	\
990
		$(STORAGE_DRIVER_BACKEND_SOURCES) \
991
		storage/storage_util.h storage/storage_util.c
992 993

STORAGE_DRIVER_FS_SOURCES =					\
994
		storage/storage_backend_fs.h storage/storage_backend_fs.c
R
Richard W.M. Jones 已提交
995

996
STORAGE_DRIVER_LVM_SOURCES =					\
O
Osier Yang 已提交
997
		storage/storage_backend_logical.h		\
998
		storage/storage_backend_logical.c
999 1000

STORAGE_DRIVER_ISCSI_SOURCES =					\
1001
		storage/storage_backend_iscsi.h storage/storage_backend_iscsi.c
1002

1003
STORAGE_DRIVER_SCSI_SOURCES =					\
1004
		storage/storage_backend_scsi.h storage/storage_backend_scsi.c
1005

D
Dave Allan 已提交
1006
STORAGE_DRIVER_MPATH_SOURCES =					\
1007
		storage/storage_backend_mpath.h storage/storage_backend_mpath.c
D
Dave Allan 已提交
1008

1009
STORAGE_DRIVER_DISK_SOURCES =					\
1010
		storage/storage_backend_disk.h storage/storage_backend_disk.c
1011

1012 1013 1014
STORAGE_DRIVER_RBD_SOURCES =					\
		storage/storage_backend_rbd.h storage/storage_backend_rbd.c

1015
STORAGE_DRIVER_SHEEPDOG_SOURCES =				\
1016 1017
		storage/storage_backend_sheepdog.h storage/storage_backend_sheepdog.c \
		storage/storage_backend_sheepdog_priv.h
1018

1019 1020 1021
STORAGE_DRIVER_GLUSTER_SOURCES =				\
		storage/storage_backend_gluster.h storage/storage_backend_gluster.c

R
Roman Bogorodskiy 已提交
1022 1023 1024
STORAGE_DRIVER_ZFS_SOURCES =					\
                storage/storage_backend_zfs.h storage/storage_backend_zfs.c

1025 1026 1027 1028
STORAGE_DRIVER_VSTORAGE_SOURCES =				\
                storage/storage_backend_vstorage.h		\
                storage/storage_backend_vstorage.c

1029
STORAGE_HELPER_DISK_SOURCES =					\
1030
		storage/parthelper.c
1031

1032 1033 1034
UTIL_IO_HELPER_SOURCES =					\
		util/iohelper.c

1035 1036 1037
NETWORK_LEASES_HELPER_SOURCES =                                 \
               network/leaseshelper.c

1038
# Network filters
O
Osier Yang 已提交
1039
NWFILTER_DRIVER_SOURCES =						\
1040
		nwfilter/nwfilter_driver.h nwfilter/nwfilter_driver.c	\
1041
		nwfilter/nwfilter_tech_driver.h				\
1042 1043
		nwfilter/nwfilter_gentech_driver.c			\
		nwfilter/nwfilter_gentech_driver.h			\
S
Stefan Berger 已提交
1044 1045
		nwfilter/nwfilter_dhcpsnoop.c				\
		nwfilter/nwfilter_dhcpsnoop.h				\
1046
		nwfilter/nwfilter_ebiptables_driver.c			\
1047 1048 1049
		nwfilter/nwfilter_ebiptables_driver.h			\
		nwfilter/nwfilter_learnipaddr.c				\
		nwfilter/nwfilter_learnipaddr.h
1050

1051

1052
# Security framework and drivers for various models
O
Osier Yang 已提交
1053 1054 1055 1056 1057
SECURITY_DRIVER_SOURCES =						\
		security/security_driver.h security/security_driver.c	\
		security/security_nop.h security/security_nop.c		\
		security/security_stack.h security/security_stack.c	\
		security/security_dac.h security/security_dac.c		\
1058
		security/security_manager.h security/security_manager.c
1059

1060
SECURITY_DRIVER_SELINUX_SOURCES =				\
1061
		security/security_selinux.h security/security_selinux.c
1062

J
Jamie Strandboge 已提交
1063 1064 1065
SECURITY_DRIVER_APPARMOR_SOURCES =				\
		security/security_apparmor.h security/security_apparmor.c

1066
ACCESS_DRIVER_GENERATED = \
E
Eric Blake 已提交
1067 1068 1069 1070 1071 1072 1073
		access/viraccessapicheck.h \
		access/viraccessapicheck.c \
		access/viraccessapicheckqemu.h \
		access/viraccessapicheckqemu.c \
		access/viraccessapichecklxc.h \
		access/viraccessapichecklxc.c \
		$(NULL)
1074

1075
ACCESS_DRIVER_SYM_FILES = \
1076 1077 1078
		libvirt_access.syms \
		libvirt_access_qemu.syms \
		libvirt_access_lxc.syms
1079

1080 1081 1082 1083 1084
ACCESS_DRIVER_API_FILES = \
		libvirt_access.xml \
		libvirt_access_qemu.xml \
		libvirt_access_lxc.xml

1085 1086 1087 1088 1089 1090 1091
ACCESS_DRIVER_SOURCES = \
		access/viraccessperm.h access/viraccessperm.c \
		access/viraccessmanager.h access/viraccessmanager.c \
		access/viraccessdriver.h \
		access/viraccessdrivernop.h access/viraccessdrivernop.c \
		access/viraccessdriverstack.h access/viraccessdriverstack.c

1092 1093 1094 1095
ACCESS_DRIVER_POLKIT_SOURCES = \
		access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c

ACCESS_DRIVER_POLKIT_POLICY = \
1096
		$(srcdir)/access/org.libvirt.api.policy
1097 1098


1099
NODE_DEVICE_DRIVER_SOURCES =					\
O
Osier Yang 已提交
1100 1101
		node_device/node_device_driver.c		\
		node_device/node_device_driver.h		\
1102 1103
		node_device/node_device_linux_sysfs.c           \
		node_device/node_device_linux_sysfs.h
1104 1105

NODE_DEVICE_DRIVER_HAL_SOURCES =				\
1106
		node_device/node_device_hal.c			\
1107
		node_device/node_device_hal.h
1108

1109
NODE_DEVICE_DRIVER_UDEV_SOURCES =				\
D
Daniel Veillard 已提交
1110 1111
		node_device/node_device_udev.c			\
		node_device/node_device_udev.h
1112

J
Jiri Denemark 已提交
1113 1114 1115
CPU_SOURCES =							\
		cpu/cpu.h cpu/cpu.c				\
		cpu/cpu_x86.h cpu/cpu_x86.c cpu/cpu_x86_data.h	\
T
Thang Pham 已提交
1116
		cpu/cpu_s390.h cpu/cpu_s390.c			\
C
Chuck Short 已提交
1117
		cpu/cpu_arm.h cpu/cpu_arm.c			\
1118 1119 1120
		cpu/cpu_ppc64.h cpu/cpu_ppc64.c			\
		cpu/cpu_ppc64_data.h				\
		cpu/cpu_map.h cpu/cpu_map.c
1121

1122 1123 1124
VMX_SOURCES =							\
		vmx/vmx.c vmx/vmx.h

1125 1126
XENCONFIG_SOURCES =						\
		xenconfig/xenxs_private.h			\
1127
		xenconfig/xen_common.c xenconfig/xen_common.h   \
1128
		xenconfig/xen_sxpr.c xenconfig/xen_sxpr.h	\
1129
		xenconfig/xen_xm.c xenconfig/xen_xm.h
1130 1131 1132 1133
if WITH_LIBXL
XENCONFIG_SOURCES +=						\
		xenconfig/xen_xl.c xenconfig/xen_xl.h
endif WITH_LIBXL
1134

J
Jiri Denemark 已提交
1135 1136
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
1137
EXTRA_DIST +=	$(pkgdata_DATA)
1138

1139 1140 1141 1142 1143 1144
#########################
#
# Build up list of libvirt.la source files based on configure conditions
#
# First deal with sources usable in non-daemon context

1145
noinst_LTLIBRARIES = libvirt_util.la
1146 1147
libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
libvirt_la_BUILT_LIBADD = libvirt_util.la
1148 1149
libvirt_util_la_SOURCES =					\
		$(UTIL_SOURCES)
1150
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
1151
		$(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
1152
		$(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS)	\
1153
		$(POLKIT_CFLAGS) $(GNUTLS_CFLAGS) $(ACL_CFLAGS)
1154
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
1155
		$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
1156
		$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(WIN32_EXTRA_LIBS) $(LIBXML_LIBS) \
M
Michal Privoznik 已提交
1157
		$(SECDRIVER_LIBS) $(NUMACTL_LIBS) $(ACL_LIBS) \
1158
		$(POLKIT_LIBS)
1159

1160 1161

noinst_LTLIBRARIES += libvirt_conf.la
1162
libvirt_la_BUILT_LIBADD += libvirt_conf.la
1163
libvirt_conf_la_SOURCES = $(CONF_SOURCES)
1164 1165
libvirt_conf_la_CFLAGS = \
		-I$(srcdir)/conf $(AM_CFLAGS)
1166
libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS)
1167
libvirt_conf_la_LIBADD = $(LIBXML_LIBS)
1168

J
Jiri Denemark 已提交
1169
noinst_LTLIBRARIES += libvirt_cpu.la
1170
libvirt_la_BUILT_LIBADD += libvirt_cpu.la
J
Jiri Denemark 已提交
1171
libvirt_cpu_la_CFLAGS = \
1172
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jiri Denemark 已提交
1173 1174
libvirt_cpu_la_SOURCES = $(CPU_SOURCES)

1175 1176 1177 1178 1179 1180
noinst_LTLIBRARIES += libvirt_secret.la
libvirt_la_BUILT_LIBADD += libvirt_secret.la
libvirt_secret_la_CFLAGS = $(AM_CFLAGS)
libvirt_secret_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_secret_la_SOURCES = $(SECRET_UTIL_SOURCES)

1181 1182 1183 1184
if WITH_VMX
noinst_LTLIBRARIES += libvirt_vmx.la
libvirt_la_BUILT_LIBADD += libvirt_vmx.la
libvirt_vmx_la_CFLAGS = \
1185
		-I$(srcdir)/conf $(AM_CFLAGS)
1186
libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
1187
endif WITH_VMX
1188

J
Jim Fehlig 已提交
1189 1190 1191
if WITH_XENCONFIG
noinst_LTLIBRARIES += libvirt_xenconfig.la
libvirt_la_BUILT_LIBADD += libvirt_xenconfig.la
1192
libvirt_xenconfig_la_LIBADD = $(LIBXL_LIBS)
J
Jim Fehlig 已提交
1193
libvirt_xenconfig_la_CFLAGS = \
J
Jim Fehlig 已提交
1194
		-I$(srcdir)/conf -I$(srcdir)/libxl $(AM_CFLAGS)
J
Jim Fehlig 已提交
1195 1196
libvirt_xenconfig_la_SOURCES = $(XENCONFIG_SOURCES)
endif WITH_XENCONFIG
1197

1198

1199
noinst_LTLIBRARIES += libvirt_driver.la
1200
libvirt_la_BUILT_LIBADD += libvirt_driver.la
1201
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
1202

1203
libvirt_driver_la_CFLAGS = \
1204
		$(GNUTLS_CFLAGS) $(CURL_CFLAGS) $(XDR_CFLAGS) \
1205
		-I$(srcdir)/conf $(AM_CFLAGS)
1206
libvirt_driver_la_LIBADD = \
1207
		$(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS)
1208

1209 1210
# All .syms files should be placed in exactly one of these three lists,
# depending on whether they are stored in git and/or used in the build.
1211
SYM_FILES = $(USED_SYM_FILES)
1212
USED_SYM_FILES = $(srcdir)/libvirt_private.syms
1213 1214 1215
GENERATED_SYM_FILES = \
	$(ACCESS_DRIVER_SYM_FILES) \
	libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \
1216
	libvirt_admin.syms libvirt_admin.def \
1217
	$(NULL)
1218

1219
if WITH_TEST
D
Daniel P. Berrange 已提交
1220 1221 1222 1223

driver_test_asset_DATA = $(TEST_DRIVER_ASSETS)
driver_test_assetdir = $(pkgdatadir)

1224
noinst_LTLIBRARIES += libvirt_driver_test.la
1225
libvirt_la_BUILT_LIBADD += libvirt_driver_test.la
1226
libvirt_driver_test_la_CFLAGS = \
1227
		-I$(srcdir)/conf $(AM_CFLAGS)
1228
libvirt_driver_test_la_SOURCES = $(TEST_DRIVER_SOURCES)
1229
endif WITH_TEST
1230 1231

if WITH_REMOTE
1232
noinst_LTLIBRARIES += libvirt_driver_remote.la
1233
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
1234 1235
libvirt_driver_remote_la_CFLAGS =				\
		$(GNUTLS_CFLAGS)				\
E
Eric Blake 已提交
1236
		$(XDR_CFLAGS)					\
1237 1238
		-I$(srcdir)/conf				\
		-I$(srcdir)/rpc					\
1239 1240
		$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
1241 1242 1243 1244
libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) \
                libvirt-net-rpc-client.la \
                libvirt-net-rpc-server.la \
                libvirt-net-rpc.la
1245
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
1246

E
Eric Blake 已提交
1247
BUILT_SOURCES += $(REMOTE_DRIVER_GENERATED)
C
Chris Lalancette 已提交
1248

1249 1250
endif WITH_REMOTE

1251
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
1252
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
1253
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1254

1255
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
1256
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
1257
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1258

1259
if WITH_XEN
E
Eric Blake 已提交
1260 1261 1262
noinst_LTLIBRARIES += libvirt_driver_xen_impl.la
libvirt_driver_xen_la_SOURCES =
libvirt_driver_xen_la_LIBADD = libvirt_driver_xen_impl.la
1263 1264
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_xen.la
E
Eric Blake 已提交
1265
libvirt_driver_xen_la_LIBADD += ../gnulib/lib/libgnu.la
1266
libvirt_driver_xen_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1267
else ! WITH_DRIVER_MODULES
1268
noinst_LTLIBRARIES += libvirt_driver_xen.la
1269 1270
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_xen.la
1271
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1272

1273
libvirt_driver_xen_impl_la_CFLAGS =				\
1274
		$(XEN_CFLAGS)					\
1275 1276 1277
		-I$(srcdir)/access				\
		-I$(srcdir)/conf				\
		-I$(srcdir)/xenconfig				\
1278
		$(AM_CFLAGS)
E
Eric Blake 已提交
1279
libvirt_driver_xen_impl_la_LDFLAGS = $(AM_LDFLAGS)
P
Pavel Hrdina 已提交
1280
libvirt_driver_xen_impl_la_LIBADD = $(XEN_LIBS) libvirt_xenconfig.la
E
Eric Blake 已提交
1281
libvirt_driver_xen_impl_la_SOURCES = $(XEN_DRIVER_SOURCES)
1282
endif WITH_XEN
1283

1284 1285
if WITH_PHYP
noinst_LTLIBRARIES += libvirt_driver_phyp.la
1286
libvirt_la_BUILT_LIBADD += libvirt_driver_phyp.la
1287 1288
libvirt_driver_phyp_la_LIBADD = $(SSH2_LIBS)
libvirt_driver_phyp_la_CFLAGS = $(SSH2_CFLAGS) \
1289
		-I$(srcdir)/conf $(AM_CFLAGS)
1290
libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES)
1291
endif WITH_PHYP
1292

1293
if WITH_OPENVZ
1294
noinst_LTLIBRARIES += libvirt_driver_openvz.la
1295
libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la
1296
libvirt_driver_openvz_la_CFLAGS = \
1297
		-I$(srcdir)/conf $(AM_CFLAGS)
1298
libvirt_driver_openvz_la_SOURCES = $(OPENVZ_DRIVER_SOURCES)
1299
endif WITH_OPENVZ
1300

1301 1302 1303 1304
if WITH_VMWARE
noinst_LTLIBRARIES += libvirt_driver_vmware.la
libvirt_la_BUILT_LIBADD += libvirt_driver_vmware.la
libvirt_driver_vmware_la_CFLAGS = \
1305
		-I$(srcdir)/conf -I$(srcdir)/vmx $(AM_CFLAGS)
1306
libvirt_driver_vmware_la_SOURCES = $(VMWARE_DRIVER_SOURCES)
1307
endif WITH_VMWARE
1308

1309
if WITH_VBOX
M
Michal Privoznik 已提交
1310
noinst_LTLIBRARIES += \
1311
		libvirt_driver_vbox_impl.la
1312 1313 1314
libvirt_driver_vbox_la_SOURCES =
libvirt_driver_vbox_la_LIBADD = libvirt_driver_vbox_impl.la
if WITH_DRIVER_MODULES
M
Michal Privoznik 已提交
1315
mod_LTLIBRARIES += \
1316
		libvirt_driver_vbox.la
1317
libvirt_driver_vbox_la_LIBADD += ../gnulib/lib/libgnu.la
1318
libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1319
else ! WITH_DRIVER_MODULES
1320
noinst_LTLIBRARIES += libvirt_driver_vbox.la
1321 1322 1323
# GPLv2-only license requries that it be linked into
# libvirtd and *not* libvirt.so
#libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la
1324
endif ! WITH_DRIVER_MODULES
1325 1326

libvirt_driver_vbox_impl_la_CFLAGS =				\
1327 1328
		-I$(srcdir)/conf				\
		$(AM_CFLAGS)					\
M
Michal Privoznik 已提交
1329
		-DVBOX_DRIVER
1330
libvirt_driver_vbox_impl_la_LDFLAGS = $(AM_LDFLAGS)
1331
libvirt_driver_vbox_impl_la_LIBADD =  $(DLOPEN_LIBS)		\
1332
		$(WIN32_EXTRA_LIBS)				\
1333
		$(LIBXML_LIBS)
1334
libvirt_driver_vbox_impl_la_SOURCES = $(VBOX_DRIVER_SOURCES)
1335
endif WITH_VBOX
1336

1337 1338
if WITH_XENAPI
noinst_LTLIBRARIES += libvirt_driver_xenapi.la
1339
libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la
1340
libvirt_driver_xenapi_la_CFLAGS = $(XENAPI_CFLAGS) $(CURL_CFLAGS) \
P
Pavel Hrdina 已提交
1341
		-I$(srcdir)/conf -I$(srcdir)/xenconfig $(AM_CFLAGS)
1342
libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS)
1343
libvirt_driver_xenapi_la_LIBADD = $(XENAPI_LIBS) $(CURL_LIBS)
1344
libvirt_driver_xenapi_la_SOURCES = $(XENAPI_DRIVER_SOURCES)
1345
endif WITH_XENAPI
1346

J
Jim Fehlig 已提交
1347
if WITH_LIBXL
E
Eric Blake 已提交
1348 1349 1350
noinst_LTLIBRARIES += libvirt_driver_libxl_impl.la
libvirt_driver_libxl_la_SOURCES =
libvirt_driver_libxl_la_LIBADD = libvirt_driver_libxl_impl.la
J
Jim Fehlig 已提交
1351 1352
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_libxl.la
E
Eric Blake 已提交
1353
libvirt_driver_libxl_la_LIBADD += ../gnulib/lib/libgnu.la
1354
libvirt_driver_libxl_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1355
else ! WITH_DRIVER_MODULES
J
Jim Fehlig 已提交
1356 1357 1358
noinst_LTLIBRARIES += libvirt_driver_libxl.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_libxl.la
1359
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1360

1361 1362
libvirt_driver_libxl_impl_la_CFLAGS = 		\
		$(LIBXL_CFLAGS)			\
1363 1364
		-I$(srcdir)/access	\
		-I$(srcdir)/conf	\
1365
		-I$(srcdir)/secret      \
1366
		-I$(srcdir)/xenconfig	\
1367
		$(AM_CFLAGS)
E
Eric Blake 已提交
1368
libvirt_driver_libxl_impl_la_LDFLAGS = $(AM_LDFLAGS)
1369 1370 1371
libvirt_driver_libxl_impl_la_LIBADD = $(LIBXL_LIBS) \
				      libvirt_xenconfig.la \
				      libvirt_secret.la
E
Eric Blake 已提交
1372
libvirt_driver_libxl_impl_la_SOURCES = $(LIBXL_DRIVER_SOURCES)
1373 1374 1375 1376 1377 1378

conf_DATA += libxl/libxl.conf
augeas_DATA += libxl/libvirtd_libxl.aug
augeastest_DATA += test_libvirtd_libxl.aug
CLEANFILES += test_libvirtd_libxl.aug

1379
endif WITH_LIBXL
1380 1381
EXTRA_DIST += libxl/libxl.conf libxl/libvirtd_libxl.aug \
		libxl/test_libvirtd_libxl.aug.in
J
Jim Fehlig 已提交
1382

1383
if WITH_QEMU
E
Eric Blake 已提交
1384 1385 1386
noinst_LTLIBRARIES += libvirt_driver_qemu_impl.la
libvirt_driver_qemu_la_SOURCES =
libvirt_driver_qemu_la_LIBADD = libvirt_driver_qemu_impl.la
1387 1388
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_qemu.la
E
Eric Blake 已提交
1389
libvirt_driver_qemu_la_LIBADD += ../gnulib/lib/libgnu.la
1390
libvirt_driver_qemu_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1391
else ! WITH_DRIVER_MODULES
1392
noinst_LTLIBRARIES += libvirt_driver_qemu.la
1393
# Stateful, so linked to daemon instead
1394
#libvirt_la_BUILT_LIBADD += libvirt_driver_qemu.la
1395
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1396

1397 1398 1399
libvirt_driver_qemu_impl_la_CFLAGS = \
		$(GNUTLS_CFLAGS) \
		$(LIBNL_CFLAGS) \
1400
		$(XDR_CFLAGS) \
1401 1402
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1403
		-I$(srcdir)/secret \
1404
		$(AM_CFLAGS)
E
Eric Blake 已提交
1405
libvirt_driver_qemu_impl_la_LDFLAGS = $(AM_LDFLAGS)
1406
libvirt_driver_qemu_impl_la_LIBADD = $(CAPNG_LIBS) \
1407
                                $(GNUTLS_LIBS) \
1408 1409
				$(LIBNL_LIBS) \
				$(LIBXML_LIBS) \
1410
				libvirt_secret.la \
1411
				$(NULL)
E
Eric Blake 已提交
1412
libvirt_driver_qemu_impl_la_SOURCES = $(QEMU_DRIVER_SOURCES)
1413

A
Amy Griffis 已提交
1414
conf_DATA += qemu/qemu.conf
1415

1416
augeas_DATA += qemu/libvirtd_qemu.aug
1417 1418
augeastest_DATA += test_libvirtd_qemu.aug
CLEANFILES += test_libvirtd_qemu.aug
1419

1420
endif WITH_QEMU
1421
EXTRA_DIST += qemu/qemu.conf qemu/libvirtd_qemu.aug \
1422
		qemu/test_libvirtd_qemu.aug.in qemu/THREADS.txt
1423

1424 1425

if WITH_LXC
E
Eric Blake 已提交
1426 1427 1428
noinst_LTLIBRARIES += libvirt_driver_lxc_impl.la
libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = libvirt_driver_lxc_impl.la
1429 1430
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_lxc.la
E
Eric Blake 已提交
1431 1432
libvirt_driver_lxc_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_lxc_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1433
else ! WITH_DRIVER_MODULES
1434
noinst_LTLIBRARIES += libvirt_driver_lxc.la
1435
# Stateful, so linked to daemon instead
1436
#libvirt_la_BUILT_LIBADD += libvirt_driver_lxc.la
1437
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1438 1439

libvirt_driver_lxc_impl_la_CFLAGS = \
S
Serge Hallyn 已提交
1440
		$(LIBNL_CFLAGS) \
G
Gao feng 已提交
1441
		$(FUSE_CFLAGS) \
P
Pavel Fedin 已提交
1442
		$(XDR_CFLAGS) \
1443 1444
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1445
		$(AM_CFLAGS)
I
ik.nitk 已提交
1446 1447 1448 1449 1450 1451
libvirt_driver_lxc_impl_la_LIBADD = \
               $(CAPNG_LIBS) \
               $(LIBNL_LIBS) \
               $(LIBXML_LIBS) \
               $(FUSE_LIBS)

1452
if WITH_BLKID
E
Eric Blake 已提交
1453 1454
libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS)
1455
endif WITH_BLKID
1456
libvirt_driver_lxc_impl_la_LIBADD += $(SECDRIVER_LIBS)
E
Eric Blake 已提交
1457
libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES)
A
Amy Griffis 已提交
1458 1459 1460

conf_DATA += lxc/lxc.conf

1461
augeas_DATA += lxc/libvirtd_lxc.aug
1462 1463
augeastest_DATA += test_libvirtd_lxc.aug
CLEANFILES += test_libvirtd_lxc.aug
1464

1465
endif WITH_LXC
1466
EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in
1467

1468
if WITH_UML
E
Eric Blake 已提交
1469 1470 1471
noinst_LTLIBRARIES += libvirt_driver_uml_impl.la
libvirt_driver_uml_la_SOURCES =
libvirt_driver_uml_la_LIBADD = libvirt_driver_uml_impl.la
1472 1473
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_uml.la
E
Eric Blake 已提交
1474
libvirt_driver_uml_la_LIBADD += ../gnulib/lib/libgnu.la
1475
libvirt_driver_uml_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1476
else ! WITH_DRIVER_MODULES
1477 1478
noinst_LTLIBRARIES += libvirt_driver_uml.la
# Stateful, so linked to daemon instead
1479
#libvirt_la_BUILT_LIBADD += libvirt_driver_uml.la
1480
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1481

1482
libvirt_driver_uml_impl_la_CFLAGS = \
1483 1484
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1485
		$(AM_CFLAGS)
E
Eric Blake 已提交
1486
libvirt_driver_uml_impl_la_LDFLAGS = $(AM_LDFLAGS)
1487
# libvirt_driver_uml_impl_la_LIBADD =
E
Eric Blake 已提交
1488
libvirt_driver_uml_impl_la_SOURCES = $(UML_DRIVER_SOURCES)
1489
endif WITH_UML
1490

D
Daniel Veillard 已提交
1491

1492
BUILT_SOURCES += $(ESX_DRIVER_GENERATED)
D
Daniel Veillard 已提交
1493

1494 1495
ESX_GENERATED_STAMP = .esx_vi_generator.stamp

E
Eric Blake 已提交
1496 1497
EXTRA_DIST += $(ESX_GENERATED_STAMP)

1498 1499 1500
$(ESX_DRIVER_GENERATED): $(ESX_GENERATED_STAMP)

$(ESX_GENERATED_STAMP): $(srcdir)/esx/esx_vi_generator.input \
1501
                         $(srcdir)/esx/esx_vi_generator.py
1502 1503 1504 1505 1506
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/esx/esx_vi_generator.py \
	  && touch $@

MAINTAINERCLEANFILES += $(ESX_DRIVER_GENERATED) $(ESX_GENERATED_STAMP)

D
Daniel Veillard 已提交
1507

1508 1509
if WITH_ESX
noinst_LTLIBRARIES += libvirt_driver_esx.la
1510
libvirt_la_BUILT_LIBADD += libvirt_driver_esx.la
1511
libvirt_driver_esx_la_CFLAGS = $(CURL_CFLAGS) \
1512
		-I$(srcdir)/conf -I$(srcdir)/vmx $(AM_CFLAGS)
1513
libvirt_driver_esx_la_LDFLAGS = $(AM_LDFLAGS)
1514
libvirt_driver_esx_la_LIBADD = $(CURL_LIBS)
1515
libvirt_driver_esx_la_SOURCES = $(ESX_DRIVER_SOURCES)
1516
libvirt_driver_esx_la_DEPENDENCIES = $(ESX_DRIVER_GENERATED)
1517
endif WITH_ESX
1518

M
Matthias Bolte 已提交
1519

1520 1521
BUILT_SOURCES += $(HYPERV_DRIVER_GENERATED)

1522 1523
HYPERV_GENERATED_STAMP = .hyperv_wmi_generator.stamp

E
Eric Blake 已提交
1524 1525
EXTRA_DIST += $(HYPERV_GENERATED_STAMP)

1526 1527 1528
$(HYPERV_DRIVER_GENERATED): $(HYPERV_GENERATED_STAMP)

$(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \
1529
                            $(srcdir)/hyperv/hyperv_wmi_generator.py
1530 1531
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) \
	  $(srcdir)/hyperv/hyperv_wmi_generator.py \
1532 1533 1534
	  && touch $@

MAINTAINERCLEANFILES += $(HYPERV_DRIVER_GENERATED) $(HYPERV_GENERATED_STAMP)
1535

M
Matthias Bolte 已提交
1536 1537 1538 1539
if WITH_HYPERV
noinst_LTLIBRARIES += libvirt_driver_hyperv.la
libvirt_la_BUILT_LIBADD += libvirt_driver_hyperv.la
libvirt_driver_hyperv_la_CFLAGS = $(OPENWSMAN_CFLAGS) \
1540
		-I$(srcdir)/conf $(AM_CFLAGS)
M
Matthias Bolte 已提交
1541 1542 1543
libvirt_driver_hyperv_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_hyperv_la_LIBADD = $(OPENWSMAN_LIBS)
libvirt_driver_hyperv_la_SOURCES = $(HYPERV_DRIVER_SOURCES)
1544
endif WITH_HYPERV
M
Matthias Bolte 已提交
1545

1546
if WITH_VZ
1547 1548 1549 1550 1551 1552 1553 1554
noinst_LTLIBRARIES += libvirt_driver_vz_impl.la
libvirt_driver_vz_la_SOURCES =
libvirt_driver_vz_la_LIBADD = libvirt_driver_vz_impl.la
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_vz.la
libvirt_driver_vz_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_vz_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
else ! WITH_DRIVER_MODULES
1555
noinst_LTLIBRARIES += libvirt_driver_vz.la
1556 1557
endif ! WITH_DRIVER_MODULES
libvirt_driver_vz_impl_la_CFLAGS = \
1558 1559 1560
		-I$(srcdir)/conf \
		-I$(srcdir)/access \
		$(AM_CFLAGS) \
1561
		$(PARALLELS_SDK_CFLAGS) $(LIBNL_CFLAGS)
1562 1563
libvirt_driver_vz_impl_la_SOURCES = $(VZ_DRIVER_SOURCES)
libvirt_driver_vz_impl_la_LIBADD =  $(PARALLELS_SDK_LIBS) $(LIBNL_LIBS)
1564
endif WITH_VZ
D
Dmitry Guryanov 已提交
1565

R
Roman Bogorodskiy 已提交
1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578
if WITH_BHYVE
noinst_LTLIBRARIES += libvirt_driver_bhyve_impl.la
libvirt_driver_bhyve_la_SOURCES =
libvirt_driver_bhyve_la_LIBADD = libvirt_driver_bhyve_impl.la
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_bhyve.la
libvirt_driver_bhyve_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_bhyve_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
else ! WITH_DRIVER_MODULES
noinst_LTLIBRARIES += libvirt_driver_bhyve.la
endif ! WITH_DRIVER_MODULES

libvirt_driver_bhyve_impl_la_CFLAGS = \
1579 1580
	-I$(srcdir)/access \
	-I$(srcdir)/conf \
R
Roman Bogorodskiy 已提交
1581 1582 1583
	$(AM_CFLAGS)
libvirt_driver_bhyve_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_bhyve_impl_la_SOURCES = $(BHYVE_DRIVER_SOURCES)
1584 1585 1586 1587

conf_DATA += bhyve/bhyve.conf
augeas_DATA += bhyve/libvirtd_bhyve.aug
augeastest_DATA += test_libvirtd_bhyve.aug
R
Roman Bogorodskiy 已提交
1588
endif WITH_BHYVE
1589 1590 1591
EXTRA_DIST += bhyve/bhyve.conf \
	bhyve/libvirtd_bhyve.aug \
	bhyve/test_libvirtd_bhyve.aug.in
R
Roman Bogorodskiy 已提交
1592

1593
if WITH_NETWORK
E
Eric Blake 已提交
1594 1595 1596
noinst_LTLIBRARIES += libvirt_driver_network_impl.la
libvirt_driver_network_la_SOURCES =
libvirt_driver_network_la_LIBADD = libvirt_driver_network_impl.la
1597 1598
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_network.la
1599 1600 1601 1602
libvirt_driver_network_la_LIBADD += ../gnulib/lib/libgnu.la \
	$(LIBNL_LIBS) \
	$(DBUS_LIBS) \
	$(NULL)
E
Eric Blake 已提交
1603
libvirt_driver_network_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1604
else ! WITH_DRIVER_MODULES
1605
noinst_LTLIBRARIES += libvirt_driver_network.la
1606
# Stateful, so linked to daemon instead
1607
#libvirt_la_BUILT_LIBADD += libvirt_driver_network.la
1608
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1609 1610

libvirt_driver_network_impl_la_CFLAGS = \
1611 1612
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1613 1614
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1615
		$(AM_CFLAGS)
E
Eric Blake 已提交
1616
libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
1617
libvirt_driver_network_impl_la_LIBADD  = $(DBUS_LIBS)
1618
endif WITH_NETWORK
1619 1620 1621
EXTRA_DIST += network/default.xml


1622
if WITH_INTERFACE
1623 1624
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_interface.la
1625
else ! WITH_DRIVER_MODULES
1626
noinst_LTLIBRARIES += libvirt_driver_interface.la
1627 1628
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_interface.la
1629
endif ! WITH_DRIVER_MODULES
1630
libvirt_driver_interface_la_CFLAGS = \
1631 1632
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1633
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1634
libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS)
1635 1636 1637 1638
libvirt_driver_interface_la_LIBADD =
if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
1639
endif WITH_NETCF
1640
if WITH_UDEV
1641 1642
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
1643
endif WITH_UDEV
1644
if WITH_DRIVER_MODULES
1645
libvirt_driver_interface_la_LIBADD += ../gnulib/lib/libgnu.la
1646
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
1647
endif WITH_DRIVER_MODULES
1648
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
1649
endif WITH_INTERFACE
D
Daniel Veillard 已提交
1650

D
Daniel P. Berrange 已提交
1651
if WITH_SECRETS
1652 1653
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_secret.la
1654
else ! WITH_DRIVER_MODULES
1655
noinst_LTLIBRARIES += libvirt_driver_secret.la
1656
# Stateful, so linked to daemon instead
1657
#libvirt_la_BUILT_LIBADD += libvirt_driver_secret.la
1658
endif ! WITH_DRIVER_MODULES
1659
libvirt_driver_secret_la_CFLAGS = \
1660 1661
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1662
		$(AM_CFLAGS)
1663
if WITH_DRIVER_MODULES
1664
libvirt_driver_secret_la_LIBADD = ../gnulib/lib/libgnu.la
1665
libvirt_driver_secret_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1666
endif WITH_DRIVER_MODULES
1667
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
1668
endif WITH_SECRETS
1669

1670
# Needed to keep automake quiet about conditionals
1671 1672
libvirt_driver_storage_impl_la_SOURCES =
libvirt_driver_storage_impl_la_CFLAGS = \
1673 1674
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1675
		-I$(srcdir)/secret \
1676
		$(AM_CFLAGS)
1677 1678
libvirt_driver_storage_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_storage_impl_la_LIBADD =
1679
libvirt_driver_storage_impl_la_LIBADD += $(SECDRIVER_LIBS) $(LIBXML_LIBS)
1680
if WITH_BLKID
1681 1682
libvirt_driver_storage_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(BLKID_LIBS)
1683
endif WITH_BLKID
1684 1685 1686 1687 1688 1689

if WITH_DRIVER_MODULES
storagebackenddir = $(libdir)/libvirt/storage-backend
storagebackend_LTLIBRARIES =
endif WITH_DRIVER_MODULES

1690
if WITH_STORAGE
1691 1692 1693
noinst_LTLIBRARIES += libvirt_driver_storage_impl.la
libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_LIBADD = libvirt_driver_storage_impl.la
1694 1695
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_storage.la
1696
libvirt_driver_storage_la_LIBADD += ../gnulib/lib/libgnu.la
1697
libvirt_driver_storage_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1698
else ! WITH_DRIVER_MODULES
1699
noinst_LTLIBRARIES += libvirt_driver_storage.la
1700
# Stateful, so linked to daemon instead
1701
#libvirt_la_BUILT_LIBADD += libvirt_driver_storage.la
1702
endif ! WITH_DRIVER_MODULES
1703
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
1704 1705 1706 1707 1708 1709 1710


libvirt_storage_backend_fs_la_SOURCES = $(STORAGE_DRIVER_FS_SOURCES)
libvirt_storage_backend_fs_la_CFLAGS =	\
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1711 1712 1713 1714 1715
if WITH_DRIVER_MODULES
storagebackend_LTLIBRARIES += libvirt_storage_backend_fs.la
libvirt_storage_backend_fs_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
else ! WITH_DRIVER_MODULES
1716 1717
noinst_LTLIBRARIES += libvirt_storage_backend_fs.la
libvirt_driver_storage_impl_la_LIBADD += libvirt_storage_backend_fs.la
1718
endif ! WITH_DRIVER_MODULES
1719
endif WITH_STORAGE
1720

1721
if WITH_STORAGE_LVM
1722 1723 1724 1725 1726 1727
libvirt_storage_backend_logical_la_SOURCES = \
	$(STORAGE_DRIVER_LVM_SOURCES)
libvirt_storage_backend_logical_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1728 1729 1730 1731 1732
if WITH_DRIVER_MODULES
storagebackend_LTLIBRARIES += libvirt_storage_backend_logical.la
libvirt_storage_backend_logical_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
else ! WITH_DRIVER_MODULES
1733 1734 1735
noinst_LTLIBRARIES += libvirt_storage_backend_logical.la
libvirt_driver_storage_impl_la_LIBADD += \
	libvirt_storage_backend_logical.la
1736
endif ! WITH_DRIVER_MODULES
1737
endif WITH_STORAGE_LVM
1738

1739
if WITH_STORAGE_ISCSI
1740 1741 1742 1743 1744 1745 1746
libvirt_storage_backend_iscsi_la_SOURCES = \
	$(STORAGE_DRIVER_ISCSI_SOURCES)
libvirt_storage_backend_iscsi_la_CFLAGS = \
	-I$(srcdir)/conf \
	-I$(srcdir)/secret \
	$(AM_CFLAGS)

1747 1748 1749 1750 1751
if WITH_DRIVER_MODULES
storagebackend_LTLIBRARIES += libvirt_storage_backend_iscsi.la
libvirt_storage_backend_iscsi_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
else ! WITH_DRIVER_MODULES
1752 1753 1754
noinst_LTLIBRARIES += libvirt_storage_backend_iscsi.la
libvirt_driver_storage_impl_la_LIBADD += \
	libvirt_storage_backend_iscsi.la
1755
endif ! WITH_DRIVER_MODULES
1756
endif WITH_STORAGE_ISCSI
1757

1758
if WITH_STORAGE_SCSI
1759 1760 1761 1762 1763
libvirt_storage_backend_scsi_la_SOURCES = $(STORAGE_DRIVER_SCSI_SOURCES)
libvirt_storage_backend_scsi_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1764 1765 1766 1767 1768
if WITH_DRIVER_MODULES
storagebackend_LTLIBRARIES += libvirt_storage_backend_scsi.la
libvirt_storage_backend_scsi_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
else ! WITH_DRIVER_MODULES
1769 1770
noinst_LTLIBRARIES += libvirt_storage_backend_scsi.la
libvirt_driver_storage_impl_la_LIBADD += libvirt_storage_backend_scsi.la
1771
endif ! WITH_DRIVER_MODULES
1772
endif WITH_STORAGE_SCSI
1773

D
Dave Allan 已提交
1774
if WITH_STORAGE_MPATH
1775 1776 1777 1778 1779 1780 1781 1782
libvirt_storage_backend_mpath_la_SOURCES = \
	$(STORAGE_DRIVER_MPATH_SOURCES)
libvirt_storage_backend_mpath_la_LIBADD = $(DEVMAPPER_LIBS)
libvirt_storage_backend_mpath_la_CFLAGS =	\
	-I$(srcdir)/conf \
	$(DEVMAPPER_CFLAGS) \
	$(AM_CFLAGS)

1783 1784 1785 1786 1787
if WITH_DRIVER_MODULES
storagebackend_LTLIBRARIES += libvirt_storage_backend_mpath.la
libvirt_storage_backend_mpath_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
else ! WITH_DRIVER_MODULES
1788 1789 1790
noinst_LTLIBRARIES += libvirt_storage_backend_mpath.la
libvirt_driver_storage_impl_la_LIBADD += \
	libvirt_storage_backend_mpath.la
1791
endif ! WITH_DRIVER_MODULES
1792
endif WITH_STORAGE_MPATH
D
Dave Allan 已提交
1793

1794
if WITH_STORAGE_DISK
1795 1796 1797 1798 1799
libvirt_storage_backend_disk_la_SOURCES = $(STORAGE_DRIVER_DISK_SOURCES)
libvirt_storage_backend_disk_la_CFLAGS =	\
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1800 1801 1802 1803 1804
if WITH_DRIVER_MODULES
storagebackend_LTLIBRARIES += libvirt_storage_backend_disk.la
libvirt_storage_backend_disk_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
else ! WITH_DRIVER_MODULES
1805 1806
noinst_LTLIBRARIES += libvirt_storage_backend_disk.la
libvirt_driver_storage_impl_la_LIBADD += libvirt_storage_backend_disk.la
1807
endif ! WITH_DRIVER_MODULES
1808
endif WITH_STORAGE_DISK
1809

1810
if WITH_STORAGE_RBD
1811 1812 1813 1814 1815 1816 1817
libvirt_storage_backend_rbd_la_SOURCES = $(STORAGE_DRIVER_RBD_SOURCES)
libvirt_storage_backend_rbd_la_LIBADD = $(LIBRBD_LIBS)
libvirt_storage_backend_rbd_la_CFLAGS = \
	-I$(srcdir)/conf \
	-I$(srcdir)/secret \
	$(AM_CFLAGS)

1818 1819 1820 1821 1822
if WITH_DRIVER_MODULES
storagebackend_LTLIBRARIES += libvirt_storage_backend_rbd.la
libvirt_storage_backend_rbd_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
else ! WITH_DRIVER_MODULES
1823 1824
noinst_LTLIBRARIES += libvirt_storage_backend_rbd.la
libvirt_driver_storage_impl_la_LIBADD += libvirt_storage_backend_rbd.la
1825
endif ! WITH_DRIVER_MODULES
1826
endif WITH_STORAGE_RBD
1827

1828
if WITH_STORAGE_SHEEPDOG
1829 1830 1831 1832 1833 1834
libvirt_storage_backend_sheepdog_la_SOURCES = \
	$(STORAGE_DRIVER_SHEEPDOG_SOURCES)
libvirt_storage_backend_sheepdog_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847
libvirt_storage_backend_sheepdog_priv_la_SOURCES = \
	$(STORAGE_DRIVER_SHEEPDOG_SOURCES) \
	$(STORAGE_DRIVER_BACKEND_SOURCES)
libvirt_storage_backend_sheepdog_priv_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)
noinst_LTLIBRARIES += libvirt_storage_backend_sheepdog_priv.la

if WITH_DRIVER_MODULES
storagebackend_LTLIBRARIES += libvirt_storage_backend_sheepdog.la
libvirt_storage_backend_sheepdog_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
else ! WITH_DRIVER_MODULES
1848 1849 1850
noinst_LTLIBRARIES += libvirt_storage_backend_sheepdog.la
libvirt_driver_storage_impl_la_LIBADD += \
	libvirt_storage_backend_sheepdog.la
1851
endif ! WITH_DRIVER_MODULES
1852
endif WITH_STORAGE_SHEEPDOG
1853

1854
if WITH_STORAGE_GLUSTER
1855 1856 1857 1858 1859 1860 1861 1862
libvirt_storage_backend_gluster_la_SOURCES = \
	$(STORAGE_DRIVER_GLUSTER_SOURCES)
libvirt_storage_backend_gluster_la_LIBADD = $(GLUSTERFS_LIBS)
libvirt_storage_backend_gluster_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(GLUSTERFS_CFLAGS) \
	$(AM_CFLAGS)

1863 1864 1865 1866 1867
if WITH_DRIVER_MODULES
storagebackend_LTLIBRARIES += libvirt_storage_backend_gluster.la
libvirt_storage_backend_gluster_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
else ! WITH_DRIVER_MODULES
1868 1869 1870
noinst_LTLIBRARIES += libvirt_storage_backend_gluster.la
libvirt_driver_storage_impl_la_LIBADD += \
	libvirt_storage_backend_gluster.la
1871
endif ! WITH_DRIVER_MODULES
1872 1873
endif WITH_STORAGE_GLUSTER

R
Roman Bogorodskiy 已提交
1874
if WITH_STORAGE_ZFS
1875 1876 1877 1878 1879
libvirt_storage_backend_zfs_la_SOURCES = $(STORAGE_DRIVER_ZFS_SOURCES)
libvirt_storage_backend_zfs_la_CFLAGS =	\
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1880 1881 1882 1883 1884
if WITH_DRIVER_MODULES
storagebackend_LTLIBRARIES += libvirt_storage_backend_zfs.la
libvirt_storage_backend_zfs_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
else ! WITH_DRIVER_MODULES
1885 1886
noinst_LTLIBRARIES += libvirt_storage_backend_zfs.la
libvirt_driver_storage_impl_la_LIBADD += libvirt_storage_backend_zfs.la
1887
endif ! WITH_DRIVER_MODULES
R
Roman Bogorodskiy 已提交
1888 1889
endif WITH_STORAGE_ZFS

1890
if WITH_STORAGE_VSTORAGE
1891 1892 1893 1894 1895 1896
libvirt_storage_backend_vstorage_la_SOURCES = \
	$(STORAGE_DRIVER_VSTORAGE_SOURCES)
libvirt_storage_backend_vstorage_la_CFLAGS =	\
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1897 1898 1899 1900 1901
if WITH_DRIVER_MODULES
storagebackend_LTLIBRARIES += libvirt_storage_backend_vstorage.la
libvirt_storage_backend_vstorage_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
else ! WITH_DRIVER_MODULES
1902 1903 1904
noinst_LTLIBRARIES += libvirt_storage_backend_vstorage.la
libvirt_driver_storage_impl_la_LIBADD += \
	libvirt_storage_backend_vstorage.la
1905
endif ! WITH_DRIVER_MODULES
1906 1907
endif WITH_STORAGE_VSTORAGE

1908 1909 1910 1911
if WITH_NODE_DEVICES
# Needed to keep automake quiet about conditionals
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nodedev.la
1912
else ! WITH_DRIVER_MODULES
1913 1914
noinst_LTLIBRARIES += libvirt_driver_nodedev.la
# Stateful, so linked to daemon instead
1915
#libvirt_la_BUILT_LIBADD += libvirt_driver_nodedev.la
1916
endif ! WITH_DRIVER_MODULES
1917 1918
libvirt_driver_nodedev_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES)

1919
libvirt_driver_nodedev_la_CFLAGS = \
1920 1921
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1922
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1923
libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS)
1924
libvirt_driver_nodedev_la_LIBADD =
1925

D
Doug Goldstein 已提交
1926
if WITH_LIBVIRTD
1927
if WITH_HAL
1928 1929
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS)
1930
libvirt_driver_nodedev_la_LIBADD += $(HAL_LIBS)
1931
endif WITH_HAL
1932
if WITH_UDEV
1933
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES)
1934
libvirt_driver_nodedev_la_CFLAGS += $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS)
1935
libvirt_driver_nodedev_la_LIBADD += $(UDEV_LIBS) $(PCIACCESS_LIBS)
1936 1937
endif WITH_UDEV
endif WITH_LIBVIRTD
1938 1939

if WITH_DRIVER_MODULES
1940
libvirt_driver_nodedev_la_LIBADD += ../gnulib/lib/libgnu.la
1941
libvirt_driver_nodedev_la_LDFLAGS += -module -avoid-version
1942 1943
endif WITH_DRIVER_MODULES
endif WITH_NODE_DEVICES
1944 1945


1946
if WITH_NWFILTER
1947 1948 1949
noinst_LTLIBRARIES += libvirt_driver_nwfilter_impl.la
libvirt_driver_nwfilter_la_SOURCES =
libvirt_driver_nwfilter_la_LIBADD = libvirt_driver_nwfilter_impl.la
1950 1951
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nwfilter.la
1952
libvirt_driver_nwfilter_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1953
else ! WITH_DRIVER_MODULES
1954
noinst_LTLIBRARIES += libvirt_driver_nwfilter.la
1955 1956
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_nwfilter.la
1957
endif ! WITH_DRIVER_MODULES
1958
libvirt_driver_nwfilter_impl_la_CFLAGS = \
1959 1960 1961
		$(LIBPCAP_CFLAGS) \
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1962 1963
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1964
		$(AM_CFLAGS)
1965 1966 1967 1968 1969
libvirt_driver_nwfilter_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_nwfilter_impl_la_LIBADD = \
		$(LIBPCAP_LIBS) \
		$(LIBNL_LIBS) \
		$(DBUS_LIBS)
1970
if WITH_DRIVER_MODULES
1971 1972
libvirt_driver_nwfilter_impl_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_nwfilter_impl_la_LDFLAGS += -module -avoid-version
1973
endif WITH_DRIVER_MODULES
1974
libvirt_driver_nwfilter_impl_la_SOURCES = $(NWFILTER_DRIVER_SOURCES)
1975
endif WITH_NWFILTER
1976 1977


1978 1979 1980 1981
libvirt_security_manager_la_SOURCES = $(SECURITY_DRIVER_SOURCES)
noinst_LTLIBRARIES += libvirt_security_manager.la
libvirt_la_BUILT_LIBADD += libvirt_security_manager.la
libvirt_security_manager_la_CFLAGS = \
1982
		-I$(srcdir)/conf $(AM_CFLAGS)
1983
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
1984
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
1985
if WITH_SECDRIVER_SELINUX
1986 1987
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
1988
endif WITH_SECDRIVER_SELINUX
J
Jamie Strandboge 已提交
1989
if WITH_SECDRIVER_APPARMOR
1990 1991
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
1992
endif WITH_SECDRIVER_APPARMOR
1993

1994 1995
libvirt_driver_access_la_SOURCES = \
	$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
1996 1997 1998
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
1999
		-I$(srcdir)/conf $(AM_CFLAGS)
2000 2001 2002
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD =

2003 2004
EXTRA_DIST += access/genpolkit.pl

2005 2006 2007 2008
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
    $(srcdir)/access/genpolkit.pl Makefile.am
	$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@

2009 2010 2011 2012
if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)

polkitactiondir = $(datadir)/polkit-1/actions
2013
if WITH_LIBVIRTD
2014
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
2015
endif WITH_LIBVIRTD
2016 2017 2018

CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
2019
else ! WITH_POLKIT1
2020
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
2021
endif ! WITH_POLKIT1
2022

2023

2024 2025
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039

libvirt_access.syms: $(srcdir)/rpc/gendispatch.pl \
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclsym \
	  remote REMOTE $(REMOTE_PROTOCOL) > $@
libvirt_access_qemu.syms: $(srcdir)/rpc/gendispatch.pl \
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclsym \
	  qemu QEMU $(QEMU_PROTOCOL) > $@
libvirt_access_lxc.syms: $(srcdir)/rpc/gendispatch.pl \
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclsym \
	  lxc LXC $(LXC_PROTOCOL) > $@

2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052
libvirt_access.xml: $(srcdir)/rpc/gendispatch.pl \
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclapi \
	  remote REMOTE $(REMOTE_PROTOCOL) > $@
libvirt_access_qemu.xml: $(srcdir)/rpc/gendispatch.pl \
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclapi \
	  qemu QEMU $(QEMU_PROTOCOL) > $@
libvirt_access_lxc.xml: $(srcdir)/rpc/gendispatch.pl \
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclapi \
	  lxc LXC $(LXC_PROTOCOL) > $@

E
Eric Blake 已提交
2053
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
2054 2055
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
2056 2057 2058
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
2059 2060
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
2061 2062
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
	  > $(srcdir)/access/viraccessapicheck.c
2063

E
Eric Blake 已提交
2064
access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
2065 2066
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
2067 2068 2069
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheckqemu.h
access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
2070 2071
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
2072 2073
	  qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h \
	  > $(srcdir)/access/viraccessapicheckqemu.c
2074

E
Eric Blake 已提交
2075
access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
2076 2077
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
2078 2079 2080
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/access/viraccessapichecklxc.h
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
2081 2082
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
2083 2084
	  lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \
	  > $(srcdir)/access/viraccessapichecklxc.c
2085

2086 2087 2088
# Add all conditional sources just in case...
EXTRA_DIST +=							\
		$(TEST_DRIVER_SOURCES)				\
D
Daniel P. Berrange 已提交
2089
		$(TEST_DRIVER_ASSETS)				\
2090 2091 2092 2093
		$(REMOTE_DRIVER_SOURCES)			\
		$(XEN_DRIVER_SOURCES)				\
		$(QEMU_DRIVER_SOURCES)				\
		$(LXC_DRIVER_SOURCES)				\
2094
		$(UML_DRIVER_SOURCES)				\
2095
		$(OPENVZ_DRIVER_SOURCES)			\
2096
		$(PHYP_DRIVER_SOURCES)				\
2097
		$(VBOX_DRIVER_SOURCES)				\
2098
		$(XENAPI_DRIVER_SOURCES)			\
O
Osier Yang 已提交
2099
		$(LIBXL_DRIVER_SOURCES)				\
2100
		$(ESX_DRIVER_SOURCES)				\
2101
		$(ESX_DRIVER_EXTRA_DIST)			\
M
Matthias Bolte 已提交
2102
		$(HYPERV_DRIVER_SOURCES)			\
2103
		$(HYPERV_DRIVER_EXTRA_DIST)			\
2104
		$(VZ_DRIVER_SOURCES)				\
R
Roman Bogorodskiy 已提交
2105
		$(BHYVE_DRIVER_SOURCES)				\
2106
		$(NETWORK_DRIVER_SOURCES)			\
2107
		$(INTERFACE_DRIVER_SOURCES)			\
2108 2109 2110 2111
		$(STORAGE_DRIVER_SOURCES)			\
		$(STORAGE_DRIVER_FS_SOURCES)			\
		$(STORAGE_DRIVER_LVM_SOURCES)			\
		$(STORAGE_DRIVER_ISCSI_SOURCES)			\
2112
		$(STORAGE_DRIVER_SCSI_SOURCES)			\
D
Dave Allan 已提交
2113
		$(STORAGE_DRIVER_MPATH_SOURCES)			\
2114
		$(STORAGE_DRIVER_DISK_SOURCES)			\
2115
		$(STORAGE_DRIVER_RBD_SOURCES)			\
2116
		$(STORAGE_DRIVER_SHEEPDOG_SOURCES)		\
2117
		$(STORAGE_DRIVER_GLUSTER_SOURCES)		\
R
Roman Bogorodskiy 已提交
2118
		$(STORAGE_DRIVER_ZFS_SOURCES)			\
2119
		$(STORAGE_DRIVER_VSTORAGE_SOURCES)		\
2120 2121
		$(NODE_DEVICE_DRIVER_SOURCES)			\
		$(NODE_DEVICE_DRIVER_HAL_SOURCES)		\
2122
		$(NODE_DEVICE_DRIVER_UDEV_SOURCES)		\
2123
		$(NWFILTER_DRIVER_SOURCES)			\
2124
		$(SECURITY_DRIVER_SELINUX_SOURCES)		\
J
Jamie Strandboge 已提交
2125
		$(SECURITY_DRIVER_APPARMOR_SOURCES)		\
D
Daniel P. Berrange 已提交
2126
		$(SECRET_DRIVER_SOURCES)			\
2127
		$(SECRET_UTIL_SOURCES)				\
2128
		$(VBOX_DRIVER_EXTRA_DIST)			\
2129
		$(VMWARE_DRIVER_SOURCES)			\
J
Jim Fehlig 已提交
2130
		$(XENCONFIG_SOURCES)				\
2131
		$(ACCESS_DRIVER_POLKIT_POLICY)
2132

2133 2134
check-local: check-augeas

2135 2136 2137 2138 2139
.PHONY: check-augeas \
	check-augeas-qemu \
	check-augeas-lxc \
	check-augeas-sanlock \
	check-augeas-lockd \
2140
	check-augeas-libxl \
2141
	check-augeas-bhyve \
2142
	$(NULL)
2143

2144
check-augeas: check-augeas-qemu check-augeas-lxc check-augeas-sanlock \
2145
	check-augeas-lockd check-augeas-virtlockd check-augeas-libxl \
2146
	check-augeas-bhyve check-augeas-virtlogd
2147

2148
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
2149
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
2150

2151
if WITH_QEMU
2152 2153
test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
		$(srcdir)/qemu/qemu.conf $(AUG_GENTEST)
E
Eric Blake 已提交
2154
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
2155

2156
check-augeas-qemu: test_libvirtd_qemu.aug
2157
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
2158
	    '$(AUGPARSE)' -I $(srcdir)/qemu test_libvirtd_qemu.aug; \
2159
	fi
2160
else ! WITH_QEMU
2161
check-augeas-qemu:
2162
endif ! WITH_QEMU
2163

2164
if WITH_LXC
2165 2166
test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
		$(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
E
Eric Blake 已提交
2167
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
2168

2169
check-augeas-lxc: test_libvirtd_lxc.aug
2170
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
2171
	    '$(AUGPARSE)' -I $(srcdir)/lxc test_libvirtd_lxc.aug; \
2172
	fi
2173
else ! WITH_LXC
2174
check-augeas-lxc:
2175
endif ! WITH_LXC
2176

2177
if WITH_SANLOCK
2178 2179
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
2180
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
2181

2182
check-augeas-sanlock: test_libvirt_sanlock.aug
2183
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
2184
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
2185
	fi
2186
else ! WITH_SANLOCK
2187
check-augeas-sanlock:
2188
endif ! WITH_SANLOCK
2189

2190
if WITH_QEMU
2191 2192 2193
test_libvirt_lockd.aug: locking/test_libvirt_lockd.aug.in \
		locking/qemu-lockd.conf $(AUG_GENTEST)
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-lockd.conf $< $@
2194 2195 2196
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
2197

2198 2199
test_virtlockd.aug: locking/test_virtlockd.aug.in \
		locking/virtlockd.conf $(AUG_GENTEST)
2200
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
2201

2202
if WITH_QEMU
2203 2204 2205 2206
check-augeas-lockd: test_libvirt_lockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_lockd.aug; \
	fi
2207 2208 2209
else ! WITH_QEMU
check-augeas-lockd:
endif ! WITH_QEMU
2210

2211 2212 2213 2214 2215
check-augeas-virtlockd: test_virtlockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
	fi

2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228
if WITH_LIBXL
test_libvirtd_libxl.aug: libxl/test_libvirtd_libxl.aug.in \
		$(srcdir)/libxl/libxl.conf $(AUG_GENTEST)
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/libxl/libxl.conf $< $@

check-augeas-libxl: test_libvirtd_libxl.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/libxl test_libvirtd_libxl.aug; \
	fi
else ! WITH_LIBXL
check-augeas-libxl:
endif ! WITH_LIBXL

2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241
if WITH_BHYVE
test_libvirtd_bhyve.aug: bhyve/test_libvirtd_bhyve.aug.in \
		$(srcdir)/bhyve/bhyve.conf $(AUG_GENTEST)
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/bhyve/bhyve.conf $< $@

check-augeas-bhyve: test_libvirtd_bhyve.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/bhyve test_libvirtd_bhyve.aug; \
	fi
else ! WITH_BHYVE
check-augeas-bhyve:
endif ! WITH_BHYVE

2242 2243 2244 2245 2246 2247 2248 2249 2250
test_virtlogd.aug: logging/test_virtlogd.aug.in \
		logging/virtlogd.conf $(AUG_GENTEST)
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/logging/virtlogd.conf $< $@

check-augeas-virtlogd: test_virtlogd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/logging test_virtlogd.aug; \
	fi

2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269
#
# Build our version script.  This is composed of three parts:
#
# 1. libvirt_public.syms - public API.  These functions are always
# present in the library and should never change incompatibly.
#
# 2. libvirt_private.syms - private API.  These symbols are private and
# semantics may change on every release, hence the version number is
# spliced in at build time. This ensures that if libvirtd, virsh, or a
# driver module was built against one libvirt release, it will refuse to
# load with another where symbols may have same names but different
# semantics. Such symbols should never be visible in an (installed)
# public header file.
#
# 3. libvirt_*.syms - dynamic private API.  Like libvirt_private.syms,
# except that build options (such as --enable-debug) can mean these
# symbols aren't present at all.
#

2270
if WITH_DRIVER_MODULES
2271
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
2272
else ! WITH_DRIVER_MODULES
2273
SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
2274
endif ! WITH_DRIVER_MODULES
2275

2276
if WITH_LINUX
2277
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
2278
else ! WITH_LINUX
2279
SYM_FILES += $(srcdir)/libvirt_linux.syms
2280
endif ! WITH_LINUX
2281

2282
if WITH_ESX
2283
USED_SYM_FILES += $(srcdir)/libvirt_esx.syms
2284
else ! WITH_ESX
2285
SYM_FILES += $(srcdir)/libvirt_esx.syms
2286
endif ! WITH_ESX
2287

E
Eric Blake 已提交
2288 2289 2290 2291 2292 2293
if WITH_REMOTE
USED_SYM_FILES += $(srcdir)/libvirt_remote.syms
else ! WITH_REMOTE
SYM_FILES += $(srcdir)/libvirt_remote.syms
endif ! WITH_REMOTE

2294
if WITH_OPENVZ
2295
USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms
2296
else ! WITH_OPENVZ
2297
SYM_FILES += $(srcdir)/libvirt_openvz.syms
2298
endif ! WITH_OPENVZ
2299

2300
if WITH_VMX
2301
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
2302
else ! WITH_VMX
2303
SYM_FILES += $(srcdir)/libvirt_vmx.syms
2304
endif ! WITH_VMX
2305

2306 2307 2308 2309 2310 2311
if WITH_VMWARE
USED_SYM_FILES += $(srcdir)/libvirt_vmware.syms
else ! WITH_VMWARE
SYM_FILES += $(srcdir)/libvirt_vmware.syms
endif ! WITH_VMWARE

J
Jim Fehlig 已提交
2312 2313 2314 2315 2316
if WITH_XENCONFIG
USED_SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
else ! WITH_XENCONFIG
SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
endif ! WITH_XENCONFIG
2317

2318 2319 2320 2321 2322 2323
if WITH_LIBXL
USED_SYM_FILES += $(srcdir)/libvirt_xenxlconfig.syms
else ! WITH_LIBXL
SYM_FILES += $(srcdir)/libvirt_xenxlconfig.syms
endif ! WITH_LIBXL

2324
if WITH_SASL
2325
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
2326
else ! WITH_SASL
2327
SYM_FILES += $(srcdir)/libvirt_sasl.syms
2328
endif ! WITH_SASL
E
Eric Blake 已提交
2329

2330 2331
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2332
else ! WITH_GNUTLS
2333
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2334
endif ! WITH_GNUTLS
2335

2336
if WITH_SSH2
2337
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2338
else ! WITH_SSH2
2339
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2340
endif ! WITH_SSH2
2341

2342
if WITH_ATOMIC_OPS_PTHREAD
2343
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
2344
else ! WITH_ATOMIC_OPS_PTHREAD
2345
SYM_FILES += $(srcdir)/libvirt_atomic.syms
2346
endif ! WITH_ATOMIC_OPS_PTHREAD
2347

2348 2349 2350 2351 2352 2353
if WITH_LIBSSH
USED_SYM_FILES += $(srcdir)/libvirt_libssh.syms
else ! WITH_LIBSSH
SYM_FILES += $(srcdir)/libvirt_libssh.syms
endif ! WITH_LIBSSH

2354
EXTRA_DIST += \
2355 2356 2357
	libvirt_public.syms		\
	libvirt_lxc.syms		\
	libvirt_qemu.syms		\
2358
	libvirt_admin_public.syms	\
2359
	$(SYM_FILES)			\
2360
	$(ADMIN_SYM_FILES)		\
2361
	$(NULL)
2362

2363
BUILT_SOURCES += $(GENERATED_SYM_FILES)
2364

2365 2366
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(ACCESS_DRIVER_SYM_FILES) \
2367
		$(top_builddir)/config.status
2368 2369 2370 2371 2372 2373
	$(AM_V_GEN)rm -f $@-tmp $@ ; \
	printf '# WARNING: generated from the following:\n# $^\n\n' >$@-tmp && \
	cat $(srcdir)/libvirt_public.syms >>$@-tmp && \
	printf '\n\n# Private symbols\n\n' >>$@-tmp && \
	printf 'LIBVIRT_PRIVATE_$(VERSION) {\n\n'  >>$@-tmp && \
	printf 'global:\n\n' >>$@-tmp && \
2374
	cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
2375 2376
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
2377
	mv $@-tmp libvirt.syms
2378

2379
%.def: %.syms
2380 2381
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
2382 2383
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d'	\
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
2384
	chmod a-w $@-tmp && \
2385
	mv $@-tmp $@
2386

2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399
libvirt_admin.syms: libvirt_admin_public.syms $(ADMIN_SYM_FILES) \
		$(top_builddir)/config.status
	$(AM_V_GEN)rm -f $@-tmp $@ ; \
	printf '# WARNING: generated from the following:\n# $^\n\n' >$@-tmp && \
	cat $(srcdir)/libvirt_admin_public.syms >>$@-tmp && \
	printf '\n\n# Private symbols\n\n' >>$@-tmp && \
	printf 'LIBVIRT_ADMIN_PRIVATE_$(VERSION) {\n\n'  >>$@-tmp && \
	printf 'global:\n\n' >>$@-tmp && \
	cat $(ADMIN_SYM_FILES) >>$@-tmp && \
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
	mv $@-tmp libvirt_admin.syms

2400 2401 2402 2403
# admin/admin_remote.c is being included in libvirt-admin.c, so we
# need to include it in the dist
EXTRA_DIST += admin/admin_remote.c

M
Martin Kletzander 已提交
2404 2405 2406 2407 2408 2409 2410 2411 2412
lib_LTLIBRARIES += libvirt-admin.la
libvirt_admin_la_SOURCES = \
		libvirt-admin.c			\
		$(ADMIN_PROTOCOL_GENERATED)	\
		$(DATATYPES_SOURCES)

libvirt_admin_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_ADMIN_SYMBOL_FILE)	\
		-version-info $(LIBVIRT_VERSION_INFO)			\
2413
		$(AM_LDFLAGS)
M
Martin Kletzander 已提交
2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425

libvirt_admin_la_LIBADD = \
		libvirt.la		\
		$(CYGWIN_EXTRA_LIBADD)

libvirt_admin_la_CFLAGS = \
		$(AM_CFLAGS)		\
		-I$(srcdir)/remote	\
		-I$(srcdir)/rpc		\
		-I$(srcdir)/admin

libvirt_admin_la_CFLAGS += \
2426
		$(XDR_CFLAGS)			\
M
Martin Kletzander 已提交
2427 2428 2429 2430
		$(CAPNG_CFLAGS)			\
		$(YAJL_CFLAGS)			\
		$(SSH2_CFLAGS)			\
		$(SASL_CFLAGS)			\
2431 2432
		$(GNUTLS_CFLAGS)		\
		$(LIBSSH_CFLAGS)
M
Martin Kletzander 已提交
2433 2434 2435 2436 2437 2438 2439 2440

libvirt_admin_la_LIBADD += \
		$(CAPNG_LIBS)			\
		$(YAJL_LIBS)			\
		$(DEVMAPPER_LIBS)		\
		$(LIBXML_LIBS)			\
		$(SSH2_LIBS)			\
		$(SASL_LIBS)			\
2441 2442
		$(GNUTLS_LIBS)			\
		$(LIBSSH_LIBS)
M
Martin Kletzander 已提交
2443

2444 2445
ADMIN_SYM_FILES = $(srcdir)/libvirt_admin_private.syms

M
Martin Kletzander 已提交
2446 2447 2448 2449
if WITH_DTRACE_PROBES
libvirt_admin_la_LIBADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

2450 2451
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
2452 2453 2454 2455 2456 2457
libvirt_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(LIBVIRT_NODELETE) \
		$(AM_LDFLAGS) \
		$(NULL)
2458
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
2459
libvirt_la_LIBADD += \
2460
		    $(DRIVER_MODULES_LIBS) \
2461
		    $(CYGWIN_EXTRA_LIBADD)
2462
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
2463 2464 2465 2466 2467 2468
# Because we specify libvirt_la_DEPENDENCIES for $(LIBVIRT_SYMBOL_FILE), we
# lose automake's automatic dependencies on an appropriate subset of
# $(libvirt_la_LIBADD).  But we were careful to create
# $(libvirt_la_BUILT_LIBADD) as the subset that automake would have
# picked out for us.
libvirt_la_DEPENDENCIES = $(libvirt_la_BUILT_LIBADD) $(LIBVIRT_SYMBOL_FILE)
2469

2470
if WITH_DTRACE_PROBES
2471
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
2472
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
2473
nodist_libvirt_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2474
if WITH_REMOTE
E
Eric Blake 已提交
2475
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2476
endif WITH_REMOTE
2477 2478
if WITH_DRIVER_MODULES
DTRACE2SYSTEMTAP_FLAGS = --with-modules
2479
endif WITH_DRIVER_MODULES
2480

2481 2482 2483
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

if WITH_QEMU
2484
libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.lo
2485
nodist_libvirt_driver_qemu_la_SOURCES = libvirt_qemu_probes.h
2486
BUILT_SOURCES += libvirt_qemu_probes.h
2487
endif WITH_QEMU
2488 2489

tapsetdir = $(datadir)/systemtap/tapset
2490
tapset_DATA = libvirt_probes.stp libvirt_qemu_probes.stp libvirt_functions.stp
2491

2492
%_probes.h: %_probes.d
2493 2494
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

E
Eric Blake 已提交
2495
.PRECIOUS: %_probes.o
2496
%_probes.o: %_probes.d
2497 2498
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

2499 2500 2501 2502 2503 2504 2505 2506 2507
%_probes.lo: %_probes.o
	$(AM_V_GEN)printf %s\\n \
	  '# $@ - a libtool object file' \
	  '# Generated by libtool (GNU libtool) 2.4' \
	  '# Actually generated by Makefile.am, in order to shut up libtool' \
	  "pic_object='$<'" \
	  "non_pic_object='$<'" \
	> $@

E
Eric Blake 已提交
2508
# Keep this list synced with PROTOCOL_STRUCTS
J
Jiri Denemark 已提交
2509 2510 2511
RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
2512
		  $(srcdir)/remote/lxc_protocol.x \
2513 2514
		  $(srcdir)/remote/qemu_protocol.x \
		  $(srcdir)/lxc/lxc_monitor_protocol.x \
M
Martin Kletzander 已提交
2515 2516
		  $(srcdir)/locking/lock_protocol.x \
		  $(srcdir)/admin/admin_protocol.x
2517 2518

libvirt_functions.stp: $(RPC_PROBE_FILES) $(srcdir)/rpc/gensystemtap.pl
2519
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gensystemtap.pl $(RPC_PROBE_FILES) > $@
2520

2521 2522
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl \
		$(top_builddir)/config.status
2523
	$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
2524
	  $(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
2525

2526
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
2527
              libvirt_qemu_probes.h libvirt_qemu_probes.o \
2528
              libvirt_qemu_probes.lo\
2529 2530
              libvirt_functions.stp libvirt_probes.stp \
              libvirt_qemu_probes.stp
2531
endif WITH_DTRACE_PROBES
2532

2533
EXTRA_DIST += libvirt_probes.d libvirt_qemu_probes.d
2534

C
Chris Lalancette 已提交
2535
libvirt_qemu_la_SOURCES = libvirt-qemu.c
D
Daniel P. Berrange 已提交
2536 2537 2538 2539 2540
libvirt_qemu_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
2541
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
C
Chris Lalancette 已提交
2542
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
2543

2544
libvirt_lxc_la_SOURCES = libvirt-lxc.c
D
Daniel P. Berrange 已提交
2545 2546 2547 2548 2549
libvirt_lxc_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
2550 2551 2552
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)

2553 2554 2555 2556 2557 2558 2559
# Since virt-login-shell will be setuid, we must do everything
# we can to avoid linking to other libraries. Many of them do
# unsafe things in functions marked __atttribute__((constructor)).
# This library is built to include the bare minimum required to
# have a RPC client for local UNIX socket access only. We use
# the ../config-post.h header to disable all external deps that
# we don't want
2560
if WITH_SETUID_RPC_CLIENT
2561 2562 2563 2564
noinst_LTLIBRARIES += libvirt-setuid-rpc-client.la

libvirt_setuid_rpc_client_la_SOURCES = 		\
		util/viralloc.c			\
2565 2566
		util/viratomic.c		\
		util/viratomic.h		\
2567 2568
		util/virbitmap.c		\
		util/virbuffer.c		\
2569
		util/vircgroup.c		\
2570 2571
		util/vircommand.c		\
		util/virconf.c			\
2572
		util/virdbus.c			\
2573 2574 2575 2576
		util/virerror.c			\
		util/virevent.c			\
		util/vireventpoll.c		\
		util/virfile.c			\
2577
		util/virgettext.c		\
2578 2579
		util/virhash.c			\
		util/virhashcode.c		\
2580
		util/virhostcpu.c		\
2581 2582 2583 2584 2585 2586 2587 2588
		util/virjson.c			\
		util/virlog.c			\
		util/virobject.c		\
		util/virpidfile.c		\
		util/virprocess.c		\
		util/virrandom.c		\
		util/virsocketaddr.c		\
		util/virstring.c		\
2589
		util/virsysfs.c			\
2590
		util/virsystemd.c		\
2591 2592
		util/virtime.c			\
		util/virthread.c		\
2593
		util/virthreadjob.c		\
2594 2595 2596 2597 2598
		util/virtypedparam.c		\
		util/viruri.c			\
		util/virutil.c			\
		util/viruuid.c			\
		conf/domain_event.c		\
2599
		conf/network_event.c		\
2600
		conf/object_event.c		\
2601
		conf/storage_event.c            \
2602
		conf/node_device_event.c	\
2603
		conf/secret_event.c		\
2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619
		rpc/virnetsocket.c		\
		rpc/virnetsocket.h		\
		rpc/virnetmessage.h		\
		rpc/virnetmessage.c		\
		rpc/virkeepalive.c		\
		rpc/virkeepalive.h		\
		rpc/virnetclient.c		\
		rpc/virnetclientprogram.c	\
		rpc/virnetclientstream.c	\
		rpc/virnetprotocol.c		\
		remote/remote_driver.c		\
		remote/remote_protocol.c	\
		remote/qemu_protocol.c		\
		remote/lxc_protocol.c		\
		datatypes.c			\
		libvirt.c			\
2620
		libvirt-domain.c		\
2621
		libvirt-domain-snapshot.c	\
2622
		libvirt-host.c			\
2623
		libvirt-interface.c		\
2624
		libvirt-network.c		\
2625
		libvirt-nodedev.c		\
2626
		libvirt-nwfilter.c		\
2627
		libvirt-secret.c		\
2628
		libvirt-storage.c		\
2629
		libvirt-stream.c		\
2630 2631 2632 2633 2634 2635
		libvirt-lxc.c			\
		$(NULL)

libvirt_setuid_rpc_client_la_LDFLAGS =		\
		$(AM_LDFLAGS)			\
		$(LIBXML_LIBS)			\
J
Jim Fehlig 已提交
2636
		$(SECDRIVER_LIBS)		\
2637 2638 2639
		$(NULL)
libvirt_setuid_rpc_client_la_CFLAGS =		\
		-DLIBVIRT_SETUID_RPC_CLIENT	\
2640 2641
		-I$(srcdir)/conf		\
		-I$(srcdir)/rpc			\
2642
		$(AM_CFLAGS)			\
J
Jim Fehlig 已提交
2643
		$(SECDRIVER_CFLAGS)		\
P
Pavel Fedin 已提交
2644
		$(XDR_CFLAGS)			\
2645
		$(NULL)
2646
endif WITH_SETUID_RPC_CLIENT
2647

2648 2649 2650
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

2651
if WITH_LIBVIRTD
2652 2653 2654 2655 2656
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
		$(LOCK_DRIVER_LOCKD_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
		$(NULL)
2657
lockd_la_CFLAGS = -I$(srcdir)/conf \
E
Eric Blake 已提交
2658 2659
		$(XDR_CFLAGS) \
		$(AM_CFLAGS)
2660
lockd_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
2661 2662 2663 2664
lockd_la_LIBADD = ../gnulib/lib/libgnu.la \
	libvirt-net-rpc.la \
	libvirt-net-rpc-client.la \
	$(NULL)
J
Jiri Denemark 已提交
2665
augeas_DATA += locking/libvirt_lockd.aug
2666 2667
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
2668
endif WITH_DTRACE_PROBES
2669
if WITH_QEMU
2670 2671
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
2672
nodist_conf_DATA += locking/qemu-lockd.conf
2673 2674
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
2675
endif WITH_QEMU
2676

2677 2678 2679 2680 2681 2682
if WITH_LIBXL
nodist_conf_DATA += locking/libxl-lockd.conf
BUILT_SOURCES += locking/libxl-lockd.conf
DISTCLEANFILES += locking/libxl-lockd.conf
endif WITH_LIBXL

2683 2684 2685 2686 2687
locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
	$(AM_V_GEN)$(MKDIR_P) locking ; \
	cp $< $@


2688
sbin_PROGRAMS = virtlockd virtlogd
2689

2690 2691 2692
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
2693
		$(LOCK_DAEMON_GENERATED) \
2694
		$(NULL)
2695 2696
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
2697
		$(PIE_CFLAGS) \
2698
		$(XDR_CFLAGS) \
2699 2700 2701
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
2702
		$(PIE_LDFLAGS) \
2703 2704 2705 2706 2707 2708 2709 2710 2711 2712
		$(NULL)
virtlockd_LDADD = \
		libvirt-net-rpc-server.la \
		libvirt-net-rpc.la \
		libvirt_util.la \
		../gnulib/lib/libgnu.la \
		$(CYGWIN_EXTRA_LIBADD) \
		$(NULL)
if WITH_DTRACE_PROBES
virtlockd_LDADD += libvirt_probes.lo
2713
endif WITH_DTRACE_PROBES
2714

2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740

virtlogd_SOURCES = \
		$(LOG_DAEMON_SOURCES) \
		$(LOG_PROTOCOL_GENERATED) \
		$(LOG_DAEMON_GENERATED) \
		$(NULL)
virtlogd_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(XDR_CFLAGS) \
		$(NULL)
virtlogd_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
virtlogd_LDADD = \
		libvirt-net-rpc-server.la \
		libvirt-net-rpc.la \
		libvirt_util.la \
		../gnulib/lib/libgnu.la \
		$(CYGWIN_EXTRA_LIBADD) \
		$(NULL)
if WITH_DTRACE_PROBES
virtlogd_LDADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

2741
else ! WITH_LIBVIRTD
2742
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
2743 2744
              $(LOCK_DRIVER_LOCKD_SOURCES) \
	      $(LOG_DAEMON_SOURCES)
2745
endif ! WITH_LIBVIRTD
2746

2747 2748
EXTRA_DIST += \
	locking/virtlockd.sysconf \
J
Jiri Denemark 已提交
2749 2750
	locking/lockd.conf \
	locking/libvirt_lockd.aug \
2751
	locking/test_libvirt_lockd.aug.in \
2752
	logging/virtlogd.sysconf
2753 2754

install-sysconfig:
E
Eric Blake 已提交
2755
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
2756 2757
	$(INSTALL_DATA) $(srcdir)/locking/virtlockd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
2758 2759
	$(INSTALL_DATA) $(srcdir)/logging/virtlogd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlogd
2760 2761

uninstall-sysconfig:
2762
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlogd
2763
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
E
Eric Blake 已提交
2764
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
2765

2766
EXTRA_DIST += locking/virtlockd.init.in logging/virtlogd.init.in
2767 2768 2769

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_RED_HAT
2770
install-init:: virtlockd.init virtlogd.init install-sysconfig
E
Eric Blake 已提交
2771
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
2772 2773
	$(INSTALL_SCRIPT) virtlockd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
2774 2775
	$(INSTALL_SCRIPT) virtlogd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlogd
2776 2777

uninstall-init:: uninstall-sysconfig
E
Eric Blake 已提交
2778
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
2779
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlogd
E
Eric Blake 已提交
2780
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
2781

2782 2783
BUILT_SOURCES += virtlockd.init virtlogd.init
DISTCLEANFILES += virtlockd.init virtlogd.init
2784
else ! LIBVIRT_INIT_SCRIPT_RED_HAT
2785 2786
install-init::
uninstall-init::
2787 2788
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
else ! WITH_LIBVIRTD
2789 2790
install-init::
uninstall-init::
2791
endif ! WITH_LIBVIRTD
2792 2793

virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
2794 2795 2796 2797 2798 2799
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g'		\
	    < $< > $@-t &&					\
	    chmod a+x $@-t &&					\
2800 2801
	    mv $@-t $@

2802 2803 2804 2805 2806 2807 2808 2809 2810
virtlogd.init: logging/virtlogd.init.in $(top_builddir)/config.status
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g'		\
	    < $< > $@-t &&					\
	    chmod a+x $@-t &&					\
	    mv $@-t $@

2811
POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)"
2812

2813
virtlockd.8.in: locking/virtlockd.pod
2814 2815 2816 2817 2818 2819 2820 2821
	$(AM_V_GEN)$(POD2MAN) --section=8 $< $@-t1 && \
	if grep 'POD ERROR' $@-t1; then rm $@-t1; exit 1; fi && \
	sed \
		-e 's|SYSCONFDIR|\@sysconfdir\@|g' \
		-e 's|LOCALSTATEDIR|\@localstatedir\@|g' \
		< $@-t1 > $@-t2 && \
	rm -f $@-t1 && \
	mv $@-t2 $@
2822

2823
virtlogd.8.in: logging/virtlogd.pod
2824 2825 2826 2827 2828 2829 2830 2831
	$(AM_V_GEN)$(POD2MAN) --section=8 $< $@-t1 && \
	if grep 'POD ERROR' $@-t1; then rm $@-t1; exit 1; fi && \
	sed \
		-e 's|SYSCONFDIR|\@sysconfdir\@|g' \
		-e 's|LOCALSTATEDIR|\@localstatedir\@|g' \
		< $@-t1 > $@-t2 && \
	rm -f $@-t1 && \
	mv $@-t2 $@
2832

2833
%.8: %.8.in $(top_srcdir)/configure.ac
2834
	$(AM_V_GEN)sed \
2835 2836 2837
		-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
		-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
		< $< > $@-t && \
2838 2839
	mv $@-t $@

2840
if WITH_LIBVIRTD
2841
man8_MANS = virtlockd.8 virtlogd.8
2842

2843
conf_DATA += locking/virtlockd.conf logging/virtlogd.conf
2844

2845 2846
augeas_DATA += locking/virtlockd.aug logging/virtlogd.aug
augeastest_DATA += test_virtlockd.aug test_virtlogd.aug
2847
endif WITH_LIBVIRTD
2848

A
Andrea Bolognani 已提交
2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860
PODFILES = \
	locking/virtlockd.pod \
	logging/virtlogd.pod \
	$(NULL)

MANINFILES = \
	virtlockd.8.in \
	virtlogd.8.in \
	$(NULL)

CLEANFILES += test_virtlockd.aug test_virtlogd.aug $(man8_MANS)
MAINTAINERCLEANFILES += $(MANINFILES)
2861 2862 2863 2864

EXTRA_DIST += \
        locking/virtlockd.service.in \
        locking/virtlockd.socket.in \
2865 2866 2867
        locking/virtlockd.aug \
        locking/virtlockd.conf \
        locking/test_virtlockd.aug.in \
2868 2869 2870 2871 2872
        logging/virtlogd.service.in \
        logging/virtlogd.socket.in \
        logging/virtlogd.aug \
        logging/virtlogd.conf \
        logging/test_virtlogd.aug.in \
A
Andrea Bolognani 已提交
2873 2874
        $(PODFILES) \
        $(MANINFILES) \
2875
        $(NULL)
2876

2877 2878 2879 2880

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

2881
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
2882

2883 2884 2885 2886
BUILT_SOURCES += virtlockd.service virtlockd.socket \
		 virtlogd.service virtlogd.socket
DISTCLEANFILES += virtlockd.service virtlockd.socket \
		  virtlogd.service virtlogd.socket
2887

2888 2889
install-systemd: virtlockd.service virtlockd.socket \
                 virtlogd.service virtlogd.socket install-sysconfig
E
Eric Blake 已提交
2890
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
2891
	$(INSTALL_DATA) virtlockd.service \
2892
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2893
	$(INSTALL_DATA) virtlockd.socket \
2894
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2895 2896 2897 2898
	$(INSTALL_DATA) virtlogd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
	$(INSTALL_DATA) virtlogd.socket \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2899 2900

uninstall-systemd: uninstall-sysconfig
E
Eric Blake 已提交
2901 2902
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.socket
2903 2904
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlogd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlogd.socket
E
Eric Blake 已提交
2905
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
2906
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
2907 2908
install-systemd:
uninstall-systemd:
2909 2910
endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
else ! WITH_LIBVIRTD
2911 2912
install-systemd:
uninstall-systemd:
2913
endif ! WITH_LIBVIRTD
2914 2915

virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
2916 2917 2918
	$(AM_V_GEN)sed						\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    < $< > $@-t &&					\
2919 2920 2921
	    mv $@-t $@

virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
2922 2923 2924
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    < $< > $@-t &&					\
2925 2926
	    mv $@-t $@

2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938
virtlogd.service: logging/virtlogd.service.in $(top_builddir)/config.status
	$(AM_V_GEN)sed						\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    < $< > $@-t &&					\
	    mv $@-t $@

virtlogd.socket: logging/virtlogd.socket.in $(top_builddir)/config.status
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    < $< > $@-t &&					\
	    mv $@-t $@

2939

2940
if WITH_SANLOCK
2941
lockdriver_LTLIBRARIES += sanlock.la
2942
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
2943
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
2944
sanlock_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
2945
sanlock_la_LIBADD = -lsanlock_client \
2946 2947 2948
		../gnulib/lib/libgnu.la

augeas_DATA += locking/libvirt_sanlock.aug
2949 2950
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
2951

E
Eric Blake 已提交
2952
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
2953
	$(AM_V_GEN)$(MKDIR_P) locking ; \
2954 2955 2956
	cp $< $@

if WITH_QEMU
2957
nodist_conf_DATA += locking/qemu-sanlock.conf
2958
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
2959
DISTCLEANFILES += locking/qemu-sanlock.conf
2960
endif WITH_QEMU
2961 2962 2963 2964 2965 2966

if WITH_LIBXL
nodist_conf_DATA += locking/libxl-sanlock.conf
BUILT_SOURCES += locking/libxl-sanlock.conf
DISTCLEANFILES += locking/libxl-sanlock.conf
endif WITH_LIBXL
2967
else ! WITH_SANLOCK
2968
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
2969
endif ! WITH_SANLOCK
2970 2971
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
2972
	locking/test_libvirt_sanlock.aug.in
2973

2974 2975 2976 2977
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
2978

2979
EXTRA_DIST += \
E
Eric Blake 已提交
2980 2981 2982 2983
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
2984 2985
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
2986

E
Eric Blake 已提交
2987
VIR_NET_RPC_GENERATED = \
2988 2989 2990 2991
	rpc/virnetprotocol.h \
	rpc/virnetprotocol.c \
	rpc/virkeepaliveprotocol.h \
	rpc/virkeepaliveprotocol.c
2992

2993
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2994

2995
libvirt_net_rpc_la_SOURCES = \
2996
	rpc/virnetmessage.h rpc/virnetmessage.c \
2997
	rpc/virnetsocket.h rpc/virnetsocket.c \
2998 2999
	rpc/virkeepalive.h rpc/virkeepalive.c \
	$(VIR_NET_RPC_GENERATED)
3000
if WITH_SSH2
3001 3002
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
3003
else ! WITH_SSH2
3004 3005
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
3006
endif ! WITH_SSH2
3007
if WITH_GNUTLS
3008 3009
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
3010
else ! WITH_GNUTLS
3011 3012
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
3013
endif ! WITH_GNUTLS
3014
if WITH_SASL
3015 3016
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
3017
else ! WITH_SASL
3018 3019
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
3020
endif ! WITH_SASL
3021 3022 3023 3024 3025 3026 3027
if WITH_LIBSSH
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetlibsshsession.h rpc/virnetlibsshsession.c
else ! WITH_LIBSSH
EXTRA_DIST += \
	rpc/virnetlibsshsession.h rpc/virnetlibsshsession.c
endif ! WITH_LIBSSH
3028
libvirt_net_rpc_la_CFLAGS = \
3029
			$(GNUTLS_CFLAGS) \
3030
			$(SASL_CFLAGS) \
3031
			$(SSH2_CFLAGS) \
3032
			$(LIBSSH_CFLAGS) \
3033
			$(XDR_CFLAGS) \
3034 3035
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
3036
			$(GNUTLS_LIBS) \
3037
			$(SASL_LIBS) \
3038
			$(SSH2_LIBS)\
3039
			$(LIBSSH_LIBS) \
J
Jim Fehlig 已提交
3040
			$(SECDRIVER_LIBS) \
3041
			$(AM_LDFLAGS) \
3042
			$(NULL)
3043 3044 3045
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

3046 3047 3048 3049
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
3050
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
3051
	rpc/virnetdaemon.h rpc/virnetdaemon.c \
3052 3053
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
3054
			$(AVAHI_CFLAGS) \
3055
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
3056
			$(XDR_CFLAGS) \
3057
			$(AM_CFLAGS)
3058 3059
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
3060
			$(AVAHI_LIBS) \
3061
			$(DBUS_LIBS) \
3062
			$(NULL)
3063 3064 3065
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

3066 3067 3068 3069 3070
libvirt_net_rpc_client_la_SOURCES = \
	rpc/virnetclientprogram.h rpc/virnetclientprogram.c \
	rpc/virnetclientstream.h rpc/virnetclientstream.c \
	rpc/virnetclient.h rpc/virnetclient.c
libvirt_net_rpc_client_la_CFLAGS = \
E
Eric Blake 已提交
3071 3072
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
3073
libvirt_net_rpc_client_la_LDFLAGS = $(AM_LDFLAGS)
3074 3075
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
3076

3077 3078
libexec_PROGRAMS =

3079
if WITH_LIBVIRTD
3080 3081
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
3082 3083 3084 3085
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3086 3087 3088
libvirt_iohelper_LDADD =		\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
3089 3090
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
3091
endif WITH_DTRACE_PROBES
3092

D
Daniel P. Berrange 已提交
3093 3094 3095 3096
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
3097 3098 3099 3100

if WITH_NETWORK
libexec_PROGRAMS += libvirt_leaseshelper
libvirt_leaseshelper_SOURCES = $(NETWORK_LEASES_HELPER_SOURCES)
3101 3102 3103 3104
libvirt_leaseshelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119
libvirt_leaseshelper_LDADD =           \
               libvirt_util.la         \
               ../gnulib/lib/libgnu.la
if WITH_DTRACE_PROBES
libvirt_leaseshelper_LDADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

libvirt_leaseshelper_CFLAGS = \
	       $(AM_CFLAGS) \
               $(PIE_CFLAGS) \
               $(NULL)
else ! WITH_NETWORK
EXTRA_DIST += $(NETWORK_LEASES_HELPER_SOURCES)
endif ! WITH_NETWORK

3120
endif WITH_LIBVIRTD
3121

3122
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
3123
if WITH_LIBVIRTD
3124
libexec_PROGRAMS += libvirt_parthelper
3125

3126
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
D
Daniel P. Berrange 已提交
3127 3128 3129 3130
libvirt_parthelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3131 3132 3133 3134
libvirt_parthelper_LDADD =		\
		$(LIBPARTED_LIBS)	\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
3135 3136
if WITH_DTRACE_PROBES
libvirt_parthelper_LDADD += libvirt_probes.lo
3137
endif WITH_DTRACE_PROBES
3138

D
Daniel P. Berrange 已提交
3139 3140 3141 3142 3143
libvirt_parthelper_CFLAGS = \
		$(LIBPARTED_CFLAGS) \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
3144 3145
endif WITH_LIBVIRTD
endif WITH_STORAGE_DISK
3146 3147
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)

3148

3149
if WITH_SANLOCK
3150 3151 3152
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
3153
libvirt_sanlock_helper_CFLAGS = \
3154
		-I$(srcdir)/conf \
D
Daniel P. Berrange 已提交
3155 3156 3157 3158 3159 3160 3161
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3162
libvirt_sanlock_helper_LDADD = libvirt.la
3163
endif WITH_SANLOCK
3164

3165 3166 3167 3168 3169 3170
if WITH_LXC
if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_lxc

libvirt_lxc_SOURCES =						\
		$(LXC_CONTROLLER_SOURCES)			\
O
Osier Yang 已提交
3171
		$(DATATYPES_SOURCES)
D
Daniel P. Berrange 已提交
3172 3173 3174 3175
libvirt_lxc_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3176
libvirt_lxc_LDADD =			\
G
Gao feng 已提交
3177
		$(FUSE_LIBS) \
3178 3179
		libvirt-net-rpc-server.la \
		libvirt-net-rpc.la \
3180
		libvirt_security_manager.la \
3181 3182
		libvirt_conf.la \
		libvirt_util.la \
3183
		../gnulib/lib/libgnu.la
3184
if WITH_DTRACE_PROBES
3185
libvirt_lxc_LDADD += libvirt_probes.lo
3186
endif WITH_DTRACE_PROBES
3187
libvirt_lxc_LDADD += $(SECDRIVER_LIBS)
3188
libvirt_lxc_CFLAGS =				\
3189
		-I$(srcdir)/conf	\
3190
		$(AM_CFLAGS)                    \
D
Daniel P. Berrange 已提交
3191
		$(PIE_CFLAGS)			\
G
Gao feng 已提交
3192
		$(LIBNL_CFLAGS)			\
D
Daniel P. Berrange 已提交
3193
		$(FUSE_CFLAGS)			\
3194
		$(DBUS_CFLAGS)			\
P
Pavel Fedin 已提交
3195
		$(XDR_CFLAGS)			\
D
Daniel P. Berrange 已提交
3196
		$(NULL)
3197
if WITH_BLKID
3198 3199
libvirt_lxc_CFLAGS += $(BLKID_CFLAGS)
libvirt_lxc_LDADD += $(BLKID_LIBS)
3200
endif WITH_BLKID
J
Jim Fehlig 已提交
3201
libvirt_lxc_CFLAGS += $(SECDRIVER_CFLAGS)
3202 3203
endif WITH_LIBVIRTD
endif WITH_LXC
3204 3205
EXTRA_DIST += $(LXC_CONTROLLER_SOURCES)

J
Jamie Strandboge 已提交
3206 3207 3208 3209 3210 3211
if WITH_SECDRIVER_APPARMOR
if WITH_LIBVIRTD
libexec_PROGRAMS += virt-aa-helper

virt_aa_helper_SOURCES = $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

D
Daniel P. Berrange 已提交
3212 3213 3214 3215
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
J
Jamie Strandboge 已提交
3216
virt_aa_helper_LDADD =						\
3217
		libvirt.la					\
C
Chris Lalancette 已提交
3218 3219
		libvirt_conf.la					\
		libvirt_util.la					\
3220
		libvirt_driver_storage_impl.la			\
C
Chris Lalancette 已提交
3221
		../gnulib/lib/libgnu.la
3222
if WITH_DTRACE_PROBES
3223
virt_aa_helper_LDADD += libvirt_probes.lo
3224
endif WITH_DTRACE_PROBES
J
Jamie Strandboge 已提交
3225
virt_aa_helper_CFLAGS =						\
3226 3227 3228 3229
		-I$(srcdir)/conf				\
		-I$(srcdir)/security				\
		$(AM_CFLAGS) 					\
		$(PIE_CFLAGS) 					\
D
Daniel P. Berrange 已提交
3230
		$(NULL)
3231 3232
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
J
Jamie Strandboge 已提交
3233 3234
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

3235
if WITH_NSS
3236 3237 3238 3239 3240
noinst_LTLIBRARIES += libvirt-nss.la

libvirt_nss_la_SOURCES =		\
		util/viralloc.c			\
		util/viralloc.h			\
K
Kai Kang 已提交
3241 3242
		util/viratomic.c		\
		util/viratomic.h		\
3243 3244 3245 3246 3247 3248 3249 3250 3251 3252
		util/virbitmap.c		\
		util/virbitmap.h		\
		util/virbuffer.c		\
		util/virbuffer.h		\
		util/vircommand.c		\
		util/vircommand.h		\
		util/virerror.c			\
		util/virerror.h			\
		util/virfile.c			\
		util/virfile.h			\
3253 3254 3255 3256
		util/virhash.c			\
		util/virhash.h			\
		util/virhashcode.c		\
		util/virhashcode.h		\
3257 3258 3259 3260 3261 3262 3263 3264
		util/virjson.c			\
		util/virjson.h			\
		util/virkmod.c			\
		util/virkmod.h			\
		util/virlease.c			\
		util/virlease.h			\
		util/virlog.c			\
		util/virlog.h			\
3265 3266
		util/virmacmap.c		\
		util/virmacmap.h		\
3267 3268 3269 3270 3271 3272
		util/virobject.c		\
		util/virobject.h		\
		util/virpidfile.c		\
		util/virpidfile.h		\
		util/virprocess.c		\
		util/virprocess.h		\
3273 3274
		util/virrandom.c		\
		util/virrandom.h		\
3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300
		util/virsocketaddr.c	\
		util/virsocketaddr.h	\
		util/virstring.c		\
		util/virstring.h		\
		util/virthread.c		\
		util/virthread.h		\
		util/virthreadjob.c		\
		util/virthreadjob.h		\
		util/virtime.c			\
		util/virtime.h			\
		util/virutil.c			\
		util/virutil.h			\
		$(NULL)

libvirt_nss_la_CFLAGS =			\
		-DLIBVIRT_NSS			\
		$(AM_CFLAGS)			\
		$(YAJL_CFLAGS)			\
		$(NULL)
libvirt_nss_la_LDFLAGS =		\
		$(AM_LDFLAGS)			\
		$(NULL)

libvirt_nss_la_LIBADD =			\
		$(YAJL_LIBS)			\
		$(NULL)
3301
endif WITH_NSS
3302 3303


3304
install-data-local: install-init install-systemd
3305 3306
if WITH_LIBVIRTD
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
3307
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
3308
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
3309
endif WITH_LIBVIRTD
3310 3311
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
3312
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
3313
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
3314
if WITH_SANLOCK
3315
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
3316
endif WITH_SANLOCK
3317
if WITH_QEMU
3318
	$(MKDIR_P) -m 0751 "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu"
3319
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu"
3320
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu"
3321
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu"
3322
endif WITH_QEMU
3323 3324 3325
if WITH_LXC
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lxc"
3326
endif WITH_LXC
J
Jim Fehlig 已提交
3327 3328 3329
if WITH_LIBXL
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/libxl"
J
Jim Fehlig 已提交
3330
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl"
3331
endif WITH_LIBXL
3332 3333 3334
if WITH_UML
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/uml"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/uml"
3335
endif WITH_UML
3336 3337
if WITH_XEN
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/xen"
3338
endif WITH_XEN
3339 3340
if WITH_NETWORK
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network"
3341
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq"
3342
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/network"
3343
	$(MKDIR_P) "$(DESTDIR)$(confdir)/qemu/networks/autostart"
3344
	$(INSTALL_DATA) $(srcdir)/network/default.xml \
3345
	  $(DESTDIR)$(confdir)/qemu/networks/default.xml
3346
	test -z "$(UUID)" || \
3347 3348 3349
	  { sed -e "s,</name>,</name>;  <uuid>$(UUID)</uuid>," \
	      $(DESTDIR)$(confdir)/qemu/networks/default.xml | \
	      tr ";" "\n" > \
3350 3351 3352 3353
	      $(DESTDIR)$(confdir)/qemu/networks/default.xml.t && \
	    cp $(DESTDIR)$(confdir)/qemu/networks/default.xml.t \
	      $(DESTDIR)$(confdir)/qemu/networks/default.xml && \
	    rm $(DESTDIR)$(confdir)/qemu/networks/default.xml.t; }
A
Andrea Bolognani 已提交
3354
	( cd $(DESTDIR)$(confdir)/qemu/networks/autostart && \
3355 3356
	  rm -f default.xml && \
	  $(LN_S) ../default.xml default.xml )
3357
endif WITH_NETWORK
3358

3359
uninstall-local:: uninstall-init uninstall-systemd
3360
if WITH_LIBVIRTD
3361
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
3362 3363
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
3364
endif WITH_LIBVIRTD
3365 3366
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
3367
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
3368
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
3369
if WITH_SANLOCK
3370
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
3371
endif WITH_SANLOCK
3372 3373 3374 3375 3376
if WITH_QEMU
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/qemu" ||:
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu" ||:
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/qemu" ||:
3377
endif WITH_QEMU
3378 3379 3380
if WITH_LXC
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||:
3381
endif WITH_LXC
J
Jim Fehlig 已提交
3382 3383 3384
if WITH_LIBXL
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||:
J
Jim Fehlig 已提交
3385
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||:
3386
endif WITH_LIBXL
3387 3388 3389
if WITH_UML
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/uml" ||:
3390
endif WITH_UML
3391 3392
if WITH_XEN
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/xen" ||:
3393
endif WITH_XEN
3394
if WITH_NETWORK
3395 3396 3397 3398
	rm -f $(DESTDIR)$(confdir)/qemu/networks/autostart/default.xml
	rm -f $(DESTDIR)$(confdir)/qemu/networks/default.xml
	rmdir "$(DESTDIR)$(confdir)/qemu/networks/autostart" || :
	rmdir "$(DESTDIR)$(confdir)/qemu/networks" || :
3399 3400
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||:
3401
endif WITH_NETWORK
3402
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
3403

3404 3405
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
3406
MAINTAINERCLEANFILES += $(REMOTE_DRIVER_GENERATED) $(VIR_NET_RPC_GENERATED)