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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

E
Eric Blake 已提交
192
BUILT_SOURCES += util/virkeymaps.h
193
MAINTAINERCLEANFILES += util/virkeymaps.h
194

E
Eric Blake 已提交
195
util/virkeymaps.h: $(srcdir)/util/keymaps.csv	\
L
Lai Jiangshan 已提交
196
		$(srcdir)/util/virkeycode-mapgen.py
197
	$(MKDIR_P) util/
198
	$(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py \
199
	  <$(srcdir)/util/keymaps.csv >util/virkeymaps.h
L
Lai Jiangshan 已提交
200

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

237 238 239
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

240 241
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
242

243
LOCK_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
244 245
		locking/lock_protocol.h \
		locking/lock_protocol.c \
246 247
		$(NULL)

248 249 250
LOCK_PROTOCOL = $(srcdir)/locking/lock_protocol.x
EXTRA_DIST += $(LOCK_PROTOCOL) \
	$(LOCK_PROTOCOL_GENERATED)
251 252 253
BUILT_SOURCES += $(LOCK_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(LOCK_PROTOCOL_GENERATED)

254
LOCK_DAEMON_GENERATED = \
255
		locking/lock_daemon_dispatch_stubs.h
256 257 258
		$(NULL)

BUILT_SOURCES += $(LOCK_DAEMON_GENERATED)
259
EXTRA_DIST += $(LOCK_DAEMON_GENERATED)
260 261
MAINTAINERCLEANFILES += $(LOCK_DAEMON_GENERATED)

262 263
LOCK_DRIVER_LOCKD_SOURCES = \
		locking/lock_driver_lockd.c \
264
		locking/lock_driver_lockd.h \
265 266
		$(NULL)

267 268 269 270 271
LOCK_DAEMON_SOURCES = \
		locking/lock_daemon.h \
		locking/lock_daemon.c \
		locking/lock_daemon_config.h \
		locking/lock_daemon_config.c \
272 273
		locking/lock_daemon_dispatch.c \
		locking/lock_daemon_dispatch.h \
274 275
		$(NULL)

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


283 284 285 286 287
LOG_PROTOCOL_GENERATED = \
		logging/log_protocol.h \
		logging/log_protocol.c \
		$(NULL)

288 289
DRIVER_SOURCES += $(LOG_PROTOCOL_GENERATED)

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


322 323
NETDEV_CONF_SOURCES =						\
		conf/netdev_bandwidth_conf.h conf/netdev_bandwidth_conf.c \
324 325
		conf/netdev_vport_profile_conf.h conf/netdev_vport_profile_conf.c \
		conf/netdev_vlan_conf.h conf/netdev_vlan_conf.c
326

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

340 341 342 343
OBJECT_EVENT_SOURCES =						\
		conf/object_event.c conf/object_event.h \
		conf/object_event_private.h

344 345
DOMAIN_EVENT_SOURCES =						\
		conf/domain_event.c conf/domain_event.h
346

347 348 349
NETWORK_EVENT_SOURCES =						\
		conf/network_event.c conf/network_event.h

350 351 352
STORAGE_EVENT_SOURCES =						\
                conf/storage_event.c conf/storage_event.h

353 354 355
NODE_DEVICE_EVENT_SOURCES =					\
                conf/node_device_event.c conf/node_device_event.h

356
# Network driver generic impl APIs
357
NETWORK_CONF_SOURCES =						\
358 359
		conf/network_conf.c conf/network_conf.h \
		conf/networkcommon_conf.c conf/networkcommon_conf.h
360

361 362
# Network filter driver generic impl APIs
NWFILTER_PARAM_CONF_SOURCES =					\
363
		conf/nwfilter_params.c conf/nwfilter_params.h	\
364 365
		conf/nwfilter_ipaddrmap.c			\
		conf/nwfilter_ipaddrmap.h			\
366
		conf/nwfilter_conf.h
367

368
NWFILTER_CONF_SOURCES =						\
369 370 371
		$(NWFILTER_PARAM_CONF_SOURCES)			\
		conf/nwfilter_conf.c conf/nwfilter_conf.h

372
# Storage driver generic impl APIs
373 374
STORAGE_CONF_SOURCES =                                         \
		conf/storage_conf.h conf/storage_conf.c
375

376
# Interface driver generic impl APIs
377 378
INTERFACE_CONF_SOURCES =                                       \
		conf/interface_conf.c conf/interface_conf.h
379

380
# Secret driver generic impl APIs
381
SECRET_CONF_SOURCES =                                          \
382 383
		conf/secret_conf.h conf/secret_conf.c          \
		conf/virsecretobj.h conf/virsecretobj.c
384 385 386 387 388

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

389 390
CPU_CONF_SOURCES =						\
		conf/cpu_conf.c conf/cpu_conf.h
391

392 393
# Safe character device handling helper APIs
CHRDEV_CONF_SOURCES =						\
394
		conf/virchrdev.c conf/virchrdev.h
395

396 397 398 399
# Device Helper APIs
DEVICE_CONF_SOURCES =                                           \
		conf/device_conf.c conf/device_conf.h

400
CONF_SOURCES =							\
401
		$(NETDEV_CONF_SOURCES)				\
402
		$(DOMAIN_CONF_SOURCES)				\
403
		$(OBJECT_EVENT_SOURCES)				\
404
		$(DOMAIN_EVENT_SOURCES)				\
405
		$(NETWORK_EVENT_SOURCES)			\
406
		$(STORAGE_EVENT_SOURCES)			\
407
		$(NODE_DEVICE_EVENT_SOURCES)			\
408
		$(NETWORK_CONF_SOURCES)				\
409
		$(NWFILTER_CONF_SOURCES)			\
410 411 412
		$(NODE_DEVICE_CONF_SOURCES)			\
		$(STORAGE_CONF_SOURCES)				\
		$(INTERFACE_CONF_SOURCES)			\
413
		$(SECRET_CONF_SOURCES)				\
414
		$(CPU_CONF_SOURCES)				\
415
		$(CHRDEV_CONF_SOURCES)				\
416
		$(DEVICE_CONF_SOURCES)
417

418
# The remote RPC driver, covering domains, storage, networks, etc
419
REMOTE_DRIVER_GENERATED = \
E
Eric Blake 已提交
420 421 422 423 424 425 426 427 428 429
		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 已提交
430 431

REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x
432
LXC_PROTOCOL = $(srcdir)/remote/lxc_protocol.x
E
Eric Blake 已提交
433
QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x
434
REMOTE_DRIVER_PROTOCOL = $(REMOTE_PROTOCOL) $(QEMU_PROTOCOL) $(LXC_PROTOCOL)
435

E
Eric Blake 已提交
436
remote/remote_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
437
		$(REMOTE_PROTOCOL) Makefile.am
438
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
439 440
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/remote/remote_client_bodies.h
441

E
Eric Blake 已提交
442
remote/lxc_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
443
		$(LXC_PROTOCOL) Makefile.am
444
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
445 446
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/remote/lxc_client_bodies.h
447

E
Eric Blake 已提交
448
remote/qemu_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
449
		$(QEMU_PROTOCOL) Makefile.am
450
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
451 452
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/remote/qemu_client_bodies.h
453 454 455 456

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

458
EXTRA_DIST +=  $(REMOTE_DRIVER_PROTOCOL) \
459
		$(REMOTE_DRIVER_GENERATED)
460

M
Martin Kletzander 已提交
461 462 463 464
ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x

ADMIN_PROTOCOL_GENERATED = \
		admin/admin_protocol.c	\
465 466 467 468 469 470 471 472
		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 已提交
473 474 475 476 477

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

478 479 480 481 482 483 484 485 486 487
# 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
488 489 490 491

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

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

549
# .libs/libvirt.so is built by libtool as a side-effect of the Makefile
550 551
# rule for libvirt.la.  However, checking symbols relies on Linux ELF layout
if WITH_LINUX
552 553 554
check-symfile: libvirt.syms libvirt.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt.syms \
	  .libs/libvirt.so
555 556 557
check-admin-symfile: libvirt_admin.syms libvirt-admin.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt_admin.syms \
	  .libs/libvirt-admin.so
558
else ! WITH_LINUX
559
check-symfile:
560
check-admin-symfile:
561
endif ! WITH_LINUX
562
check-symsorting:
563
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
564
		$(srcdir) $(SYM_FILES)
565 566 567
check-admin-symsorting:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
		$(srcdir) $(ADMIN_SYM_FILES)
J
Jiri Denemark 已提交
568
EXTRA_DIST += check-symfile.pl check-symsorting.pl
569

E
Eric Blake 已提交
570
# Keep this list synced with RPC_PROBE_FILES
571 572
PROTOCOL_STRUCTS = \
	$(srcdir)/remote_protocol-structs \
573
	$(srcdir)/lxc_protocol-structs \
574
	$(srcdir)/qemu_protocol-structs \
J
Jiri Denemark 已提交
575
	$(srcdir)/virnetprotocol-structs \
E
Eric Blake 已提交
576 577 578
	$(srcdir)/virkeepaliveprotocol-structs \
	$(srcdir)/lxc_monitor_protocol-structs \
	$(srcdir)/lock_protocol-structs \
M
Martin Kletzander 已提交
579
	$(srcdir)/admin_protocol-structs \
E
Eric Blake 已提交
580 581
	$(NULL)

582
if WITH_REMOTE
583 584
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)

585 586
# 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.
587 588 589
$(srcdir)/remote_protocol-struct \
	$(srcdir)/qemu_protocol-struct \
	$(srcdir)/lxc_protocol-struct: \
E
Eric Blake 已提交
590
		$(srcdir)/%-struct: remote/libvirt_driver_remote_la-%.lo
591
	$(PDWTAGS)
592
$(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \
E
Eric Blake 已提交
593
		$(srcdir)/%-struct: rpc/libvirt_net_rpc_la-%.lo
594
	$(PDWTAGS)
E
Eric Blake 已提交
595
$(srcdir)/lxc_monitor_protocol-struct: \
E
Eric Blake 已提交
596
		$(srcdir)/%-struct: lxc/libvirt_driver_lxc_impl_la-%.lo
E
Eric Blake 已提交
597 598
	$(PDWTAGS)
$(srcdir)/lock_protocol-struct: \
E
Eric Blake 已提交
599
		$(srcdir)/%-struct: locking/lockd_la-%.lo
E
Eric Blake 已提交
600
	$(PDWTAGS)
M
Martin Kletzander 已提交
601 602 603
$(srcdir)/admin_protocol-struct: \
		$(srcdir)/%-struct: admin/libvirt_admin_la-%.lo
	$(PDWTAGS)
E
Eric Blake 已提交
604

605
else !WITH_REMOTE
606 607 608
# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be
# re-generated when configured --without-remote.
check-protocol:
609
endif !WITH_REMOTE
J
Jiri Denemark 已提交
610
EXTRA_DIST += $(PROTOCOL_STRUCTS)
611 612 613 614 615

check-drivername:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-drivername.pl \
		$(srcdir)/driver.h \
		$(srcdir)/libvirt_public.syms \
616
		$(srcdir)/libvirt_admin_public.syms \
617 618 619 620 621
		$(srcdir)/libvirt_qemu.syms \
		$(srcdir)/libvirt_lxc.syms

EXTRA_DIST += check-drivername.pl

622
DRIVER_SOURCE_FILES = \
623 624 625 626 627 628 629 630 631 632 633
	$(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) \
634
	$(VZ_DRIVER_SOURCES) \
635 636 637 638 639 640 641 642
	$(PHYP_DRIVER_SOURCES) \
	$(QEMU_DRIVER_SOURCES) \
	$(REMOTE_DRIVER_SOURCES) \
	$(SECRET_DRIVER_SOURCES) \
	$(STORAGE_DRIVER_SOURCES) \
	$(TEST_DRIVER_SOURCES) \
	$(UML_DRIVER_SOURCES) \
	$(VBOX_DRIVER_SOURCES) \
643
	vbox/vbox_tmpl.c \
644 645 646
	$(VMWARE_DRIVER_SOURCES) \
	$(XEN_DRIVER_SOURCES) \
	$(XENAPI_DRIVER_SOURCES) \
647 648
	$(NULL)

649
STATEFUL_DRIVER_SOURCE_FILES = \
R
Roman Bogorodskiy 已提交
650
	$(BHYVE_DRIVER_SOURCES) \
651 652 653 654 655 656 657 658 659 660 661
	$(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) \
662
	$(VZ_DRIVER_SOURCES) \
663 664
	$(NULL)

665 666 667

check-driverimpls:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-driverimpls.pl \
668
		$(filter /%,$(DRIVER_SOURCE_FILES)) \
E
Eric Blake 已提交
669 670 671
		$(filter $(srcdir)/%,$(DRIVER_SOURCE_FILES)) \
		$(addprefix $(srcdir)/,$(filter-out $(srcdir)/%, \
			$(filter-out /%,$(DRIVER_SOURCE_FILES))))
672

673 674
check-aclrules:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclrules.pl \
E
Eric Blake 已提交
675
		$(REMOTE_PROTOCOL) \
676
		$(addprefix $(srcdir)/,$(filter-out /%,$(STATEFUL_DRIVER_SOURCE_FILES)))
677

678 679 680 681 682
check-aclperms:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclperms.pl \
		$(srcdir)/access/viraccessperm.h \
		$(srcdir)/access/viraccessperm.c

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

685
check-local: check-protocol check-symfile check-symsorting \
686
	check-drivername check-driverimpls check-aclrules \
687
	check-aclperms check-admin-symfile check-admin-symsorting
688
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
689

690 691
# Mock driver, covering domains, storage, networks, etc
TEST_DRIVER_SOURCES =						\
692
		test/test_driver.c test/test_driver.h
693 694 695

# Now the Hypervisor specific drivers
XEN_DRIVER_SOURCES =						\
696 697 698 699 700 701
		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
702
if WITH_XEN_INOTIFY
703
XEN_DRIVER_SOURCES += xen/xen_inotify.c xen/xen_inotify.h
704
endif WITH_XEN_INOTIFY
705

706
LXC_MONITOR_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
707 708
	lxc/lxc_monitor_protocol.h \
	lxc/lxc_monitor_protocol.c \
709 710 711
	$(NULL)

LXC_MONITOR_GENERATED = \
E
Eric Blake 已提交
712
	lxc/lxc_monitor_dispatch.h \
713 714 715
	$(NULL)

LXC_CONTROLLER_GENERATED = \
E
Eric Blake 已提交
716
	lxc/lxc_controller_dispatch.h \
717 718 719
	$(NULL)

LXC_GENERATED = \
720
	$(LXC_MONITOR_PROTOCOL_GENERATED) \
721 722 723 724
	$(LXC_MONITOR_GENERATED) \
	$(LXC_CONTROLLER_GENERATED) \
	$(NULL)

725
LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x
726

E
Eric Blake 已提交
727
lxc/lxc_monitor_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
728
		$(LXC_MONITOR_PROTOCOL) Makefile.am
729
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
730 731
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_monitor_dispatch.h
732

E
Eric Blake 已提交
733
lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
734
		$(REMOTE_PROTOCOL) Makefile.am
735
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \
E
Eric Blake 已提交
736 737
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_controller_dispatch.h
738 739

EXTRA_DIST += \
740
	$(LXC_MONITOR_PROTOCOL) \
741 742 743 744 745
	$(LXC_GENERATED) \
	$(NULL)

BUILT_SOURCES += $(LXC_GENERATED)

746 747
CLEANFILES += $(LXC_GENERATED)

748
LXC_DRIVER_SOURCES =						\
749
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
750
		$(LXC_MONITOR_GENERATED)			\
751 752
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
753
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
754
		lxc/lxc_domain.c lxc/lxc_domain.h		\
755
		lxc/lxc_hostdev.c lxc/lxc_hostdev.h		\
756
		lxc/lxc_monitor.c lxc/lxc_monitor.h		\
757
		lxc/lxc_process.c lxc/lxc_process.h		\
G
Gao feng 已提交
758
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
759
		lxc/lxc_native.c lxc/lxc_native.h		\
760
		lxc/lxc_driver.c lxc/lxc_driver.h
761

762
LXC_CONTROLLER_SOURCES =					\
763
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
764
		$(LXC_CONTROLLER_GENERATED)			\
765 766
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
767
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
768
		lxc/lxc_domain.c lxc/lxc_domain.h		\
G
Gao feng 已提交
769
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
770
		lxc/lxc_controller.c
771

J
Jamie Strandboge 已提交
772
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES =			\
E
Eric Blake 已提交
773
		$(DATATYPES_SOURCES)				\
J
Jamie Strandboge 已提交
774 775
		security/virt-aa-helper.c

776 777 778
PHYP_DRIVER_SOURCES =						\
		phyp/phyp_driver.c phyp/phyp_driver.h

779
OPENVZ_DRIVER_SOURCES =						\
780
		openvz/openvz_conf.c openvz/openvz_conf.h	\
781 782
		openvz/openvz_driver.c openvz/openvz_driver.h   \
		openvz/openvz_util.c openvz/openvz_util.h
783

E
Eric Blake 已提交
784
VMWARE_DRIVER_SOURCES =						\
785
		vmware/vmware_driver.c vmware/vmware_driver.h	\
786 787
		vmware/vmware_conf.c vmware/vmware_conf.h

788
VBOX_DRIVER_SOURCES =						\
E
Eric Blake 已提交
789 790
	vbox/vbox_glue.c vbox/vbox_glue.h			\
	vbox/vbox_driver.c vbox/vbox_driver.h			\
T
Taowei 已提交
791
	vbox/vbox_snapshot_conf.c vbox/vbox_snapshot_conf.h     \
E
Eric Blake 已提交
792 793 794 795
	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			\
796
	vbox/vbox_V4_0.c vbox/vbox_CAPI_v4_0.h			\
797
	vbox/vbox_V4_1.c vbox/vbox_CAPI_v4_1.h			\
R
Ryota Ozaki 已提交
798
	vbox/vbox_V4_2.c vbox/vbox_CAPI_v4_2.h			\
T
Taowei 已提交
799
	vbox/vbox_V4_2_20.c vbox/vbox_CAPI_v4_2_20.h		\
800
	vbox/vbox_V4_3.c vbox/vbox_CAPI_v4_3.h			\
T
Taowei 已提交
801
	vbox/vbox_V4_3_4.c vbox/vbox_CAPI_v4_3_4.h              \
M
Martin Pietsch 已提交
802
	vbox/vbox_V5_0.c vbox/vbox_CAPI_v5_0.h			\
T
Taowei 已提交
803 804
	vbox/vbox_common.c vbox/vbox_common.h                   \
	vbox/vbox_uniformed_api.h                               \
805 806 807
	vbox/vbox_get_driver.h					\
	vbox/vbox_network.c					\
	vbox/vbox_storage.c
T
Taowei Luo 已提交
808

E
Eric Blake 已提交
809
VBOX_DRIVER_EXTRA_DIST =					\
810 811 812
		vbox/vbox_tmpl.c vbox/README			\
		vbox/vbox_MSCOMGlue.c vbox/vbox_MSCOMGlue.h	\
		vbox/vbox_XPCOMCGlue.c vbox/vbox_XPCOMCGlue.h
813

O
Osier Yang 已提交
814 815
QEMU_DRIVER_SOURCES =							\
		qemu/qemu_agent.c qemu/qemu_agent.h			\
816
		qemu/qemu_alias.c qemu/qemu_alias.h			\
817
		qemu/qemu_blockjob.c qemu/qemu_blockjob.h		\
O
Osier Yang 已提交
818 819
		qemu/qemu_capabilities.c qemu/qemu_capabilities.h	\
		qemu/qemu_command.c qemu/qemu_command.h			\
820
		qemu/qemu_parse_command.c qemu/qemu_parse_command.h	\
O
Osier Yang 已提交
821
		qemu/qemu_domain.c qemu/qemu_domain.h			\
822
		qemu/qemu_domain_address.c qemu/qemu_domain_address.h	\
O
Osier Yang 已提交
823 824 825
		qemu/qemu_cgroup.c qemu/qemu_cgroup.h			\
		qemu/qemu_hostdev.c qemu/qemu_hostdev.h			\
		qemu/qemu_hotplug.c qemu/qemu_hotplug.h			\
826
		qemu/qemu_hotplugpriv.h					\
O
Osier Yang 已提交
827 828
		qemu/qemu_conf.c qemu/qemu_conf.h			\
		qemu/qemu_process.c qemu/qemu_process.h			\
829
		qemu/qemu_processpriv.h					\
O
Osier Yang 已提交
830 831 832 833 834 835
		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				\
836
		qemu/qemu_driver.c qemu/qemu_driver.h	\
837 838
		qemu/qemu_interface.c qemu/qemu_interface.h		\
		qemu/qemu_capspriv.h
R
Richard W.M. Jones 已提交
839

O
Osier Yang 已提交
840
XENAPI_DRIVER_SOURCES =						\
841
		xenapi/xenapi_driver.c xenapi/xenapi_driver.h	\
O
Osier Yang 已提交
842
		xenapi/xenapi_driver_private.h			\
843 844
		xenapi/xenapi_utils.c xenapi/xenapi_utils.h

845 846 847 848 849
LIBXL_DRIVER_SOURCES =							\
		libxl/libxl_conf.c libxl/libxl_conf.h			\
		libxl/libxl_capabilities.c libxl/libxl_capabilities.h	\
		libxl/libxl_domain.c libxl/libxl_domain.h       	\
		libxl/libxl_driver.c libxl/libxl_driver.h       	\
J
Jim Fehlig 已提交
850
		libxl/libxl_migration.c libxl/libxl_migration.h
J
Jim Fehlig 已提交
851

852
UML_DRIVER_SOURCES =						\
D
Daniel P. Berrange 已提交
853 854
		uml/uml_conf.c uml/uml_conf.h			\
		uml/uml_driver.c uml/uml_driver.h
855

O
Osier Yang 已提交
856 857 858 859 860 861
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	\
862
		esx/esx_storage_backend_vmfs.c esx/esx_storage_backend_vmfs.h	\
863
		esx/esx_storage_backend_iscsi.c esx/esx_storage_backend_iscsi.h	\
864
		esx/esx_stream.c esx/esx_stream.h			\
O
Osier Yang 已提交
865 866 867
		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		\
868
		esx/esx_vi_types.c esx/esx_vi_types.h
869

870
ESX_DRIVER_GENERATED =							\
871 872
		esx/esx_vi_methods.generated.c				\
		esx/esx_vi_methods.generated.h				\
873
		esx/esx_vi_methods.generated.macro			\
874 875 876 877 878
		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			\
879 880 881
		esx/esx_vi_types.generated.typefromstring		\
		esx/esx_vi.generated.c					\
		esx/esx_vi.generated.h
882

O
Osier Yang 已提交
883
ESX_DRIVER_EXTRA_DIST =							\
884 885 886 887 888
		esx/README						\
		esx/esx_vi_generator.input				\
		esx/esx_vi_generator.py					\
		$(ESX_DRIVER_GENERATED)

O
Osier Yang 已提交
889
HYPERV_DRIVER_SOURCES =									\
M
Matthias Bolte 已提交
890 891
		hyperv/hyperv_private.h							\
		hyperv/hyperv_driver.c hyperv/hyperv_driver.h				\
892
		hyperv/hyperv_util.c hyperv/hyperv_util.h				\
893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908
		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)

909
VZ_DRIVER_SOURCES =				\
910 911 912 913 914 915
		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 已提交
916

R
Roman Bogorodskiy 已提交
917
BHYVE_DRIVER_SOURCES =						\
918 919
		bhyve/bhyve_capabilities.c			\
		bhyve/bhyve_capabilities.h			\
R
Roman Bogorodskiy 已提交
920 921
		bhyve/bhyve_command.c				\
		bhyve/bhyve_command.h				\
922 923
		bhyve/bhyve_parse_command.c			\
		bhyve/bhyve_parse_command.h			\
924 925 926 927
		bhyve/bhyve_device.c				\
		bhyve/bhyve_device.h				\
		bhyve/bhyve_domain.c				\
		bhyve/bhyve_domain.h				\
R
Roman Bogorodskiy 已提交
928 929
		bhyve/bhyve_driver.h				\
		bhyve/bhyve_driver.c				\
930 931
		bhyve/bhyve_monitor.c				\
		bhyve/bhyve_monitor.h				\
R
Roman Bogorodskiy 已提交
932 933 934 935 936
		bhyve/bhyve_process.c				\
		bhyve/bhyve_process.h				\
		bhyve/bhyve_utils.h				\
		$(NULL)

937
NETWORK_DRIVER_SOURCES =					\
938 939 940 941 942
		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
943

944 945 946 947
INTERFACE_DRIVER_SOURCES =

if WITH_INTERFACE
INTERFACE_DRIVER_SOURCES +=					\
948 949
		interface/interface_driver.h        \
		interface/interface_driver.c
950 951 952 953

if WITH_NETCF
INTERFACE_DRIVER_SOURCES +=					\
		interface/interface_backend_netcf.c
954
endif WITH_NETCF
955
if WITH_UDEV
956 957
INTERFACE_DRIVER_SOURCES +=					\
		interface/interface_backend_udev.c
958 959
endif WITH_UDEV
endif WITH_INTERFACE
960

961 962 963
SECRET_UTIL_SOURCES =						\
		secret/secret_util.h secret/secret_util.c

964
SECRET_DRIVER_SOURCES =						\
965
		secret/secret_driver.h secret/secret_driver.c
966

967
# Storage backend specific impls
O
Osier Yang 已提交
968 969
STORAGE_DRIVER_SOURCES =						\
		storage/storage_driver.h storage/storage_driver.c	\
970
		storage/storage_backend.h storage/storage_backend.c
971 972

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

975
STORAGE_DRIVER_LVM_SOURCES =					\
O
Osier Yang 已提交
976
		storage/storage_backend_logical.h		\
977
		storage/storage_backend_logical.c
978 979

STORAGE_DRIVER_ISCSI_SOURCES =					\
980
		storage/storage_backend_iscsi.h storage/storage_backend_iscsi.c
981

982
STORAGE_DRIVER_SCSI_SOURCES =					\
983
		storage/storage_backend_scsi.h storage/storage_backend_scsi.c
984

D
Dave Allan 已提交
985
STORAGE_DRIVER_MPATH_SOURCES =					\
986
		storage/storage_backend_mpath.h storage/storage_backend_mpath.c
D
Dave Allan 已提交
987

988
STORAGE_DRIVER_DISK_SOURCES =					\
989
		storage/storage_backend_disk.h storage/storage_backend_disk.c
990

991 992 993
STORAGE_DRIVER_RBD_SOURCES =					\
		storage/storage_backend_rbd.h storage/storage_backend_rbd.c

994 995 996
STORAGE_DRIVER_SHEEPDOG_SOURCES =				\
		storage/storage_backend_sheepdog.h storage/storage_backend_sheepdog.c

997 998 999
STORAGE_DRIVER_GLUSTER_SOURCES =				\
		storage/storage_backend_gluster.h storage/storage_backend_gluster.c

R
Roman Bogorodskiy 已提交
1000 1001 1002
STORAGE_DRIVER_ZFS_SOURCES =					\
                storage/storage_backend_zfs.h storage/storage_backend_zfs.c

1003
STORAGE_HELPER_DISK_SOURCES =					\
1004
		storage/parthelper.c
1005

1006 1007 1008
UTIL_IO_HELPER_SOURCES =					\
		util/iohelper.c

1009 1010 1011
NETWORK_LEASES_HELPER_SOURCES =                                 \
               network/leaseshelper.c

1012
# Network filters
O
Osier Yang 已提交
1013
NWFILTER_DRIVER_SOURCES =						\
1014
		nwfilter/nwfilter_driver.h nwfilter/nwfilter_driver.c	\
1015
		nwfilter/nwfilter_tech_driver.h				\
1016 1017
		nwfilter/nwfilter_gentech_driver.c			\
		nwfilter/nwfilter_gentech_driver.h			\
S
Stefan Berger 已提交
1018 1019
		nwfilter/nwfilter_dhcpsnoop.c				\
		nwfilter/nwfilter_dhcpsnoop.h				\
1020
		nwfilter/nwfilter_ebiptables_driver.c			\
1021 1022 1023
		nwfilter/nwfilter_ebiptables_driver.h			\
		nwfilter/nwfilter_learnipaddr.c				\
		nwfilter/nwfilter_learnipaddr.h
1024

1025

1026
# Security framework and drivers for various models
O
Osier Yang 已提交
1027 1028 1029 1030 1031
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		\
1032
		security/security_manager.h security/security_manager.c
1033

1034
SECURITY_DRIVER_SELINUX_SOURCES =				\
1035
		security/security_selinux.h security/security_selinux.c
1036

J
Jamie Strandboge 已提交
1037 1038 1039
SECURITY_DRIVER_APPARMOR_SOURCES =				\
		security/security_apparmor.h security/security_apparmor.c

1040
ACCESS_DRIVER_GENERATED = \
E
Eric Blake 已提交
1041 1042 1043 1044 1045 1046 1047
		access/viraccessapicheck.h \
		access/viraccessapicheck.c \
		access/viraccessapicheckqemu.h \
		access/viraccessapicheckqemu.c \
		access/viraccessapichecklxc.h \
		access/viraccessapichecklxc.c \
		$(NULL)
1048

1049
ACCESS_DRIVER_SYM_FILES = \
1050 1051 1052
		libvirt_access.syms \
		libvirt_access_qemu.syms \
		libvirt_access_lxc.syms
1053

1054 1055 1056 1057 1058
ACCESS_DRIVER_API_FILES = \
		libvirt_access.xml \
		libvirt_access_qemu.xml \
		libvirt_access_lxc.xml

1059 1060 1061 1062 1063 1064 1065
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

1066 1067 1068 1069
ACCESS_DRIVER_POLKIT_SOURCES = \
		access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c

ACCESS_DRIVER_POLKIT_POLICY = \
1070
		$(srcdir)/access/org.libvirt.api.policy
1071 1072


1073
NODE_DEVICE_DRIVER_SOURCES =					\
O
Osier Yang 已提交
1074 1075
		node_device/node_device_driver.c		\
		node_device/node_device_driver.h		\
1076 1077
		node_device/node_device_linux_sysfs.c           \
		node_device/node_device_linux_sysfs.h
1078 1079

NODE_DEVICE_DRIVER_HAL_SOURCES =				\
1080
		node_device/node_device_hal.c			\
1081
		node_device/node_device_hal.h
1082

1083
NODE_DEVICE_DRIVER_UDEV_SOURCES =				\
D
Daniel Veillard 已提交
1084 1085
		node_device/node_device_udev.c			\
		node_device/node_device_udev.h
1086

J
Jiri Denemark 已提交
1087 1088 1089
CPU_SOURCES =							\
		cpu/cpu.h cpu/cpu.c				\
		cpu/cpu_x86.h cpu/cpu_x86.c cpu/cpu_x86_data.h	\
T
Thang Pham 已提交
1090
		cpu/cpu_s390.h cpu/cpu_s390.c			\
C
Chuck Short 已提交
1091
		cpu/cpu_arm.h cpu/cpu_arm.c			\
1092 1093 1094
		cpu/cpu_ppc64.h cpu/cpu_ppc64.c			\
		cpu/cpu_ppc64_data.h				\
		cpu/cpu_map.h cpu/cpu_map.c
1095

1096 1097 1098
VMX_SOURCES =							\
		vmx/vmx.c vmx/vmx.h

1099 1100
XENCONFIG_SOURCES =						\
		xenconfig/xenxs_private.h			\
1101
		xenconfig/xen_common.c xenconfig/xen_common.h   \
1102
		xenconfig/xen_sxpr.c xenconfig/xen_sxpr.h	\
1103
		xenconfig/xen_xm.c xenconfig/xen_xm.h
1104 1105 1106 1107
if WITH_LIBXL
XENCONFIG_SOURCES +=						\
		xenconfig/xen_xl.c xenconfig/xen_xl.h
endif WITH_LIBXL
1108

J
Jiri Denemark 已提交
1109 1110
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
1111
EXTRA_DIST +=	$(pkgdata_DATA)
1112

1113 1114 1115 1116 1117 1118
#########################
#
# Build up list of libvirt.la source files based on configure conditions
#
# First deal with sources usable in non-daemon context

1119
noinst_LTLIBRARIES = libvirt_util.la
1120 1121
libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
libvirt_la_BUILT_LIBADD = libvirt_util.la
1122 1123
libvirt_util_la_SOURCES =					\
		$(UTIL_SOURCES)
1124
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
1125
		$(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
1126
		$(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS)	\
1127
		$(POLKIT_CFLAGS) $(GNUTLS_CFLAGS) \
1128
		-I$(srcdir)/conf
1129
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
1130
		$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
1131
		$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(MSCOM_LIBS) $(LIBXML_LIBS) \
1132
		$(SECDRIVER_LIBS) $(NUMACTL_LIBS) \
1133
		$(POLKIT_LIBS)
1134

1135 1136

noinst_LTLIBRARIES += libvirt_conf.la
1137
libvirt_la_BUILT_LIBADD += libvirt_conf.la
1138
libvirt_conf_la_SOURCES = $(CONF_SOURCES)
1139 1140
libvirt_conf_la_CFLAGS = $(AM_CFLAGS)
libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS)
1141
libvirt_conf_la_LIBADD = $(LIBXML_LIBS)
1142

J
Jiri Denemark 已提交
1143
noinst_LTLIBRARIES += libvirt_cpu.la
1144
libvirt_la_BUILT_LIBADD += libvirt_cpu.la
J
Jiri Denemark 已提交
1145
libvirt_cpu_la_CFLAGS = \
1146
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jiri Denemark 已提交
1147 1148
libvirt_cpu_la_SOURCES = $(CPU_SOURCES)

1149 1150 1151 1152 1153 1154
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)

1155 1156 1157 1158
if WITH_VMX
noinst_LTLIBRARIES += libvirt_vmx.la
libvirt_la_BUILT_LIBADD += libvirt_vmx.la
libvirt_vmx_la_CFLAGS = \
1159
		-I$(srcdir)/conf $(AM_CFLAGS)
1160
libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
1161
endif WITH_VMX
1162

J
Jim Fehlig 已提交
1163 1164 1165
if WITH_XENCONFIG
noinst_LTLIBRARIES += libvirt_xenconfig.la
libvirt_la_BUILT_LIBADD += libvirt_xenconfig.la
1166
libvirt_xenconfig_la_LIBADD = $(LIBXL_LIBS)
J
Jim Fehlig 已提交
1167
libvirt_xenconfig_la_CFLAGS = \
J
Jim Fehlig 已提交
1168
		-I$(srcdir)/conf -I$(srcdir)/libxl $(AM_CFLAGS)
J
Jim Fehlig 已提交
1169 1170
libvirt_xenconfig_la_SOURCES = $(XENCONFIG_SOURCES)
endif WITH_XENCONFIG
1171

1172

1173
noinst_LTLIBRARIES += libvirt_driver.la
1174
libvirt_la_BUILT_LIBADD += libvirt_driver.la
1175
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
1176

1177
libvirt_driver_la_CFLAGS = \
1178
		$(GNUTLS_CFLAGS) $(CURL_CFLAGS) $(XDR_CFLAGS) \
1179
		-I$(srcdir)/conf $(AM_CFLAGS)
1180
libvirt_driver_la_LIBADD = \
1181
		$(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS)
1182

1183 1184
# 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.
1185
SYM_FILES = $(USED_SYM_FILES)
1186
USED_SYM_FILES = $(srcdir)/libvirt_private.syms
1187 1188 1189
GENERATED_SYM_FILES = \
	$(ACCESS_DRIVER_SYM_FILES) \
	libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \
1190
	libvirt_admin.syms libvirt_admin.def \
1191
	$(NULL)
1192

1193
if WITH_TEST
1194
noinst_LTLIBRARIES += libvirt_driver_test.la
1195
libvirt_la_BUILT_LIBADD += libvirt_driver_test.la
1196
libvirt_driver_test_la_CFLAGS = \
1197
		-I$(srcdir)/conf $(AM_CFLAGS)
1198
libvirt_driver_test_la_SOURCES = $(TEST_DRIVER_SOURCES)
1199
endif WITH_TEST
1200 1201

if WITH_REMOTE
1202
noinst_LTLIBRARIES += libvirt_driver_remote.la
1203
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
1204 1205
libvirt_driver_remote_la_CFLAGS =				\
		$(GNUTLS_CFLAGS)				\
E
Eric Blake 已提交
1206
		$(XDR_CFLAGS)					\
1207 1208
		-I$(srcdir)/conf				\
		-I$(srcdir)/rpc					\
1209 1210
		$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
1211 1212 1213 1214
libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) \
                libvirt-net-rpc-client.la \
                libvirt-net-rpc-server.la \
                libvirt-net-rpc.la
1215
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
1216

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

1219 1220
endif WITH_REMOTE

1221
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
1222
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
1223
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1224

1225
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
1226
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
1227
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1228

1229
if WITH_XEN
E
Eric Blake 已提交
1230 1231 1232
noinst_LTLIBRARIES += libvirt_driver_xen_impl.la
libvirt_driver_xen_la_SOURCES =
libvirt_driver_xen_la_LIBADD = libvirt_driver_xen_impl.la
1233 1234
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_xen.la
E
Eric Blake 已提交
1235
libvirt_driver_xen_la_LIBADD += ../gnulib/lib/libgnu.la
1236
libvirt_driver_xen_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1237
else ! WITH_DRIVER_MODULES
1238
noinst_LTLIBRARIES += libvirt_driver_xen.la
1239 1240
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_xen.la
1241
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1242

1243
libvirt_driver_xen_impl_la_CFLAGS =				\
1244
		$(XEN_CFLAGS)					\
1245 1246 1247
		-I$(srcdir)/access				\
		-I$(srcdir)/conf				\
		-I$(srcdir)/xenconfig				\
1248
		$(AM_CFLAGS)
E
Eric Blake 已提交
1249
libvirt_driver_xen_impl_la_LDFLAGS = $(AM_LDFLAGS)
P
Pavel Hrdina 已提交
1250
libvirt_driver_xen_impl_la_LIBADD = $(XEN_LIBS) libvirt_xenconfig.la
E
Eric Blake 已提交
1251
libvirt_driver_xen_impl_la_SOURCES = $(XEN_DRIVER_SOURCES)
1252
endif WITH_XEN
1253

1254 1255
if WITH_PHYP
noinst_LTLIBRARIES += libvirt_driver_phyp.la
1256
libvirt_la_BUILT_LIBADD += libvirt_driver_phyp.la
1257 1258
libvirt_driver_phyp_la_LIBADD = $(SSH2_LIBS)
libvirt_driver_phyp_la_CFLAGS = $(SSH2_CFLAGS) \
1259
		-I$(srcdir)/conf $(AM_CFLAGS)
1260
libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES)
1261
endif WITH_PHYP
1262

1263
if WITH_OPENVZ
1264
noinst_LTLIBRARIES += libvirt_driver_openvz.la
1265
libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la
1266
libvirt_driver_openvz_la_CFLAGS = \
1267
		-I$(srcdir)/conf $(AM_CFLAGS)
1268
libvirt_driver_openvz_la_SOURCES = $(OPENVZ_DRIVER_SOURCES)
1269
endif WITH_OPENVZ
1270

1271 1272 1273 1274
if WITH_VMWARE
noinst_LTLIBRARIES += libvirt_driver_vmware.la
libvirt_la_BUILT_LIBADD += libvirt_driver_vmware.la
libvirt_driver_vmware_la_CFLAGS = \
1275
		-I$(srcdir)/conf -I$(srcdir)/vmx $(AM_CFLAGS)
1276
libvirt_driver_vmware_la_SOURCES = $(VMWARE_DRIVER_SOURCES)
1277
endif WITH_VMWARE
1278

1279
if WITH_VBOX
M
Michal Privoznik 已提交
1280
noinst_LTLIBRARIES += \
1281
		libvirt_driver_vbox_impl.la
1282 1283 1284
libvirt_driver_vbox_la_SOURCES =
libvirt_driver_vbox_la_LIBADD = libvirt_driver_vbox_impl.la
if WITH_DRIVER_MODULES
M
Michal Privoznik 已提交
1285
mod_LTLIBRARIES += \
1286
		libvirt_driver_vbox.la
1287
libvirt_driver_vbox_la_LIBADD += ../gnulib/lib/libgnu.la
1288
libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1289
else ! WITH_DRIVER_MODULES
1290
noinst_LTLIBRARIES += libvirt_driver_vbox.la
1291 1292 1293
# GPLv2-only license requries that it be linked into
# libvirtd and *not* libvirt.so
#libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la
1294
endif ! WITH_DRIVER_MODULES
1295 1296

libvirt_driver_vbox_impl_la_CFLAGS =				\
1297 1298
		-I$(srcdir)/conf				\
		$(AM_CFLAGS)					\
M
Michal Privoznik 已提交
1299
		-DVBOX_DRIVER
1300
libvirt_driver_vbox_impl_la_LDFLAGS = $(AM_LDFLAGS)
1301 1302 1303
libvirt_driver_vbox_impl_la_LIBADD =  $(DLOPEN_LIBS)		\
		$(MSCOM_LIBS)					\
		$(LIBXML_LIBS)
1304
libvirt_driver_vbox_impl_la_SOURCES = $(VBOX_DRIVER_SOURCES)
1305
endif WITH_VBOX
1306

1307 1308
if WITH_XENAPI
noinst_LTLIBRARIES += libvirt_driver_xenapi.la
1309
libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la
1310
libvirt_driver_xenapi_la_CFLAGS = $(LIBXENSERVER_CFLAGS) $(CURL_CFLAGS) \
P
Pavel Hrdina 已提交
1311
		-I$(srcdir)/conf -I$(srcdir)/xenconfig $(AM_CFLAGS)
1312
libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS)
1313
libvirt_driver_xenapi_la_LIBADD = $(LIBXENSERVER_LIBS) $(CURL_LIBS)
1314
libvirt_driver_xenapi_la_SOURCES = $(XENAPI_DRIVER_SOURCES)
1315
endif WITH_XENAPI
1316

J
Jim Fehlig 已提交
1317
if WITH_LIBXL
E
Eric Blake 已提交
1318 1319 1320
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 已提交
1321 1322
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_libxl.la
E
Eric Blake 已提交
1323
libvirt_driver_libxl_la_LIBADD += ../gnulib/lib/libgnu.la
1324
libvirt_driver_libxl_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1325
else ! WITH_DRIVER_MODULES
J
Jim Fehlig 已提交
1326 1327 1328
noinst_LTLIBRARIES += libvirt_driver_libxl.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_libxl.la
1329
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1330

1331 1332
libvirt_driver_libxl_impl_la_CFLAGS = 		\
		$(LIBXL_CFLAGS)			\
1333 1334
		-I$(srcdir)/access	\
		-I$(srcdir)/conf	\
1335
		-I$(srcdir)/secret      \
1336
		-I$(srcdir)/xenconfig	\
1337
		$(AM_CFLAGS)
E
Eric Blake 已提交
1338
libvirt_driver_libxl_impl_la_LDFLAGS = $(AM_LDFLAGS)
1339 1340 1341
libvirt_driver_libxl_impl_la_LIBADD = $(LIBXL_LIBS) \
				      libvirt_xenconfig.la \
				      libvirt_secret.la
E
Eric Blake 已提交
1342
libvirt_driver_libxl_impl_la_SOURCES = $(LIBXL_DRIVER_SOURCES)
1343 1344 1345 1346 1347 1348

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

1349
endif WITH_LIBXL
1350 1351
EXTRA_DIST += libxl/libxl.conf libxl/libvirtd_libxl.aug \
		libxl/test_libvirtd_libxl.aug.in
J
Jim Fehlig 已提交
1352

1353
if WITH_QEMU
E
Eric Blake 已提交
1354 1355 1356
noinst_LTLIBRARIES += libvirt_driver_qemu_impl.la
libvirt_driver_qemu_la_SOURCES =
libvirt_driver_qemu_la_LIBADD = libvirt_driver_qemu_impl.la
1357 1358
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_qemu.la
E
Eric Blake 已提交
1359
libvirt_driver_qemu_la_LIBADD += ../gnulib/lib/libgnu.la
1360
libvirt_driver_qemu_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1361
else ! WITH_DRIVER_MODULES
1362
noinst_LTLIBRARIES += libvirt_driver_qemu.la
1363
# Stateful, so linked to daemon instead
1364
#libvirt_la_BUILT_LIBADD += libvirt_driver_qemu.la
1365
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1366

1367 1368 1369
libvirt_driver_qemu_impl_la_CFLAGS = \
		$(GNUTLS_CFLAGS) \
		$(LIBNL_CFLAGS) \
1370
		$(XDR_CFLAGS) \
1371 1372
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1373
		-I$(srcdir)/secret \
1374
		$(AM_CFLAGS)
E
Eric Blake 已提交
1375
libvirt_driver_qemu_impl_la_LDFLAGS = $(AM_LDFLAGS)
1376
libvirt_driver_qemu_impl_la_LIBADD = $(CAPNG_LIBS) \
1377
                                $(GNUTLS_LIBS) \
1378 1379
				$(LIBNL_LIBS) \
				$(LIBXML_LIBS) \
1380
				libvirt_secret.la \
1381
				$(NULL)
E
Eric Blake 已提交
1382
libvirt_driver_qemu_impl_la_SOURCES = $(QEMU_DRIVER_SOURCES)
1383

A
Amy Griffis 已提交
1384
conf_DATA += qemu/qemu.conf
1385

1386
augeas_DATA += qemu/libvirtd_qemu.aug
1387 1388
augeastest_DATA += test_libvirtd_qemu.aug
CLEANFILES += test_libvirtd_qemu.aug
1389

1390
endif WITH_QEMU
1391
EXTRA_DIST += qemu/qemu.conf qemu/libvirtd_qemu.aug \
1392
		qemu/test_libvirtd_qemu.aug.in qemu/THREADS.txt
1393

1394 1395

if WITH_LXC
E
Eric Blake 已提交
1396 1397 1398
noinst_LTLIBRARIES += libvirt_driver_lxc_impl.la
libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = libvirt_driver_lxc_impl.la
1399 1400
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_lxc.la
E
Eric Blake 已提交
1401 1402
libvirt_driver_lxc_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_lxc_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1403
else ! WITH_DRIVER_MODULES
1404
noinst_LTLIBRARIES += libvirt_driver_lxc.la
1405
# Stateful, so linked to daemon instead
1406
#libvirt_la_BUILT_LIBADD += libvirt_driver_lxc.la
1407
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1408 1409

libvirt_driver_lxc_impl_la_CFLAGS = \
S
Serge Hallyn 已提交
1410
		$(LIBNL_CFLAGS) \
G
Gao feng 已提交
1411
		$(FUSE_CFLAGS) \
P
Pavel Fedin 已提交
1412
		$(XDR_CFLAGS) \
1413 1414
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1415
		$(AM_CFLAGS)
I
ik.nitk 已提交
1416 1417 1418 1419 1420 1421
libvirt_driver_lxc_impl_la_LIBADD = \
               $(CAPNG_LIBS) \
               $(LIBNL_LIBS) \
               $(LIBXML_LIBS) \
               $(FUSE_LIBS)

1422
if WITH_BLKID
E
Eric Blake 已提交
1423 1424
libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS)
1425
endif WITH_BLKID
1426
libvirt_driver_lxc_impl_la_LIBADD += $(SECDRIVER_LIBS)
E
Eric Blake 已提交
1427
libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES)
A
Amy Griffis 已提交
1428 1429 1430

conf_DATA += lxc/lxc.conf

1431
augeas_DATA += lxc/libvirtd_lxc.aug
1432 1433
augeastest_DATA += test_libvirtd_lxc.aug
CLEANFILES += test_libvirtd_lxc.aug
1434

1435
endif WITH_LXC
1436
EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in
1437

1438
if WITH_UML
E
Eric Blake 已提交
1439 1440 1441
noinst_LTLIBRARIES += libvirt_driver_uml_impl.la
libvirt_driver_uml_la_SOURCES =
libvirt_driver_uml_la_LIBADD = libvirt_driver_uml_impl.la
1442 1443
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_uml.la
E
Eric Blake 已提交
1444
libvirt_driver_uml_la_LIBADD += ../gnulib/lib/libgnu.la
1445
libvirt_driver_uml_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1446
else ! WITH_DRIVER_MODULES
1447 1448
noinst_LTLIBRARIES += libvirt_driver_uml.la
# Stateful, so linked to daemon instead
1449
#libvirt_la_BUILT_LIBADD += libvirt_driver_uml.la
1450
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1451

1452
libvirt_driver_uml_impl_la_CFLAGS = \
1453 1454
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1455
		$(AM_CFLAGS)
E
Eric Blake 已提交
1456
libvirt_driver_uml_impl_la_LDFLAGS = $(AM_LDFLAGS)
1457
# libvirt_driver_uml_impl_la_LIBADD =
E
Eric Blake 已提交
1458
libvirt_driver_uml_impl_la_SOURCES = $(UML_DRIVER_SOURCES)
1459
endif WITH_UML
1460

D
Daniel Veillard 已提交
1461

1462
BUILT_SOURCES += $(ESX_DRIVER_GENERATED)
D
Daniel Veillard 已提交
1463

1464 1465
ESX_GENERATED_STAMP = .esx_vi_generator.stamp

E
Eric Blake 已提交
1466 1467
EXTRA_DIST += $(ESX_GENERATED_STAMP)

1468 1469 1470
$(ESX_DRIVER_GENERATED): $(ESX_GENERATED_STAMP)

$(ESX_GENERATED_STAMP): $(srcdir)/esx/esx_vi_generator.input \
1471
                         $(srcdir)/esx/esx_vi_generator.py
1472 1473 1474 1475 1476
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/esx/esx_vi_generator.py \
	  && touch $@

MAINTAINERCLEANFILES += $(ESX_DRIVER_GENERATED) $(ESX_GENERATED_STAMP)

D
Daniel Veillard 已提交
1477

1478 1479
if WITH_ESX
noinst_LTLIBRARIES += libvirt_driver_esx.la
1480
libvirt_la_BUILT_LIBADD += libvirt_driver_esx.la
1481
libvirt_driver_esx_la_CFLAGS = $(CURL_CFLAGS) \
1482
		-I$(srcdir)/conf -I$(srcdir)/vmx $(AM_CFLAGS)
1483
libvirt_driver_esx_la_LDFLAGS = $(AM_LDFLAGS)
1484
libvirt_driver_esx_la_LIBADD = $(CURL_LIBS)
1485
libvirt_driver_esx_la_SOURCES = $(ESX_DRIVER_SOURCES)
1486
libvirt_driver_esx_la_DEPENDENCIES = $(ESX_DRIVER_GENERATED)
1487
endif WITH_ESX
1488

M
Matthias Bolte 已提交
1489

1490 1491
BUILT_SOURCES += $(HYPERV_DRIVER_GENERATED)

1492 1493
HYPERV_GENERATED_STAMP = .hyperv_wmi_generator.stamp

E
Eric Blake 已提交
1494 1495
EXTRA_DIST += $(HYPERV_GENERATED_STAMP)

1496 1497 1498
$(HYPERV_DRIVER_GENERATED): $(HYPERV_GENERATED_STAMP)

$(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \
1499
                            $(srcdir)/hyperv/hyperv_wmi_generator.py
1500 1501
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) \
	  $(srcdir)/hyperv/hyperv_wmi_generator.py \
1502 1503 1504
	  && touch $@

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

M
Matthias Bolte 已提交
1506 1507 1508 1509
if WITH_HYPERV
noinst_LTLIBRARIES += libvirt_driver_hyperv.la
libvirt_la_BUILT_LIBADD += libvirt_driver_hyperv.la
libvirt_driver_hyperv_la_CFLAGS = $(OPENWSMAN_CFLAGS) \
1510
		-I$(srcdir)/conf $(AM_CFLAGS)
M
Matthias Bolte 已提交
1511 1512 1513
libvirt_driver_hyperv_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_hyperv_la_LIBADD = $(OPENWSMAN_LIBS)
libvirt_driver_hyperv_la_SOURCES = $(HYPERV_DRIVER_SOURCES)
1514
endif WITH_HYPERV
M
Matthias Bolte 已提交
1515

1516
if WITH_VZ
1517 1518 1519 1520 1521 1522 1523 1524
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
1525
noinst_LTLIBRARIES += libvirt_driver_vz.la
1526 1527
endif ! WITH_DRIVER_MODULES
libvirt_driver_vz_impl_la_CFLAGS = \
1528 1529 1530
		-I$(srcdir)/conf \
		-I$(srcdir)/access \
		$(AM_CFLAGS) \
1531
		$(PARALLELS_SDK_CFLAGS) $(LIBNL_CFLAGS)
1532 1533
libvirt_driver_vz_impl_la_SOURCES = $(VZ_DRIVER_SOURCES)
libvirt_driver_vz_impl_la_LIBADD =  $(PARALLELS_SDK_LIBS) $(LIBNL_LIBS)
1534
endif WITH_VZ
D
Dmitry Guryanov 已提交
1535

R
Roman Bogorodskiy 已提交
1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548
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 = \
1549 1550
	-I$(srcdir)/access \
	-I$(srcdir)/conf \
R
Roman Bogorodskiy 已提交
1551 1552 1553 1554 1555
	$(AM_CFLAGS)
libvirt_driver_bhyve_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_bhyve_impl_la_SOURCES = $(BHYVE_DRIVER_SOURCES)
endif WITH_BHYVE

1556
if WITH_NETWORK
E
Eric Blake 已提交
1557 1558 1559
noinst_LTLIBRARIES += libvirt_driver_network_impl.la
libvirt_driver_network_la_SOURCES =
libvirt_driver_network_la_LIBADD = libvirt_driver_network_impl.la
1560 1561
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_network.la
1562 1563 1564 1565
libvirt_driver_network_la_LIBADD += ../gnulib/lib/libgnu.la \
	$(LIBNL_LIBS) \
	$(DBUS_LIBS) \
	$(NULL)
E
Eric Blake 已提交
1566
libvirt_driver_network_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1567
else ! WITH_DRIVER_MODULES
1568
noinst_LTLIBRARIES += libvirt_driver_network.la
1569
# Stateful, so linked to daemon instead
1570
#libvirt_la_BUILT_LIBADD += libvirt_driver_network.la
1571
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1572 1573

libvirt_driver_network_impl_la_CFLAGS = \
1574 1575
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1576 1577
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1578
		$(AM_CFLAGS)
E
Eric Blake 已提交
1579
libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
1580
libvirt_driver_network_impl_la_LIBADD  = $(DBUS_LIBS)
1581
endif WITH_NETWORK
1582 1583 1584
EXTRA_DIST += network/default.xml


1585
if WITH_INTERFACE
1586 1587
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_interface.la
1588
else ! WITH_DRIVER_MODULES
1589
noinst_LTLIBRARIES += libvirt_driver_interface.la
1590 1591
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_interface.la
1592
endif ! WITH_DRIVER_MODULES
1593
libvirt_driver_interface_la_CFLAGS = \
1594 1595
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1596
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1597
libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS)
1598 1599 1600 1601
libvirt_driver_interface_la_LIBADD =
if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
1602
endif WITH_NETCF
1603
if WITH_UDEV
1604 1605
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
1606
endif WITH_UDEV
1607
if WITH_DRIVER_MODULES
1608
libvirt_driver_interface_la_LIBADD += ../gnulib/lib/libgnu.la
1609
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
1610
endif WITH_DRIVER_MODULES
1611
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
1612
endif WITH_INTERFACE
D
Daniel Veillard 已提交
1613

D
Daniel P. Berrange 已提交
1614
if WITH_SECRETS
1615 1616
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_secret.la
1617
else ! WITH_DRIVER_MODULES
1618
noinst_LTLIBRARIES += libvirt_driver_secret.la
1619
# Stateful, so linked to daemon instead
1620
#libvirt_la_BUILT_LIBADD += libvirt_driver_secret.la
1621
endif ! WITH_DRIVER_MODULES
1622
libvirt_driver_secret_la_CFLAGS = \
1623 1624
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1625
		$(AM_CFLAGS)
1626
if WITH_DRIVER_MODULES
1627
libvirt_driver_secret_la_LIBADD = ../gnulib/lib/libgnu.la
1628
libvirt_driver_secret_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1629
endif WITH_DRIVER_MODULES
1630
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
1631
endif WITH_SECRETS
1632

1633
# Needed to keep automake quiet about conditionals
1634 1635
libvirt_driver_storage_impl_la_SOURCES =
libvirt_driver_storage_impl_la_CFLAGS = \
1636 1637
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1638
		-I$(srcdir)/secret \
1639
		$(AM_CFLAGS)
1640 1641
libvirt_driver_storage_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_storage_impl_la_LIBADD =
1642
libvirt_driver_storage_impl_la_LIBADD += $(SECDRIVER_LIBS) $(LIBXML_LIBS)
1643
if WITH_BLKID
1644 1645
libvirt_driver_storage_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(BLKID_LIBS)
1646
endif WITH_BLKID
1647
if WITH_STORAGE
1648 1649 1650
noinst_LTLIBRARIES += libvirt_driver_storage_impl.la
libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_LIBADD = libvirt_driver_storage_impl.la
1651 1652
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_storage.la
1653
libvirt_driver_storage_la_LIBADD += ../gnulib/lib/libgnu.la
1654
libvirt_driver_storage_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1655
else ! WITH_DRIVER_MODULES
1656
noinst_LTLIBRARIES += libvirt_driver_storage.la
1657
# Stateful, so linked to daemon instead
1658
#libvirt_la_BUILT_LIBADD += libvirt_driver_storage.la
1659
endif ! WITH_DRIVER_MODULES
1660 1661
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_FS_SOURCES)
1662
endif WITH_STORAGE
1663

1664
if WITH_STORAGE_LVM
1665
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_LVM_SOURCES)
1666
endif WITH_STORAGE_LVM
1667

1668
if WITH_STORAGE_ISCSI
1669
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_ISCSI_SOURCES)
1670
endif WITH_STORAGE_ISCSI
1671

1672
if WITH_STORAGE_SCSI
1673
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SCSI_SOURCES)
1674
endif WITH_STORAGE_SCSI
1675

D
Dave Allan 已提交
1676
if WITH_STORAGE_MPATH
1677 1678 1679
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)
1680
endif WITH_STORAGE_MPATH
D
Dave Allan 已提交
1681

1682
if WITH_STORAGE_DISK
1683
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_DISK_SOURCES)
1684
endif WITH_STORAGE_DISK
1685

1686
if WITH_STORAGE_RBD
1687 1688
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_RBD_SOURCES)
libvirt_driver_storage_impl_la_LIBADD += $(LIBRBD_LIBS)
1689
endif WITH_STORAGE_RBD
1690

1691
if WITH_STORAGE_SHEEPDOG
1692
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SHEEPDOG_SOURCES)
1693
endif WITH_STORAGE_SHEEPDOG
1694

1695 1696 1697 1698 1699 1700
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 已提交
1701 1702 1703 1704
if WITH_STORAGE_ZFS
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_ZFS_SOURCES)
endif WITH_STORAGE_ZFS

1705 1706 1707 1708
if WITH_NODE_DEVICES
# Needed to keep automake quiet about conditionals
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nodedev.la
1709
else ! WITH_DRIVER_MODULES
1710 1711
noinst_LTLIBRARIES += libvirt_driver_nodedev.la
# Stateful, so linked to daemon instead
1712
#libvirt_la_BUILT_LIBADD += libvirt_driver_nodedev.la
1713
endif ! WITH_DRIVER_MODULES
1714 1715
libvirt_driver_nodedev_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES)

1716
libvirt_driver_nodedev_la_CFLAGS = \
1717 1718
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1719
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1720
libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS)
1721
libvirt_driver_nodedev_la_LIBADD =
1722

D
Doug Goldstein 已提交
1723
if WITH_LIBVIRTD
1724
if WITH_HAL
1725 1726
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS)
1727
libvirt_driver_nodedev_la_LIBADD += $(HAL_LIBS)
1728
endif WITH_HAL
1729
if WITH_UDEV
1730
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES)
1731
libvirt_driver_nodedev_la_CFLAGS += $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS)
1732
libvirt_driver_nodedev_la_LIBADD += $(UDEV_LIBS) $(PCIACCESS_LIBS)
1733 1734
endif WITH_UDEV
endif WITH_LIBVIRTD
1735 1736

if WITH_DRIVER_MODULES
1737
libvirt_driver_nodedev_la_LIBADD += ../gnulib/lib/libgnu.la
1738
libvirt_driver_nodedev_la_LDFLAGS += -module -avoid-version
1739 1740
endif WITH_DRIVER_MODULES
endif WITH_NODE_DEVICES
1741 1742


1743
if WITH_NWFILTER
1744 1745 1746
noinst_LTLIBRARIES += libvirt_driver_nwfilter_impl.la
libvirt_driver_nwfilter_la_SOURCES =
libvirt_driver_nwfilter_la_LIBADD = libvirt_driver_nwfilter_impl.la
1747 1748
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nwfilter.la
1749
libvirt_driver_nwfilter_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1750
else ! WITH_DRIVER_MODULES
1751
noinst_LTLIBRARIES += libvirt_driver_nwfilter.la
1752 1753
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_nwfilter.la
1754
endif ! WITH_DRIVER_MODULES
1755
libvirt_driver_nwfilter_impl_la_CFLAGS = \
1756 1757 1758
		$(LIBPCAP_CFLAGS) \
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1759 1760
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1761
		$(AM_CFLAGS)
1762 1763 1764 1765 1766
libvirt_driver_nwfilter_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_nwfilter_impl_la_LIBADD = \
		$(LIBPCAP_LIBS) \
		$(LIBNL_LIBS) \
		$(DBUS_LIBS)
1767
if WITH_DRIVER_MODULES
1768 1769
libvirt_driver_nwfilter_impl_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_nwfilter_impl_la_LDFLAGS += -module -avoid-version
1770
endif WITH_DRIVER_MODULES
1771
libvirt_driver_nwfilter_impl_la_SOURCES = $(NWFILTER_DRIVER_SOURCES)
1772
endif WITH_NWFILTER
1773 1774


1775 1776 1777 1778
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 = \
1779
		-I$(srcdir)/conf $(AM_CFLAGS)
1780
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
1781
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
1782
if WITH_SECDRIVER_SELINUX
1783 1784
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
1785
endif WITH_SECDRIVER_SELINUX
J
Jamie Strandboge 已提交
1786
if WITH_SECDRIVER_APPARMOR
1787 1788
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
1789
endif WITH_SECDRIVER_APPARMOR
1790

1791 1792
libvirt_driver_access_la_SOURCES = \
	$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
1793 1794 1795
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
1796
		-I$(srcdir)/conf $(AM_CFLAGS)
1797 1798 1799
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD =

1800 1801
EXTRA_DIST += access/genpolkit.pl

1802 1803 1804 1805
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
    $(srcdir)/access/genpolkit.pl Makefile.am
	$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@

1806 1807 1808 1809
if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)

polkitactiondir = $(datadir)/polkit-1/actions
1810
if WITH_LIBVIRTD
1811
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
1812
endif WITH_LIBVIRTD
1813 1814 1815

CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
1816
else ! WITH_POLKIT1
1817
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
1818
endif ! WITH_POLKIT1
1819

1820

1821 1822
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836

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

1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849
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 已提交
1850
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
1851 1852
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1853 1854 1855
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
1856 1857
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1858 1859
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
	  > $(srcdir)/access/viraccessapicheck.c
1860

E
Eric Blake 已提交
1861
access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
1862 1863
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1864 1865 1866
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheckqemu.h
access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
1867 1868
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1869 1870
	  qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h \
	  > $(srcdir)/access/viraccessapicheckqemu.c
1871

E
Eric Blake 已提交
1872
access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
1873 1874
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1875 1876 1877
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/access/viraccessapichecklxc.h
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
1878 1879
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1880 1881
	  lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \
	  > $(srcdir)/access/viraccessapichecklxc.c
1882

1883 1884 1885 1886 1887 1888 1889
# Add all conditional sources just in case...
EXTRA_DIST +=							\
		$(TEST_DRIVER_SOURCES)				\
		$(REMOTE_DRIVER_SOURCES)			\
		$(XEN_DRIVER_SOURCES)				\
		$(QEMU_DRIVER_SOURCES)				\
		$(LXC_DRIVER_SOURCES)				\
1890
		$(UML_DRIVER_SOURCES)				\
1891
		$(OPENVZ_DRIVER_SOURCES)			\
1892
		$(PHYP_DRIVER_SOURCES)				\
1893
		$(VBOX_DRIVER_SOURCES)				\
1894
		$(XENAPI_DRIVER_SOURCES)			\
O
Osier Yang 已提交
1895
		$(LIBXL_DRIVER_SOURCES)				\
1896
		$(ESX_DRIVER_SOURCES)				\
1897
		$(ESX_DRIVER_EXTRA_DIST)			\
M
Matthias Bolte 已提交
1898
		$(HYPERV_DRIVER_SOURCES)			\
1899
		$(HYPERV_DRIVER_EXTRA_DIST)			\
1900
		$(VZ_DRIVER_SOURCES)				\
R
Roman Bogorodskiy 已提交
1901
		$(BHYVE_DRIVER_SOURCES)				\
1902
		$(NETWORK_DRIVER_SOURCES)			\
1903
		$(INTERFACE_DRIVER_SOURCES)			\
1904 1905 1906 1907
		$(STORAGE_DRIVER_SOURCES)			\
		$(STORAGE_DRIVER_FS_SOURCES)			\
		$(STORAGE_DRIVER_LVM_SOURCES)			\
		$(STORAGE_DRIVER_ISCSI_SOURCES)			\
1908
		$(STORAGE_DRIVER_SCSI_SOURCES)			\
D
Dave Allan 已提交
1909
		$(STORAGE_DRIVER_MPATH_SOURCES)			\
1910
		$(STORAGE_DRIVER_DISK_SOURCES)			\
1911
		$(STORAGE_DRIVER_RBD_SOURCES)			\
1912
		$(STORAGE_DRIVER_SHEEPDOG_SOURCES)		\
1913
		$(STORAGE_DRIVER_GLUSTER_SOURCES)		\
R
Roman Bogorodskiy 已提交
1914
		$(STORAGE_DRIVER_ZFS_SOURCES)			\
1915 1916
		$(NODE_DEVICE_DRIVER_SOURCES)			\
		$(NODE_DEVICE_DRIVER_HAL_SOURCES)		\
1917
		$(NODE_DEVICE_DRIVER_UDEV_SOURCES)		\
1918
		$(NWFILTER_DRIVER_SOURCES)			\
1919
		$(SECURITY_DRIVER_SELINUX_SOURCES)		\
J
Jamie Strandboge 已提交
1920
		$(SECURITY_DRIVER_APPARMOR_SOURCES)		\
D
Daniel P. Berrange 已提交
1921
		$(SECRET_DRIVER_SOURCES)			\
1922
		$(SECRET_UTIL_SOURCES)				\
1923
		$(VBOX_DRIVER_EXTRA_DIST)			\
1924
		$(VMWARE_DRIVER_SOURCES)			\
J
Jim Fehlig 已提交
1925
		$(XENCONFIG_SOURCES)				\
1926
		$(ACCESS_DRIVER_POLKIT_POLICY)
1927

1928 1929
check-local: check-augeas

1930 1931 1932 1933 1934
.PHONY: check-augeas \
	check-augeas-qemu \
	check-augeas-lxc \
	check-augeas-sanlock \
	check-augeas-lockd \
1935
	check-augeas-libxl \
1936
	$(NULL)
1937

1938
check-augeas: check-augeas-qemu check-augeas-lxc check-augeas-sanlock \
1939 1940
	check-augeas-lockd check-augeas-virtlockd check-augeas-libxl \
	check-augeas-virtlogd
1941

1942
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
1943
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
1944

1945
if WITH_QEMU
1946 1947
test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
		$(srcdir)/qemu/qemu.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1948
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
1949

1950
check-augeas-qemu: test_libvirtd_qemu.aug
1951
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1952
	    '$(AUGPARSE)' -I $(srcdir)/qemu test_libvirtd_qemu.aug; \
1953
	fi
1954
else ! WITH_QEMU
1955
check-augeas-qemu:
1956
endif ! WITH_QEMU
1957

1958
if WITH_LXC
1959 1960
test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
		$(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1961
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
1962

1963
check-augeas-lxc: test_libvirtd_lxc.aug
1964
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1965
	    '$(AUGPARSE)' -I $(srcdir)/lxc test_libvirtd_lxc.aug; \
1966
	fi
1967
else ! WITH_LXC
1968
check-augeas-lxc:
1969
endif ! WITH_LXC
1970

1971
if WITH_SANLOCK
1972 1973
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1974
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
1975

1976
check-augeas-sanlock: test_libvirt_sanlock.aug
1977
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1978
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
1979
	fi
1980
else ! WITH_SANLOCK
1981
check-augeas-sanlock:
1982
endif ! WITH_SANLOCK
1983

1984
if WITH_QEMU
1985 1986 1987
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 $< $@
1988 1989 1990
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
1991

1992 1993
test_virtlockd.aug: locking/test_virtlockd.aug.in \
		locking/virtlockd.conf $(AUG_GENTEST)
1994
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
1995

1996
if WITH_QEMU
1997 1998 1999 2000
check-augeas-lockd: test_libvirt_lockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_lockd.aug; \
	fi
2001 2002 2003
else ! WITH_QEMU
check-augeas-lockd:
endif ! WITH_QEMU
2004

2005 2006 2007 2008 2009
check-augeas-virtlockd: test_virtlockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
	fi

2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022
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

2023 2024 2025 2026 2027 2028 2029 2030 2031
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

2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050
#
# 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.
#

2051
if WITH_DRIVER_MODULES
2052
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
2053
else ! WITH_DRIVER_MODULES
2054
SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
2055
endif ! WITH_DRIVER_MODULES
2056

2057
if WITH_LINUX
2058
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
2059
else ! WITH_LINUX
2060
SYM_FILES += $(srcdir)/libvirt_linux.syms
2061
endif ! WITH_LINUX
2062

2063
if WITH_ESX
2064
USED_SYM_FILES += $(srcdir)/libvirt_esx.syms
2065
else ! WITH_ESX
2066
SYM_FILES += $(srcdir)/libvirt_esx.syms
2067
endif ! WITH_ESX
2068

E
Eric Blake 已提交
2069 2070 2071 2072 2073 2074
if WITH_REMOTE
USED_SYM_FILES += $(srcdir)/libvirt_remote.syms
else ! WITH_REMOTE
SYM_FILES += $(srcdir)/libvirt_remote.syms
endif ! WITH_REMOTE

2075
if WITH_OPENVZ
2076
USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms
2077
else ! WITH_OPENVZ
2078
SYM_FILES += $(srcdir)/libvirt_openvz.syms
2079
endif ! WITH_OPENVZ
2080

2081
if WITH_VMX
2082
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
2083
else ! WITH_VMX
2084
SYM_FILES += $(srcdir)/libvirt_vmx.syms
2085
endif ! WITH_VMX
2086

2087 2088 2089 2090 2091 2092
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 已提交
2093 2094 2095 2096 2097
if WITH_XENCONFIG
USED_SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
else ! WITH_XENCONFIG
SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
endif ! WITH_XENCONFIG
2098

2099 2100 2101 2102 2103 2104
if WITH_LIBXL
USED_SYM_FILES += $(srcdir)/libvirt_xenxlconfig.syms
else ! WITH_LIBXL
SYM_FILES += $(srcdir)/libvirt_xenxlconfig.syms
endif ! WITH_LIBXL

2105
if WITH_SASL
2106
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
2107
else ! WITH_SASL
2108
SYM_FILES += $(srcdir)/libvirt_sasl.syms
2109
endif ! WITH_SASL
E
Eric Blake 已提交
2110

2111 2112
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2113
else ! WITH_GNUTLS
2114
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2115
endif ! WITH_GNUTLS
2116

2117
if WITH_SSH2
2118
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2119
else ! WITH_SSH2
2120
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2121
endif ! WITH_SSH2
2122

2123
if WITH_ATOMIC_OPS_PTHREAD
2124
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
2125
else ! WITH_ATOMIC_OPS_PTHREAD
2126
SYM_FILES += $(srcdir)/libvirt_atomic.syms
2127
endif ! WITH_ATOMIC_OPS_PTHREAD
2128

2129
EXTRA_DIST += \
2130 2131 2132
	libvirt_public.syms		\
	libvirt_lxc.syms		\
	libvirt_qemu.syms		\
2133
	libvirt_admin_public.syms	\
2134
	$(SYM_FILES)			\
2135
	$(ADMIN_SYM_FILES)		\
2136
	$(NULL)
2137

2138
BUILT_SOURCES += $(GENERATED_SYM_FILES)
2139

2140 2141
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(ACCESS_DRIVER_SYM_FILES) \
2142
		$(top_builddir)/config.status
2143 2144 2145 2146 2147 2148
	$(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 && \
2149
	cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
2150 2151
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
2152
	mv $@-tmp libvirt.syms
2153

2154
%.def: %.syms
2155 2156
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
2157 2158
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d'	\
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
2159
	chmod a-w $@-tmp && \
2160
	mv $@-tmp $@
2161

2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174
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

2175 2176 2177 2178
# 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 已提交
2179 2180 2181 2182 2183 2184 2185 2186 2187
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)			\
2188
		$(AM_LDFLAGS)
M
Martin Kletzander 已提交
2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200

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 += \
2201
		$(XDR_CFLAGS)			\
M
Martin Kletzander 已提交
2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216
		$(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)

2217 2218
ADMIN_SYM_FILES = $(srcdir)/libvirt_admin_private.syms

M
Martin Kletzander 已提交
2219 2220 2221 2222
if WITH_DTRACE_PROBES
libvirt_admin_la_LIBADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

2223 2224
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
2225 2226 2227 2228 2229 2230
libvirt_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(LIBVIRT_NODELETE) \
		$(AM_LDFLAGS) \
		$(NULL)
2231
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
2232
libvirt_la_LIBADD += \
2233
		    $(DRIVER_MODULE_LIBS) \
2234
		    $(CYGWIN_EXTRA_LIBADD)
2235
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
2236 2237 2238 2239 2240 2241
# 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)
2242

2243
if WITH_DTRACE_PROBES
2244
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
2245
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
2246
nodist_libvirt_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2247
if WITH_REMOTE
E
Eric Blake 已提交
2248
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2249
endif WITH_REMOTE
2250 2251
if WITH_DRIVER_MODULES
DTRACE2SYSTEMTAP_FLAGS = --with-modules
2252
endif WITH_DRIVER_MODULES
2253

2254 2255 2256
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

if WITH_QEMU
2257
libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.lo
2258
nodist_libvirt_driver_qemu_la_SOURCES = libvirt_qemu_probes.h
2259
BUILT_SOURCES += libvirt_qemu_probes.h
2260
endif WITH_QEMU
2261 2262

tapsetdir = $(datadir)/systemtap/tapset
2263
tapset_DATA = libvirt_probes.stp libvirt_qemu_probes.stp libvirt_functions.stp
2264

2265
%_probes.h: %_probes.d
2266 2267
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

E
Eric Blake 已提交
2268
.PRECIOUS: %_probes.o
2269
%_probes.o: %_probes.d
2270 2271
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

2272 2273 2274 2275 2276 2277 2278 2279 2280
%_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 已提交
2281
# Keep this list synced with PROTOCOL_STRUCTS
J
Jiri Denemark 已提交
2282 2283 2284
RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
2285
		  $(srcdir)/remote/lxc_protocol.x \
2286 2287
		  $(srcdir)/remote/qemu_protocol.x \
		  $(srcdir)/lxc/lxc_monitor_protocol.x \
M
Martin Kletzander 已提交
2288 2289
		  $(srcdir)/locking/lock_protocol.x \
		  $(srcdir)/admin/admin_protocol.x
2290 2291

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

2294 2295
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl \
		$(top_builddir)/config.status
2296
	$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
2297
	  $(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
2298

2299
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
2300
              libvirt_qemu_probes.h libvirt_qemu_probes.o \
2301
              libvirt_qemu_probes.lo\
2302 2303
              libvirt_functions.stp libvirt_probes.stp \
              libvirt_qemu_probes.stp
2304
endif WITH_DTRACE_PROBES
2305

2306
EXTRA_DIST += libvirt_probes.d libvirt_qemu_probes.d
2307

C
Chris Lalancette 已提交
2308
libvirt_qemu_la_SOURCES = libvirt-qemu.c
D
Daniel P. Berrange 已提交
2309 2310 2311 2312 2313
libvirt_qemu_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
2314
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
C
Chris Lalancette 已提交
2315
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
2316

2317
libvirt_lxc_la_SOURCES = libvirt-lxc.c
D
Daniel P. Berrange 已提交
2318 2319 2320 2321 2322
libvirt_lxc_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
2323 2324 2325
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)

2326 2327 2328 2329 2330 2331 2332
# 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
2333
if WITH_SETUID_RPC_CLIENT
2334 2335 2336 2337
noinst_LTLIBRARIES += libvirt-setuid-rpc-client.la

libvirt_setuid_rpc_client_la_SOURCES = 		\
		util/viralloc.c			\
2338 2339
		util/viratomic.c		\
		util/viratomic.h		\
2340 2341
		util/virbitmap.c		\
		util/virbuffer.c		\
2342
		util/vircgroup.c		\
2343 2344
		util/vircommand.c		\
		util/virconf.c			\
2345
		util/virdbus.c			\
2346 2347 2348 2349
		util/virerror.c			\
		util/virevent.c			\
		util/vireventpoll.c		\
		util/virfile.c			\
2350
		util/virgettext.c		\
2351 2352
		util/virhash.c			\
		util/virhashcode.c		\
2353
		util/virhostcpu.c		\
2354 2355 2356 2357 2358 2359 2360 2361
		util/virjson.c			\
		util/virlog.c			\
		util/virobject.c		\
		util/virpidfile.c		\
		util/virprocess.c		\
		util/virrandom.c		\
		util/virsocketaddr.c		\
		util/virstring.c		\
2362
		util/virsystemd.c		\
2363 2364
		util/virtime.c			\
		util/virthread.c		\
2365
		util/virthreadjob.c		\
2366 2367 2368 2369 2370
		util/virtypedparam.c		\
		util/viruri.c			\
		util/virutil.c			\
		util/viruuid.c			\
		conf/domain_event.c		\
2371
		conf/network_event.c		\
2372
		conf/object_event.c		\
2373
		conf/storage_event.c            \
2374
		conf/node_device_event.c	\
2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390
		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			\
2391
		libvirt-domain.c		\
2392
		libvirt-domain-snapshot.c	\
2393
		libvirt-host.c			\
2394
		libvirt-interface.c		\
2395
		libvirt-network.c		\
2396
		libvirt-nodedev.c		\
2397
		libvirt-nwfilter.c		\
2398
		libvirt-secret.c		\
2399
		libvirt-storage.c		\
2400
		libvirt-stream.c		\
2401 2402 2403 2404 2405 2406
		libvirt-lxc.c			\
		$(NULL)

libvirt_setuid_rpc_client_la_LDFLAGS =		\
		$(AM_LDFLAGS)			\
		$(LIBXML_LIBS)			\
J
Jim Fehlig 已提交
2407
		$(SECDRIVER_LIBS)		\
2408 2409 2410
		$(NULL)
libvirt_setuid_rpc_client_la_CFLAGS =		\
		-DLIBVIRT_SETUID_RPC_CLIENT	\
2411 2412
		-I$(srcdir)/conf		\
		-I$(srcdir)/rpc			\
2413
		$(AM_CFLAGS)			\
J
Jim Fehlig 已提交
2414
		$(SECDRIVER_CFLAGS)		\
P
Pavel Fedin 已提交
2415
		$(XDR_CFLAGS)			\
2416
		$(NULL)
2417
endif WITH_SETUID_RPC_CLIENT
2418

2419 2420 2421
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

2422
if WITH_LIBVIRTD
2423 2424 2425 2426 2427
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
		$(LOCK_DRIVER_LOCKD_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
		$(NULL)
2428
lockd_la_CFLAGS = -I$(srcdir)/conf \
E
Eric Blake 已提交
2429 2430
		$(XDR_CFLAGS) \
		$(AM_CFLAGS)
2431
lockd_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
2432 2433 2434 2435
lockd_la_LIBADD = ../gnulib/lib/libgnu.la \
	libvirt-net-rpc.la \
	libvirt-net-rpc-client.la \
	$(NULL)
J
Jiri Denemark 已提交
2436
augeas_DATA += locking/libvirt_lockd.aug
2437 2438
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
2439
endif WITH_DTRACE_PROBES
2440
if WITH_QEMU
2441 2442
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
2443
nodist_conf_DATA += locking/qemu-lockd.conf
2444 2445
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
2446
endif WITH_QEMU
2447

2448 2449 2450 2451 2452 2453
if WITH_LIBXL
nodist_conf_DATA += locking/libxl-lockd.conf
BUILT_SOURCES += locking/libxl-lockd.conf
DISTCLEANFILES += locking/libxl-lockd.conf
endif WITH_LIBXL

2454 2455 2456 2457 2458
locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
	$(AM_V_GEN)$(MKDIR_P) locking ; \
	cp $< $@


2459
sbin_PROGRAMS = virtlockd virtlogd
2460

2461 2462 2463
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
2464
		$(LOCK_DAEMON_GENERATED) \
2465
		$(NULL)
2466 2467
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
2468
		$(PIE_CFLAGS) \
2469
		$(XDR_CFLAGS) \
2470 2471 2472
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
2473
		$(PIE_LDFLAGS) \
2474 2475 2476 2477 2478 2479 2480 2481 2482 2483
		$(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
2484
endif WITH_DTRACE_PROBES
2485

2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511

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

2512
else ! WITH_LIBVIRTD
2513
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
2514 2515
              $(LOCK_DRIVER_LOCKD_SOURCES) \
	      $(LOG_DAEMON_SOURCES)
2516
endif ! WITH_LIBVIRTD
2517

2518 2519
EXTRA_DIST += \
	locking/virtlockd.sysconf \
J
Jiri Denemark 已提交
2520 2521
	locking/lockd.conf \
	locking/libvirt_lockd.aug \
2522
	locking/test_libvirt_lockd.aug.in \
2523
	logging/virtlogd.sysconf
2524 2525

install-sysconfig:
E
Eric Blake 已提交
2526
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
2527 2528
	$(INSTALL_DATA) $(srcdir)/locking/virtlockd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
2529 2530
	$(INSTALL_DATA) $(srcdir)/logging/virtlogd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlogd
2531 2532

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

2537
EXTRA_DIST += locking/virtlockd.init.in logging/virtlogd.init.in
2538 2539 2540

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_RED_HAT
2541
install-init:: virtlockd.init virtlogd.init install-sysconfig
E
Eric Blake 已提交
2542
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
2543 2544
	$(INSTALL_SCRIPT) virtlockd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
2545 2546
	$(INSTALL_SCRIPT) virtlogd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlogd
2547 2548

uninstall-init:: uninstall-sysconfig
E
Eric Blake 已提交
2549
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
2550
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlogd
E
Eric Blake 已提交
2551
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
2552

2553 2554
BUILT_SOURCES += virtlockd.init virtlogd.init
DISTCLEANFILES += virtlockd.init virtlogd.init
2555
else ! LIBVIRT_INIT_SCRIPT_RED_HAT
2556 2557
install-init::
uninstall-init::
2558 2559
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
else ! WITH_LIBVIRTD
2560 2561
install-init::
uninstall-init::
2562
endif ! WITH_LIBVIRTD
2563 2564

virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
2565 2566 2567 2568 2569 2570
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g'		\
	    < $< > $@-t &&					\
	    chmod a+x $@-t &&					\
2571 2572
	    mv $@-t $@

2573 2574 2575 2576 2577 2578 2579 2580 2581
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 $@

2582
POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)"
2583

2584
virtlockd.8.in: locking/virtlockd.pod
2585 2586 2587 2588 2589 2590 2591 2592
	$(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 $@
2593

2594
virtlogd.8.in: logging/virtlogd.pod
2595 2596 2597 2598 2599 2600 2601 2602
	$(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 $@
2603

2604
%.8: %.8.in $(top_srcdir)/configure.ac
2605
	$(AM_V_GEN)sed \
2606 2607 2608
		-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
		-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
		< $< > $@-t && \
2609 2610
	mv $@-t $@

2611
if WITH_LIBVIRTD
2612
man8_MANS = virtlockd.8 virtlogd.8
2613

2614
conf_DATA += locking/virtlockd.conf logging/virtlogd.conf
2615

2616 2617
augeas_DATA += locking/virtlockd.aug logging/virtlogd.aug
augeastest_DATA += test_virtlockd.aug test_virtlogd.aug
2618
endif WITH_LIBVIRTD
2619

A
Andrea Bolognani 已提交
2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631
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)
2632 2633 2634 2635

EXTRA_DIST += \
        locking/virtlockd.service.in \
        locking/virtlockd.socket.in \
2636 2637 2638
        locking/virtlockd.aug \
        locking/virtlockd.conf \
        locking/test_virtlockd.aug.in \
2639 2640 2641 2642 2643
        logging/virtlogd.service.in \
        logging/virtlogd.socket.in \
        logging/virtlogd.aug \
        logging/virtlogd.conf \
        logging/test_virtlogd.aug.in \
A
Andrea Bolognani 已提交
2644 2645
        $(PODFILES) \
        $(MANINFILES) \
2646
        $(NULL)
2647

2648 2649 2650 2651

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

2652
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
2653

2654 2655 2656 2657
BUILT_SOURCES += virtlockd.service virtlockd.socket \
		 virtlogd.service virtlogd.socket
DISTCLEANFILES += virtlockd.service virtlockd.socket \
		  virtlogd.service virtlogd.socket
2658

2659 2660
install-systemd: virtlockd.service virtlockd.socket \
                 virtlogd.service virtlogd.socket install-sysconfig
E
Eric Blake 已提交
2661
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
2662
	$(INSTALL_DATA) virtlockd.service \
2663
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2664
	$(INSTALL_DATA) virtlockd.socket \
2665
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2666 2667 2668 2669
	$(INSTALL_DATA) virtlogd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
	$(INSTALL_DATA) virtlogd.socket \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2670 2671

uninstall-systemd: uninstall-sysconfig
E
Eric Blake 已提交
2672 2673
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.socket
2674 2675
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlogd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlogd.socket
E
Eric Blake 已提交
2676
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
2677
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
2678 2679
install-systemd:
uninstall-systemd:
2680 2681
endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
else ! WITH_LIBVIRTD
2682 2683
install-systemd:
uninstall-systemd:
2684
endif ! WITH_LIBVIRTD
2685 2686

virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
2687 2688 2689
	$(AM_V_GEN)sed						\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    < $< > $@-t &&					\
2690 2691 2692
	    mv $@-t $@

virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
2693 2694 2695
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    < $< > $@-t &&					\
2696 2697
	    mv $@-t $@

2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709
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 $@

2710

2711
if WITH_SANLOCK
2712
lockdriver_LTLIBRARIES += sanlock.la
2713
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
2714
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
2715
sanlock_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
2716
sanlock_la_LIBADD = -lsanlock_client \
2717 2718 2719
		../gnulib/lib/libgnu.la

augeas_DATA += locking/libvirt_sanlock.aug
2720 2721
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
2722

E
Eric Blake 已提交
2723
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
2724
	$(AM_V_GEN)$(MKDIR_P) locking ; \
2725 2726 2727
	cp $< $@

if WITH_QEMU
2728
nodist_conf_DATA += locking/qemu-sanlock.conf
2729
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
2730
DISTCLEANFILES += locking/qemu-sanlock.conf
2731
endif WITH_QEMU
2732 2733 2734 2735 2736 2737

if WITH_LIBXL
nodist_conf_DATA += locking/libxl-sanlock.conf
BUILT_SOURCES += locking/libxl-sanlock.conf
DISTCLEANFILES += locking/libxl-sanlock.conf
endif WITH_LIBXL
2738
else ! WITH_SANLOCK
2739
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
2740
endif ! WITH_SANLOCK
2741 2742
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
2743
	locking/test_libvirt_sanlock.aug.in
2744

2745 2746 2747 2748
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
2749

2750
EXTRA_DIST += \
E
Eric Blake 已提交
2751 2752 2753 2754
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
2755 2756
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
2757

E
Eric Blake 已提交
2758
VIR_NET_RPC_GENERATED = \
2759 2760 2761 2762
	rpc/virnetprotocol.h \
	rpc/virnetprotocol.c \
	rpc/virkeepaliveprotocol.h \
	rpc/virkeepaliveprotocol.c
2763

2764
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2765

2766
libvirt_net_rpc_la_SOURCES = \
2767
	rpc/virnetmessage.h rpc/virnetmessage.c \
2768
	rpc/virnetsocket.h rpc/virnetsocket.c \
2769 2770
	rpc/virkeepalive.h rpc/virkeepalive.c \
	$(VIR_NET_RPC_GENERATED)
2771
if WITH_SSH2
2772 2773
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2774
else ! WITH_SSH2
2775 2776
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2777
endif ! WITH_SSH2
2778
if WITH_GNUTLS
2779 2780
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2781
else ! WITH_GNUTLS
2782 2783
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2784
endif ! WITH_GNUTLS
2785
if WITH_SASL
2786 2787
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2788
else ! WITH_SASL
2789 2790
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2791
endif ! WITH_SASL
2792
libvirt_net_rpc_la_CFLAGS = \
2793
			$(GNUTLS_CFLAGS) \
2794
			$(SASL_CFLAGS) \
2795
			$(SSH2_CFLAGS) \
2796
			$(XDR_CFLAGS) \
2797 2798
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
2799
			$(GNUTLS_LIBS) \
2800
			$(SASL_LIBS) \
2801
			$(SSH2_LIBS)\
J
Jim Fehlig 已提交
2802
			$(SECDRIVER_LIBS) \
2803
			$(AM_LDFLAGS) \
2804
			$(NULL)
2805 2806 2807
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2808 2809 2810 2811
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
2812
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
2813
	rpc/virnetdaemon.h rpc/virnetdaemon.c \
2814 2815
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
2816
			$(AVAHI_CFLAGS) \
2817
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
2818
			$(XDR_CFLAGS) \
2819
			$(AM_CFLAGS)
2820 2821
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
2822
			$(AVAHI_LIBS) \
2823
			$(DBUS_LIBS) \
2824
			$(NULL)
2825 2826 2827
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2828 2829 2830 2831 2832
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 已提交
2833 2834
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
2835
libvirt_net_rpc_client_la_LDFLAGS = $(AM_LDFLAGS)
2836 2837
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
2838

2839 2840
libexec_PROGRAMS =

2841
if WITH_LIBVIRTD
2842 2843
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2844 2845 2846 2847
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2848 2849 2850
libvirt_iohelper_LDADD =		\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
2851 2852
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
2853
endif WITH_DTRACE_PROBES
2854

D
Daniel P. Berrange 已提交
2855 2856 2857 2858
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2859 2860 2861 2862

if WITH_NETWORK
libexec_PROGRAMS += libvirt_leaseshelper
libvirt_leaseshelper_SOURCES = $(NETWORK_LEASES_HELPER_SOURCES)
2863 2864 2865 2866
libvirt_leaseshelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881
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

2882
endif WITH_LIBVIRTD
2883

2884
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
2885
if WITH_LIBVIRTD
2886
libexec_PROGRAMS += libvirt_parthelper
2887

2888
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
D
Daniel P. Berrange 已提交
2889 2890 2891 2892
libvirt_parthelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2893 2894 2895 2896
libvirt_parthelper_LDADD =		\
		$(LIBPARTED_LIBS)	\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
2897 2898
if WITH_DTRACE_PROBES
libvirt_parthelper_LDADD += libvirt_probes.lo
2899
endif WITH_DTRACE_PROBES
2900

D
Daniel P. Berrange 已提交
2901 2902 2903 2904 2905
libvirt_parthelper_CFLAGS = \
		$(LIBPARTED_CFLAGS) \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2906 2907
endif WITH_LIBVIRTD
endif WITH_STORAGE_DISK
2908 2909
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)

2910

2911
if WITH_SANLOCK
2912 2913 2914
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2915
libvirt_sanlock_helper_CFLAGS = \
2916
		-I$(srcdir)/conf \
D
Daniel P. Berrange 已提交
2917 2918 2919 2920 2921 2922 2923
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2924
libvirt_sanlock_helper_LDADD = libvirt.la
2925
endif WITH_SANLOCK
2926

2927 2928 2929 2930 2931 2932
if WITH_LXC
if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_lxc

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

J
Jamie Strandboge 已提交
2969 2970 2971 2972 2973 2974
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 已提交
2975 2976 2977 2978
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
J
Jamie Strandboge 已提交
2979
virt_aa_helper_LDADD =						\
2980
		libvirt.la					\
C
Chris Lalancette 已提交
2981 2982
		libvirt_conf.la					\
		libvirt_util.la					\
2983
		libvirt_driver_storage_impl.la			\
C
Chris Lalancette 已提交
2984
		../gnulib/lib/libgnu.la
2985
if WITH_DTRACE_PROBES
2986
virt_aa_helper_LDADD += libvirt_probes.lo
2987
endif WITH_DTRACE_PROBES
J
Jamie Strandboge 已提交
2988
virt_aa_helper_CFLAGS =						\
2989 2990 2991 2992
		-I$(srcdir)/conf				\
		-I$(srcdir)/security				\
		$(AM_CFLAGS) 					\
		$(PIE_CFLAGS) 					\
D
Daniel P. Berrange 已提交
2993
		$(NULL)
2994 2995
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
J
Jamie Strandboge 已提交
2996 2997
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

2998 2999 3000 3001 3002
noinst_LTLIBRARIES += libvirt-nss.la

libvirt_nss_la_SOURCES =		\
		util/viralloc.c			\
		util/viralloc.h			\
K
Kai Kang 已提交
3003 3004
		util/viratomic.c		\
		util/viratomic.h		\
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 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056
		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)


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

3112
uninstall-local:: uninstall-init uninstall-systemd
3113
if WITH_LIBVIRTD
3114
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
3115 3116
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
3117
endif WITH_LIBVIRTD
3118 3119
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
3120
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
3121
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
3122
if WITH_SANLOCK
3123
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
3124
endif WITH_SANLOCK
3125 3126 3127 3128 3129
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" ||:
3130
endif WITH_QEMU
3131 3132 3133
if WITH_LXC
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||:
3134
endif WITH_LXC
J
Jim Fehlig 已提交
3135 3136 3137
if WITH_LIBXL
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||:
J
Jim Fehlig 已提交
3138
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||:
3139
endif WITH_LIBXL
3140 3141 3142
if WITH_UML
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/uml" ||:
3143
endif WITH_UML
3144 3145
if WITH_XEN
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/xen" ||:
3146
endif WITH_XEN
3147
if WITH_NETWORK
3148 3149 3150 3151
	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" || :
3152 3153
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||:
3154
endif WITH_NETWORK
3155
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
3156

3157 3158
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
3159
MAINTAINERCLEANFILES += $(REMOTE_DRIVER_GENERATED) $(VIR_NET_RPC_GENERATED)