Makefile.am 105.5 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
AM_CFLAGS =	$(LIBXML_CFLAGS)				\
41
		$(WARN_CFLAGS)					\
E
Eric Blake 已提交
42 43 44
		$(LOCK_CHECKING_CFLAGS)				\
		$(WIN32_EXTRA_CFLAGS)				\
		$(COVERAGE_CFLAGS)
45
AM_LDFLAGS =	$(DRIVER_MODULES_LDFLAGS)			\
G
Guido Günther 已提交
46 47
		$(COVERAGE_LDFLAGS)				\
		$(RELRO_LDFLAGS)				\
48
		$(NO_INDIRECT_LDFLAGS)				\
49 50
		$(CYGWIN_EXTRA_LDFLAGS) 			\
		$(MINGW_EXTRA_LDFLAGS)				\
G
Guido Günther 已提交
51
		$(NULL)
52

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

55
BUILT_SOURCES =
56 57 58
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
59
nodist_conf_DATA =
60

E
Eric Blake 已提交
61 62
THREAD_LIBS = $(LIB_PTHREAD) $(LTLIBMULTITHREAD)

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

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

78
lib_LTLIBRARIES = libvirt.la libvirt-qemu.la libvirt-lxc.la
79

80
moddir = $(libdir)/libvirt/connection-driver
81 82
mod_LTLIBRARIES =

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

86 87 88 89 90 91
augeasdir = $(datadir)/augeas/lenses
augeas_DATA =

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

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

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

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

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

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

240 241 242
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

243 244
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
245

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

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

257
LOCK_DAEMON_GENERATED = \
258
		locking/lock_daemon_dispatch_stubs.h
259 260 261
		$(NULL)

BUILT_SOURCES += $(LOCK_DAEMON_GENERATED)
262
EXTRA_DIST += $(LOCK_DAEMON_GENERATED)
263 264
MAINTAINERCLEANFILES += $(LOCK_DAEMON_GENERATED)

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

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

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


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

291 292
DRIVER_SOURCES += $(LOG_PROTOCOL_GENERATED)

293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313
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 \
314 315
		logging/log_handler.c \
		logging/log_handler.h \
316 317 318 319 320 321 322 323 324
		$(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


325 326
NETDEV_CONF_SOURCES =						\
		conf/netdev_bandwidth_conf.h conf/netdev_bandwidth_conf.c \
327 328
		conf/netdev_vport_profile_conf.h conf/netdev_vport_profile_conf.c \
		conf/netdev_vlan_conf.h conf/netdev_vlan_conf.c
329

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

343 344 345 346
OBJECT_EVENT_SOURCES =						\
		conf/object_event.c conf/object_event.h \
		conf/object_event_private.h

347 348
DOMAIN_EVENT_SOURCES =						\
		conf/domain_event.c conf/domain_event.h
349

350 351 352
NETWORK_EVENT_SOURCES =						\
		conf/network_event.c conf/network_event.h

353 354 355
STORAGE_EVENT_SOURCES =						\
                conf/storage_event.c conf/storage_event.h

356 357 358
NODE_DEVICE_EVENT_SOURCES =					\
                conf/node_device_event.c conf/node_device_event.h

359 360 361
SECRET_EVENT_SOURCES =					\
                conf/secret_event.c conf/secret_event.h

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

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

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

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

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

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

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

401 402
CPU_CONF_SOURCES =						\
		conf/cpu_conf.c conf/cpu_conf.h
403

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

408 409 410 411
# Device Helper APIs
DEVICE_CONF_SOURCES =                                           \
		conf/device_conf.c conf/device_conf.h

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

431
# The remote RPC driver, covering domains, storage, networks, etc
432
REMOTE_DRIVER_GENERATED = \
E
Eric Blake 已提交
433 434 435 436 437 438 439 440 441 442
		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 已提交
443 444

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

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

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

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

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

471
EXTRA_DIST +=  $(REMOTE_DRIVER_PROTOCOL) \
472
		$(REMOTE_DRIVER_GENERATED)
473

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

ADMIN_PROTOCOL_GENERATED = \
		admin/admin_protocol.c	\
478 479 480 481 482 483 484 485
		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 已提交
486 487 488 489 490

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

491 492 493 494 495 496 497 498 499 500
# 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
501 502 503 504

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

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

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

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

595
if WITH_REMOTE
596 597
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)

598 599
# 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.
600 601 602
$(srcdir)/remote_protocol-struct \
	$(srcdir)/qemu_protocol-struct \
	$(srcdir)/lxc_protocol-struct: \
E
Eric Blake 已提交
603
		$(srcdir)/%-struct: remote/libvirt_driver_remote_la-%.lo
604
	$(PDWTAGS)
605
$(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \
E
Eric Blake 已提交
606
		$(srcdir)/%-struct: rpc/libvirt_net_rpc_la-%.lo
607
	$(PDWTAGS)
E
Eric Blake 已提交
608
$(srcdir)/lxc_monitor_protocol-struct: \
E
Eric Blake 已提交
609
		$(srcdir)/%-struct: lxc/libvirt_driver_lxc_impl_la-%.lo
E
Eric Blake 已提交
610 611
	$(PDWTAGS)
$(srcdir)/lock_protocol-struct: \
E
Eric Blake 已提交
612
		$(srcdir)/%-struct: locking/lockd_la-%.lo
E
Eric Blake 已提交
613
	$(PDWTAGS)
M
Martin Kletzander 已提交
614 615 616
$(srcdir)/admin_protocol-struct: \
		$(srcdir)/%-struct: admin/libvirt_admin_la-%.lo
	$(PDWTAGS)
E
Eric Blake 已提交
617

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

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

EXTRA_DIST += check-drivername.pl

635
DRIVER_SOURCE_FILES = \
636 637 638 639 640 641 642 643 644 645 646
	$(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) \
647
	$(VZ_DRIVER_SOURCES) \
648 649 650 651 652 653 654 655
	$(PHYP_DRIVER_SOURCES) \
	$(QEMU_DRIVER_SOURCES) \
	$(REMOTE_DRIVER_SOURCES) \
	$(SECRET_DRIVER_SOURCES) \
	$(STORAGE_DRIVER_SOURCES) \
	$(TEST_DRIVER_SOURCES) \
	$(UML_DRIVER_SOURCES) \
	$(VBOX_DRIVER_SOURCES) \
656
	vbox/vbox_tmpl.c \
657 658 659
	$(VMWARE_DRIVER_SOURCES) \
	$(XEN_DRIVER_SOURCES) \
	$(XENAPI_DRIVER_SOURCES) \
660 661
	$(NULL)

662
STATEFUL_DRIVER_SOURCE_FILES = \
R
Roman Bogorodskiy 已提交
663
	$(BHYVE_DRIVER_SOURCES) \
664 665 666 667 668 669 670 671 672 673 674
	$(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) \
675
	$(VZ_DRIVER_SOURCES) \
676 677
	$(NULL)

678 679 680

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

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

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

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

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

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

# Now the Hypervisor specific drivers
XEN_DRIVER_SOURCES =						\
710 711 712 713 714 715
		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
716
if WITH_XEN_INOTIFY
717
XEN_DRIVER_SOURCES += xen/xen_inotify.c xen/xen_inotify.h
718
endif WITH_XEN_INOTIFY
719

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

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

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

LXC_GENERATED = \
734
	$(LXC_MONITOR_PROTOCOL_GENERATED) \
735 736 737 738
	$(LXC_MONITOR_GENERATED) \
	$(LXC_CONTROLLER_GENERATED) \
	$(NULL)

739
LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x
740

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

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

EXTRA_DIST += \
754
	$(LXC_MONITOR_PROTOCOL) \
755 756 757 758 759
	$(LXC_GENERATED) \
	$(NULL)

BUILT_SOURCES += $(LXC_GENERATED)

760 761
CLEANFILES += $(LXC_GENERATED)

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

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

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

790 791 792
PHYP_DRIVER_SOURCES =						\
		phyp/phyp_driver.c phyp/phyp_driver.h

793
OPENVZ_DRIVER_SOURCES =						\
794
		openvz/openvz_conf.c openvz/openvz_conf.h	\
795 796
		openvz/openvz_driver.c openvz/openvz_driver.h   \
		openvz/openvz_util.c openvz/openvz_util.h
797

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

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

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

O
Osier Yang 已提交
825 826
QEMU_DRIVER_SOURCES =							\
		qemu/qemu_agent.c qemu/qemu_agent.h			\
827
		qemu/qemu_alias.c qemu/qemu_alias.h			\
828
		qemu/qemu_block.c qemu/qemu_block.h			\
829
		qemu/qemu_blockjob.c qemu/qemu_blockjob.h		\
O
Osier Yang 已提交
830 831
		qemu/qemu_capabilities.c qemu/qemu_capabilities.h	\
		qemu/qemu_command.c qemu/qemu_command.h			\
832
		qemu/qemu_parse_command.c qemu/qemu_parse_command.h	\
O
Osier Yang 已提交
833
		qemu/qemu_domain.c qemu/qemu_domain.h			\
834
		qemu/qemu_domain_address.c qemu/qemu_domain_address.h	\
O
Osier Yang 已提交
835 836 837
		qemu/qemu_cgroup.c qemu/qemu_cgroup.h			\
		qemu/qemu_hostdev.c qemu/qemu_hostdev.h			\
		qemu/qemu_hotplug.c qemu/qemu_hotplug.h			\
838
		qemu/qemu_hotplugpriv.h					\
O
Osier Yang 已提交
839 840
		qemu/qemu_conf.c qemu/qemu_conf.h			\
		qemu/qemu_process.c qemu/qemu_process.h			\
841
		qemu/qemu_processpriv.h					\
O
Osier Yang 已提交
842 843 844 845 846 847
		qemu/qemu_migration.c qemu/qemu_migration.h		\
		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				\
848
		qemu/qemu_driver.c qemu/qemu_driver.h	\
849
		qemu/qemu_interface.c qemu/qemu_interface.h		\
850 851
		qemu/qemu_capspriv.h					\
		qemu/qemu_security.c qemu/qemu_security.h
R
Richard W.M. Jones 已提交
852

O
Osier Yang 已提交
853
XENAPI_DRIVER_SOURCES =						\
854
		xenapi/xenapi_driver.c xenapi/xenapi_driver.h	\
O
Osier Yang 已提交
855
		xenapi/xenapi_driver_private.h			\
856 857
		xenapi/xenapi_utils.c xenapi/xenapi_utils.h

858 859 860 861 862
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       	\
863
		libxl/libxl_logger.c libxl/libxl_logger.h           \
J
Jim Fehlig 已提交
864
		libxl/libxl_migration.c libxl/libxl_migration.h
J
Jim Fehlig 已提交
865

866
UML_DRIVER_SOURCES =						\
D
Daniel P. Berrange 已提交
867 868
		uml/uml_conf.c uml/uml_conf.h			\
		uml/uml_driver.c uml/uml_driver.h
869

O
Osier Yang 已提交
870 871 872 873 874 875
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	\
876
		esx/esx_storage_backend_vmfs.c esx/esx_storage_backend_vmfs.h	\
877
		esx/esx_storage_backend_iscsi.c esx/esx_storage_backend_iscsi.h	\
878
		esx/esx_stream.c esx/esx_stream.h			\
O
Osier Yang 已提交
879 880 881
		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		\
882
		esx/esx_vi_types.c esx/esx_vi_types.h
883

884
ESX_DRIVER_GENERATED =							\
885 886
		esx/esx_vi_methods.generated.c				\
		esx/esx_vi_methods.generated.h				\
887
		esx/esx_vi_methods.generated.macro			\
888 889 890 891 892
		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			\
893 894 895
		esx/esx_vi_types.generated.typefromstring		\
		esx/esx_vi.generated.c					\
		esx/esx_vi.generated.h
896

O
Osier Yang 已提交
897
ESX_DRIVER_EXTRA_DIST =							\
898 899 900 901 902
		esx/README						\
		esx/esx_vi_generator.input				\
		esx/esx_vi_generator.py					\
		$(ESX_DRIVER_GENERATED)

O
Osier Yang 已提交
903
HYPERV_DRIVER_SOURCES =									\
M
Matthias Bolte 已提交
904 905
		hyperv/hyperv_private.h							\
		hyperv/hyperv_driver.c hyperv/hyperv_driver.h				\
906
		hyperv/hyperv_util.c hyperv/hyperv_util.h				\
907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922
		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.generated.c					\
		hyperv/hyperv_wmi.generated.h					\
		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)

923
VZ_DRIVER_SOURCES =				\
924 925 926 927 928 929
		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 已提交
930

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

953
NETWORK_DRIVER_SOURCES =					\
954 955 956 957 958
		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
959

960 961 962 963
INTERFACE_DRIVER_SOURCES =

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1028
STORAGE_HELPER_DISK_SOURCES =					\
1029
		storage/parthelper.c
1030

1031 1032 1033
UTIL_IO_HELPER_SOURCES =					\
		util/iohelper.c

1034 1035 1036
NETWORK_LEASES_HELPER_SOURCES =                                 \
               network/leaseshelper.c

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

1050

1051
# Security framework and drivers for various models
O
Osier Yang 已提交
1052 1053 1054 1055 1056
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		\
1057
		security/security_manager.h security/security_manager.c
1058

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

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

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

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

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

1084 1085 1086 1087 1088 1089 1090
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

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

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


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

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

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

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

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

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

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

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

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

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

1159 1160

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

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

1174 1175 1176 1177 1178 1179
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)

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

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

1197

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

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

1208 1209
# 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.
1210
SYM_FILES = $(USED_SYM_FILES)
1211
USED_SYM_FILES = $(srcdir)/libvirt_private.syms
1212 1213 1214
GENERATED_SYM_FILES = \
	$(ACCESS_DRIVER_SYM_FILES) \
	libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \
1215
	libvirt_admin.syms libvirt_admin.def \
1216
	$(NULL)
1217

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

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

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

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

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

1248 1249
endif WITH_REMOTE

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1423 1424

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

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

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

conf_DATA += lxc/lxc.conf

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

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

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

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

D
Daniel Veillard 已提交
1490

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

1493 1494
ESX_GENERATED_STAMP = .esx_vi_generator.stamp

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

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

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

MAINTAINERCLEANFILES += $(ESX_DRIVER_GENERATED) $(ESX_GENERATED_STAMP)

D
Daniel Veillard 已提交
1506

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

M
Matthias Bolte 已提交
1518

1519 1520
BUILT_SOURCES += $(HYPERV_DRIVER_GENERATED)

1521 1522
HYPERV_GENERATED_STAMP = .hyperv_wmi_generator.stamp

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

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

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

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

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

1545
if WITH_VZ
1546 1547 1548 1549 1550 1551 1552 1553
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
1554
noinst_LTLIBRARIES += libvirt_driver_vz.la
1555 1556
endif ! WITH_DRIVER_MODULES
libvirt_driver_vz_impl_la_CFLAGS = \
1557 1558 1559
		-I$(srcdir)/conf \
		-I$(srcdir)/access \
		$(AM_CFLAGS) \
1560
		$(PARALLELS_SDK_CFLAGS) $(LIBNL_CFLAGS)
1561 1562
libvirt_driver_vz_impl_la_SOURCES = $(VZ_DRIVER_SOURCES)
libvirt_driver_vz_impl_la_LIBADD =  $(PARALLELS_SDK_LIBS) $(LIBNL_LIBS)
1563
endif WITH_VZ
D
Dmitry Guryanov 已提交
1564

R
Roman Bogorodskiy 已提交
1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577
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 = \
1578 1579
	-I$(srcdir)/access \
	-I$(srcdir)/conf \
R
Roman Bogorodskiy 已提交
1580 1581 1582
	$(AM_CFLAGS)
libvirt_driver_bhyve_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_bhyve_impl_la_SOURCES = $(BHYVE_DRIVER_SOURCES)
1583 1584 1585 1586

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

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

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


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

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

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

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

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


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

1710 1711 1712 1713 1714
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
1715 1716
noinst_LTLIBRARIES += libvirt_storage_backend_fs.la
libvirt_driver_storage_impl_la_LIBADD += libvirt_storage_backend_fs.la
1717
endif ! WITH_DRIVER_MODULES
1718
endif WITH_STORAGE
1719

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

1727 1728 1729 1730 1731
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
1732 1733 1734
noinst_LTLIBRARIES += libvirt_storage_backend_logical.la
libvirt_driver_storage_impl_la_LIBADD += \
	libvirt_storage_backend_logical.la
1735
endif ! WITH_DRIVER_MODULES
1736
endif WITH_STORAGE_LVM
1737

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

1746 1747 1748 1749 1750
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
1751 1752 1753
noinst_LTLIBRARIES += libvirt_storage_backend_iscsi.la
libvirt_driver_storage_impl_la_LIBADD += \
	libvirt_storage_backend_iscsi.la
1754
endif ! WITH_DRIVER_MODULES
1755
endif WITH_STORAGE_ISCSI
1756

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

1763 1764 1765 1766 1767
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
1768 1769
noinst_LTLIBRARIES += libvirt_storage_backend_scsi.la
libvirt_driver_storage_impl_la_LIBADD += libvirt_storage_backend_scsi.la
1770
endif ! WITH_DRIVER_MODULES
1771
endif WITH_STORAGE_SCSI
1772

D
Dave Allan 已提交
1773
if WITH_STORAGE_MPATH
1774 1775 1776 1777 1778 1779 1780 1781
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)

1782 1783 1784 1785 1786
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
1787 1788 1789
noinst_LTLIBRARIES += libvirt_storage_backend_mpath.la
libvirt_driver_storage_impl_la_LIBADD += \
	libvirt_storage_backend_mpath.la
1790
endif ! WITH_DRIVER_MODULES
1791
endif WITH_STORAGE_MPATH
D
Dave Allan 已提交
1792

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

1799 1800 1801 1802 1803
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
1804 1805
noinst_LTLIBRARIES += libvirt_storage_backend_disk.la
libvirt_driver_storage_impl_la_LIBADD += libvirt_storage_backend_disk.la
1806
endif ! WITH_DRIVER_MODULES
1807
endif WITH_STORAGE_DISK
1808

1809
if WITH_STORAGE_RBD
1810 1811 1812 1813 1814 1815 1816
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)

1817 1818 1819 1820 1821
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
1822 1823
noinst_LTLIBRARIES += libvirt_storage_backend_rbd.la
libvirt_driver_storage_impl_la_LIBADD += libvirt_storage_backend_rbd.la
1824
endif ! WITH_DRIVER_MODULES
1825
endif WITH_STORAGE_RBD
1826

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

1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846
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
1847 1848 1849
noinst_LTLIBRARIES += libvirt_storage_backend_sheepdog.la
libvirt_driver_storage_impl_la_LIBADD += \
	libvirt_storage_backend_sheepdog.la
1850
endif ! WITH_DRIVER_MODULES
1851
endif WITH_STORAGE_SHEEPDOG
1852

1853
if WITH_STORAGE_GLUSTER
1854 1855 1856 1857 1858 1859 1860 1861
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)

1862 1863 1864 1865 1866
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
1867 1868 1869
noinst_LTLIBRARIES += libvirt_storage_backend_gluster.la
libvirt_driver_storage_impl_la_LIBADD += \
	libvirt_storage_backend_gluster.la
1870
endif ! WITH_DRIVER_MODULES
1871 1872
endif WITH_STORAGE_GLUSTER

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

1879 1880 1881 1882 1883
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
1884 1885
noinst_LTLIBRARIES += libvirt_storage_backend_zfs.la
libvirt_driver_storage_impl_la_LIBADD += libvirt_storage_backend_zfs.la
1886
endif ! WITH_DRIVER_MODULES
R
Roman Bogorodskiy 已提交
1887 1888
endif WITH_STORAGE_ZFS

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

1896 1897 1898 1899 1900
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
1901 1902 1903
noinst_LTLIBRARIES += libvirt_storage_backend_vstorage.la
libvirt_driver_storage_impl_la_LIBADD += \
	libvirt_storage_backend_vstorage.la
1904
endif ! WITH_DRIVER_MODULES
1905 1906
endif WITH_STORAGE_VSTORAGE

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

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

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

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


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


1977 1978 1979 1980
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 = \
1981
		-I$(srcdir)/conf $(AM_CFLAGS)
1982
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
1983
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
1984
if WITH_SECDRIVER_SELINUX
1985 1986
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
1987
endif WITH_SECDRIVER_SELINUX
J
Jamie Strandboge 已提交
1988
if WITH_SECDRIVER_APPARMOR
1989 1990
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
1991
endif WITH_SECDRIVER_APPARMOR
1992

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

2002 2003
EXTRA_DIST += access/genpolkit.pl

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

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

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

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

2022

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

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) > $@

2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051
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 已提交
2052
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
2053 2054
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
2055 2056 2057
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
2058 2059
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
2060 2061
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
	  > $(srcdir)/access/viraccessapicheck.c
2062

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

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

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

2132 2133
check-local: check-augeas

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

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

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

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

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

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

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

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

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

2189
if WITH_QEMU
2190 2191 2192
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 $< $@
2193 2194 2195
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
2196

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

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

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

2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227
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

2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240
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

2241 2242 2243 2244 2245 2246 2247 2248 2249
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

2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268
#
# 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.
#

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

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

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

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

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

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

2305 2306 2307 2308 2309 2310
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 已提交
2311 2312 2313 2314 2315
if WITH_XENCONFIG
USED_SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
else ! WITH_XENCONFIG
SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
endif ! WITH_XENCONFIG
2316

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

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

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

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

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

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

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

2362
BUILT_SOURCES += $(GENERATED_SYM_FILES)
2363

2364 2365
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(ACCESS_DRIVER_SYM_FILES) \
2366
		$(top_builddir)/config.status
2367 2368 2369 2370 2371 2372
	$(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 && \
2373
	cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
2374 2375
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
2376
	mv $@-tmp libvirt.syms
2377

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

2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398
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

2399 2400 2401 2402
# 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 已提交
2403 2404 2405 2406 2407 2408 2409 2410 2411
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)			\
2412
		$(AM_LDFLAGS)
M
Martin Kletzander 已提交
2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424

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 += \
2425
		$(XDR_CFLAGS)			\
M
Martin Kletzander 已提交
2426 2427 2428 2429
		$(CAPNG_CFLAGS)			\
		$(YAJL_CFLAGS)			\
		$(SSH2_CFLAGS)			\
		$(SASL_CFLAGS)			\
2430 2431
		$(GNUTLS_CFLAGS)		\
		$(LIBSSH_CFLAGS)
M
Martin Kletzander 已提交
2432 2433 2434 2435 2436 2437 2438 2439

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

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

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

2449 2450
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
2451 2452 2453 2454 2455 2456
libvirt_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(LIBVIRT_NODELETE) \
		$(AM_LDFLAGS) \
		$(NULL)
2457
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
2458
libvirt_la_LIBADD += \
2459
		    $(DRIVER_MODULES_LIBS) \
2460
		    $(CYGWIN_EXTRA_LIBADD)
2461
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
2462 2463 2464 2465 2466 2467
# 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)
2468

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

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

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

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

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

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

2498 2499 2500 2501 2502 2503 2504 2505 2506
%_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 已提交
2507
# Keep this list synced with PROTOCOL_STRUCTS
J
Jiri Denemark 已提交
2508 2509 2510
RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
2511
		  $(srcdir)/remote/lxc_protocol.x \
2512 2513
		  $(srcdir)/remote/qemu_protocol.x \
		  $(srcdir)/lxc/lxc_monitor_protocol.x \
M
Martin Kletzander 已提交
2514 2515
		  $(srcdir)/locking/lock_protocol.x \
		  $(srcdir)/admin/admin_protocol.x
2516 2517

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

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

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

2532
EXTRA_DIST += libvirt_probes.d libvirt_qemu_probes.d
2533

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

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

2552 2553 2554 2555 2556 2557 2558
# 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
2559
if WITH_SETUID_RPC_CLIENT
2560 2561 2562 2563
noinst_LTLIBRARIES += libvirt-setuid-rpc-client.la

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

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

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

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

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

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


2687
sbin_PROGRAMS = virtlockd virtlogd
2688

2689 2690 2691
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
2692
		$(LOCK_DAEMON_GENERATED) \
2693
		$(NULL)
2694 2695
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
2696
		$(PIE_CFLAGS) \
2697
		$(XDR_CFLAGS) \
2698 2699 2700
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
2701
		$(PIE_LDFLAGS) \
2702 2703 2704 2705 2706 2707 2708 2709 2710 2711
		$(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
2712
endif WITH_DTRACE_PROBES
2713

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

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

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

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

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

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

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

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

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

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

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

2801 2802 2803 2804 2805 2806 2807 2808 2809
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 $@

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

2812
virtlockd.8.in: locking/virtlockd.pod
2813 2814 2815 2816 2817 2818 2819 2820
	$(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 $@
2821

2822
virtlogd.8.in: logging/virtlogd.pod
2823 2824 2825 2826 2827 2828 2829 2830
	$(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 $@
2831

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

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

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

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

A
Andrea Bolognani 已提交
2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859
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)
2860 2861 2862 2863

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

2876 2877 2878 2879

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

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

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

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

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

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

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

2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937
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 $@

2938

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

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

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

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

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

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

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

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

2992
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2993

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

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

3065 3066 3067 3068 3069
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 已提交
3070 3071
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
3072
libvirt_net_rpc_client_la_LDFLAGS = $(AM_LDFLAGS)
3073 3074
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
3075

3076 3077
libexec_PROGRAMS =

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

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

if WITH_NETWORK
libexec_PROGRAMS += libvirt_leaseshelper
libvirt_leaseshelper_SOURCES = $(NETWORK_LEASES_HELPER_SOURCES)
3100 3101 3102 3103
libvirt_leaseshelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118
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

3119
endif WITH_LIBVIRTD
3120

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

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

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

3147

3148
if WITH_SANLOCK
3149 3150 3151
libexec_PROGRAMS += libvirt_sanlock_helper

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

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

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

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

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

libvirt_nss_la_SOURCES =		\
		util/viralloc.c			\
		util/viralloc.h			\
K
Kai Kang 已提交
3240 3241
		util/viratomic.c		\
		util/viratomic.h		\
3242 3243 3244 3245 3246 3247 3248 3249 3250 3251
		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			\
3252 3253 3254 3255
		util/virhash.c			\
		util/virhash.h			\
		util/virhashcode.c		\
		util/virhashcode.h		\
3256 3257 3258 3259 3260 3261 3262 3263
		util/virjson.c			\
		util/virjson.h			\
		util/virkmod.c			\
		util/virkmod.h			\
		util/virlease.c			\
		util/virlease.h			\
		util/virlog.c			\
		util/virlog.h			\
3264 3265
		util/virmacmap.c		\
		util/virmacmap.h		\
3266 3267 3268 3269 3270 3271
		util/virobject.c		\
		util/virobject.h		\
		util/virpidfile.c		\
		util/virpidfile.h		\
		util/virprocess.c		\
		util/virprocess.h		\
3272 3273
		util/virrandom.c		\
		util/virrandom.h		\
3274 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
		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)
3300
endif WITH_NSS
3301 3302


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

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

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