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

3
## Copyright (C) 2005-2015 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_MODULE_LDFLAGS)			\
G
Guido Günther 已提交
46 47
		$(COVERAGE_LDFLAGS)				\
		$(RELRO_LDFLAGS)				\
48
		$(NO_INDIRECT_LDFLAGS)				\
G
Guido Günther 已提交
49
		$(NULL)
50

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

53
BUILT_SOURCES =
54 55 56
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
57
nodist_conf_DATA =
58

E
Eric Blake 已提交
59 60
THREAD_LIBS = $(LIB_PTHREAD) $(LTLIBMULTITHREAD)

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

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

76
lib_LTLIBRARIES = libvirt.la libvirt-qemu.la libvirt-lxc.la
77

78
moddir = $(libdir)/libvirt/connection-driver
79 80
mod_LTLIBRARIES =

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

84 85 86 87 88 89
augeasdir = $(datadir)/augeas/lenses
augeas_DATA =

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

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

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

E
Eric Blake 已提交
184
BUILT_SOURCES += util/virkeymaps.h
185
MAINTAINERCLEANFILES += util/virkeymaps.h
186

E
Eric Blake 已提交
187
util/virkeymaps.h: $(srcdir)/util/keymaps.csv	\
L
Lai Jiangshan 已提交
188
		$(srcdir)/util/virkeycode-mapgen.py
189
	$(MKDIR_P) util/
190
	$(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py \
191
	  <$(srcdir)/util/keymaps.csv >util/virkeymaps.h
L
Lai Jiangshan 已提交
192

193
# Internal generic driver infrastructure
194
NODE_INFO_SOURCES = nodeinfo.h nodeinfo.c nodeinfopriv.h
O
Osier Yang 已提交
195 196 197
DATATYPES_SOURCES = datatypes.h datatypes.c
DRIVER_SOURCES =							\
		driver.c driver.h					\
198 199 200 201 202 203 204 205 206
		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 已提交
207 208 209 210 211
		internal.h						\
		$(DATATYPES_SOURCES)					\
		fdstream.c fdstream.h					\
		$(NODE_INFO_SOURCES)					\
		libvirt.c libvirt_internal.h				\
212
		libvirt-domain.c 					\
213
		libvirt-domain-snapshot.c 				\
214
		libvirt-host.c 						\
215
		libvirt-interface.c	 				\
216
		libvirt-network.c	 				\
217
		libvirt-nodedev.c	 				\
218
		libvirt-nwfilter.c	 				\
219
		libvirt-secret.c	 				\
220
		libvirt-storage.c	 				\
221
		libvirt-stream.c	 				\
O
Osier Yang 已提交
222 223 224
		locking/lock_manager.c locking/lock_manager.h		\
		locking/lock_driver.h					\
		locking/lock_driver_nop.h locking/lock_driver_nop.c	\
225 226 227
		locking/domain_lock.h locking/domain_lock.c		\
		logging/log_manager.c logging/log_manager.h		\
		$(NULL)
228

229 230 231
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

232 233
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
234

235
LOCK_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
236 237
		locking/lock_protocol.h \
		locking/lock_protocol.c \
238 239
		$(NULL)

240 241 242
LOCK_PROTOCOL = $(srcdir)/locking/lock_protocol.x
EXTRA_DIST += $(LOCK_PROTOCOL) \
	$(LOCK_PROTOCOL_GENERATED)
243 244 245
BUILT_SOURCES += $(LOCK_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(LOCK_PROTOCOL_GENERATED)

246
LOCK_DAEMON_GENERATED = \
247
		locking/lock_daemon_dispatch_stubs.h
248 249 250
		$(NULL)

BUILT_SOURCES += $(LOCK_DAEMON_GENERATED)
251
EXTRA_DIST += $(LOCK_DAEMON_GENERATED)
252 253
MAINTAINERCLEANFILES += $(LOCK_DAEMON_GENERATED)

254 255
LOCK_DRIVER_LOCKD_SOURCES = \
		locking/lock_driver_lockd.c \
256
		locking/lock_driver_lockd.h \
257 258
		$(NULL)

259 260 261 262 263
LOCK_DAEMON_SOURCES = \
		locking/lock_daemon.h \
		locking/lock_daemon.c \
		locking/lock_daemon_config.h \
		locking/lock_daemon_config.c \
264 265
		locking/lock_daemon_dispatch.c \
		locking/lock_daemon_dispatch.h \
266 267
		$(NULL)

E
Eric Blake 已提交
268
locking/lock_daemon_dispatch_stubs.h: $(LOCK_PROTOCOL) \
269
		$(srcdir)/rpc/gendispatch.pl Makefile.am
270 271
	$(AM_V_GEN)perl -w $(srcdir)/rpc/gendispatch.pl --mode=server \
	    virLockSpaceProtocol VIR_LOCK_SPACE_PROTOCOL \
E
Eric Blake 已提交
272
	    $(LOCK_PROTOCOL) > $(srcdir)/locking/lock_daemon_dispatch_stubs.h
273 274


275 276 277 278 279
LOG_PROTOCOL_GENERATED = \
		logging/log_protocol.h \
		logging/log_protocol.c \
		$(NULL)

280 281
DRIVER_SOURCES += $(LOG_PROTOCOL_GENERATED)

282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302
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 \
303 304
		logging/log_handler.c \
		logging/log_handler.h \
305 306 307 308 309 310 311 312 313
		$(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


314 315
NETDEV_CONF_SOURCES =						\
		conf/netdev_bandwidth_conf.h conf/netdev_bandwidth_conf.c \
316 317
		conf/netdev_vport_profile_conf.h conf/netdev_vport_profile_conf.c \
		conf/netdev_vlan_conf.h conf/netdev_vlan_conf.c
318

319
# XML configuration format handling sources
320 321
# Domain driver generic impl APIs
DOMAIN_CONF_SOURCES =						\
322
		conf/capabilities.c conf/capabilities.h		\
323
		conf/domain_addr.c conf/domain_addr.h		\
M
Michal Privoznik 已提交
324
		conf/domain_capabilities.c conf/domain_capabilities.h	\
325
		conf/domain_conf.c conf/domain_conf.h		\
326
		conf/domain_audit.c conf/domain_audit.h		\
327
		conf/domain_nwfilter.c conf/domain_nwfilter.h	\
328
		conf/snapshot_conf.c conf/snapshot_conf.h	\
329 330
		conf/numa_conf.c conf/numa_conf.h	\
		conf/virdomainobjlist.c conf/virdomainobjlist.h
331

332 333 334 335
OBJECT_EVENT_SOURCES =						\
		conf/object_event.c conf/object_event.h \
		conf/object_event_private.h

336 337
DOMAIN_EVENT_SOURCES =						\
		conf/domain_event.c conf/domain_event.h
338

339 340 341
NETWORK_EVENT_SOURCES =						\
		conf/network_event.c conf/network_event.h

342
# Network driver generic impl APIs
343
NETWORK_CONF_SOURCES =						\
344 345
		conf/network_conf.c conf/network_conf.h \
		conf/networkcommon_conf.c conf/networkcommon_conf.h
346

347 348
# Network filter driver generic impl APIs
NWFILTER_PARAM_CONF_SOURCES =					\
349
		conf/nwfilter_params.c conf/nwfilter_params.h	\
350 351
		conf/nwfilter_ipaddrmap.c			\
		conf/nwfilter_ipaddrmap.h			\
352
		conf/nwfilter_conf.h
353

354
NWFILTER_CONF_SOURCES =						\
355 356 357
		$(NWFILTER_PARAM_CONF_SOURCES)			\
		conf/nwfilter_conf.c conf/nwfilter_conf.h

358
# Storage driver generic impl APIs
359 360
STORAGE_CONF_SOURCES =                                         \
		conf/storage_conf.h conf/storage_conf.c
361

362
# Interface driver generic impl APIs
363 364
INTERFACE_CONF_SOURCES =                                       \
		conf/interface_conf.c conf/interface_conf.h
365

366
# Secret driver generic impl APIs
367
SECRET_CONF_SOURCES =                                          \
368 369
		conf/secret_conf.h conf/secret_conf.c          \
		conf/virsecretobj.h conf/virsecretobj.c
370 371 372 373 374

# Network driver generic impl APIs
NODE_DEVICE_CONF_SOURCES =                                     \
		conf/node_device_conf.c conf/node_device_conf.h

375 376
CPU_CONF_SOURCES =						\
		conf/cpu_conf.c conf/cpu_conf.h
377

378 379
# Safe character device handling helper APIs
CHRDEV_CONF_SOURCES =						\
380
		conf/virchrdev.c conf/virchrdev.h
381

382 383 384 385
# Device Helper APIs
DEVICE_CONF_SOURCES =                                           \
		conf/device_conf.c conf/device_conf.h

386
CONF_SOURCES =							\
387
		$(NETDEV_CONF_SOURCES)				\
388
		$(DOMAIN_CONF_SOURCES)				\
389
		$(OBJECT_EVENT_SOURCES)				\
390
		$(DOMAIN_EVENT_SOURCES)				\
391
		$(NETWORK_EVENT_SOURCES)			\
392
		$(NETWORK_CONF_SOURCES)				\
393
		$(NWFILTER_CONF_SOURCES)			\
394 395 396
		$(NODE_DEVICE_CONF_SOURCES)			\
		$(STORAGE_CONF_SOURCES)				\
		$(INTERFACE_CONF_SOURCES)			\
397
		$(SECRET_CONF_SOURCES)				\
398
		$(CPU_CONF_SOURCES)				\
399
		$(CHRDEV_CONF_SOURCES)				\
400
		$(DEVICE_CONF_SOURCES)
401

402
# The remote RPC driver, covering domains, storage, networks, etc
403
REMOTE_DRIVER_GENERATED = \
E
Eric Blake 已提交
404 405 406 407 408 409 410 411 412 413
		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 已提交
414 415

REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x
416
LXC_PROTOCOL = $(srcdir)/remote/lxc_protocol.x
E
Eric Blake 已提交
417
QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x
418
REMOTE_DRIVER_PROTOCOL = $(REMOTE_PROTOCOL) $(QEMU_PROTOCOL) $(LXC_PROTOCOL)
419

E
Eric Blake 已提交
420
remote/remote_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
421
		$(REMOTE_PROTOCOL) Makefile.am
422
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
423 424
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/remote/remote_client_bodies.h
425

E
Eric Blake 已提交
426
remote/lxc_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
427
		$(LXC_PROTOCOL) Makefile.am
428
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
429 430
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/remote/lxc_client_bodies.h
431

E
Eric Blake 已提交
432
remote/qemu_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
433
		$(QEMU_PROTOCOL) Makefile.am
434
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
435 436
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/remote/qemu_client_bodies.h
437 438 439 440 441

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

443
EXTRA_DIST +=  $(REMOTE_DRIVER_PROTOCOL) \
444
		$(REMOTE_DRIVER_GENERATED)
445

M
Martin Kletzander 已提交
446 447 448 449
ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x

ADMIN_PROTOCOL_GENERATED = \
		admin/admin_protocol.c	\
450 451 452 453 454 455 456 457
		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 已提交
458 459 460 461 462

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

463 464 465 466 467 468 469 470 471 472
# 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
473 474 475 476

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

487
# Depending on configure options, libtool creates one or both of
E
Eric Blake 已提交
488 489
# remote/{,.libs/}libvirt_driver_remote_la-remote_protocol.o.  We want
# the newest of the two, in case configure options changed and a stale
490
# file is left around from an earlier build.
491
PDWTAGS = \
492
	$(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then		\
E
Eric Blake 已提交
493 494
	  o=`ls -t $(<:.lo=.$(OBJEXT))					\
	     $(subst /,/.libs/,$(<:.lo=.$(OBJEXT)))			\
495 496 497
	    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 已提交
498
	  if test ! -s $(@F)-t1 && test -s $(@F)-t2; then		\
499 500 501
	    rm -rf $(@F)-t?;						\
	    echo 'WARNING: pdwtags appears broken; skipping the $@ test' >&2;\
	  else								\
502
	    $(PERL) -0777 -n						\
503
		-e 'foreach my $$p (split m!\n*(?:$(r1)|$(r2))\n!) {'	\
504
		-e '  if ($$p =~ /^(struct|enum) $(struct_prefix)/ ||'	\
505
		-e '      $$p =~ /^enum \{/) {'				\
506 507 508
		-e '    $$p =~ s!\t*/\*.*?\*/!!sg;'			\
		-e '    $$p =~ s!\s+\n!\n!sg;'				\
		-e '    $$p =~ s!\s+$$!!;'				\
509
		-e '    $$p =~ s!\t!        !g;'			\
510 511 512 513
		-e '    print "$$p\n";'					\
		-e '    $$n++;'						\
		-e '  }'						\
		-e '}'							\
514 515 516
		-e 'BEGIN {'						\
		-e '  print "/* -*- c -*- */\n";'			\
		-e '}'							\
517
		-e 'END {'						\
518
		-e '  if ($$n < 1) {'					\
519 520 521 522 523 524
		-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 '}'							\
525 526
		< $(@F)-t1 > $(@F)-t3;					\
	    case $$? in 8) rm -f $(@F)-t?; exit 0;; 0) ;; *) exit 1;; esac;\
527
	    diff -u $(@)s $(@F)-t3; st=$$?; rm -f $(@F)-t?; exit $$st;	\
528
	  fi;								\
529
	else								\
530 531
	  echo 'WARNING: you lack pdwtags; skipping the $@ test' >&2;	\
	  echo 'WARNING: install the dwarves package to get pdwtags' >&2; \
532
	fi
533

534
# .libs/libvirt.so is built by libtool as a side-effect of the Makefile
535 536
# rule for libvirt.la.  However, checking symbols relies on Linux ELF layout
if WITH_LINUX
537 538 539
check-symfile: libvirt.syms libvirt.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt.syms \
	  .libs/libvirt.so
540 541 542
check-admin-symfile: libvirt_admin.syms libvirt-admin.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt_admin.syms \
	  .libs/libvirt-admin.so
543
else ! WITH_LINUX
544
check-symfile:
545
check-admin-symfile:
546
endif ! WITH_LINUX
547
check-symsorting:
548
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
549
		$(srcdir) $(SYM_FILES)
550 551 552
check-admin-symsorting:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
		$(srcdir) $(ADMIN_SYM_FILES)
J
Jiri Denemark 已提交
553
EXTRA_DIST += check-symfile.pl check-symsorting.pl
554

E
Eric Blake 已提交
555
# Keep this list synced with RPC_PROBE_FILES
556 557
PROTOCOL_STRUCTS = \
	$(srcdir)/remote_protocol-structs \
558
	$(srcdir)/lxc_protocol-structs \
559
	$(srcdir)/qemu_protocol-structs \
J
Jiri Denemark 已提交
560
	$(srcdir)/virnetprotocol-structs \
E
Eric Blake 已提交
561 562 563
	$(srcdir)/virkeepaliveprotocol-structs \
	$(srcdir)/lxc_monitor_protocol-structs \
	$(srcdir)/lock_protocol-structs \
M
Martin Kletzander 已提交
564
	$(srcdir)/admin_protocol-structs \
E
Eric Blake 已提交
565 566
	$(NULL)

567
if WITH_REMOTE
568 569
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)

570 571
# 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.
572 573 574
$(srcdir)/remote_protocol-struct \
	$(srcdir)/qemu_protocol-struct \
	$(srcdir)/lxc_protocol-struct: \
E
Eric Blake 已提交
575
		$(srcdir)/%-struct: remote/libvirt_driver_remote_la-%.lo
576
	$(PDWTAGS)
577
$(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \
E
Eric Blake 已提交
578
		$(srcdir)/%-struct: rpc/libvirt_net_rpc_la-%.lo
579
	$(PDWTAGS)
E
Eric Blake 已提交
580
$(srcdir)/lxc_monitor_protocol-struct: \
E
Eric Blake 已提交
581
		$(srcdir)/%-struct: lxc/libvirt_driver_lxc_impl_la-%.lo
E
Eric Blake 已提交
582 583
	$(PDWTAGS)
$(srcdir)/lock_protocol-struct: \
E
Eric Blake 已提交
584
		$(srcdir)/%-struct: locking/lockd_la-%.lo
E
Eric Blake 已提交
585
	$(PDWTAGS)
M
Martin Kletzander 已提交
586 587 588
$(srcdir)/admin_protocol-struct: \
		$(srcdir)/%-struct: admin/libvirt_admin_la-%.lo
	$(PDWTAGS)
E
Eric Blake 已提交
589

590
else !WITH_REMOTE
591 592 593
# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be
# re-generated when configured --without-remote.
check-protocol:
594
endif !WITH_REMOTE
J
Jiri Denemark 已提交
595
EXTRA_DIST += $(PROTOCOL_STRUCTS)
596 597 598 599 600

check-drivername:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-drivername.pl \
		$(srcdir)/driver.h \
		$(srcdir)/libvirt_public.syms \
601
		$(srcdir)/libvirt_admin_public.syms \
602 603 604 605 606
		$(srcdir)/libvirt_qemu.syms \
		$(srcdir)/libvirt_lxc.syms

EXTRA_DIST += check-drivername.pl

607
DRIVER_SOURCE_FILES = \
608 609 610 611 612 613 614 615 616 617 618
	$(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) \
619
	$(VZ_DRIVER_SOURCES) \
620 621 622 623 624 625 626 627
	$(PHYP_DRIVER_SOURCES) \
	$(QEMU_DRIVER_SOURCES) \
	$(REMOTE_DRIVER_SOURCES) \
	$(SECRET_DRIVER_SOURCES) \
	$(STORAGE_DRIVER_SOURCES) \
	$(TEST_DRIVER_SOURCES) \
	$(UML_DRIVER_SOURCES) \
	$(VBOX_DRIVER_SOURCES) \
628
	vbox/vbox_tmpl.c \
629 630 631
	$(VMWARE_DRIVER_SOURCES) \
	$(XEN_DRIVER_SOURCES) \
	$(XENAPI_DRIVER_SOURCES) \
632 633
	$(NULL)

634
STATEFUL_DRIVER_SOURCE_FILES = \
R
Roman Bogorodskiy 已提交
635
	$(BHYVE_DRIVER_SOURCES) \
636 637 638 639 640 641 642 643 644 645 646 647 648
	$(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) \
	$(NULL)

649 650 651

check-driverimpls:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-driverimpls.pl \
652
		$(filter /%,$(DRIVER_SOURCE_FILES)) \
E
Eric Blake 已提交
653 654 655
		$(filter $(srcdir)/%,$(DRIVER_SOURCE_FILES)) \
		$(addprefix $(srcdir)/,$(filter-out $(srcdir)/%, \
			$(filter-out /%,$(DRIVER_SOURCE_FILES))))
656

657 658
check-aclrules:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclrules.pl \
E
Eric Blake 已提交
659
		$(REMOTE_PROTOCOL) \
660
		$(addprefix $(srcdir)/,$(filter-out /%,$(STATEFUL_DRIVER_SOURCE_FILES)))
661

662 663 664 665 666
check-aclperms:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclperms.pl \
		$(srcdir)/access/viraccessperm.h \
		$(srcdir)/access/viraccessperm.c

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

669
check-local: check-protocol check-symfile check-symsorting \
670
	check-drivername check-driverimpls check-aclrules \
671
	check-aclperms check-admin-symfile check-admin-symsorting
672
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
673

674 675
# Mock driver, covering domains, storage, networks, etc
TEST_DRIVER_SOURCES =						\
676
		test/test_driver.c test/test_driver.h
677 678 679

# Now the Hypervisor specific drivers
XEN_DRIVER_SOURCES =						\
680 681 682 683 684 685
		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
686
if WITH_XEN_INOTIFY
687
XEN_DRIVER_SOURCES += xen/xen_inotify.c xen/xen_inotify.h
688
endif WITH_XEN_INOTIFY
689

690
LXC_MONITOR_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
691 692
	lxc/lxc_monitor_protocol.h \
	lxc/lxc_monitor_protocol.c \
693 694 695
	$(NULL)

LXC_MONITOR_GENERATED = \
E
Eric Blake 已提交
696
	lxc/lxc_monitor_dispatch.h \
697 698 699
	$(NULL)

LXC_CONTROLLER_GENERATED = \
E
Eric Blake 已提交
700
	lxc/lxc_controller_dispatch.h \
701 702 703
	$(NULL)

LXC_GENERATED = \
704
	$(LXC_MONITOR_PROTOCOL_GENERATED) \
705 706 707 708
	$(LXC_MONITOR_GENERATED) \
	$(LXC_CONTROLLER_GENERATED) \
	$(NULL)

709
LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x
710

E
Eric Blake 已提交
711
lxc/lxc_monitor_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
712
		$(LXC_MONITOR_PROTOCOL) Makefile.am
713
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
714 715
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_monitor_dispatch.h
716

E
Eric Blake 已提交
717
lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
718
		$(REMOTE_PROTOCOL) Makefile.am
719
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \
E
Eric Blake 已提交
720 721
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_controller_dispatch.h
722 723

EXTRA_DIST += \
724
	$(LXC_MONITOR_PROTOCOL) \
725 726 727 728 729
	$(LXC_GENERATED) \
	$(NULL)

BUILT_SOURCES += $(LXC_GENERATED)

730 731
CLEANFILES += $(LXC_GENERATED)

732
LXC_DRIVER_SOURCES =						\
733
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
734
		$(LXC_MONITOR_GENERATED)			\
735 736
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
737
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
738
		lxc/lxc_domain.c lxc/lxc_domain.h		\
739
		lxc/lxc_hostdev.c lxc/lxc_hostdev.h		\
740
		lxc/lxc_monitor.c lxc/lxc_monitor.h		\
741
		lxc/lxc_process.c lxc/lxc_process.h		\
G
Gao feng 已提交
742
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
743
		lxc/lxc_native.c lxc/lxc_native.h		\
744
		lxc/lxc_driver.c lxc/lxc_driver.h
745

746
LXC_CONTROLLER_SOURCES =					\
747
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
748
		$(LXC_CONTROLLER_GENERATED)			\
749 750
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
751
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
752
		lxc/lxc_domain.c lxc/lxc_domain.h		\
G
Gao feng 已提交
753
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
754
		lxc/lxc_controller.c
755

J
Jamie Strandboge 已提交
756
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES =			\
E
Eric Blake 已提交
757
		$(DATATYPES_SOURCES)				\
J
Jamie Strandboge 已提交
758 759
		security/virt-aa-helper.c

760 761 762
PHYP_DRIVER_SOURCES =						\
		phyp/phyp_driver.c phyp/phyp_driver.h

763
OPENVZ_DRIVER_SOURCES =						\
764
		openvz/openvz_conf.c openvz/openvz_conf.h	\
765 766
		openvz/openvz_driver.c openvz/openvz_driver.h   \
		openvz/openvz_util.c openvz/openvz_util.h
767

E
Eric Blake 已提交
768
VMWARE_DRIVER_SOURCES =						\
769
		vmware/vmware_driver.c vmware/vmware_driver.h	\
770 771
		vmware/vmware_conf.c vmware/vmware_conf.h

772
VBOX_DRIVER_SOURCES =						\
E
Eric Blake 已提交
773 774
	vbox/vbox_glue.c vbox/vbox_glue.h			\
	vbox/vbox_driver.c vbox/vbox_driver.h			\
T
Taowei 已提交
775
	vbox/vbox_snapshot_conf.c vbox/vbox_snapshot_conf.h     \
E
Eric Blake 已提交
776 777 778 779
	vbox/vbox_V2_2.c vbox/vbox_CAPI_v2_2.h			\
	vbox/vbox_V3_0.c vbox/vbox_CAPI_v3_0.h			\
	vbox/vbox_V3_1.c vbox/vbox_CAPI_v3_1.h			\
	vbox/vbox_V3_2.c vbox/vbox_CAPI_v3_2.h			\
780
	vbox/vbox_V4_0.c vbox/vbox_CAPI_v4_0.h			\
781
	vbox/vbox_V4_1.c vbox/vbox_CAPI_v4_1.h			\
R
Ryota Ozaki 已提交
782
	vbox/vbox_V4_2.c vbox/vbox_CAPI_v4_2.h			\
T
Taowei 已提交
783
	vbox/vbox_V4_2_20.c vbox/vbox_CAPI_v4_2_20.h		\
784
	vbox/vbox_V4_3.c vbox/vbox_CAPI_v4_3.h			\
T
Taowei 已提交
785 786 787
	vbox/vbox_V4_3_4.c vbox/vbox_CAPI_v4_3_4.h              \
	vbox/vbox_common.c vbox/vbox_common.h                   \
	vbox/vbox_uniformed_api.h                               \
788 789 790
	vbox/vbox_get_driver.h					\
	vbox/vbox_network.c					\
	vbox/vbox_storage.c
T
Taowei Luo 已提交
791

E
Eric Blake 已提交
792
VBOX_DRIVER_EXTRA_DIST =					\
793 794 795
		vbox/vbox_tmpl.c vbox/README			\
		vbox/vbox_MSCOMGlue.c vbox/vbox_MSCOMGlue.h	\
		vbox/vbox_XPCOMCGlue.c vbox/vbox_XPCOMCGlue.h
796

O
Osier Yang 已提交
797 798
QEMU_DRIVER_SOURCES =							\
		qemu/qemu_agent.c qemu/qemu_agent.h			\
799
		qemu/qemu_alias.c qemu/qemu_alias.h			\
800
		qemu/qemu_blockjob.c qemu/qemu_blockjob.h		\
O
Osier Yang 已提交
801 802
		qemu/qemu_capabilities.c qemu/qemu_capabilities.h	\
		qemu/qemu_command.c qemu/qemu_command.h			\
803
		qemu/qemu_parse_command.c qemu/qemu_parse_command.h	\
O
Osier Yang 已提交
804
		qemu/qemu_domain.c qemu/qemu_domain.h			\
805
		qemu/qemu_domain_address.c qemu/qemu_domain_address.h	\
O
Osier Yang 已提交
806 807 808
		qemu/qemu_cgroup.c qemu/qemu_cgroup.h			\
		qemu/qemu_hostdev.c qemu/qemu_hostdev.h			\
		qemu/qemu_hotplug.c qemu/qemu_hotplug.h			\
809
		qemu/qemu_hotplugpriv.h					\
O
Osier Yang 已提交
810 811
		qemu/qemu_conf.c qemu/qemu_conf.h			\
		qemu/qemu_process.c qemu/qemu_process.h			\
812
		qemu/qemu_processpriv.h					\
O
Osier Yang 已提交
813 814 815 816 817 818
		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				\
819
		qemu/qemu_driver.c qemu/qemu_driver.h	\
820 821
		qemu/qemu_interface.c qemu/qemu_interface.h		\
		qemu/qemu_capspriv.h
R
Richard W.M. Jones 已提交
822

O
Osier Yang 已提交
823
XENAPI_DRIVER_SOURCES =						\
824
		xenapi/xenapi_driver.c xenapi/xenapi_driver.h	\
O
Osier Yang 已提交
825
		xenapi/xenapi_driver_private.h			\
826 827
		xenapi/xenapi_utils.c xenapi/xenapi_utils.h

J
Jim Fehlig 已提交
828 829
LIBXL_DRIVER_SOURCES =						\
		libxl/libxl_conf.c libxl/libxl_conf.h		\
J
Jim Fehlig 已提交
830
		libxl/libxl_domain.c libxl/libxl_domain.h       \
J
Jim Fehlig 已提交
831 832
		libxl/libxl_driver.c libxl/libxl_driver.h       \
		libxl/libxl_migration.c libxl/libxl_migration.h
J
Jim Fehlig 已提交
833

834
UML_DRIVER_SOURCES =						\
D
Daniel P. Berrange 已提交
835 836
		uml/uml_conf.c uml/uml_conf.h			\
		uml/uml_driver.c uml/uml_driver.h
837

O
Osier Yang 已提交
838 839 840 841 842 843
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	\
844
		esx/esx_storage_backend_vmfs.c esx/esx_storage_backend_vmfs.h	\
845
		esx/esx_storage_backend_iscsi.c esx/esx_storage_backend_iscsi.h	\
846
		esx/esx_stream.c esx/esx_stream.h			\
O
Osier Yang 已提交
847 848 849
		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		\
850
		esx/esx_vi_types.c esx/esx_vi_types.h
851

852
ESX_DRIVER_GENERATED =							\
853 854
		esx/esx_vi_methods.generated.c				\
		esx/esx_vi_methods.generated.h				\
855
		esx/esx_vi_methods.generated.macro			\
856 857 858 859 860
		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			\
861 862 863
		esx/esx_vi_types.generated.typefromstring		\
		esx/esx_vi.generated.c					\
		esx/esx_vi.generated.h
864

O
Osier Yang 已提交
865
ESX_DRIVER_EXTRA_DIST =							\
866 867 868 869 870
		esx/README						\
		esx/esx_vi_generator.input				\
		esx/esx_vi_generator.py					\
		$(ESX_DRIVER_GENERATED)

O
Osier Yang 已提交
871
HYPERV_DRIVER_SOURCES =									\
M
Matthias Bolte 已提交
872 873
		hyperv/hyperv_private.h							\
		hyperv/hyperv_driver.c hyperv/hyperv_driver.h				\
874
		hyperv/hyperv_util.c hyperv/hyperv_util.h				\
875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890
		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)

891
VZ_DRIVER_SOURCES =				\
892 893 894 895 896 897
		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 已提交
898

R
Roman Bogorodskiy 已提交
899
BHYVE_DRIVER_SOURCES =						\
900 901
		bhyve/bhyve_capabilities.c			\
		bhyve/bhyve_capabilities.h			\
R
Roman Bogorodskiy 已提交
902 903
		bhyve/bhyve_command.c				\
		bhyve/bhyve_command.h				\
904 905 906 907
		bhyve/bhyve_device.c				\
		bhyve/bhyve_device.h				\
		bhyve/bhyve_domain.c				\
		bhyve/bhyve_domain.h				\
R
Roman Bogorodskiy 已提交
908 909
		bhyve/bhyve_driver.h				\
		bhyve/bhyve_driver.c				\
910 911
		bhyve/bhyve_monitor.c				\
		bhyve/bhyve_monitor.h				\
R
Roman Bogorodskiy 已提交
912 913 914 915 916
		bhyve/bhyve_process.c				\
		bhyve/bhyve_process.h				\
		bhyve/bhyve_utils.h				\
		$(NULL)

917
NETWORK_DRIVER_SOURCES =					\
918 919 920 921 922
		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
923

924 925 926 927
INTERFACE_DRIVER_SOURCES =

if WITH_INTERFACE
INTERFACE_DRIVER_SOURCES +=					\
928 929
		interface/interface_driver.h        \
		interface/interface_driver.c
930 931 932 933

if WITH_NETCF
INTERFACE_DRIVER_SOURCES +=					\
		interface/interface_backend_netcf.c
934
endif WITH_NETCF
935
if WITH_UDEV
936 937
INTERFACE_DRIVER_SOURCES +=					\
		interface/interface_backend_udev.c
938 939
endif WITH_UDEV
endif WITH_INTERFACE
940

941 942 943
SECRET_UTIL_SOURCES =						\
		secret/secret_util.h secret/secret_util.c

944
SECRET_DRIVER_SOURCES =						\
945
		secret/secret_driver.h secret/secret_driver.c
946

947
# Storage backend specific impls
O
Osier Yang 已提交
948 949
STORAGE_DRIVER_SOURCES =						\
		storage/storage_driver.h storage/storage_driver.c	\
950
		storage/storage_backend.h storage/storage_backend.c
951 952

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

955
STORAGE_DRIVER_LVM_SOURCES =					\
O
Osier Yang 已提交
956
		storage/storage_backend_logical.h		\
957
		storage/storage_backend_logical.c
958 959

STORAGE_DRIVER_ISCSI_SOURCES =					\
960
		storage/storage_backend_iscsi.h storage/storage_backend_iscsi.c
961

962
STORAGE_DRIVER_SCSI_SOURCES =					\
963
		storage/storage_backend_scsi.h storage/storage_backend_scsi.c
964

D
Dave Allan 已提交
965
STORAGE_DRIVER_MPATH_SOURCES =					\
966
		storage/storage_backend_mpath.h storage/storage_backend_mpath.c
D
Dave Allan 已提交
967

968
STORAGE_DRIVER_DISK_SOURCES =					\
969
		storage/storage_backend_disk.h storage/storage_backend_disk.c
970

971 972 973
STORAGE_DRIVER_RBD_SOURCES =					\
		storage/storage_backend_rbd.h storage/storage_backend_rbd.c

974 975 976
STORAGE_DRIVER_SHEEPDOG_SOURCES =				\
		storage/storage_backend_sheepdog.h storage/storage_backend_sheepdog.c

977 978 979
STORAGE_DRIVER_GLUSTER_SOURCES =				\
		storage/storage_backend_gluster.h storage/storage_backend_gluster.c

R
Roman Bogorodskiy 已提交
980 981 982
STORAGE_DRIVER_ZFS_SOURCES =					\
                storage/storage_backend_zfs.h storage/storage_backend_zfs.c

983
STORAGE_HELPER_DISK_SOURCES =					\
984
		storage/parthelper.c
985

986 987 988
UTIL_IO_HELPER_SOURCES =					\
		util/iohelper.c

989 990 991
NETWORK_LEASES_HELPER_SOURCES =                                 \
               network/leaseshelper.c

992
# Network filters
O
Osier Yang 已提交
993
NWFILTER_DRIVER_SOURCES =						\
994
		nwfilter/nwfilter_driver.h nwfilter/nwfilter_driver.c	\
995
		nwfilter/nwfilter_tech_driver.h				\
996 997
		nwfilter/nwfilter_gentech_driver.c			\
		nwfilter/nwfilter_gentech_driver.h			\
S
Stefan Berger 已提交
998 999
		nwfilter/nwfilter_dhcpsnoop.c				\
		nwfilter/nwfilter_dhcpsnoop.h				\
1000
		nwfilter/nwfilter_ebiptables_driver.c			\
1001 1002 1003
		nwfilter/nwfilter_ebiptables_driver.h			\
		nwfilter/nwfilter_learnipaddr.c				\
		nwfilter/nwfilter_learnipaddr.h
1004

1005

1006
# Security framework and drivers for various models
O
Osier Yang 已提交
1007 1008 1009 1010 1011
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		\
1012
		security/security_manager.h security/security_manager.c
1013

1014
SECURITY_DRIVER_SELINUX_SOURCES =				\
1015
		security/security_selinux.h security/security_selinux.c
1016

J
Jamie Strandboge 已提交
1017 1018 1019
SECURITY_DRIVER_APPARMOR_SOURCES =				\
		security/security_apparmor.h security/security_apparmor.c

1020
ACCESS_DRIVER_GENERATED = \
E
Eric Blake 已提交
1021 1022 1023 1024 1025 1026 1027
		access/viraccessapicheck.h \
		access/viraccessapicheck.c \
		access/viraccessapicheckqemu.h \
		access/viraccessapicheckqemu.c \
		access/viraccessapichecklxc.h \
		access/viraccessapichecklxc.c \
		$(NULL)
1028

1029
ACCESS_DRIVER_SYM_FILES = \
1030 1031 1032
		libvirt_access.syms \
		libvirt_access_qemu.syms \
		libvirt_access_lxc.syms
1033

1034 1035 1036 1037 1038
ACCESS_DRIVER_API_FILES = \
		libvirt_access.xml \
		libvirt_access_qemu.xml \
		libvirt_access_lxc.xml

1039 1040 1041 1042 1043 1044 1045
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

1046 1047 1048 1049
ACCESS_DRIVER_POLKIT_SOURCES = \
		access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c

ACCESS_DRIVER_POLKIT_POLICY = \
1050
		$(srcdir)/access/org.libvirt.api.policy
1051 1052


1053
NODE_DEVICE_DRIVER_SOURCES =					\
O
Osier Yang 已提交
1054 1055
		node_device/node_device_driver.c		\
		node_device/node_device_driver.h		\
1056 1057
		node_device/node_device_linux_sysfs.c           \
		node_device/node_device_linux_sysfs.h
1058 1059

NODE_DEVICE_DRIVER_HAL_SOURCES =				\
1060
		node_device/node_device_hal.c			\
1061
		node_device/node_device_hal.h
1062

1063
NODE_DEVICE_DRIVER_UDEV_SOURCES =				\
D
Daniel Veillard 已提交
1064 1065
		node_device/node_device_udev.c			\
		node_device/node_device_udev.h
1066

J
Jiri Denemark 已提交
1067 1068 1069 1070
CPU_SOURCES =							\
		cpu/cpu.h cpu/cpu.c				\
		cpu/cpu_generic.h cpu/cpu_generic.c		\
		cpu/cpu_x86.h cpu/cpu_x86.c cpu/cpu_x86_data.h	\
T
Thang Pham 已提交
1071
		cpu/cpu_s390.h cpu/cpu_s390.c			\
C
Chuck Short 已提交
1072
		cpu/cpu_arm.h cpu/cpu_arm.c			\
1073
		cpu/cpu_aarch64.h cpu/cpu_aarch64.c		\
1074 1075 1076
		cpu/cpu_ppc64.h cpu/cpu_ppc64.c			\
		cpu/cpu_ppc64_data.h				\
		cpu/cpu_map.h cpu/cpu_map.c
1077

1078 1079 1080
VMX_SOURCES =							\
		vmx/vmx.c vmx/vmx.h

1081 1082
XENCONFIG_SOURCES =						\
		xenconfig/xenxs_private.h			\
1083
		xenconfig/xen_common.c xenconfig/xen_common.h   \
1084
		xenconfig/xen_sxpr.c xenconfig/xen_sxpr.h	\
1085
		xenconfig/xen_xm.c xenconfig/xen_xm.h
1086 1087 1088 1089
if WITH_LIBXL
XENCONFIG_SOURCES +=						\
		xenconfig/xen_xl.c xenconfig/xen_xl.h
endif WITH_LIBXL
1090

J
Jiri Denemark 已提交
1091 1092
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
1093
EXTRA_DIST +=	$(pkgdata_DATA)
1094

1095 1096 1097 1098 1099 1100
#########################
#
# Build up list of libvirt.la source files based on configure conditions
#
# First deal with sources usable in non-daemon context

1101
noinst_LTLIBRARIES = libvirt_util.la
1102 1103
libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
libvirt_la_BUILT_LIBADD = libvirt_util.la
1104 1105
libvirt_util_la_SOURCES =					\
		$(UTIL_SOURCES)
1106
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
1107
		$(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
1108
		$(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS)	\
1109
		$(SYSTEMD_DAEMON_CFLAGS) $(POLKIT_CFLAGS) $(GNUTLS_CFLAGS) \
1110
		-I$(srcdir)/conf
1111
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
1112
		$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
1113
		$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(MSCOM_LIBS) $(LIBXML_LIBS) \
1114 1115
		$(SECDRIVER_LIBS) $(NUMACTL_LIBS) $(SYSTEMD_DAEMON_LIBS) \
		$(POLKIT_LIBS)
1116

1117 1118

noinst_LTLIBRARIES += libvirt_conf.la
1119
libvirt_la_BUILT_LIBADD += libvirt_conf.la
1120
libvirt_conf_la_SOURCES = $(CONF_SOURCES)
1121 1122
libvirt_conf_la_CFLAGS = $(AM_CFLAGS)
libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS)
1123
libvirt_conf_la_LIBADD = $(LIBXML_LIBS)
1124

J
Jiri Denemark 已提交
1125
noinst_LTLIBRARIES += libvirt_cpu.la
1126
libvirt_la_BUILT_LIBADD += libvirt_cpu.la
J
Jiri Denemark 已提交
1127
libvirt_cpu_la_CFLAGS = \
1128
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jiri Denemark 已提交
1129 1130
libvirt_cpu_la_SOURCES = $(CPU_SOURCES)

1131 1132 1133 1134 1135 1136
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)

1137 1138 1139 1140
if WITH_VMX
noinst_LTLIBRARIES += libvirt_vmx.la
libvirt_la_BUILT_LIBADD += libvirt_vmx.la
libvirt_vmx_la_CFLAGS = \
1141
		-I$(srcdir)/conf $(AM_CFLAGS)
1142
libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
1143
endif WITH_VMX
1144

J
Jim Fehlig 已提交
1145 1146 1147
if WITH_XENCONFIG
noinst_LTLIBRARIES += libvirt_xenconfig.la
libvirt_la_BUILT_LIBADD += libvirt_xenconfig.la
1148
libvirt_xenconfig_la_LIBADD = $(LIBXL_LIBS)
J
Jim Fehlig 已提交
1149
libvirt_xenconfig_la_CFLAGS = \
1150
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jim Fehlig 已提交
1151 1152
libvirt_xenconfig_la_SOURCES = $(XENCONFIG_SOURCES)
endif WITH_XENCONFIG
1153

1154

1155
noinst_LTLIBRARIES += libvirt_driver.la
1156
libvirt_la_BUILT_LIBADD += libvirt_driver.la
1157
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
1158

1159
libvirt_driver_la_CFLAGS = \
1160
		$(GNUTLS_CFLAGS) $(CURL_CFLAGS) \
1161
		-I$(srcdir)/conf $(AM_CFLAGS)
1162
libvirt_driver_la_LIBADD = \
1163
		$(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS)
1164

1165 1166
# 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.
1167
SYM_FILES = $(USED_SYM_FILES)
1168
USED_SYM_FILES = $(srcdir)/libvirt_private.syms
1169 1170 1171
GENERATED_SYM_FILES = \
	$(ACCESS_DRIVER_SYM_FILES) \
	libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \
1172
	libvirt_admin.syms libvirt_admin.def \
1173
	$(NULL)
1174

1175
if WITH_TEST
1176
noinst_LTLIBRARIES += libvirt_driver_test.la
1177
libvirt_la_BUILT_LIBADD += libvirt_driver_test.la
1178
libvirt_driver_test_la_CFLAGS = \
1179
		-I$(srcdir)/conf $(AM_CFLAGS)
1180
libvirt_driver_test_la_SOURCES = $(TEST_DRIVER_SOURCES)
1181
endif WITH_TEST
1182 1183

if WITH_REMOTE
1184
noinst_LTLIBRARIES += libvirt_driver_remote.la
1185
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
1186 1187
libvirt_driver_remote_la_CFLAGS =				\
		$(GNUTLS_CFLAGS)				\
E
Eric Blake 已提交
1188
		$(XDR_CFLAGS)					\
1189 1190
		-I$(srcdir)/conf				\
		-I$(srcdir)/rpc					\
1191 1192
		$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
1193 1194 1195 1196
libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) \
                libvirt-net-rpc-client.la \
                libvirt-net-rpc-server.la \
                libvirt-net-rpc.la
1197
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
1198

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

1201 1202
endif WITH_REMOTE

1203
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
1204
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
1205
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1206

1207
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
1208
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
1209
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1210

1211
if WITH_XEN
E
Eric Blake 已提交
1212 1213 1214
noinst_LTLIBRARIES += libvirt_driver_xen_impl.la
libvirt_driver_xen_la_SOURCES =
libvirt_driver_xen_la_LIBADD = libvirt_driver_xen_impl.la
1215 1216
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_xen.la
E
Eric Blake 已提交
1217
libvirt_driver_xen_la_LIBADD += ../gnulib/lib/libgnu.la
1218
libvirt_driver_xen_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1219
else ! WITH_DRIVER_MODULES
1220
noinst_LTLIBRARIES += libvirt_driver_xen.la
1221 1222
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_xen.la
1223
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1224

1225
libvirt_driver_xen_impl_la_CFLAGS =				\
1226
		$(XEN_CFLAGS)					\
1227 1228 1229
		-I$(srcdir)/access				\
		-I$(srcdir)/conf				\
		-I$(srcdir)/xenconfig				\
1230
		$(AM_CFLAGS)
E
Eric Blake 已提交
1231
libvirt_driver_xen_impl_la_LDFLAGS = $(AM_LDFLAGS)
P
Pavel Hrdina 已提交
1232
libvirt_driver_xen_impl_la_LIBADD = $(XEN_LIBS) libvirt_xenconfig.la
E
Eric Blake 已提交
1233
libvirt_driver_xen_impl_la_SOURCES = $(XEN_DRIVER_SOURCES)
1234
endif WITH_XEN
1235

1236 1237
if WITH_PHYP
noinst_LTLIBRARIES += libvirt_driver_phyp.la
1238
libvirt_la_BUILT_LIBADD += libvirt_driver_phyp.la
1239 1240
libvirt_driver_phyp_la_LIBADD = $(SSH2_LIBS)
libvirt_driver_phyp_la_CFLAGS = $(SSH2_CFLAGS) \
1241
		-I$(srcdir)/conf $(AM_CFLAGS)
1242
libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES)
1243
endif WITH_PHYP
1244

1245
if WITH_OPENVZ
1246
noinst_LTLIBRARIES += libvirt_driver_openvz.la
1247
libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la
1248
libvirt_driver_openvz_la_CFLAGS = \
1249
		-I$(srcdir)/conf $(AM_CFLAGS)
1250
libvirt_driver_openvz_la_SOURCES = $(OPENVZ_DRIVER_SOURCES)
1251
endif WITH_OPENVZ
1252

1253 1254 1255 1256
if WITH_VMWARE
noinst_LTLIBRARIES += libvirt_driver_vmware.la
libvirt_la_BUILT_LIBADD += libvirt_driver_vmware.la
libvirt_driver_vmware_la_CFLAGS = \
1257
		-I$(srcdir)/conf -I$(srcdir)/vmx $(AM_CFLAGS)
1258
libvirt_driver_vmware_la_SOURCES = $(VMWARE_DRIVER_SOURCES)
1259
endif WITH_VMWARE
1260

1261
if WITH_VBOX
M
Michal Privoznik 已提交
1262
noinst_LTLIBRARIES += \
1263
		libvirt_driver_vbox_impl.la
1264 1265 1266
libvirt_driver_vbox_la_SOURCES =
libvirt_driver_vbox_la_LIBADD = libvirt_driver_vbox_impl.la
if WITH_DRIVER_MODULES
M
Michal Privoznik 已提交
1267
mod_LTLIBRARIES += \
1268
		libvirt_driver_vbox.la
1269
libvirt_driver_vbox_la_LIBADD += ../gnulib/lib/libgnu.la
1270
libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1271
else ! WITH_DRIVER_MODULES
1272
noinst_LTLIBRARIES += libvirt_driver_vbox.la
1273 1274 1275
# GPLv2-only license requries that it be linked into
# libvirtd and *not* libvirt.so
#libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la
1276
endif ! WITH_DRIVER_MODULES
1277 1278

libvirt_driver_vbox_impl_la_CFLAGS =				\
1279 1280
		-I$(srcdir)/conf				\
		$(AM_CFLAGS)					\
M
Michal Privoznik 已提交
1281
		-DVBOX_DRIVER
1282
libvirt_driver_vbox_impl_la_LDFLAGS = $(AM_LDFLAGS)
1283 1284 1285
libvirt_driver_vbox_impl_la_LIBADD =  $(DLOPEN_LIBS)		\
		$(MSCOM_LIBS)					\
		$(LIBXML_LIBS)
1286
libvirt_driver_vbox_impl_la_SOURCES = $(VBOX_DRIVER_SOURCES)
1287
endif WITH_VBOX
1288

1289 1290
if WITH_XENAPI
noinst_LTLIBRARIES += libvirt_driver_xenapi.la
1291
libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la
1292
libvirt_driver_xenapi_la_CFLAGS = $(LIBXENSERVER_CFLAGS) $(CURL_CFLAGS) \
P
Pavel Hrdina 已提交
1293
		-I$(srcdir)/conf -I$(srcdir)/xenconfig $(AM_CFLAGS)
1294
libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS)
1295
libvirt_driver_xenapi_la_LIBADD = $(LIBXENSERVER_LIBS) $(CURL_LIBS)
1296
libvirt_driver_xenapi_la_SOURCES = $(XENAPI_DRIVER_SOURCES)
1297
endif WITH_XENAPI
1298

J
Jim Fehlig 已提交
1299
if WITH_LIBXL
E
Eric Blake 已提交
1300 1301 1302
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 已提交
1303 1304
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_libxl.la
E
Eric Blake 已提交
1305
libvirt_driver_libxl_la_LIBADD += ../gnulib/lib/libgnu.la
1306
libvirt_driver_libxl_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1307
else ! WITH_DRIVER_MODULES
J
Jim Fehlig 已提交
1308 1309 1310
noinst_LTLIBRARIES += libvirt_driver_libxl.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_libxl.la
1311
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1312

1313 1314
libvirt_driver_libxl_impl_la_CFLAGS = 		\
		$(LIBXL_CFLAGS)			\
1315 1316
		-I$(srcdir)/access	\
		-I$(srcdir)/conf	\
1317
		-I$(srcdir)/secret      \
1318
		-I$(srcdir)/xenconfig	\
1319
		$(AM_CFLAGS)
E
Eric Blake 已提交
1320
libvirt_driver_libxl_impl_la_LDFLAGS = $(AM_LDFLAGS)
1321 1322 1323
libvirt_driver_libxl_impl_la_LIBADD = $(LIBXL_LIBS) \
				      libvirt_xenconfig.la \
				      libvirt_secret.la
E
Eric Blake 已提交
1324
libvirt_driver_libxl_impl_la_SOURCES = $(LIBXL_DRIVER_SOURCES)
1325 1326 1327 1328 1329 1330

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

1331
endif WITH_LIBXL
1332 1333
EXTRA_DIST += libxl/libxl.conf libxl/libvirtd_libxl.aug \
		libxl/test_libvirtd_libxl.aug.in
J
Jim Fehlig 已提交
1334

1335
if WITH_QEMU
E
Eric Blake 已提交
1336 1337 1338
noinst_LTLIBRARIES += libvirt_driver_qemu_impl.la
libvirt_driver_qemu_la_SOURCES =
libvirt_driver_qemu_la_LIBADD = libvirt_driver_qemu_impl.la
1339 1340
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_qemu.la
E
Eric Blake 已提交
1341
libvirt_driver_qemu_la_LIBADD += ../gnulib/lib/libgnu.la
1342
libvirt_driver_qemu_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1343
else ! WITH_DRIVER_MODULES
1344
noinst_LTLIBRARIES += libvirt_driver_qemu.la
1345
# Stateful, so linked to daemon instead
1346
#libvirt_la_BUILT_LIBADD += libvirt_driver_qemu.la
1347
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1348

1349 1350 1351
libvirt_driver_qemu_impl_la_CFLAGS = \
		$(GNUTLS_CFLAGS) \
		$(LIBNL_CFLAGS) \
1352 1353
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1354
		-I$(srcdir)/secret \
1355
		$(AM_CFLAGS)
E
Eric Blake 已提交
1356
libvirt_driver_qemu_impl_la_LDFLAGS = $(AM_LDFLAGS)
1357
libvirt_driver_qemu_impl_la_LIBADD = $(CAPNG_LIBS) \
1358
                                $(GNUTLS_LIBS) \
1359 1360
				$(LIBNL_LIBS) \
				$(LIBXML_LIBS) \
1361
				libvirt_secret.la \
1362
				$(NULL)
E
Eric Blake 已提交
1363
libvirt_driver_qemu_impl_la_SOURCES = $(QEMU_DRIVER_SOURCES)
1364

A
Amy Griffis 已提交
1365
conf_DATA += qemu/qemu.conf
1366

1367
augeas_DATA += qemu/libvirtd_qemu.aug
1368 1369
augeastest_DATA += test_libvirtd_qemu.aug
CLEANFILES += test_libvirtd_qemu.aug
1370

1371
endif WITH_QEMU
1372
EXTRA_DIST += qemu/qemu.conf qemu/libvirtd_qemu.aug \
1373
		qemu/test_libvirtd_qemu.aug.in qemu/THREADS.txt
1374

1375 1376

if WITH_LXC
E
Eric Blake 已提交
1377 1378 1379
noinst_LTLIBRARIES += libvirt_driver_lxc_impl.la
libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = libvirt_driver_lxc_impl.la
1380 1381
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_lxc.la
E
Eric Blake 已提交
1382 1383
libvirt_driver_lxc_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_lxc_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1384
else ! WITH_DRIVER_MODULES
1385
noinst_LTLIBRARIES += libvirt_driver_lxc.la
1386
# Stateful, so linked to daemon instead
1387
#libvirt_la_BUILT_LIBADD += libvirt_driver_lxc.la
1388
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1389 1390

libvirt_driver_lxc_impl_la_CFLAGS = \
S
Serge Hallyn 已提交
1391
		$(LIBNL_CFLAGS) \
G
Gao feng 已提交
1392
		$(FUSE_CFLAGS) \
P
Pavel Fedin 已提交
1393
		$(XDR_CFLAGS) \
1394 1395
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1396
		$(AM_CFLAGS)
I
ik.nitk 已提交
1397 1398 1399 1400 1401 1402
libvirt_driver_lxc_impl_la_LIBADD = \
               $(CAPNG_LIBS) \
               $(LIBNL_LIBS) \
               $(LIBXML_LIBS) \
               $(FUSE_LIBS)

1403
if WITH_BLKID
E
Eric Blake 已提交
1404 1405
libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS)
1406
endif WITH_BLKID
1407
libvirt_driver_lxc_impl_la_LIBADD += $(SECDRIVER_LIBS)
E
Eric Blake 已提交
1408
libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES)
A
Amy Griffis 已提交
1409 1410 1411

conf_DATA += lxc/lxc.conf

1412
augeas_DATA += lxc/libvirtd_lxc.aug
1413 1414
augeastest_DATA += test_libvirtd_lxc.aug
CLEANFILES += test_libvirtd_lxc.aug
1415

1416
endif WITH_LXC
1417
EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in
1418

1419
if WITH_UML
E
Eric Blake 已提交
1420 1421 1422
noinst_LTLIBRARIES += libvirt_driver_uml_impl.la
libvirt_driver_uml_la_SOURCES =
libvirt_driver_uml_la_LIBADD = libvirt_driver_uml_impl.la
1423 1424
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_uml.la
E
Eric Blake 已提交
1425
libvirt_driver_uml_la_LIBADD += ../gnulib/lib/libgnu.la
1426
libvirt_driver_uml_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1427
else ! WITH_DRIVER_MODULES
1428 1429
noinst_LTLIBRARIES += libvirt_driver_uml.la
# Stateful, so linked to daemon instead
1430
#libvirt_la_BUILT_LIBADD += libvirt_driver_uml.la
1431
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1432

1433
libvirt_driver_uml_impl_la_CFLAGS = \
1434 1435
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1436
		$(AM_CFLAGS)
E
Eric Blake 已提交
1437
libvirt_driver_uml_impl_la_LDFLAGS = $(AM_LDFLAGS)
1438
# libvirt_driver_uml_impl_la_LIBADD =
E
Eric Blake 已提交
1439
libvirt_driver_uml_impl_la_SOURCES = $(UML_DRIVER_SOURCES)
1440
endif WITH_UML
1441

D
Daniel Veillard 已提交
1442

1443
BUILT_SOURCES += $(ESX_DRIVER_GENERATED)
D
Daniel Veillard 已提交
1444

1445 1446
ESX_GENERATED_STAMP = .esx_vi_generator.stamp

E
Eric Blake 已提交
1447 1448
EXTRA_DIST += $(ESX_GENERATED_STAMP)

1449 1450 1451
$(ESX_DRIVER_GENERATED): $(ESX_GENERATED_STAMP)

$(ESX_GENERATED_STAMP): $(srcdir)/esx/esx_vi_generator.input \
1452
                         $(srcdir)/esx/esx_vi_generator.py
1453 1454 1455 1456 1457
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/esx/esx_vi_generator.py \
	  && touch $@

MAINTAINERCLEANFILES += $(ESX_DRIVER_GENERATED) $(ESX_GENERATED_STAMP)

D
Daniel Veillard 已提交
1458

1459 1460
if WITH_ESX
noinst_LTLIBRARIES += libvirt_driver_esx.la
1461
libvirt_la_BUILT_LIBADD += libvirt_driver_esx.la
1462
libvirt_driver_esx_la_CFLAGS = $(CURL_CFLAGS) \
1463
		-I$(srcdir)/conf -I$(srcdir)/vmx $(AM_CFLAGS)
1464
libvirt_driver_esx_la_LDFLAGS = $(AM_LDFLAGS)
1465
libvirt_driver_esx_la_LIBADD = $(CURL_LIBS)
1466
libvirt_driver_esx_la_SOURCES = $(ESX_DRIVER_SOURCES)
1467
libvirt_driver_esx_la_DEPENDENCIES = $(ESX_DRIVER_GENERATED)
1468
endif WITH_ESX
1469

M
Matthias Bolte 已提交
1470

1471 1472
BUILT_SOURCES += $(HYPERV_DRIVER_GENERATED)

1473 1474
HYPERV_GENERATED_STAMP = .hyperv_wmi_generator.stamp

E
Eric Blake 已提交
1475 1476
EXTRA_DIST += $(HYPERV_GENERATED_STAMP)

1477 1478 1479
$(HYPERV_DRIVER_GENERATED): $(HYPERV_GENERATED_STAMP)

$(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \
1480
                            $(srcdir)/hyperv/hyperv_wmi_generator.py
1481 1482
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) \
	  $(srcdir)/hyperv/hyperv_wmi_generator.py \
1483 1484 1485
	  && touch $@

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

M
Matthias Bolte 已提交
1487 1488 1489 1490
if WITH_HYPERV
noinst_LTLIBRARIES += libvirt_driver_hyperv.la
libvirt_la_BUILT_LIBADD += libvirt_driver_hyperv.la
libvirt_driver_hyperv_la_CFLAGS = $(OPENWSMAN_CFLAGS) \
1491
		-I$(srcdir)/conf $(AM_CFLAGS)
M
Matthias Bolte 已提交
1492 1493 1494
libvirt_driver_hyperv_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_hyperv_la_LIBADD = $(OPENWSMAN_LIBS)
libvirt_driver_hyperv_la_SOURCES = $(HYPERV_DRIVER_SOURCES)
1495
endif WITH_HYPERV
M
Matthias Bolte 已提交
1496

1497
if WITH_VZ
1498 1499 1500 1501 1502 1503 1504 1505
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
1506
noinst_LTLIBRARIES += libvirt_driver_vz.la
1507 1508
endif ! WITH_DRIVER_MODULES
libvirt_driver_vz_impl_la_CFLAGS = \
1509
		-I$(srcdir)/conf $(AM_CFLAGS) \
1510
		$(PARALLELS_SDK_CFLAGS) $(LIBNL_CFLAGS)
1511 1512
libvirt_driver_vz_impl_la_SOURCES = $(VZ_DRIVER_SOURCES)
libvirt_driver_vz_impl_la_LIBADD =  $(PARALLELS_SDK_LIBS) $(LIBNL_LIBS)
1513
endif WITH_VZ
D
Dmitry Guryanov 已提交
1514

R
Roman Bogorodskiy 已提交
1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527
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 = \
1528 1529
	-I$(srcdir)/access \
	-I$(srcdir)/conf \
R
Roman Bogorodskiy 已提交
1530 1531 1532 1533 1534
	$(AM_CFLAGS)
libvirt_driver_bhyve_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_bhyve_impl_la_SOURCES = $(BHYVE_DRIVER_SOURCES)
endif WITH_BHYVE

1535
if WITH_NETWORK
E
Eric Blake 已提交
1536 1537 1538
noinst_LTLIBRARIES += libvirt_driver_network_impl.la
libvirt_driver_network_la_SOURCES =
libvirt_driver_network_la_LIBADD = libvirt_driver_network_impl.la
1539 1540
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_network.la
1541 1542 1543 1544
libvirt_driver_network_la_LIBADD += ../gnulib/lib/libgnu.la \
	$(LIBNL_LIBS) \
	$(DBUS_LIBS) \
	$(NULL)
E
Eric Blake 已提交
1545
libvirt_driver_network_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1546
else ! WITH_DRIVER_MODULES
1547
noinst_LTLIBRARIES += libvirt_driver_network.la
1548
# Stateful, so linked to daemon instead
1549
#libvirt_la_BUILT_LIBADD += libvirt_driver_network.la
1550
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1551 1552

libvirt_driver_network_impl_la_CFLAGS = \
1553 1554
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1555 1556
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1557
		$(AM_CFLAGS)
E
Eric Blake 已提交
1558
libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
1559
libvirt_driver_network_impl_la_LIBADD  = $(DBUS_LIBS)
1560
endif WITH_NETWORK
1561 1562 1563
EXTRA_DIST += network/default.xml


1564
if WITH_INTERFACE
1565 1566
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_interface.la
1567
else ! WITH_DRIVER_MODULES
1568
noinst_LTLIBRARIES += libvirt_driver_interface.la
1569 1570
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_interface.la
1571
endif ! WITH_DRIVER_MODULES
1572
libvirt_driver_interface_la_CFLAGS = \
1573 1574
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1575
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1576
libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS)
1577 1578 1579 1580
libvirt_driver_interface_la_LIBADD =
if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
1581
endif WITH_NETCF
1582
if WITH_UDEV
1583 1584
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
1585
endif WITH_UDEV
1586
if WITH_DRIVER_MODULES
1587
libvirt_driver_interface_la_LIBADD += ../gnulib/lib/libgnu.la
1588
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
1589
endif WITH_DRIVER_MODULES
1590
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
1591
endif WITH_INTERFACE
D
Daniel Veillard 已提交
1592

D
Daniel P. Berrange 已提交
1593
if WITH_SECRETS
1594 1595
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_secret.la
1596
else ! WITH_DRIVER_MODULES
1597
noinst_LTLIBRARIES += libvirt_driver_secret.la
1598
# Stateful, so linked to daemon instead
1599
#libvirt_la_BUILT_LIBADD += libvirt_driver_secret.la
1600
endif ! WITH_DRIVER_MODULES
1601
libvirt_driver_secret_la_CFLAGS = \
1602 1603
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1604
		$(AM_CFLAGS)
1605
if WITH_DRIVER_MODULES
1606
libvirt_driver_secret_la_LIBADD = ../gnulib/lib/libgnu.la
1607
libvirt_driver_secret_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1608
endif WITH_DRIVER_MODULES
1609
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
1610
endif WITH_SECRETS
1611

1612
# Needed to keep automake quiet about conditionals
1613 1614
libvirt_driver_storage_impl_la_SOURCES =
libvirt_driver_storage_impl_la_CFLAGS = \
1615 1616
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1617
		$(AM_CFLAGS)
1618 1619
libvirt_driver_storage_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_storage_impl_la_LIBADD =
1620
libvirt_driver_storage_impl_la_LIBADD += $(SECDRIVER_LIBS) $(LIBXML_LIBS)
1621
if WITH_BLKID
1622 1623
libvirt_driver_storage_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(BLKID_LIBS)
1624
endif WITH_BLKID
1625
if WITH_STORAGE
1626 1627 1628
noinst_LTLIBRARIES += libvirt_driver_storage_impl.la
libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_LIBADD = libvirt_driver_storage_impl.la
1629 1630
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_storage.la
1631
libvirt_driver_storage_la_LIBADD += ../gnulib/lib/libgnu.la
1632
libvirt_driver_storage_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1633
else ! WITH_DRIVER_MODULES
1634
noinst_LTLIBRARIES += libvirt_driver_storage.la
1635
# Stateful, so linked to daemon instead
1636
#libvirt_la_BUILT_LIBADD += libvirt_driver_storage.la
1637
endif ! WITH_DRIVER_MODULES
1638 1639
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_FS_SOURCES)
1640
endif WITH_STORAGE
1641

1642
if WITH_STORAGE_LVM
1643
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_LVM_SOURCES)
1644
endif WITH_STORAGE_LVM
1645

1646
if WITH_STORAGE_ISCSI
1647
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_ISCSI_SOURCES)
1648
endif WITH_STORAGE_ISCSI
1649

1650
if WITH_STORAGE_SCSI
1651
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SCSI_SOURCES)
1652
endif WITH_STORAGE_SCSI
1653

D
Dave Allan 已提交
1654
if WITH_STORAGE_MPATH
1655 1656 1657
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_MPATH_SOURCES)
libvirt_driver_storage_impl_la_CFLAGS += $(DEVMAPPER_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(DEVMAPPER_LIBS)
1658
endif WITH_STORAGE_MPATH
D
Dave Allan 已提交
1659

1660
if WITH_STORAGE_DISK
1661
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_DISK_SOURCES)
1662
endif WITH_STORAGE_DISK
1663

1664
if WITH_STORAGE_RBD
1665 1666
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_RBD_SOURCES)
libvirt_driver_storage_impl_la_LIBADD += $(LIBRBD_LIBS)
1667
endif WITH_STORAGE_RBD
1668

1669
if WITH_STORAGE_SHEEPDOG
1670
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SHEEPDOG_SOURCES)
1671
endif WITH_STORAGE_SHEEPDOG
1672

1673 1674 1675 1676 1677 1678
if WITH_STORAGE_GLUSTER
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_GLUSTER_SOURCES)
libvirt_driver_storage_impl_la_CFLAGS += $(GLUSTERFS_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(GLUSTERFS_LIBS)
endif WITH_STORAGE_GLUSTER

R
Roman Bogorodskiy 已提交
1679 1680 1681 1682
if WITH_STORAGE_ZFS
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_ZFS_SOURCES)
endif WITH_STORAGE_ZFS

1683 1684 1685 1686
if WITH_NODE_DEVICES
# Needed to keep automake quiet about conditionals
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nodedev.la
1687
else ! WITH_DRIVER_MODULES
1688 1689
noinst_LTLIBRARIES += libvirt_driver_nodedev.la
# Stateful, so linked to daemon instead
1690
#libvirt_la_BUILT_LIBADD += libvirt_driver_nodedev.la
1691
endif ! WITH_DRIVER_MODULES
1692 1693
libvirt_driver_nodedev_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES)

1694
libvirt_driver_nodedev_la_CFLAGS = \
1695 1696
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1697
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1698
libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS)
1699
libvirt_driver_nodedev_la_LIBADD =
1700

D
Doug Goldstein 已提交
1701
if WITH_LIBVIRTD
1702
if WITH_HAL
1703 1704
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS)
1705
libvirt_driver_nodedev_la_LIBADD += $(HAL_LIBS)
1706
endif WITH_HAL
1707
if WITH_UDEV
1708
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES)
1709
libvirt_driver_nodedev_la_CFLAGS += $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS)
1710
libvirt_driver_nodedev_la_LIBADD += $(UDEV_LIBS) $(PCIACCESS_LIBS)
1711 1712
endif WITH_UDEV
endif WITH_LIBVIRTD
1713 1714

if WITH_DRIVER_MODULES
1715
libvirt_driver_nodedev_la_LIBADD += ../gnulib/lib/libgnu.la
1716
libvirt_driver_nodedev_la_LDFLAGS += -module -avoid-version
1717 1718
endif WITH_DRIVER_MODULES
endif WITH_NODE_DEVICES
1719 1720


1721
if WITH_NWFILTER
1722 1723 1724
noinst_LTLIBRARIES += libvirt_driver_nwfilter_impl.la
libvirt_driver_nwfilter_la_SOURCES =
libvirt_driver_nwfilter_la_LIBADD = libvirt_driver_nwfilter_impl.la
1725 1726
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nwfilter.la
1727
libvirt_driver_nwfilter_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1728
else ! WITH_DRIVER_MODULES
1729
noinst_LTLIBRARIES += libvirt_driver_nwfilter.la
1730 1731
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_nwfilter.la
1732
endif ! WITH_DRIVER_MODULES
1733
libvirt_driver_nwfilter_impl_la_CFLAGS = \
1734 1735 1736
		$(LIBPCAP_CFLAGS) \
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1737 1738
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1739
		$(AM_CFLAGS)
1740 1741 1742 1743 1744
libvirt_driver_nwfilter_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_nwfilter_impl_la_LIBADD = \
		$(LIBPCAP_LIBS) \
		$(LIBNL_LIBS) \
		$(DBUS_LIBS)
1745
if WITH_DRIVER_MODULES
1746 1747
libvirt_driver_nwfilter_impl_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_nwfilter_impl_la_LDFLAGS += -module -avoid-version
1748
endif WITH_DRIVER_MODULES
1749
libvirt_driver_nwfilter_impl_la_SOURCES = $(NWFILTER_DRIVER_SOURCES)
1750
endif WITH_NWFILTER
1751 1752


1753 1754 1755 1756
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 = \
1757
		-I$(srcdir)/conf $(AM_CFLAGS)
1758
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
1759
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
1760
if WITH_SECDRIVER_SELINUX
1761 1762
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
1763
endif WITH_SECDRIVER_SELINUX
J
Jamie Strandboge 已提交
1764
if WITH_SECDRIVER_APPARMOR
1765 1766
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
1767
endif WITH_SECDRIVER_APPARMOR
1768

1769 1770
libvirt_driver_access_la_SOURCES = \
	$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
1771 1772 1773
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
1774
		-I$(srcdir)/conf $(AM_CFLAGS)
1775 1776 1777
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD =

1778 1779
EXTRA_DIST += access/genpolkit.pl

1780 1781 1782 1783
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
    $(srcdir)/access/genpolkit.pl Makefile.am
	$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@

1784 1785 1786 1787
if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)

polkitactiondir = $(datadir)/polkit-1/actions
1788
if WITH_LIBVIRTD
1789
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
1790
endif WITH_LIBVIRTD
1791 1792 1793

CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
1794
else ! WITH_POLKIT1
1795
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
1796
endif ! WITH_POLKIT1
1797

1798

1799 1800
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814

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

1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827
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 已提交
1828
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
1829 1830
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1831 1832 1833
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
1834 1835
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1836 1837
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
	  > $(srcdir)/access/viraccessapicheck.c
1838

E
Eric Blake 已提交
1839
access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
1840 1841
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1842 1843 1844
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheckqemu.h
access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
1845 1846
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1847 1848
	  qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h \
	  > $(srcdir)/access/viraccessapicheckqemu.c
1849

E
Eric Blake 已提交
1850
access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
1851 1852
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1853 1854 1855
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/access/viraccessapichecklxc.h
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
1856 1857
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1858 1859
	  lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \
	  > $(srcdir)/access/viraccessapichecklxc.c
1860

1861 1862 1863 1864 1865 1866 1867
# Add all conditional sources just in case...
EXTRA_DIST +=							\
		$(TEST_DRIVER_SOURCES)				\
		$(REMOTE_DRIVER_SOURCES)			\
		$(XEN_DRIVER_SOURCES)				\
		$(QEMU_DRIVER_SOURCES)				\
		$(LXC_DRIVER_SOURCES)				\
1868
		$(UML_DRIVER_SOURCES)				\
1869
		$(OPENVZ_DRIVER_SOURCES)			\
1870
		$(PHYP_DRIVER_SOURCES)				\
1871
		$(VBOX_DRIVER_SOURCES)				\
1872
		$(XENAPI_DRIVER_SOURCES)			\
O
Osier Yang 已提交
1873
		$(LIBXL_DRIVER_SOURCES)				\
1874
		$(ESX_DRIVER_SOURCES)				\
1875
		$(ESX_DRIVER_EXTRA_DIST)			\
M
Matthias Bolte 已提交
1876
		$(HYPERV_DRIVER_SOURCES)			\
1877
		$(HYPERV_DRIVER_EXTRA_DIST)			\
1878
		$(VZ_DRIVER_SOURCES)				\
R
Roman Bogorodskiy 已提交
1879
		$(BHYVE_DRIVER_SOURCES)				\
1880
		$(NETWORK_DRIVER_SOURCES)			\
1881
		$(INTERFACE_DRIVER_SOURCES)			\
1882 1883 1884 1885
		$(STORAGE_DRIVER_SOURCES)			\
		$(STORAGE_DRIVER_FS_SOURCES)			\
		$(STORAGE_DRIVER_LVM_SOURCES)			\
		$(STORAGE_DRIVER_ISCSI_SOURCES)			\
1886
		$(STORAGE_DRIVER_SCSI_SOURCES)			\
D
Dave Allan 已提交
1887
		$(STORAGE_DRIVER_MPATH_SOURCES)			\
1888
		$(STORAGE_DRIVER_DISK_SOURCES)			\
1889
		$(STORAGE_DRIVER_RBD_SOURCES)			\
1890
		$(STORAGE_DRIVER_SHEEPDOG_SOURCES)		\
1891
		$(STORAGE_DRIVER_GLUSTER_SOURCES)		\
R
Roman Bogorodskiy 已提交
1892
		$(STORAGE_DRIVER_ZFS_SOURCES)			\
1893 1894
		$(NODE_DEVICE_DRIVER_SOURCES)			\
		$(NODE_DEVICE_DRIVER_HAL_SOURCES)		\
1895
		$(NODE_DEVICE_DRIVER_UDEV_SOURCES)		\
1896
		$(NWFILTER_DRIVER_SOURCES)			\
1897
		$(SECURITY_DRIVER_SELINUX_SOURCES)		\
J
Jamie Strandboge 已提交
1898
		$(SECURITY_DRIVER_APPARMOR_SOURCES)		\
D
Daniel P. Berrange 已提交
1899
		$(SECRET_DRIVER_SOURCES)			\
1900
		$(SECRET_UTIL_SOURCES)				\
1901
		$(VBOX_DRIVER_EXTRA_DIST)			\
1902
		$(VMWARE_DRIVER_SOURCES)			\
J
Jim Fehlig 已提交
1903
		$(XENCONFIG_SOURCES)				\
1904
		$(ACCESS_DRIVER_POLKIT_POLICY)
1905

1906 1907
check-local: check-augeas

1908 1909 1910 1911 1912
.PHONY: check-augeas \
	check-augeas-qemu \
	check-augeas-lxc \
	check-augeas-sanlock \
	check-augeas-lockd \
1913
	check-augeas-libxl \
1914
	$(NULL)
1915

1916
check-augeas: check-augeas-qemu check-augeas-lxc check-augeas-sanlock \
1917 1918
	check-augeas-lockd check-augeas-virtlockd check-augeas-libxl \
	check-augeas-virtlogd
1919

1920
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
1921
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
1922

1923
if WITH_QEMU
1924 1925
test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
		$(srcdir)/qemu/qemu.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1926
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
1927

1928
check-augeas-qemu: test_libvirtd_qemu.aug
1929
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1930
	    '$(AUGPARSE)' -I $(srcdir)/qemu test_libvirtd_qemu.aug; \
1931
	fi
1932
else ! WITH_QEMU
1933
check-augeas-qemu:
1934
endif ! WITH_QEMU
1935

1936
if WITH_LXC
1937 1938
test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
		$(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1939
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
1940

1941
check-augeas-lxc: test_libvirtd_lxc.aug
1942
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1943
	    '$(AUGPARSE)' -I $(srcdir)/lxc test_libvirtd_lxc.aug; \
1944
	fi
1945
else ! WITH_LXC
1946
check-augeas-lxc:
1947
endif ! WITH_LXC
1948

1949
if WITH_SANLOCK
1950 1951
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1952
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
1953

1954
check-augeas-sanlock: test_libvirt_sanlock.aug
1955
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1956
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
1957
	fi
1958
else ! WITH_SANLOCK
1959
check-augeas-sanlock:
1960
endif ! WITH_SANLOCK
1961

1962
if WITH_QEMU
1963 1964 1965
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 $< $@
1966 1967 1968
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
1969

1970 1971
test_virtlockd.aug: locking/test_virtlockd.aug.in \
		locking/virtlockd.conf $(AUG_GENTEST)
1972
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
1973

1974
if WITH_QEMU
1975 1976 1977 1978
check-augeas-lockd: test_libvirt_lockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_lockd.aug; \
	fi
1979 1980 1981
else ! WITH_QEMU
check-augeas-lockd:
endif ! WITH_QEMU
1982

1983 1984 1985 1986 1987
check-augeas-virtlockd: test_virtlockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
	fi

1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000
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

2001 2002 2003 2004 2005 2006 2007 2008 2009
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

2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028
#
# 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.
#

2029
if WITH_DRIVER_MODULES
2030
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
2031
else ! WITH_DRIVER_MODULES
2032
SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
2033
endif ! WITH_DRIVER_MODULES
2034

2035
if WITH_LINUX
2036
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
2037
else ! WITH_LINUX
2038
SYM_FILES += $(srcdir)/libvirt_linux.syms
2039
endif ! WITH_LINUX
2040

2041
if WITH_ESX
2042
USED_SYM_FILES += $(srcdir)/libvirt_esx.syms
2043
else ! WITH_ESX
2044
SYM_FILES += $(srcdir)/libvirt_esx.syms
2045
endif ! WITH_ESX
2046

E
Eric Blake 已提交
2047 2048 2049 2050 2051 2052
if WITH_REMOTE
USED_SYM_FILES += $(srcdir)/libvirt_remote.syms
else ! WITH_REMOTE
SYM_FILES += $(srcdir)/libvirt_remote.syms
endif ! WITH_REMOTE

2053
if WITH_OPENVZ
2054
USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms
2055
else ! WITH_OPENVZ
2056
SYM_FILES += $(srcdir)/libvirt_openvz.syms
2057
endif ! WITH_OPENVZ
2058

2059
if WITH_VMX
2060
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
2061
else ! WITH_VMX
2062
SYM_FILES += $(srcdir)/libvirt_vmx.syms
2063
endif ! WITH_VMX
2064

2065 2066 2067 2068 2069 2070
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 已提交
2071 2072 2073 2074 2075
if WITH_XENCONFIG
USED_SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
else ! WITH_XENCONFIG
SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
endif ! WITH_XENCONFIG
2076

2077 2078 2079 2080 2081 2082
if WITH_LIBXL
USED_SYM_FILES += $(srcdir)/libvirt_xenxlconfig.syms
else ! WITH_LIBXL
SYM_FILES += $(srcdir)/libvirt_xenxlconfig.syms
endif ! WITH_LIBXL

2083
if WITH_SASL
2084
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
2085
else ! WITH_SASL
2086
SYM_FILES += $(srcdir)/libvirt_sasl.syms
2087
endif ! WITH_SASL
E
Eric Blake 已提交
2088

2089 2090
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2091
else ! WITH_GNUTLS
2092
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2093
endif ! WITH_GNUTLS
2094

2095
if WITH_SSH2
2096
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2097
else ! WITH_SSH2
2098
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2099
endif ! WITH_SSH2
2100

2101
if WITH_ATOMIC_OPS_PTHREAD
2102
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
2103
else ! WITH_ATOMIC_OPS_PTHREAD
2104
SYM_FILES += $(srcdir)/libvirt_atomic.syms
2105
endif ! WITH_ATOMIC_OPS_PTHREAD
2106

2107
EXTRA_DIST += \
2108 2109 2110
	libvirt_public.syms		\
	libvirt_lxc.syms		\
	libvirt_qemu.syms		\
2111
	libvirt_admin_public.syms	\
2112
	$(SYM_FILES)			\
2113
	$(ADMIN_SYM_FILES)		\
2114
	$(NULL)
2115

2116
BUILT_SOURCES += $(GENERATED_SYM_FILES)
2117

2118 2119
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(ACCESS_DRIVER_SYM_FILES) \
2120
		$(top_builddir)/config.status
2121 2122 2123 2124 2125 2126
	$(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 && \
2127
	cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
2128 2129
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
2130
	mv $@-tmp libvirt.syms
2131

2132
%.def: %.syms
2133 2134
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
2135 2136
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d'	\
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
2137
	chmod a-w $@-tmp && \
2138
	mv $@-tmp $@
2139

2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152
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

2153 2154 2155 2156
# 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 已提交
2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180
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)			\
		$(AM_LDFLAGS) 						\
		$(CYGWIN_EXTRA_LDFLAGS) 				\
		$(MINGW_EXTRA_LDFLAGS)

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 += \
2181
		$(XDR_CFLAGS)			\
M
Martin Kletzander 已提交
2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196
		$(CAPNG_CFLAGS)			\
		$(YAJL_CFLAGS)			\
		$(SSH2_CFLAGS)			\
		$(SASL_CFLAGS)			\
		$(GNUTLS_CFLAGS)

libvirt_admin_la_LIBADD += \
		$(CAPNG_LIBS)			\
		$(YAJL_LIBS)			\
		$(DEVMAPPER_LIBS)		\
		$(LIBXML_LIBS)			\
		$(SSH2_LIBS)			\
		$(SASL_LIBS)			\
		$(GNUTLS_LIBS)

2197 2198
ADMIN_SYM_FILES = $(srcdir)/libvirt_admin_private.syms

M
Martin Kletzander 已提交
2199 2200 2201 2202
if WITH_DTRACE_PROBES
libvirt_admin_la_LIBADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

2203 2204
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
2205 2206 2207 2208 2209 2210 2211 2212
libvirt_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(LIBVIRT_NODELETE) \
		$(AM_LDFLAGS) \
		$(CYGWIN_EXTRA_LDFLAGS) \
		$(MINGW_EXTRA_LDFLAGS) \
		$(NULL)
2213
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
2214
libvirt_la_LIBADD += \
2215
		    $(DRIVER_MODULE_LIBS) \
2216
		    $(CYGWIN_EXTRA_LIBADD)
2217
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
2218 2219 2220 2221 2222 2223
# 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)
2224

2225
if WITH_DTRACE_PROBES
2226
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
2227
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
2228
nodist_libvirt_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2229
if WITH_REMOTE
E
Eric Blake 已提交
2230
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2231
endif WITH_REMOTE
2232 2233
if WITH_DRIVER_MODULES
DTRACE2SYSTEMTAP_FLAGS = --with-modules
2234
endif WITH_DRIVER_MODULES
2235

2236 2237 2238
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

if WITH_QEMU
2239
libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.lo
2240
nodist_libvirt_driver_qemu_la_SOURCES = libvirt_qemu_probes.h
2241
BUILT_SOURCES += libvirt_qemu_probes.h
2242
endif WITH_QEMU
2243 2244

tapsetdir = $(datadir)/systemtap/tapset
2245
tapset_DATA = libvirt_probes.stp libvirt_qemu_probes.stp libvirt_functions.stp
2246

2247
%_probes.h: %_probes.d
2248 2249
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

E
Eric Blake 已提交
2250
.PRECIOUS: %_probes.o
2251
%_probes.o: %_probes.d
2252 2253
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

2254 2255 2256 2257 2258 2259 2260 2261 2262
%_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 已提交
2263
# Keep this list synced with PROTOCOL_STRUCTS
J
Jiri Denemark 已提交
2264 2265 2266
RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
2267
		  $(srcdir)/remote/lxc_protocol.x \
2268 2269
		  $(srcdir)/remote/qemu_protocol.x \
		  $(srcdir)/lxc/lxc_monitor_protocol.x \
M
Martin Kletzander 已提交
2270 2271
		  $(srcdir)/locking/lock_protocol.x \
		  $(srcdir)/admin/admin_protocol.x
2272 2273

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

2276 2277
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl \
		$(top_builddir)/config.status
2278
	$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
2279
	  $(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
2280

2281
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
2282
              libvirt_qemu_probes.h libvirt_qemu_probes.o \
2283
              libvirt_qemu_probes.lo\
2284 2285
              libvirt_functions.stp libvirt_probes.stp \
              libvirt_qemu_probes.stp
2286
endif WITH_DTRACE_PROBES
2287

2288
EXTRA_DIST += libvirt_probes.d libvirt_qemu_probes.d
2289

C
Chris Lalancette 已提交
2290
libvirt_qemu_la_SOURCES = libvirt-qemu.c
D
Daniel P. Berrange 已提交
2291 2292 2293 2294 2295 2296 2297
libvirt_qemu_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(CYGWIN_EXTRA_LDFLAGS) \
		$(MINGW_EXTRA_LDFLAGS) \
		$(NULL)
2298
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
C
Chris Lalancette 已提交
2299
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
2300

2301
libvirt_lxc_la_SOURCES = libvirt-lxc.c
D
Daniel P. Berrange 已提交
2302 2303 2304 2305 2306 2307 2308
libvirt_lxc_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(CYGWIN_EXTRA_LDFLAGS) \
		$(MINGW_EXTRA_LDFLAGS) \
		$(NULL)
2309 2310 2311
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)

2312 2313 2314 2315 2316 2317 2318
# 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
2319
if WITH_SETUID_RPC_CLIENT
2320 2321 2322 2323
noinst_LTLIBRARIES += libvirt-setuid-rpc-client.la

libvirt_setuid_rpc_client_la_SOURCES = 		\
		util/viralloc.c			\
2324 2325
		util/viratomic.c		\
		util/viratomic.h		\
2326 2327 2328 2329 2330 2331 2332 2333
		util/virbitmap.c		\
		util/virbuffer.c		\
		util/vircommand.c		\
		util/virconf.c			\
		util/virerror.c			\
		util/virevent.c			\
		util/vireventpoll.c		\
		util/virfile.c			\
2334
		util/virgettext.c		\
2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346
		util/virhash.c			\
		util/virhashcode.c		\
		util/virjson.c			\
		util/virlog.c			\
		util/virobject.c		\
		util/virpidfile.c		\
		util/virprocess.c		\
		util/virrandom.c		\
		util/virsocketaddr.c		\
		util/virstring.c		\
		util/virtime.c			\
		util/virthread.c		\
2347
		util/virthreadjob.c		\
2348 2349 2350 2351 2352
		util/virtypedparam.c		\
		util/viruri.c			\
		util/virutil.c			\
		util/viruuid.c			\
		conf/domain_event.c		\
2353
		conf/network_event.c		\
2354
		conf/object_event.c		\
2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370
		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			\
2371
		libvirt-domain.c		\
2372
		libvirt-domain-snapshot.c	\
2373
		libvirt-host.c			\
2374
		libvirt-interface.c		\
2375
		libvirt-network.c		\
2376
		libvirt-nodedev.c		\
2377
		libvirt-nwfilter.c		\
2378
		libvirt-secret.c		\
2379
		libvirt-storage.c		\
2380
		libvirt-stream.c		\
2381 2382 2383 2384 2385 2386
		libvirt-lxc.c			\
		$(NULL)

libvirt_setuid_rpc_client_la_LDFLAGS =		\
		$(AM_LDFLAGS)			\
		$(LIBXML_LIBS)			\
J
Jim Fehlig 已提交
2387
		$(SECDRIVER_LIBS)		\
2388 2389 2390
		$(NULL)
libvirt_setuid_rpc_client_la_CFLAGS =		\
		-DLIBVIRT_SETUID_RPC_CLIENT	\
2391 2392
		-I$(srcdir)/conf		\
		-I$(srcdir)/rpc			\
2393
		$(AM_CFLAGS)			\
J
Jim Fehlig 已提交
2394
		$(SECDRIVER_CFLAGS)		\
P
Pavel Fedin 已提交
2395
		$(XDR_CFLAGS)			\
2396
		$(NULL)
2397
endif WITH_SETUID_RPC_CLIENT
2398

2399 2400 2401
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

2402
if WITH_LIBVIRTD
2403 2404 2405 2406 2407
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
		$(LOCK_DRIVER_LOCKD_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
		$(NULL)
2408
lockd_la_CFLAGS = -I$(srcdir)/conf \
E
Eric Blake 已提交
2409 2410
		$(XDR_CFLAGS) \
		$(AM_CFLAGS)
2411
lockd_la_LDFLAGS = -module -avoid-version
2412 2413 2414 2415
lockd_la_LIBADD = ../gnulib/lib/libgnu.la \
	libvirt-net-rpc.la \
	libvirt-net-rpc-client.la \
	$(NULL)
J
Jiri Denemark 已提交
2416
augeas_DATA += locking/libvirt_lockd.aug
2417 2418
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
2419
endif WITH_DTRACE_PROBES
2420
if WITH_QEMU
2421 2422
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
2423
nodist_conf_DATA += locking/qemu-lockd.conf
2424 2425
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
2426
endif WITH_QEMU
2427

2428 2429 2430 2431 2432 2433
if WITH_LIBXL
nodist_conf_DATA += locking/libxl-lockd.conf
BUILT_SOURCES += locking/libxl-lockd.conf
DISTCLEANFILES += locking/libxl-lockd.conf
endif WITH_LIBXL

2434 2435 2436 2437 2438
locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
	$(AM_V_GEN)$(MKDIR_P) locking ; \
	cp $< $@


2439
sbin_PROGRAMS = virtlockd virtlogd
2440

2441 2442 2443
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
2444
		$(LOCK_DAEMON_GENERATED) \
2445
		$(NULL)
2446 2447
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
2448
		$(PIE_CFLAGS) \
2449
		$(XDR_CFLAGS) \
2450 2451 2452
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
2453
		$(PIE_LDFLAGS) \
2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465
		$(CYGWIN_EXTRA_LDFLAGS) \
		$(MINGW_EXTRA_LDFLAGS) \
		$(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
2466
endif WITH_DTRACE_PROBES
2467

2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495

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) \
		$(CYGWIN_EXTRA_LDFLAGS) \
		$(MINGW_EXTRA_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

2496
else ! WITH_LIBVIRTD
2497
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
2498 2499
              $(LOCK_DRIVER_LOCKD_SOURCES) \
	      $(LOG_DAEMON_SOURCES)
2500
endif ! WITH_LIBVIRTD
2501

2502 2503
EXTRA_DIST += \
	locking/virtlockd.sysconf \
J
Jiri Denemark 已提交
2504 2505
	locking/lockd.conf \
	locking/libvirt_lockd.aug \
2506
	locking/test_libvirt_lockd.aug.in \
2507
	logging/virtlogd.sysconf
2508 2509

install-sysconfig:
E
Eric Blake 已提交
2510
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
2511 2512
	$(INSTALL_DATA) $(srcdir)/locking/virtlockd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
2513 2514
	$(INSTALL_DATA) $(srcdir)/logging/virtlogd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlogd
2515 2516

uninstall-sysconfig:
2517
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlogd
2518
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
E
Eric Blake 已提交
2519
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
2520

2521
EXTRA_DIST += locking/virtlockd.init.in logging/virtlogd.init.in
2522 2523 2524

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_RED_HAT
2525
install-init:: virtlockd.init virtlogd.init install-sysconfig
E
Eric Blake 已提交
2526
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
2527 2528
	$(INSTALL_SCRIPT) virtlockd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
2529 2530
	$(INSTALL_SCRIPT) virtlogd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlogd
2531 2532

uninstall-init:: uninstall-sysconfig
E
Eric Blake 已提交
2533
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
2534
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlogd
E
Eric Blake 已提交
2535
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
2536

2537 2538
BUILT_SOURCES += virtlockd.init virtlogd.init
DISTCLEANFILES += virtlockd.init virtlogd.init
2539
else ! LIBVIRT_INIT_SCRIPT_RED_HAT
2540 2541
install-init::
uninstall-init::
2542 2543
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
else ! WITH_LIBVIRTD
2544 2545
install-init::
uninstall-init::
2546
endif ! WITH_LIBVIRTD
2547 2548

virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
2549 2550 2551 2552 2553 2554
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g'		\
	    < $< > $@-t &&					\
	    chmod a+x $@-t &&					\
2555 2556
	    mv $@-t $@

2557 2558 2559 2560 2561 2562 2563 2564 2565
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 $@

2566
POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)"
2567

2568
virtlockd.8.in: locking/virtlockd.pod
2569 2570 2571 2572 2573 2574 2575 2576
	$(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 $@
2577

2578
virtlogd.8.in: logging/virtlogd.pod
2579 2580 2581 2582 2583 2584 2585 2586
	$(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 $@
2587

2588
%.8: %.8.in $(top_srcdir)/configure.ac
2589
	$(AM_V_GEN)sed \
2590 2591 2592
		-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
		-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
		< $< > $@-t && \
2593 2594
	mv $@-t $@

2595
if WITH_LIBVIRTD
2596
man8_MANS = virtlockd.8 virtlogd.8
2597

2598
conf_DATA += locking/virtlockd.conf logging/virtlogd.conf
2599

2600 2601
augeas_DATA += locking/virtlockd.aug logging/virtlogd.aug
augeastest_DATA += test_virtlockd.aug test_virtlogd.aug
2602
endif WITH_LIBVIRTD
2603

A
Andrea Bolognani 已提交
2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615
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)
2616 2617 2618 2619

EXTRA_DIST += \
        locking/virtlockd.service.in \
        locking/virtlockd.socket.in \
2620 2621 2622
        locking/virtlockd.aug \
        locking/virtlockd.conf \
        locking/test_virtlockd.aug.in \
2623 2624 2625 2626 2627
        logging/virtlogd.service.in \
        logging/virtlogd.socket.in \
        logging/virtlogd.aug \
        logging/virtlogd.conf \
        logging/test_virtlogd.aug.in \
A
Andrea Bolognani 已提交
2628 2629
        $(PODFILES) \
        $(MANINFILES) \
2630
        $(NULL)
2631

2632 2633 2634 2635

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

2636
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
2637

2638 2639 2640 2641
BUILT_SOURCES += virtlockd.service virtlockd.socket \
		 virtlogd.service virtlogd.socket
DISTCLEANFILES += virtlockd.service virtlockd.socket \
		  virtlogd.service virtlogd.socket
2642

2643 2644
install-systemd: virtlockd.service virtlockd.socket \
                 virtlogd.service virtlogd.socket install-sysconfig
E
Eric Blake 已提交
2645
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
2646
	$(INSTALL_DATA) virtlockd.service \
2647
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2648
	$(INSTALL_DATA) virtlockd.socket \
2649
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2650 2651 2652 2653
	$(INSTALL_DATA) virtlogd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
	$(INSTALL_DATA) virtlogd.socket \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2654 2655

uninstall-systemd: uninstall-sysconfig
E
Eric Blake 已提交
2656 2657
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.socket
2658 2659
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlogd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlogd.socket
E
Eric Blake 已提交
2660
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
2661
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
2662 2663
install-systemd:
uninstall-systemd:
2664 2665
endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
else ! WITH_LIBVIRTD
2666 2667
install-systemd:
uninstall-systemd:
2668
endif ! WITH_LIBVIRTD
2669 2670

virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
2671 2672 2673
	$(AM_V_GEN)sed						\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    < $< > $@-t &&					\
2674 2675 2676
	    mv $@-t $@

virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
2677 2678 2679
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    < $< > $@-t &&					\
2680 2681
	    mv $@-t $@

2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693
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 $@

2694

2695
if WITH_SANLOCK
2696
lockdriver_LTLIBRARIES += sanlock.la
2697
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
2698
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
2699
sanlock_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
2700
sanlock_la_LIBADD = -lsanlock_client \
2701 2702 2703
		../gnulib/lib/libgnu.la

augeas_DATA += locking/libvirt_sanlock.aug
2704 2705
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
2706

E
Eric Blake 已提交
2707
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
2708
	$(AM_V_GEN)$(MKDIR_P) locking ; \
2709 2710 2711
	cp $< $@

if WITH_QEMU
2712
nodist_conf_DATA += locking/qemu-sanlock.conf
2713
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
2714
DISTCLEANFILES += locking/qemu-sanlock.conf
2715
endif WITH_QEMU
2716 2717 2718 2719 2720 2721

if WITH_LIBXL
nodist_conf_DATA += locking/libxl-sanlock.conf
BUILT_SOURCES += locking/libxl-sanlock.conf
DISTCLEANFILES += locking/libxl-sanlock.conf
endif WITH_LIBXL
2722
else ! WITH_SANLOCK
2723
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
2724
endif ! WITH_SANLOCK
2725 2726
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
2727
	locking/test_libvirt_sanlock.aug.in
2728

2729 2730 2731 2732
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
2733

2734
EXTRA_DIST += \
E
Eric Blake 已提交
2735 2736 2737 2738
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
2739 2740
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
2741

E
Eric Blake 已提交
2742
VIR_NET_RPC_GENERATED = \
2743 2744 2745 2746
	rpc/virnetprotocol.h \
	rpc/virnetprotocol.c \
	rpc/virkeepaliveprotocol.h \
	rpc/virkeepaliveprotocol.c
2747

2748
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2749

2750
libvirt_net_rpc_la_SOURCES = \
2751
	rpc/virnetmessage.h rpc/virnetmessage.c \
2752
	rpc/virnetsocket.h rpc/virnetsocket.c \
2753 2754
	rpc/virkeepalive.h rpc/virkeepalive.c \
	$(VIR_NET_RPC_GENERATED)
2755
if WITH_SSH2
2756 2757
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2758
else ! WITH_SSH2
2759 2760
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2761
endif ! WITH_SSH2
2762
if WITH_GNUTLS
2763 2764
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2765
else ! WITH_GNUTLS
2766 2767
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2768
endif ! WITH_GNUTLS
2769
if WITH_SASL
2770 2771
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2772
else ! WITH_SASL
2773 2774
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2775
endif ! WITH_SASL
2776
libvirt_net_rpc_la_CFLAGS = \
2777
			$(GNUTLS_CFLAGS) \
2778
			$(SASL_CFLAGS) \
2779
			$(SSH2_CFLAGS) \
2780
			$(XDR_CFLAGS) \
2781 2782
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
2783
			$(GNUTLS_LIBS) \
2784
			$(SASL_LIBS) \
2785
			$(SSH2_LIBS)\
J
Jim Fehlig 已提交
2786
			$(SECDRIVER_LIBS) \
2787 2788 2789 2790 2791 2792
			$(AM_LDFLAGS) \
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2793 2794 2795 2796
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
2797
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
2798
	rpc/virnetdaemon.h rpc/virnetdaemon.c \
2799 2800
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
2801
			$(AVAHI_CFLAGS) \
2802
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
2803
			$(XDR_CFLAGS) \
2804
			$(AM_CFLAGS)
2805 2806
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
2807
			$(AVAHI_LIBS) \
2808
			$(DBUS_LIBS) \
2809 2810 2811 2812 2813
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2814 2815 2816 2817 2818
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 已提交
2819 2820
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
2821 2822 2823 2824 2825 2826
libvirt_net_rpc_client_la_LDFLAGS = \
			$(AM_LDFLAGS) \
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
2827

2828 2829
libexec_PROGRAMS =

2830
if WITH_LIBVIRTD
2831 2832
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2833 2834 2835 2836
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2837 2838 2839
libvirt_iohelper_LDADD =		\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
2840 2841
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
2842
endif WITH_DTRACE_PROBES
2843

D
Daniel P. Berrange 已提交
2844 2845 2846 2847
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2848 2849 2850 2851

if WITH_NETWORK
libexec_PROGRAMS += libvirt_leaseshelper
libvirt_leaseshelper_SOURCES = $(NETWORK_LEASES_HELPER_SOURCES)
2852 2853 2854 2855
libvirt_leaseshelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870
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

2871
endif WITH_LIBVIRTD
2872

2873
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
2874
if WITH_LIBVIRTD
2875
libexec_PROGRAMS += libvirt_parthelper
2876

2877
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
D
Daniel P. Berrange 已提交
2878 2879 2880 2881
libvirt_parthelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2882 2883 2884 2885
libvirt_parthelper_LDADD =		\
		$(LIBPARTED_LIBS)	\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
2886 2887
if WITH_DTRACE_PROBES
libvirt_parthelper_LDADD += libvirt_probes.lo
2888
endif WITH_DTRACE_PROBES
2889

D
Daniel P. Berrange 已提交
2890 2891 2892 2893 2894
libvirt_parthelper_CFLAGS = \
		$(LIBPARTED_CFLAGS) \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2895 2896
endif WITH_LIBVIRTD
endif WITH_STORAGE_DISK
2897 2898
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)

2899

2900
if WITH_SANLOCK
2901 2902 2903
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2904
libvirt_sanlock_helper_CFLAGS = \
2905
		-I$(srcdir)/conf \
D
Daniel P. Berrange 已提交
2906 2907 2908 2909 2910 2911 2912
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2913
libvirt_sanlock_helper_LDADD = libvirt.la
2914
endif WITH_SANLOCK
2915

2916 2917 2918 2919 2920 2921
if WITH_LXC
if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_lxc

libvirt_lxc_SOURCES =						\
		$(LXC_CONTROLLER_SOURCES)			\
O
Osier Yang 已提交
2922 2923
		$(NODE_INFO_SOURCES)				\
		$(DATATYPES_SOURCES)
D
Daniel P. Berrange 已提交
2924 2925 2926 2927
libvirt_lxc_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2928
libvirt_lxc_LDADD =			\
G
Gao feng 已提交
2929
		$(FUSE_LIBS) \
2930 2931
		libvirt-net-rpc-server.la \
		libvirt-net-rpc.la \
2932
		libvirt_security_manager.la \
2933 2934
		libvirt_conf.la \
		libvirt_util.la \
2935
		../gnulib/lib/libgnu.la
2936
if WITH_DTRACE_PROBES
2937
libvirt_lxc_LDADD += libvirt_probes.lo
2938
endif WITH_DTRACE_PROBES
2939
libvirt_lxc_LDADD += $(SECDRIVER_LIBS)
2940
libvirt_lxc_CFLAGS =				\
2941
		-I$(srcdir)/conf	\
2942
		$(AM_CFLAGS)                    \
D
Daniel P. Berrange 已提交
2943
		$(PIE_CFLAGS)			\
G
Gao feng 已提交
2944
		$(LIBNL_CFLAGS)			\
D
Daniel P. Berrange 已提交
2945
		$(FUSE_CFLAGS)			\
2946
		$(DBUS_CFLAGS)			\
P
Pavel Fedin 已提交
2947
		$(XDR_CFLAGS)			\
D
Daniel P. Berrange 已提交
2948
		$(NULL)
2949
if WITH_BLKID
2950 2951
libvirt_lxc_CFLAGS += $(BLKID_CFLAGS)
libvirt_lxc_LDADD += $(BLKID_LIBS)
2952
endif WITH_BLKID
J
Jim Fehlig 已提交
2953
libvirt_lxc_CFLAGS += $(SECDRIVER_CFLAGS)
2954 2955
endif WITH_LIBVIRTD
endif WITH_LXC
2956 2957
EXTRA_DIST += $(LXC_CONTROLLER_SOURCES)

J
Jamie Strandboge 已提交
2958 2959 2960 2961 2962 2963
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 已提交
2964 2965 2966 2967
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
J
Jamie Strandboge 已提交
2968
virt_aa_helper_LDADD =						\
2969
		libvirt.la					\
C
Chris Lalancette 已提交
2970 2971
		libvirt_conf.la					\
		libvirt_util.la					\
2972
		libvirt_driver_storage_impl.la			\
C
Chris Lalancette 已提交
2973
		../gnulib/lib/libgnu.la
2974
if WITH_DTRACE_PROBES
2975
virt_aa_helper_LDADD += libvirt_probes.lo
2976
endif WITH_DTRACE_PROBES
J
Jamie Strandboge 已提交
2977
virt_aa_helper_CFLAGS =						\
2978 2979 2980 2981
		-I$(srcdir)/conf				\
		-I$(srcdir)/security				\
		$(AM_CFLAGS) 					\
		$(PIE_CFLAGS) 					\
D
Daniel P. Berrange 已提交
2982
		$(NULL)
2983 2984
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
J
Jamie Strandboge 已提交
2985 2986
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043
noinst_LTLIBRARIES += libvirt-nss.la

libvirt_nss_la_SOURCES =		\
		util/viralloc.c			\
		util/viralloc.h			\
		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			\
		util/virjson.c			\
		util/virjson.h			\
		util/virkmod.c			\
		util/virkmod.h			\
		util/virlease.c			\
		util/virlease.h			\
		util/virlog.c			\
		util/virlog.h			\
		util/virobject.c		\
		util/virobject.h		\
		util/virpidfile.c		\
		util/virpidfile.h		\
		util/virprocess.c		\
		util/virprocess.h		\
		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)


3044
install-data-local: install-init install-systemd
3045 3046
if WITH_LIBVIRTD
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
3047
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
3048
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
3049
endif WITH_LIBVIRTD
3050 3051
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
3052
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
3053
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
3054
if WITH_SANLOCK
3055
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
3056
endif WITH_SANLOCK
3057
if WITH_QEMU
3058
	$(MKDIR_P) -m 0751 "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu"
3059
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu"
3060
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu"
3061
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu"
3062
endif WITH_QEMU
3063 3064 3065
if WITH_LXC
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lxc"
3066
endif WITH_LXC
J
Jim Fehlig 已提交
3067 3068 3069
if WITH_LIBXL
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/libxl"
J
Jim Fehlig 已提交
3070
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl"
3071
endif WITH_LIBXL
3072 3073 3074
if WITH_UML
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/uml"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/uml"
3075
endif WITH_UML
3076 3077
if WITH_XEN
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/xen"
3078
endif WITH_XEN
3079 3080
if WITH_NETWORK
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network"
3081
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq"
3082
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/network"
3083
	$(MKDIR_P) "$(DESTDIR)$(confdir)/qemu/networks/autostart"
3084
	$(INSTALL_DATA) $(srcdir)/network/default.xml \
3085
	  $(DESTDIR)$(confdir)/qemu/networks/default.xml
3086
	test -z "$(UUID)" || \
3087 3088 3089
	  { sed -e "s,</name>,</name>;  <uuid>$(UUID)</uuid>," \
	      $(DESTDIR)$(confdir)/qemu/networks/default.xml | \
	      tr ";" "\n" > \
3090 3091 3092 3093
	      $(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 已提交
3094
	( cd $(DESTDIR)$(confdir)/qemu/networks/autostart && \
3095 3096
	  rm -f default.xml && \
	  $(LN_S) ../default.xml default.xml )
3097
endif WITH_NETWORK
3098

3099
uninstall-local:: uninstall-init uninstall-systemd
3100
if WITH_LIBVIRTD
3101
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
3102 3103
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
3104
endif WITH_LIBVIRTD
3105 3106
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
3107
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
3108
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
3109
if WITH_SANLOCK
3110
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
3111
endif WITH_SANLOCK
3112 3113 3114 3115 3116
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" ||:
3117
endif WITH_QEMU
3118 3119 3120
if WITH_LXC
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||:
3121
endif WITH_LXC
J
Jim Fehlig 已提交
3122 3123 3124
if WITH_LIBXL
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||:
J
Jim Fehlig 已提交
3125
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||:
3126
endif WITH_LIBXL
3127 3128 3129
if WITH_UML
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/uml" ||:
3130
endif WITH_UML
3131 3132
if WITH_XEN
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/xen" ||:
3133
endif WITH_XEN
3134
if WITH_NETWORK
3135 3136 3137 3138
	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" || :
3139 3140
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||:
3141
endif WITH_NETWORK
3142
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
3143

3144 3145
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
3146
MAINTAINERCLEANFILES += $(REMOTE_DRIVER_GENERATED) $(VIR_NET_RPC_GENERATED)