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

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

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

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

40 41
WARN_CFLAGS += $(STRICT_FRAME_LIMIT_CFLAGS)

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

55 56
POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)"

57
EXTRA_DIST = $(conf_DATA)
58

59
BUILT_SOURCES =
60 61 62
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
63
nodist_conf_DATA =
64

E
Eric Blake 已提交
65 66
THREAD_LIBS = $(LIB_PTHREAD) $(LTLIBMULTITHREAD)

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

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

82
lib_LTLIBRARIES = libvirt.la libvirt-qemu.la libvirt-lxc.la
83

84
moddir = $(libdir)/libvirt/connection-driver
85 86
mod_LTLIBRARIES =

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

90 91 92 93 94 95
augeasdir = $(datadir)/augeas/lenses
augeas_DATA =

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

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

201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
EXTRA_DIST += \
	$(srcdir)/keycodemapdb/data/keymaps.csv \
	$(srcdir)/keycodemapdb/tools/keymap-gen \
	$(NULL)

util/virkeycodetable_%.h: $(srcdir)/keycodemapdb/data/keymaps.csv \
			$(srcdir)/keycodemapdb/tools/keymap-gen Makefile.am
	$(AM_V_GEN)export NAME=`echo $@ | sed -e 's,util/virkeycodetable_,,' \
					      -e 's,\.h,,'` && \
		$(MKDIR_P) util/ && \
		$(PYTHON) $(srcdir)/keycodemapdb/tools/keymap-gen \
			--lang stdc --varname virKeyCodeTable_$$NAME code-table \
			$(srcdir)/keycodemapdb/data/keymaps.csv $$NAME > $@-tmp && \
		mv $@-tmp $@ || rm -f $@-tmp

util/virkeynametable_%.h: $(srcdir)/keycodemapdb/data/keymaps.csv \
			$(srcdir)/keycodemapdb/tools/keymap-gen Makefile.am
	$(AM_V_GEN)export NAME=`echo $@ | sed -e 's,util/virkeynametable_,,' \
					      -e 's,\.h,,'` && \
		$(MKDIR_P) util/ && \
		$(PYTHON) $(srcdir)/keycodemapdb/tools/keymap-gen \
			--lang stdc --varname virKeyNameTable_$$NAME name-table \
			$(srcdir)/keycodemapdb/data/keymaps.csv $$NAME > $@-tmp && \
		mv $@-tmp $@ || rm -f $@-tmp

226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
util/virkeycode-%.pod: $(srcdir)/keycodemapdb/data/keymaps.csv \
			$(srcdir)/keycodemapdb/tools/keymap-gen Makefile.am
	$(AM_V_GEN)export NAME=`echo $@ | sed -e 's,util/virkeycode-,,' \
					      -e 's,\.pod,,'` && \
		$(MKDIR_P) util/ && \
		$(PYTHON) $(srcdir)/keycodemapdb/tools/keymap-gen \
		--lang pod --varname "Key code values for $$NAME" code-docs \
		$(srcdir)/keycodemapdb/data/keymaps.csv $$NAME > \
			$@-tmp && mv $@-tmp $@ || rm $@-tmp

util/virkeyname-%.pod: $(srcdir)/keycodemapdb/data/keymaps.csv \
			$(srcdir)/keycodemapdb/tools/keymap-gen Makefile.am
	$(AM_V_GEN)export NAME=`echo $@ | sed -e 's,util/virkeyname-,,' \
					      -e 's,\.pod,,'` && \
		$(MKDIR_P) util/ && \
		$(PYTHON) $(srcdir)/keycodemapdb/tools/keymap-gen \
		--lang pod --varname "Key name values for $$NAME" name-docs \
		$(srcdir)/keycodemapdb/data/keymaps.csv $$NAME > \
			$@-tmp && mv $@-tmp $@ || rm $@-tmp

util/virkey%.7: util/virkey%.pod
	$(AM_V_GEN)$(POD2MAN) --section=7 $< $@-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 $@

256
KEYCODES = linux osx atset1 atset2 atset3 xtkbd usb win32 rfb
257 258 259 260 261 262 263
KEYNAMES = linux osx win32

KEYTABLES = \
	$(KEYCODES:%=util/virkeycodetable_%.h) \
	$(KEYNAMES:%=util/virkeynametable_%.h) \
	$(NULL)

264 265 266 267 268 269
KEYPODS = $(KEYCODES:%=util/virkeycode-%.pod) \
	  $(KEYNAMES:%=util/virkeyname-%.pod)
KEYMANS = $(KEYPODS:%.pod=%.7)

man7_MANS = $(KEYMANS)

270 271 272
UTIL_SOURCES += $(KEYTABLES)
BUILT_SOURCES += $(KEYTABLES)
MAINTAINERCLEANFILES += $(KEYTABLES)
273
CLEANFILES += $(KEYMANS) $(KEYPODS)
L
Lai Jiangshan 已提交
274

275
# Internal generic driver infrastructure
O
Osier Yang 已提交
276
DATATYPES_SOURCES = datatypes.h datatypes.c
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305
DRIVER_SOURCES = \
		driver.c driver.h \
		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 \
		internal.h \
		$(DATATYPES_SOURCES) \
		libvirt.c libvirt_internal.h \
		libvirt-domain.c \
		libvirt-domain-snapshot.c \
		libvirt-host.c \
		libvirt-interface.c \
		libvirt-network.c \
		libvirt-nodedev.c \
		libvirt-nwfilter.c \
		libvirt-secret.c \
		libvirt-storage.c \
		libvirt-stream.c \
		locking/lock_manager.c locking/lock_manager.h \
		locking/lock_driver.h \
		locking/lock_driver_nop.h locking/lock_driver_nop.c \
		locking/domain_lock.h locking/domain_lock.c \
		logging/log_manager.c logging/log_manager.h \
306
		$(NULL)
307

308 309 310
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

311 312
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
313

314
LOCK_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
315 316
		locking/lock_protocol.h \
		locking/lock_protocol.c \
317 318
		$(NULL)

319 320 321
LOCK_PROTOCOL = $(srcdir)/locking/lock_protocol.x
EXTRA_DIST += $(LOCK_PROTOCOL) \
	$(LOCK_PROTOCOL_GENERATED)
322 323 324
BUILT_SOURCES += $(LOCK_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(LOCK_PROTOCOL_GENERATED)

325
LOCK_DAEMON_GENERATED = \
326
		locking/lock_daemon_dispatch_stubs.h
327 328 329
		$(NULL)

BUILT_SOURCES += $(LOCK_DAEMON_GENERATED)
330
EXTRA_DIST += $(LOCK_DAEMON_GENERATED)
331 332
MAINTAINERCLEANFILES += $(LOCK_DAEMON_GENERATED)

333 334
LOCK_DRIVER_LOCKD_SOURCES = \
		locking/lock_driver_lockd.c \
335
		locking/lock_driver_lockd.h \
336 337
		$(NULL)

338 339 340 341 342
LOCK_DAEMON_SOURCES = \
		locking/lock_daemon.h \
		locking/lock_daemon.c \
		locking/lock_daemon_config.h \
		locking/lock_daemon_config.c \
343 344
		locking/lock_daemon_dispatch.c \
		locking/lock_daemon_dispatch.h \
345 346
		$(NULL)

E
Eric Blake 已提交
347
locking/lock_daemon_dispatch_stubs.h: $(LOCK_PROTOCOL) \
348
		$(srcdir)/rpc/gendispatch.pl Makefile.am
349 350
	$(AM_V_GEN)perl -w $(srcdir)/rpc/gendispatch.pl --mode=server \
	    virLockSpaceProtocol VIR_LOCK_SPACE_PROTOCOL \
E
Eric Blake 已提交
351
	    $(LOCK_PROTOCOL) > $(srcdir)/locking/lock_daemon_dispatch_stubs.h
352 353


354 355 356 357 358
LOG_PROTOCOL_GENERATED = \
		logging/log_protocol.h \
		logging/log_protocol.c \
		$(NULL)

359 360
DRIVER_SOURCES += $(LOG_PROTOCOL_GENERATED)

361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381
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 \
382 383
		logging/log_handler.c \
		logging/log_handler.h \
384 385 386 387 388 389 390 391 392
		$(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


393
NETDEV_CONF_SOURCES = \
394
		conf/netdev_bandwidth_conf.h conf/netdev_bandwidth_conf.c \
395 396
		conf/netdev_vport_profile_conf.h conf/netdev_vport_profile_conf.c \
		conf/netdev_vlan_conf.h conf/netdev_vlan_conf.c
397

398
# XML configuration format handling sources
399
# Domain driver generic impl APIs
400 401 402 403 404 405 406 407 408 409
DOMAIN_CONF_SOURCES = \
		conf/capabilities.c conf/capabilities.h \
		conf/domain_addr.c conf/domain_addr.h \
		conf/domain_capabilities.c conf/domain_capabilities.h \
		conf/domain_conf.c conf/domain_conf.h \
		conf/domain_audit.c conf/domain_audit.h \
		conf/domain_nwfilter.c conf/domain_nwfilter.h \
		conf/virsavecookie.c conf/virsavecookie.h \
		conf/snapshot_conf.c conf/snapshot_conf.h \
		conf/numa_conf.c conf/numa_conf.h \
410
		conf/virdomainobjlist.c conf/virdomainobjlist.h
411

412
OBJECT_EVENT_SOURCES = \
413 414 415
		conf/object_event.c conf/object_event.h \
		conf/object_event_private.h

416
DOMAIN_EVENT_SOURCES = \
417
		conf/domain_event.c conf/domain_event.h
418

419
NETWORK_EVENT_SOURCES = \
420 421
		conf/network_event.c conf/network_event.h

422
STORAGE_EVENT_SOURCES = \
423 424
                conf/storage_event.c conf/storage_event.h

425
NODE_DEVICE_EVENT_SOURCES = \
426 427
                conf/node_device_event.c conf/node_device_event.h

428
SECRET_EVENT_SOURCES = \
429 430
                conf/secret_event.c conf/secret_event.h

431
# Network driver generic impl APIs
432 433 434
NETWORK_CONF_SOURCES = \
		conf/network_conf.c conf/network_conf.h \
		conf/virnetworkobj.c conf/virnetworkobj.h \
435
		conf/networkcommon_conf.c conf/networkcommon_conf.h
436

437
# Network filter driver generic impl APIs
438 439 440 441 442
NWFILTER_PARAM_CONF_SOURCES = \
		conf/nwfilter_params.c conf/nwfilter_params.h \
		conf/nwfilter_ipaddrmap.c \
		conf/nwfilter_ipaddrmap.h \
		conf/nwfilter_conf.h \
J
John Ferlan 已提交
443
		conf/virnwfilterobj.h
444

445 446 447
NWFILTER_CONF_SOURCES = \
		$(NWFILTER_PARAM_CONF_SOURCES) \
		conf/nwfilter_conf.c conf/nwfilter_conf.h \
J
John Ferlan 已提交
448
		conf/virnwfilterobj.c conf/virnwfilterobj.h
449

450
# Storage driver generic impl APIs
451
STORAGE_CONF_SOURCES = \
452
		conf/storage_adapter_conf.h conf/storage_adapter_conf.c \
453
		conf/storage_conf.h conf/storage_conf.c \
J
John Ferlan 已提交
454
		conf/virstorageobj.h conf/virstorageobj.c
455

456
# Interface driver generic impl APIs
457 458
INTERFACE_CONF_SOURCES = \
		conf/interface_conf.c conf/interface_conf.h \
J
John Ferlan 已提交
459
		conf/virinterfaceobj.c conf/virinterfaceobj.h
460

461
# Secret driver generic impl APIs
462 463
SECRET_CONF_SOURCES = \
		conf/secret_conf.h conf/secret_conf.c \
464
		conf/virsecretobj.h conf/virsecretobj.c
465 466

# Network driver generic impl APIs
467
NODE_DEVICE_CONF_SOURCES = \
J
John Ferlan 已提交
468 469
		conf/node_device_conf.c conf/node_device_conf.h \
		conf/virnodedeviceobj.c conf/virnodedeviceobj.h
470

471
CPU_CONF_SOURCES = \
472
		conf/cpu_conf.c conf/cpu_conf.h
473

474
# Safe character device handling helper APIs
475
CHRDEV_CONF_SOURCES = \
476
		conf/virchrdev.c conf/virchrdev.h
477

478
# Device Helper APIs
479
DEVICE_CONF_SOURCES = \
480 481
		conf/device_conf.c conf/device_conf.h

482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498
CONF_SOURCES = \
		$(NETDEV_CONF_SOURCES) \
		$(DOMAIN_CONF_SOURCES) \
		$(OBJECT_EVENT_SOURCES) \
		$(DOMAIN_EVENT_SOURCES) \
		$(NETWORK_EVENT_SOURCES) \
		$(STORAGE_EVENT_SOURCES) \
		$(NODE_DEVICE_EVENT_SOURCES) \
		$(SECRET_EVENT_SOURCES) \
		$(NETWORK_CONF_SOURCES) \
		$(NWFILTER_CONF_SOURCES) \
		$(NODE_DEVICE_CONF_SOURCES) \
		$(STORAGE_CONF_SOURCES) \
		$(INTERFACE_CONF_SOURCES) \
		$(SECRET_CONF_SOURCES) \
		$(CPU_CONF_SOURCES) \
		$(CHRDEV_CONF_SOURCES) \
499
		$(DEVICE_CONF_SOURCES)
500

501
# The remote RPC driver, covering domains, storage, networks, etc
502
REMOTE_DRIVER_GENERATED = \
503 504 505 506 507 508 509 510 511
		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 \
E
Eric Blake 已提交
512
		$(NULL)
E
Eric Blake 已提交
513 514

REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x
515
LXC_PROTOCOL = $(srcdir)/remote/lxc_protocol.x
E
Eric Blake 已提交
516
QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x
517
REMOTE_DRIVER_PROTOCOL = $(REMOTE_PROTOCOL) $(QEMU_PROTOCOL) $(LXC_PROTOCOL)
518

E
Eric Blake 已提交
519
remote/remote_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
520
		$(REMOTE_PROTOCOL) Makefile.am
521
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
522 523
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/remote/remote_client_bodies.h
524

E
Eric Blake 已提交
525
remote/lxc_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
526
		$(LXC_PROTOCOL) Makefile.am
527
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
528 529
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/remote/lxc_client_bodies.h
530

E
Eric Blake 已提交
531
remote/qemu_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
532
		$(QEMU_PROTOCOL) Makefile.am
533
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
534 535
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/remote/qemu_client_bodies.h
536

537 538
REMOTE_DRIVER_SOURCES = \
		remote/remote_driver.c remote/remote_driver.h \
539
		$(REMOTE_DRIVER_GENERATED)
540

541
EXTRA_DIST +=  $(REMOTE_DRIVER_PROTOCOL) \
542
		$(REMOTE_DRIVER_GENERATED)
543

M
Martin Kletzander 已提交
544 545 546
ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x

ADMIN_PROTOCOL_GENERATED = \
547 548
		admin/admin_protocol.c \
		admin/admin_protocol.h \
549 550 551
		admin/admin_client.h \
		admin/admin_server_dispatch_stubs.h \
		$(NULL)
552 553 554 555 556 557

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 已提交
558

559 560 561 562 563 564
admin/admin_server_dispatch_stubs.h: $(srcdir)/rpc/gendispatch.pl \
		$(ADMIN_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \
	  admin ADMIN $(ADMIN_PROTOCOL) \
	  > $(srcdir)/admin/admin_server_dispatch_stubs.h

M
Martin Kletzander 已提交
565 566 567 568
EXTRA_DIST += $(ADMIN_PROTOCOL) $(ADMIN_PROTOCOL_GENERATED)
BUILT_SOURCES += $(ADMIN_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(ADMIN_PROTOCOL_GENERATED)

569 570 571 572 573 574 575 576 577 578
# 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
579 580 581 582

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

593
# Depending on configure options, libtool creates one or both of
E
Eric Blake 已提交
594 595
# remote/{,.libs/}libvirt_driver_remote_la-remote_protocol.o.  We want
# the newest of the two, in case configure options changed and a stale
596
# file is left around from an earlier build.
597
PDWTAGS = \
598 599 600 601 602 603 604 605
	$(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then \
	  o=`ls -t $(<:.lo=.$(OBJEXT)) \
	     $(subst /,/.libs/,$(<:.lo=.$(OBJEXT))) \
	    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; \
	  if test ! -s $(@F)-t1 && test -s $(@F)-t2; then \
	    rm -rf $(@F)-t?; \
606
	    echo 'WARNING: pdwtags appears broken; skipping the $@ test' >&2;\
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624
	  else \
	    $(PERL) -0777 -n \
		-e 'foreach my $$p (split m!\n*(?:$(r1)|$(r2))\n!) {' \
		-e '  if ($$p =~ /^(struct|enum) $(struct_prefix)/ ||' \
		-e '      $$p =~ /^enum \{/) {' \
		-e '    $$p =~ s!\t*/\*.*?\*/!!sg;' \
		-e '    $$p =~ s!\s+\n!\n!sg;' \
		-e '    $$p =~ s!\s+$$!!;' \
		-e '    $$p =~ s!\t!        !g;' \
		-e '    print "$$p\n";' \
		-e '    $$n++;' \
		-e '  }' \
		-e '}' \
		-e 'BEGIN {' \
		-e '  print "/* -*- c -*- */\n";' \
		-e '}' \
		-e 'END {' \
		-e '  if ($$n < 1) {' \
625
		-e '    warn "WARNING: your pdwtags program is too old\n";' \
626
		-e '    warn "WARNING: skipping the $@ test\n";' \
627
		-e '    warn "WARNING: install dwarves-1.3 or newer\n";' \
628 629 630 631
		-e '    exit 8;' \
		-e '  }' \
		-e '}' \
		< $(@F)-t1 > $(@F)-t3; \
632
	    case $$? in 8) rm -f $(@F)-t?; exit 0;; 0) ;; *) exit 1;; esac;\
633 634 635 636
	    diff -u $(@)s $(@F)-t3; st=$$?; rm -f $(@F)-t?; exit $$st; \
	  fi; \
	else \
	  echo 'WARNING: you lack pdwtags; skipping the $@ test' >&2; \
637
	  echo 'WARNING: install the dwarves package to get pdwtags' >&2; \
638
	fi
639

640
# .libs/libvirt.so is built by libtool as a side-effect of the Makefile
641 642
# rule for libvirt.la.  However, checking symbols relies on Linux ELF layout
if WITH_LINUX
643 644 645
check-symfile: libvirt.syms libvirt.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt.syms \
	  .libs/libvirt.so
646 647 648
check-admin-symfile: libvirt_admin.syms libvirt-admin.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt_admin.syms \
	  .libs/libvirt-admin.so
649
else ! WITH_LINUX
650
check-symfile:
651
check-admin-symfile:
652
endif ! WITH_LINUX
653
check-symsorting:
654
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
655
		$(srcdir) $(SYM_FILES)
656 657 658
check-admin-symsorting:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
		$(srcdir) $(ADMIN_SYM_FILES)
J
Jiri Denemark 已提交
659
EXTRA_DIST += check-symfile.pl check-symsorting.pl
660

E
Eric Blake 已提交
661
# Keep this list synced with RPC_PROBE_FILES
662 663
PROTOCOL_STRUCTS = \
	$(srcdir)/remote_protocol-structs \
664
	$(srcdir)/lxc_protocol-structs \
665
	$(srcdir)/qemu_protocol-structs \
J
Jiri Denemark 已提交
666
	$(srcdir)/virnetprotocol-structs \
E
Eric Blake 已提交
667 668 669
	$(srcdir)/virkeepaliveprotocol-structs \
	$(srcdir)/lxc_monitor_protocol-structs \
	$(srcdir)/lock_protocol-structs \
M
Martin Kletzander 已提交
670
	$(srcdir)/admin_protocol-structs \
E
Eric Blake 已提交
671 672
	$(NULL)

673
if WITH_REMOTE
674 675
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)

676 677
# 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.
678 679 680
$(srcdir)/remote_protocol-struct \
	$(srcdir)/qemu_protocol-struct \
	$(srcdir)/lxc_protocol-struct: \
E
Eric Blake 已提交
681
		$(srcdir)/%-struct: remote/libvirt_driver_remote_la-%.lo
682
	$(PDWTAGS)
683
$(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \
E
Eric Blake 已提交
684
		$(srcdir)/%-struct: rpc/libvirt_net_rpc_la-%.lo
685
	$(PDWTAGS)
E
Eric Blake 已提交
686
$(srcdir)/lxc_monitor_protocol-struct: \
E
Eric Blake 已提交
687
		$(srcdir)/%-struct: lxc/libvirt_driver_lxc_impl_la-%.lo
E
Eric Blake 已提交
688 689
	$(PDWTAGS)
$(srcdir)/lock_protocol-struct: \
E
Eric Blake 已提交
690
		$(srcdir)/%-struct: locking/lockd_la-%.lo
E
Eric Blake 已提交
691
	$(PDWTAGS)
M
Martin Kletzander 已提交
692 693 694
$(srcdir)/admin_protocol-struct: \
		$(srcdir)/%-struct: admin/libvirt_admin_la-%.lo
	$(PDWTAGS)
E
Eric Blake 已提交
695

696
else !WITH_REMOTE
697 698 699
# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be
# re-generated when configured --without-remote.
check-protocol:
700
endif !WITH_REMOTE
J
Jiri Denemark 已提交
701
EXTRA_DIST += $(PROTOCOL_STRUCTS)
702 703 704 705 706

check-drivername:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-drivername.pl \
		$(srcdir)/driver.h \
		$(srcdir)/libvirt_public.syms \
707
		$(srcdir)/libvirt_admin_public.syms \
708 709 710 711 712
		$(srcdir)/libvirt_qemu.syms \
		$(srcdir)/libvirt_lxc.syms

EXTRA_DIST += check-drivername.pl

713
DRIVER_SOURCE_FILES = \
714 715 716 717 718 719 720 721 722 723 724
	$(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) \
725
	$(VZ_DRIVER_SOURCES) \
726 727 728 729 730 731 732 733
	$(PHYP_DRIVER_SOURCES) \
	$(QEMU_DRIVER_SOURCES) \
	$(REMOTE_DRIVER_SOURCES) \
	$(SECRET_DRIVER_SOURCES) \
	$(STORAGE_DRIVER_SOURCES) \
	$(TEST_DRIVER_SOURCES) \
	$(UML_DRIVER_SOURCES) \
	$(VBOX_DRIVER_SOURCES) \
734
	vbox/vbox_tmpl.c \
735 736 737
	$(VMWARE_DRIVER_SOURCES) \
	$(XEN_DRIVER_SOURCES) \
	$(XENAPI_DRIVER_SOURCES) \
738 739
	$(NULL)

740
STATEFUL_DRIVER_SOURCE_FILES = \
R
Roman Bogorodskiy 已提交
741
	$(BHYVE_DRIVER_SOURCES) \
742 743 744 745 746 747 748 749 750 751 752
	$(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) \
753
	$(VZ_DRIVER_SOURCES) \
754 755
	$(NULL)

756 757 758

check-driverimpls:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-driverimpls.pl \
759
		$(filter /%,$(DRIVER_SOURCE_FILES)) \
E
Eric Blake 已提交
760 761 762
		$(filter $(srcdir)/%,$(DRIVER_SOURCE_FILES)) \
		$(addprefix $(srcdir)/,$(filter-out $(srcdir)/%, \
			$(filter-out /%,$(DRIVER_SOURCE_FILES))))
763

764 765
check-aclrules:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclrules.pl \
E
Eric Blake 已提交
766
		$(REMOTE_PROTOCOL) \
767
		$(addprefix $(srcdir)/,$(filter-out /%,$(STATEFUL_DRIVER_SOURCE_FILES)))
768

769 770 771 772 773
check-aclperms:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclperms.pl \
		$(srcdir)/access/viraccessperm.h \
		$(srcdir)/access/viraccessperm.c

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

776
check-local: check-protocol check-symfile check-symsorting \
777
	check-drivername check-driverimpls check-aclrules \
778
	check-aclperms check-admin-symfile check-admin-symsorting
779
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
780

781
# Mock driver, covering domains, storage, networks, etc
782
TEST_DRIVER_SOURCES = \
783
		test/test_driver.c test/test_driver.h
D
Daniel P. Berrange 已提交
784
TEST_DRIVER_ASSETS = test/test-screenshot.png
785 786

# Now the Hypervisor specific drivers
787 788 789 790 791 792
XEN_DRIVER_SOURCES = \
		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 \
793
		xen/xs_internal.c xen/xs_internal.h
794
if WITH_XEN_INOTIFY
795
XEN_DRIVER_SOURCES += xen/xen_inotify.c xen/xen_inotify.h
796
endif WITH_XEN_INOTIFY
797

798
LXC_MONITOR_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
799 800
	lxc/lxc_monitor_protocol.h \
	lxc/lxc_monitor_protocol.c \
801 802 803
	$(NULL)

LXC_MONITOR_GENERATED = \
E
Eric Blake 已提交
804
	lxc/lxc_monitor_dispatch.h \
805 806 807
	$(NULL)

LXC_CONTROLLER_GENERATED = \
E
Eric Blake 已提交
808
	lxc/lxc_controller_dispatch.h \
809 810 811
	$(NULL)

LXC_GENERATED = \
812
	$(LXC_MONITOR_PROTOCOL_GENERATED) \
813 814 815 816
	$(LXC_MONITOR_GENERATED) \
	$(LXC_CONTROLLER_GENERATED) \
	$(NULL)

817
LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x
818

E
Eric Blake 已提交
819
lxc/lxc_monitor_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
820
		$(LXC_MONITOR_PROTOCOL) Makefile.am
821
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
822 823
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_monitor_dispatch.h
824

E
Eric Blake 已提交
825
lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
826
		$(REMOTE_PROTOCOL) Makefile.am
827
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \
E
Eric Blake 已提交
828 829
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_controller_dispatch.h
830 831

EXTRA_DIST += \
832
	$(LXC_MONITOR_PROTOCOL) \
833 834 835 836 837
	$(LXC_GENERATED) \
	$(NULL)

BUILT_SOURCES += $(LXC_GENERATED)

838 839
CLEANFILES += $(LXC_GENERATED)

840 841 842 843 844 845 846 847 848 849 850 851
LXC_DRIVER_SOURCES = \
		$(LXC_MONITOR_PROTOCOL_GENERATED) \
		$(LXC_MONITOR_GENERATED) \
		lxc/lxc_conf.c lxc/lxc_conf.h \
		lxc/lxc_container.c lxc/lxc_container.h \
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h \
		lxc/lxc_domain.c lxc/lxc_domain.h \
		lxc/lxc_hostdev.c lxc/lxc_hostdev.h \
		lxc/lxc_monitor.c lxc/lxc_monitor.h \
		lxc/lxc_process.c lxc/lxc_process.h \
		lxc/lxc_fuse.c lxc/lxc_fuse.h \
		lxc/lxc_native.c lxc/lxc_native.h \
852
		lxc/lxc_driver.c lxc/lxc_driver.h
853

854 855 856 857 858 859 860 861
LXC_CONTROLLER_SOURCES = \
		$(LXC_MONITOR_PROTOCOL_GENERATED) \
		$(LXC_CONTROLLER_GENERATED) \
		lxc/lxc_conf.c lxc/lxc_conf.h \
		lxc/lxc_container.c lxc/lxc_container.h \
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h \
		lxc/lxc_domain.c lxc/lxc_domain.h \
		lxc/lxc_fuse.c lxc/lxc_fuse.h \
862
		lxc/lxc_controller.c
863

864 865
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES = \
		$(DATATYPES_SOURCES) \
J
Jamie Strandboge 已提交
866 867
		security/virt-aa-helper.c

868
PHYP_DRIVER_SOURCES = \
869 870
		phyp/phyp_driver.c phyp/phyp_driver.h

871 872 873
OPENVZ_DRIVER_SOURCES = \
		openvz/openvz_conf.c openvz/openvz_conf.h \
		openvz/openvz_driver.c openvz/openvz_driver.h \
874
		openvz/openvz_util.c openvz/openvz_util.h
875

876 877
VMWARE_DRIVER_SOURCES = \
		vmware/vmware_driver.c vmware/vmware_driver.h \
878 879
		vmware/vmware_conf.c vmware/vmware_conf.h

880 881 882 883 884 885 886 887 888 889 890 891
VBOX_DRIVER_SOURCES = \
	vbox/vbox_glue.c vbox/vbox_glue.h \
	vbox/vbox_driver.c vbox/vbox_driver.h \
	vbox/vbox_snapshot_conf.c vbox/vbox_snapshot_conf.h \
	vbox/vbox_V4_0.c vbox/vbox_CAPI_v4_0.h \
	vbox/vbox_V4_1.c vbox/vbox_CAPI_v4_1.h \
	vbox/vbox_V4_2.c vbox/vbox_CAPI_v4_2.h \
	vbox/vbox_V4_2_20.c vbox/vbox_CAPI_v4_2_20.h \
	vbox/vbox_V4_3.c vbox/vbox_CAPI_v4_3.h \
	vbox/vbox_V4_3_4.c vbox/vbox_CAPI_v4_3_4.h \
	vbox/vbox_V5_0.c vbox/vbox_CAPI_v5_0.h \
	vbox/vbox_V5_1.c vbox/vbox_CAPI_v5_1.h \
D
Dawid Zamirski 已提交
892
	vbox/vbox_V5_2.c vbox/vbox_CAPI_v5_2.h \
893 894 895 896
	vbox/vbox_common.c vbox/vbox_common.h \
	vbox/vbox_uniformed_api.h \
	vbox/vbox_get_driver.h \
	vbox/vbox_network.c \
897
	vbox/vbox_storage.c
T
Taowei Luo 已提交
898

899 900 901
VBOX_DRIVER_EXTRA_DIST = \
		vbox/vbox_tmpl.c vbox/README \
		vbox/vbox_MSCOMGlue.c vbox/vbox_MSCOMGlue.h \
902
		vbox/vbox_XPCOMCGlue.c vbox/vbox_XPCOMCGlue.h
903

904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921
QEMU_DRIVER_SOURCES = \
		qemu/qemu_agent.c qemu/qemu_agent.h \
		qemu/qemu_alias.c qemu/qemu_alias.h \
		qemu/qemu_block.c qemu/qemu_block.h \
		qemu/qemu_blockjob.c qemu/qemu_blockjob.h \
		qemu/qemu_capabilities.c qemu/qemu_capabilities.h \
		qemu/qemu_command.c qemu/qemu_command.h \
		qemu/qemu_parse_command.c qemu/qemu_parse_command.h \
		qemu/qemu_domain.c qemu/qemu_domain.h \
		qemu/qemu_domain_address.c qemu/qemu_domain_address.h \
		qemu/qemu_cgroup.c qemu/qemu_cgroup.h \
		qemu/qemu_hostdev.c qemu/qemu_hostdev.h \
		qemu/qemu_hotplug.c qemu/qemu_hotplug.h \
		qemu/qemu_hotplugpriv.h \
		qemu/qemu_conf.c qemu/qemu_conf.h \
		qemu/qemu_process.c qemu/qemu_process.h \
		qemu/qemu_processpriv.h \
		qemu/qemu_migration.c qemu/qemu_migration.h \
922
		qemu/qemu_migration_cookie.c qemu/qemu_migration_cookie.h \
923 924 925 926 927 928 929 930
		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 \
		qemu/qemu_driver.c qemu/qemu_driver.h \
		qemu/qemu_interface.c qemu/qemu_interface.h \
		qemu/qemu_capspriv.h \
931
		qemu/qemu_security.c qemu/qemu_security.h
R
Richard W.M. Jones 已提交
932

933 934 935
XENAPI_DRIVER_SOURCES = \
		xenapi/xenapi_driver.c xenapi/xenapi_driver.h \
		xenapi/xenapi_driver_private.h \
936 937
		xenapi/xenapi_utils.c xenapi/xenapi_utils.h

938 939 940 941 942 943
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 \
		libxl/libxl_logger.c libxl/libxl_logger.h \
J
Jim Fehlig 已提交
944
		libxl/libxl_migration.c libxl/libxl_migration.h
J
Jim Fehlig 已提交
945

946 947
UML_DRIVER_SOURCES = \
		uml/uml_conf.c uml/uml_conf.h \
D
Daniel P. Berrange 已提交
948
		uml/uml_driver.c uml/uml_driver.h
949

950 951 952 953 954 955 956 957 958 959 960 961
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 \
		esx/esx_storage_backend_vmfs.c esx/esx_storage_backend_vmfs.h \
		esx/esx_storage_backend_iscsi.c esx/esx_storage_backend_iscsi.h \
		esx/esx_stream.c esx/esx_stream.h \
		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 \
962
		esx/esx_vi_types.c esx/esx_vi_types.h
963

964 965 966 967 968 969 970 971 972 973 974
ESX_DRIVER_GENERATED = \
		esx/esx_vi_methods.generated.c \
		esx/esx_vi_methods.generated.h \
		esx/esx_vi_methods.generated.macro \
		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 \
		esx/esx_vi_types.generated.typefromstring \
		esx/esx_vi.generated.c \
975
		esx/esx_vi.generated.h
976

977 978 979 980
ESX_DRIVER_EXTRA_DIST = \
		esx/README \
		esx/esx_vi_generator.input \
		esx/esx_vi_generator.py \
981 982
		$(ESX_DRIVER_GENERATED)

983 984 985 986 987 988
HYPERV_DRIVER_SOURCES = \
		hyperv/hyperv_private.h \
		hyperv/hyperv_driver.c hyperv/hyperv_driver.h \
		hyperv/hyperv_util.c hyperv/hyperv_util.h \
		hyperv/hyperv_wmi.c hyperv/hyperv_wmi.h \
		hyperv/hyperv_wmi_classes.c hyperv/hyperv_wmi_classes.h \
989 990
		hyperv/openwsman.h

991 992 993
HYPERV_DRIVER_GENERATED = \
		hyperv/hyperv_wmi_classes.generated.c \
		hyperv/hyperv_wmi_classes.generated.h \
994 995
		hyperv/hyperv_wmi_classes.generated.typedef

996 997 998
HYPERV_DRIVER_EXTRA_DIST = \
		hyperv/hyperv_wmi_generator.input \
		hyperv/hyperv_wmi_generator.py \
999 1000
		$(HYPERV_DRIVER_GENERATED)

1001 1002 1003 1004 1005 1006
VZ_DRIVER_SOURCES = \
		vz/vz_driver.h \
		vz/vz_driver.c \
		vz/vz_utils.c \
		vz/vz_utils.h \
		vz/vz_sdk.h \
1007
		vz/vz_sdk.c
D
Dmitry Guryanov 已提交
1008

1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028
BHYVE_DRIVER_SOURCES = \
		bhyve/bhyve_capabilities.c \
		bhyve/bhyve_capabilities.h \
		bhyve/bhyve_command.c \
		bhyve/bhyve_command.h \
		bhyve/bhyve_conf.c \
		bhyve/bhyve_conf.h \
		bhyve/bhyve_parse_command.c \
		bhyve/bhyve_parse_command.h \
		bhyve/bhyve_device.c \
		bhyve/bhyve_device.h \
		bhyve/bhyve_domain.c \
		bhyve/bhyve_domain.h \
		bhyve/bhyve_driver.h \
		bhyve/bhyve_driver.c \
		bhyve/bhyve_monitor.c \
		bhyve/bhyve_monitor.h \
		bhyve/bhyve_process.c \
		bhyve/bhyve_process.h \
		bhyve/bhyve_utils.h \
R
Roman Bogorodskiy 已提交
1029 1030
		$(NULL)

1031
NETWORK_DRIVER_SOURCES = \
1032
		network/bridge_driver.h network/bridge_driver.c \
1033 1034
		network/bridge_driver_platform.h \
		network/bridge_driver_platform.c \
1035 1036
		$(NULL)
EXTRA_DIST += network/bridge_driver_linux.c network/bridge_driver_nop.c
1037

1038 1039 1040
INTERFACE_DRIVER_SOURCES =

if WITH_INTERFACE
1041 1042
INTERFACE_DRIVER_SOURCES += \
		interface/interface_driver.h \
1043
		interface/interface_driver.c
1044 1045

if WITH_NETCF
1046
INTERFACE_DRIVER_SOURCES += \
1047
		interface/interface_backend_netcf.c
1048
endif WITH_NETCF
1049
if WITH_UDEV
1050
INTERFACE_DRIVER_SOURCES += \
1051
		interface/interface_backend_udev.c
1052 1053
endif WITH_UDEV
endif WITH_INTERFACE
1054

1055
SECRET_UTIL_SOURCES = \
1056 1057
		secret/secret_util.h secret/secret_util.c

1058
SECRET_DRIVER_SOURCES = \
1059
		secret/secret_driver.h secret/secret_driver.c
1060

1061
# Storage backend specific impls
1062 1063 1064
STORAGE_DRIVER_BACKEND_SOURCES = \
		storage/storage_backend.h storage/storage_backend.c

1065 1066 1067
STORAGE_DRIVER_SOURCES = \
		storage/storage_driver.h storage/storage_driver.c \
		storage/storage_source.h storage/storage_source.c \
1068
		$(STORAGE_DRIVER_BACKEND_SOURCES) \
1069
		storage/storage_util.h storage/storage_util.c
1070

1071
STORAGE_DRIVER_FS_SOURCES = \
1072
		storage/storage_backend_fs.h storage/storage_backend_fs.c
R
Richard W.M. Jones 已提交
1073

1074 1075
STORAGE_DRIVER_LVM_SOURCES = \
		storage/storage_backend_logical.h \
1076
		storage/storage_backend_logical.c
1077

1078
STORAGE_DRIVER_ISCSI_SOURCES = \
1079
		storage/storage_backend_iscsi.h storage/storage_backend_iscsi.c
1080

1081
STORAGE_DRIVER_SCSI_SOURCES = \
1082
		storage/storage_backend_scsi.h storage/storage_backend_scsi.c
1083

1084
STORAGE_DRIVER_MPATH_SOURCES = \
1085
		storage/storage_backend_mpath.h storage/storage_backend_mpath.c
D
Dave Allan 已提交
1086

1087
STORAGE_DRIVER_DISK_SOURCES = \
1088
		storage/storage_backend_disk.h storage/storage_backend_disk.c
1089

1090
STORAGE_DRIVER_RBD_SOURCES = \
1091 1092
		storage/storage_backend_rbd.h storage/storage_backend_rbd.c

1093
STORAGE_DRIVER_SHEEPDOG_SOURCES = \
1094 1095
		storage/storage_backend_sheepdog.h storage/storage_backend_sheepdog.c \
		storage/storage_backend_sheepdog_priv.h
1096

1097
STORAGE_DRIVER_GLUSTER_SOURCES = \
1098 1099
		storage/storage_backend_gluster.h storage/storage_backend_gluster.c

1100
STORAGE_DRIVER_ZFS_SOURCES = \
R
Roman Bogorodskiy 已提交
1101 1102
                storage/storage_backend_zfs.h storage/storage_backend_zfs.c

1103 1104
STORAGE_DRIVER_VSTORAGE_SOURCES = \
                storage/storage_backend_vstorage.h \
1105 1106
                storage/storage_backend_vstorage.c

1107
STORAGE_HELPER_DISK_SOURCES = \
1108
		storage/parthelper.c
1109

1110
UTIL_IO_HELPER_SOURCES = \
1111 1112
		util/iohelper.c

1113
NETWORK_LEASES_HELPER_SOURCES = \
1114 1115
               network/leaseshelper.c

1116
# Network filters
1117 1118 1119 1120 1121 1122 1123 1124 1125 1126
NWFILTER_DRIVER_SOURCES = \
		nwfilter/nwfilter_driver.h nwfilter/nwfilter_driver.c \
		nwfilter/nwfilter_tech_driver.h \
		nwfilter/nwfilter_gentech_driver.c \
		nwfilter/nwfilter_gentech_driver.h \
		nwfilter/nwfilter_dhcpsnoop.c \
		nwfilter/nwfilter_dhcpsnoop.h \
		nwfilter/nwfilter_ebiptables_driver.c \
		nwfilter/nwfilter_ebiptables_driver.h \
		nwfilter/nwfilter_learnipaddr.c \
1127
		nwfilter/nwfilter_learnipaddr.h
1128

1129

1130
# Security framework and drivers for various models
1131 1132 1133 1134 1135
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 \
1136
		security/security_manager.h security/security_manager.c
1137

1138
SECURITY_DRIVER_SELINUX_SOURCES = \
1139
		security/security_selinux.h security/security_selinux.c
1140

1141
SECURITY_DRIVER_APPARMOR_SOURCES = \
J
Jamie Strandboge 已提交
1142 1143
		security/security_apparmor.h security/security_apparmor.c

1144
ACCESS_DRIVER_GENERATED = \
E
Eric Blake 已提交
1145 1146 1147 1148 1149 1150 1151
		access/viraccessapicheck.h \
		access/viraccessapicheck.c \
		access/viraccessapicheckqemu.h \
		access/viraccessapicheckqemu.c \
		access/viraccessapichecklxc.h \
		access/viraccessapichecklxc.c \
		$(NULL)
1152

1153
ACCESS_DRIVER_SYM_FILES = \
1154 1155 1156
		libvirt_access.syms \
		libvirt_access_qemu.syms \
		libvirt_access_lxc.syms
1157

1158 1159 1160 1161 1162
ACCESS_DRIVER_API_FILES = \
		libvirt_access.xml \
		libvirt_access_qemu.xml \
		libvirt_access_lxc.xml

1163 1164 1165 1166 1167 1168 1169
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

1170 1171 1172 1173
ACCESS_DRIVER_POLKIT_SOURCES = \
		access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c

ACCESS_DRIVER_POLKIT_POLICY = \
1174
		$(srcdir)/access/org.libvirt.api.policy
1175 1176


1177 1178
NODE_DEVICE_DRIVER_SOURCES = \
		node_device/node_device_driver.c \
1179
		node_device/node_device_driver.h
1180

1181 1182
NODE_DEVICE_DRIVER_HAL_SOURCES = \
		node_device/node_device_hal.c \
1183
		node_device/node_device_hal.h
1184

1185 1186
NODE_DEVICE_DRIVER_UDEV_SOURCES = \
		node_device/node_device_udev.c \
D
Daniel Veillard 已提交
1187
		node_device/node_device_udev.h
1188

1189 1190 1191 1192 1193 1194 1195
CPU_SOURCES = \
		cpu/cpu.h cpu/cpu.c \
		cpu/cpu_x86.h cpu/cpu_x86.c cpu/cpu_x86_data.h \
		cpu/cpu_s390.h cpu/cpu_s390.c \
		cpu/cpu_arm.h cpu/cpu_arm.c \
		cpu/cpu_ppc64.h cpu/cpu_ppc64.c \
		cpu/cpu_ppc64_data.h \
1196
		cpu/cpu_map.h cpu/cpu_map.c
1197

1198
VMX_SOURCES = \
1199 1200
		vmx/vmx.c vmx/vmx.h

1201 1202 1203 1204
XENCONFIG_SOURCES = \
		xenconfig/xenxs_private.h \
		xenconfig/xen_common.c xenconfig/xen_common.h \
		xenconfig/xen_sxpr.c xenconfig/xen_sxpr.h \
1205
		xenconfig/xen_xm.c xenconfig/xen_xm.h
1206
if WITH_LIBXL
1207 1208
XENCONFIG_LIBXL_SOURCES = \
		$(XENCONFIG_SOURCES) \
1209 1210
		xenconfig/xen_xl.c xenconfig/xen_xl.h
endif WITH_LIBXL
1211

J
Jiri Denemark 已提交
1212 1213
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
1214
EXTRA_DIST +=	$(pkgdata_DATA)
1215

1216 1217 1218 1219 1220 1221
#########################
#
# Build up list of libvirt.la source files based on configure conditions
#
# First deal with sources usable in non-daemon context

1222
noinst_LTLIBRARIES = libvirt_util.la
1223 1224
libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
libvirt_la_BUILT_LIBADD = libvirt_util.la
1225
libvirt_util_la_SOURCES = \
1226
		$(UTIL_SOURCES)
1227
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
1228
		$(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
1229
		$(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS) \
1230
		$(POLKIT_CFLAGS) $(GNUTLS_CFLAGS) $(ACL_CFLAGS)
1231
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
1232
		$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
1233
		$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(WIN32_EXTRA_LIBS) $(LIBXML_LIBS) \
M
Michal Privoznik 已提交
1234
		$(SECDRIVER_LIBS) $(NUMACTL_LIBS) $(ACL_LIBS) \
1235
		$(POLKIT_LIBS) $(GNUTLS_LIBS)
1236

1237 1238

noinst_LTLIBRARIES += libvirt_conf.la
1239
libvirt_la_BUILT_LIBADD += libvirt_conf.la
1240
libvirt_conf_la_SOURCES = $(CONF_SOURCES)
1241 1242
libvirt_conf_la_CFLAGS = \
		-I$(srcdir)/conf $(AM_CFLAGS)
1243
libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS)
1244
libvirt_conf_la_LIBADD = $(LIBXML_LIBS)
1245

J
Jiri Denemark 已提交
1246
noinst_LTLIBRARIES += libvirt_cpu.la
1247
libvirt_la_BUILT_LIBADD += libvirt_cpu.la
J
Jiri Denemark 已提交
1248
libvirt_cpu_la_CFLAGS = \
1249
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jiri Denemark 已提交
1250 1251
libvirt_cpu_la_SOURCES = $(CPU_SOURCES)

1252 1253 1254 1255 1256 1257
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)

1258 1259 1260 1261
if WITH_VMX
noinst_LTLIBRARIES += libvirt_vmx.la
libvirt_la_BUILT_LIBADD += libvirt_vmx.la
libvirt_vmx_la_CFLAGS = \
1262
		-I$(srcdir)/conf $(AM_CFLAGS)
1263
libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
1264
endif WITH_VMX
1265

J
Jim Fehlig 已提交
1266 1267 1268 1269
if WITH_XENCONFIG
noinst_LTLIBRARIES += libvirt_xenconfig.la
libvirt_la_BUILT_LIBADD += libvirt_xenconfig.la
libvirt_xenconfig_la_CFLAGS = \
1270
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jim Fehlig 已提交
1271
libvirt_xenconfig_la_SOURCES = $(XENCONFIG_SOURCES)
1272 1273 1274 1275 1276 1277 1278 1279

if WITH_LIBXL
noinst_LTLIBRARIES += libvirt_xenconfig_libxl.la
libvirt_xenconfig_libxl_la_LIBADD = $(LIBXL_LIBS)
libvirt_xenconfig_libxl_la_CFLAGS = \
		-I$(srcdir)/conf -I$(srcdir)/libxl $(AM_CFLAGS)
libvirt_xenconfig_libxl_la_SOURCES = $(XENCONFIG_LIBXL_SOURCES)
endif WITH_LIBXL
J
Jim Fehlig 已提交
1280
endif WITH_XENCONFIG
1281

1282

1283
noinst_LTLIBRARIES += libvirt_driver.la
1284
libvirt_la_BUILT_LIBADD += libvirt_driver.la
1285
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
1286

1287
libvirt_driver_la_CFLAGS = \
1288
		$(GNUTLS_CFLAGS) $(CURL_CFLAGS) $(XDR_CFLAGS) \
1289
		-I$(srcdir)/conf $(AM_CFLAGS)
1290
libvirt_driver_la_LIBADD = \
1291
		$(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS)
1292

1293 1294
# 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.
1295
SYM_FILES = $(USED_SYM_FILES)
1296
USED_SYM_FILES = $(srcdir)/libvirt_private.syms
1297 1298 1299
GENERATED_SYM_FILES = \
	$(ACCESS_DRIVER_SYM_FILES) \
	libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \
1300
	libvirt_admin.syms libvirt_admin.def \
1301
	$(NULL)
1302

1303
if WITH_TEST
D
Daniel P. Berrange 已提交
1304 1305 1306 1307

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

1308
noinst_LTLIBRARIES += libvirt_driver_test.la
1309
libvirt_la_BUILT_LIBADD += libvirt_driver_test.la
1310
libvirt_driver_test_la_CFLAGS = \
1311
		-I$(srcdir)/conf $(AM_CFLAGS)
1312
libvirt_driver_test_la_SOURCES = $(TEST_DRIVER_SOURCES)
1313
endif WITH_TEST
1314 1315

if WITH_REMOTE
1316
noinst_LTLIBRARIES += libvirt_driver_remote.la
1317
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
1318 1319 1320 1321 1322
libvirt_driver_remote_la_CFLAGS = \
		$(GNUTLS_CFLAGS) \
		$(XDR_CFLAGS) \
		-I$(srcdir)/conf \
		-I$(srcdir)/rpc \
1323 1324
		$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
1325 1326 1327 1328
libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) \
                libvirt-net-rpc-client.la \
                libvirt-net-rpc-server.la \
                libvirt-net-rpc.la
1329
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
1330

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

1333 1334
endif WITH_REMOTE

1335
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
1336
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
1337
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1338

1339
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
1340
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
1341
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1342

1343
if WITH_XEN
E
Eric Blake 已提交
1344 1345 1346
noinst_LTLIBRARIES += libvirt_driver_xen_impl.la
libvirt_driver_xen_la_SOURCES =
libvirt_driver_xen_la_LIBADD = libvirt_driver_xen_impl.la
1347
mod_LTLIBRARIES += libvirt_driver_xen.la
E
Eric Blake 已提交
1348
libvirt_driver_xen_la_LIBADD += ../gnulib/lib/libgnu.la
1349
libvirt_driver_xen_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
E
Eric Blake 已提交
1350

1351 1352 1353 1354 1355
libvirt_driver_xen_impl_la_CFLAGS = \
		$(XEN_CFLAGS) \
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
		-I$(srcdir)/xenconfig \
1356
		$(AM_CFLAGS)
E
Eric Blake 已提交
1357
libvirt_driver_xen_impl_la_LDFLAGS = $(AM_LDFLAGS)
P
Pavel Hrdina 已提交
1358
libvirt_driver_xen_impl_la_LIBADD = $(XEN_LIBS) libvirt_xenconfig.la
E
Eric Blake 已提交
1359
libvirt_driver_xen_impl_la_SOURCES = $(XEN_DRIVER_SOURCES)
1360
endif WITH_XEN
1361

1362 1363
if WITH_PHYP
noinst_LTLIBRARIES += libvirt_driver_phyp.la
1364
libvirt_la_BUILT_LIBADD += libvirt_driver_phyp.la
1365 1366
libvirt_driver_phyp_la_LIBADD = $(SSH2_LIBS)
libvirt_driver_phyp_la_CFLAGS = $(SSH2_CFLAGS) \
1367
		-I$(srcdir)/conf $(AM_CFLAGS)
1368
libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES)
1369
endif WITH_PHYP
1370

1371
if WITH_OPENVZ
1372
noinst_LTLIBRARIES += libvirt_driver_openvz.la
1373
libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la
1374
libvirt_driver_openvz_la_CFLAGS = \
1375
		-I$(srcdir)/conf $(AM_CFLAGS)
1376
libvirt_driver_openvz_la_SOURCES = $(OPENVZ_DRIVER_SOURCES)
1377
endif WITH_OPENVZ
1378

1379 1380 1381 1382
if WITH_VMWARE
noinst_LTLIBRARIES += libvirt_driver_vmware.la
libvirt_la_BUILT_LIBADD += libvirt_driver_vmware.la
libvirt_driver_vmware_la_CFLAGS = \
1383
		-I$(srcdir)/conf -I$(srcdir)/vmx $(AM_CFLAGS)
1384
libvirt_driver_vmware_la_SOURCES = $(VMWARE_DRIVER_SOURCES)
1385
endif WITH_VMWARE
1386

1387
if WITH_VBOX
M
Michal Privoznik 已提交
1388
noinst_LTLIBRARIES += \
1389
		libvirt_driver_vbox_impl.la
1390 1391
libvirt_driver_vbox_la_SOURCES =
libvirt_driver_vbox_la_LIBADD = libvirt_driver_vbox_impl.la
M
Michal Privoznik 已提交
1392
mod_LTLIBRARIES += \
1393
		libvirt_driver_vbox.la
1394
libvirt_driver_vbox_la_LIBADD += ../gnulib/lib/libgnu.la
1395
libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1396

1397 1398 1399
libvirt_driver_vbox_impl_la_CFLAGS = \
		-I$(srcdir)/conf \
		$(AM_CFLAGS) \
M
Michal Privoznik 已提交
1400
		-DVBOX_DRIVER
1401
libvirt_driver_vbox_impl_la_LDFLAGS = $(AM_LDFLAGS)
1402 1403
libvirt_driver_vbox_impl_la_LIBADD =  $(DLOPEN_LIBS) \
		$(WIN32_EXTRA_LIBS) \
1404
		$(LIBXML_LIBS)
1405
libvirt_driver_vbox_impl_la_SOURCES = $(VBOX_DRIVER_SOURCES)
1406
endif WITH_VBOX
1407

1408 1409
if WITH_XENAPI
noinst_LTLIBRARIES += libvirt_driver_xenapi.la
1410
libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la
1411
libvirt_driver_xenapi_la_CFLAGS = $(XENAPI_CFLAGS) $(CURL_CFLAGS) \
P
Pavel Hrdina 已提交
1412
		-I$(srcdir)/conf -I$(srcdir)/xenconfig $(AM_CFLAGS)
1413
libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS)
1414
libvirt_driver_xenapi_la_LIBADD = $(XENAPI_LIBS) $(CURL_LIBS)
1415
libvirt_driver_xenapi_la_SOURCES = $(XENAPI_DRIVER_SOURCES)
1416
endif WITH_XENAPI
1417

J
Jim Fehlig 已提交
1418
if WITH_LIBXL
E
Eric Blake 已提交
1419 1420 1421
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 已提交
1422
mod_LTLIBRARIES += libvirt_driver_libxl.la
E
Eric Blake 已提交
1423
libvirt_driver_libxl_la_LIBADD += ../gnulib/lib/libgnu.la
1424
libvirt_driver_libxl_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
E
Eric Blake 已提交
1425

1426 1427 1428 1429 1430 1431
libvirt_driver_libxl_impl_la_CFLAGS = \
		$(LIBXL_CFLAGS) \
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
		-I$(srcdir)/secret \
		-I$(srcdir)/xenconfig \
1432
		$(AM_CFLAGS)
E
Eric Blake 已提交
1433
libvirt_driver_libxl_impl_la_LDFLAGS = $(AM_LDFLAGS)
1434
libvirt_driver_libxl_impl_la_LIBADD = $(LIBXL_LIBS) \
1435
				      libvirt_xenconfig_libxl.la \
1436
				      libvirt_secret.la
E
Eric Blake 已提交
1437
libvirt_driver_libxl_impl_la_SOURCES = $(LIBXL_DRIVER_SOURCES)
1438 1439 1440 1441 1442 1443

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

1444
endif WITH_LIBXL
1445 1446
EXTRA_DIST += libxl/libxl.conf libxl/libvirtd_libxl.aug \
		libxl/test_libvirtd_libxl.aug.in
J
Jim Fehlig 已提交
1447

1448
if WITH_QEMU
E
Eric Blake 已提交
1449 1450 1451
noinst_LTLIBRARIES += libvirt_driver_qemu_impl.la
libvirt_driver_qemu_la_SOURCES =
libvirt_driver_qemu_la_LIBADD = libvirt_driver_qemu_impl.la
1452
mod_LTLIBRARIES += libvirt_driver_qemu.la
E
Eric Blake 已提交
1453
libvirt_driver_qemu_la_LIBADD += ../gnulib/lib/libgnu.la
1454
libvirt_driver_qemu_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
E
Eric Blake 已提交
1455

1456 1457 1458
libvirt_driver_qemu_impl_la_CFLAGS = \
		$(GNUTLS_CFLAGS) \
		$(LIBNL_CFLAGS) \
1459
		$(XDR_CFLAGS) \
1460 1461
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1462
		-I$(srcdir)/secret \
1463
		$(AM_CFLAGS)
E
Eric Blake 已提交
1464
libvirt_driver_qemu_impl_la_LDFLAGS = $(AM_LDFLAGS)
1465
libvirt_driver_qemu_impl_la_LIBADD = $(CAPNG_LIBS) \
1466
                                $(GNUTLS_LIBS) \
1467 1468
				$(LIBNL_LIBS) \
				$(LIBXML_LIBS) \
1469
				libvirt_secret.la \
1470
				$(NULL)
E
Eric Blake 已提交
1471
libvirt_driver_qemu_impl_la_SOURCES = $(QEMU_DRIVER_SOURCES)
1472

A
Amy Griffis 已提交
1473
conf_DATA += qemu/qemu.conf
1474

1475
augeas_DATA += qemu/libvirtd_qemu.aug
1476 1477
augeastest_DATA += test_libvirtd_qemu.aug
CLEANFILES += test_libvirtd_qemu.aug
1478

1479
endif WITH_QEMU
1480
EXTRA_DIST += qemu/qemu.conf qemu/libvirtd_qemu.aug \
1481
		qemu/test_libvirtd_qemu.aug.in qemu/THREADS.txt
1482

1483 1484

if WITH_LXC
E
Eric Blake 已提交
1485 1486 1487
noinst_LTLIBRARIES += libvirt_driver_lxc_impl.la
libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = libvirt_driver_lxc_impl.la
1488
mod_LTLIBRARIES += libvirt_driver_lxc.la
E
Eric Blake 已提交
1489 1490 1491 1492
libvirt_driver_lxc_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_lxc_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)

libvirt_driver_lxc_impl_la_CFLAGS = \
S
Serge Hallyn 已提交
1493
		$(LIBNL_CFLAGS) \
G
Gao feng 已提交
1494
		$(FUSE_CFLAGS) \
P
Pavel Fedin 已提交
1495
		$(XDR_CFLAGS) \
1496 1497
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1498
		$(AM_CFLAGS)
I
ik.nitk 已提交
1499 1500 1501 1502 1503 1504
libvirt_driver_lxc_impl_la_LIBADD = \
               $(CAPNG_LIBS) \
               $(LIBNL_LIBS) \
               $(LIBXML_LIBS) \
               $(FUSE_LIBS)

1505
if WITH_BLKID
E
Eric Blake 已提交
1506 1507
libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS)
1508
endif WITH_BLKID
1509
libvirt_driver_lxc_impl_la_LIBADD += $(SECDRIVER_LIBS)
E
Eric Blake 已提交
1510
libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES)
A
Amy Griffis 已提交
1511 1512 1513

conf_DATA += lxc/lxc.conf

1514
augeas_DATA += lxc/libvirtd_lxc.aug
1515 1516
augeastest_DATA += test_libvirtd_lxc.aug
CLEANFILES += test_libvirtd_lxc.aug
1517

1518
endif WITH_LXC
1519
EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in
1520

1521
if WITH_UML
E
Eric Blake 已提交
1522 1523 1524
noinst_LTLIBRARIES += libvirt_driver_uml_impl.la
libvirt_driver_uml_la_SOURCES =
libvirt_driver_uml_la_LIBADD = libvirt_driver_uml_impl.la
1525
mod_LTLIBRARIES += libvirt_driver_uml.la
E
Eric Blake 已提交
1526
libvirt_driver_uml_la_LIBADD += ../gnulib/lib/libgnu.la
1527
libvirt_driver_uml_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
E
Eric Blake 已提交
1528

1529
libvirt_driver_uml_impl_la_CFLAGS = \
1530 1531
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1532
		$(AM_CFLAGS)
E
Eric Blake 已提交
1533
libvirt_driver_uml_impl_la_LDFLAGS = $(AM_LDFLAGS)
1534
# libvirt_driver_uml_impl_la_LIBADD =
E
Eric Blake 已提交
1535
libvirt_driver_uml_impl_la_SOURCES = $(UML_DRIVER_SOURCES)
1536
endif WITH_UML
1537

D
Daniel Veillard 已提交
1538

1539
BUILT_SOURCES += $(ESX_DRIVER_GENERATED)
D
Daniel Veillard 已提交
1540

1541 1542
ESX_GENERATED_STAMP = .esx_vi_generator.stamp

E
Eric Blake 已提交
1543 1544
EXTRA_DIST += $(ESX_GENERATED_STAMP)

1545 1546 1547
$(ESX_DRIVER_GENERATED): $(ESX_GENERATED_STAMP)

$(ESX_GENERATED_STAMP): $(srcdir)/esx/esx_vi_generator.input \
1548
                         $(srcdir)/esx/esx_vi_generator.py
1549 1550 1551 1552 1553
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/esx/esx_vi_generator.py \
	  && touch $@

MAINTAINERCLEANFILES += $(ESX_DRIVER_GENERATED) $(ESX_GENERATED_STAMP)

D
Daniel Veillard 已提交
1554

1555 1556
if WITH_ESX
noinst_LTLIBRARIES += libvirt_driver_esx.la
1557
libvirt_la_BUILT_LIBADD += libvirt_driver_esx.la
1558
libvirt_driver_esx_la_CFLAGS = $(CURL_CFLAGS) \
1559
		-I$(srcdir)/conf -I$(srcdir)/vmx $(AM_CFLAGS)
1560
libvirt_driver_esx_la_LDFLAGS = $(AM_LDFLAGS)
1561
libvirt_driver_esx_la_LIBADD = $(CURL_LIBS)
1562
libvirt_driver_esx_la_SOURCES = $(ESX_DRIVER_SOURCES)
1563
libvirt_driver_esx_la_DEPENDENCIES = $(ESX_DRIVER_GENERATED)
1564
endif WITH_ESX
1565

M
Matthias Bolte 已提交
1566

1567 1568
BUILT_SOURCES += $(HYPERV_DRIVER_GENERATED)

1569 1570
HYPERV_GENERATED_STAMP = .hyperv_wmi_generator.stamp

E
Eric Blake 已提交
1571 1572
EXTRA_DIST += $(HYPERV_GENERATED_STAMP)

1573 1574 1575
$(HYPERV_DRIVER_GENERATED): $(HYPERV_GENERATED_STAMP)

$(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \
1576
                            $(srcdir)/hyperv/hyperv_wmi_generator.py
1577 1578
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) \
	  $(srcdir)/hyperv/hyperv_wmi_generator.py \
1579 1580 1581
	  && touch $@

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

M
Matthias Bolte 已提交
1583 1584 1585 1586
if WITH_HYPERV
noinst_LTLIBRARIES += libvirt_driver_hyperv.la
libvirt_la_BUILT_LIBADD += libvirt_driver_hyperv.la
libvirt_driver_hyperv_la_CFLAGS = $(OPENWSMAN_CFLAGS) \
1587
		-I$(srcdir)/conf $(AM_CFLAGS)
M
Matthias Bolte 已提交
1588 1589 1590
libvirt_driver_hyperv_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_hyperv_la_LIBADD = $(OPENWSMAN_LIBS)
libvirt_driver_hyperv_la_SOURCES = $(HYPERV_DRIVER_SOURCES)
1591
endif WITH_HYPERV
M
Matthias Bolte 已提交
1592

1593
if WITH_VZ
1594 1595 1596 1597 1598 1599 1600
noinst_LTLIBRARIES += libvirt_driver_vz_impl.la
libvirt_driver_vz_la_SOURCES =
libvirt_driver_vz_la_LIBADD = libvirt_driver_vz_impl.la
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)
libvirt_driver_vz_impl_la_CFLAGS = \
1601 1602 1603
		-I$(srcdir)/conf \
		-I$(srcdir)/access \
		$(AM_CFLAGS) \
1604
		$(PARALLELS_SDK_CFLAGS) $(LIBNL_CFLAGS)
1605 1606
libvirt_driver_vz_impl_la_SOURCES = $(VZ_DRIVER_SOURCES)
libvirt_driver_vz_impl_la_LIBADD =  $(PARALLELS_SDK_LIBS) $(LIBNL_LIBS)
1607
endif WITH_VZ
D
Dmitry Guryanov 已提交
1608

R
Roman Bogorodskiy 已提交
1609 1610 1611 1612 1613 1614 1615 1616 1617
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
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)

libvirt_driver_bhyve_impl_la_CFLAGS = \
1618 1619
	-I$(srcdir)/access \
	-I$(srcdir)/conf \
R
Roman Bogorodskiy 已提交
1620 1621 1622
	$(AM_CFLAGS)
libvirt_driver_bhyve_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_bhyve_impl_la_SOURCES = $(BHYVE_DRIVER_SOURCES)
1623 1624 1625 1626

conf_DATA += bhyve/bhyve.conf
augeas_DATA += bhyve/libvirtd_bhyve.aug
augeastest_DATA += test_libvirtd_bhyve.aug
R
Roman Bogorodskiy 已提交
1627
endif WITH_BHYVE
1628 1629 1630
EXTRA_DIST += bhyve/bhyve.conf \
	bhyve/libvirtd_bhyve.aug \
	bhyve/test_libvirtd_bhyve.aug.in
R
Roman Bogorodskiy 已提交
1631

1632
if WITH_NETWORK
E
Eric Blake 已提交
1633 1634 1635
noinst_LTLIBRARIES += libvirt_driver_network_impl.la
libvirt_driver_network_la_SOURCES =
libvirt_driver_network_la_LIBADD = libvirt_driver_network_impl.la
1636
mod_LTLIBRARIES += libvirt_driver_network.la
1637 1638 1639 1640
libvirt_driver_network_la_LIBADD += ../gnulib/lib/libgnu.la \
	$(LIBNL_LIBS) \
	$(DBUS_LIBS) \
	$(NULL)
E
Eric Blake 已提交
1641 1642 1643
libvirt_driver_network_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)

libvirt_driver_network_impl_la_CFLAGS = \
1644 1645
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1646 1647
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1648
		$(AM_CFLAGS)
E
Eric Blake 已提交
1649
libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
1650
libvirt_driver_network_impl_la_LIBADD  = $(DBUS_LIBS)
1651
endif WITH_NETWORK
1652 1653 1654
EXTRA_DIST += network/default.xml


1655
if WITH_INTERFACE
1656
mod_LTLIBRARIES += libvirt_driver_interface.la
1657
libvirt_driver_interface_la_CFLAGS = \
1658 1659
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1660
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1661
libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS)
1662 1663 1664 1665
libvirt_driver_interface_la_LIBADD =
if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
1666
endif WITH_NETCF
1667
if WITH_UDEV
1668 1669
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
1670
endif WITH_UDEV
1671
libvirt_driver_interface_la_LIBADD += ../gnulib/lib/libgnu.la
1672 1673
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
1674
endif WITH_INTERFACE
D
Daniel Veillard 已提交
1675

D
Daniel P. Berrange 已提交
1676
if WITH_SECRETS
1677
mod_LTLIBRARIES += libvirt_driver_secret.la
1678
libvirt_driver_secret_la_CFLAGS = \
1679 1680
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1681
		$(AM_CFLAGS)
1682
libvirt_driver_secret_la_LIBADD = ../gnulib/lib/libgnu.la
1683
libvirt_driver_secret_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1684
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
1685
endif WITH_SECRETS
1686

1687
# Needed to keep automake quiet about conditionals
1688 1689
libvirt_driver_storage_impl_la_SOURCES =
libvirt_driver_storage_impl_la_CFLAGS = \
1690 1691
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1692
		-I$(srcdir)/secret \
1693
		$(AM_CFLAGS)
1694 1695
libvirt_driver_storage_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_storage_impl_la_LIBADD =
1696
libvirt_driver_storage_impl_la_LIBADD += $(SECDRIVER_LIBS) $(LIBXML_LIBS)
1697
if WITH_BLKID
1698 1699
libvirt_driver_storage_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(BLKID_LIBS)
1700
endif WITH_BLKID
1701 1702 1703 1704

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

1705
if WITH_STORAGE
1706 1707 1708
noinst_LTLIBRARIES += libvirt_driver_storage_impl.la
libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_LIBADD = libvirt_driver_storage_impl.la
1709
mod_LTLIBRARIES += libvirt_driver_storage.la
1710
libvirt_driver_storage_la_LIBADD += ../gnulib/lib/libgnu.la
1711
libvirt_driver_storage_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1712
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
1713 1714 1715


libvirt_storage_backend_fs_la_SOURCES = $(STORAGE_DRIVER_FS_SOURCES)
1716
libvirt_storage_backend_fs_la_CFLAGS = \
1717 1718 1719
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1720 1721 1722
storagebackend_LTLIBRARIES += libvirt_storage_backend_fs.la
libvirt_storage_backend_fs_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
1723
endif WITH_STORAGE
1724

1725
if WITH_STORAGE_LVM
1726 1727 1728 1729 1730 1731
libvirt_storage_backend_logical_la_SOURCES = \
	$(STORAGE_DRIVER_LVM_SOURCES)
libvirt_storage_backend_logical_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1732 1733 1734
storagebackend_LTLIBRARIES += libvirt_storage_backend_logical.la
libvirt_storage_backend_logical_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
1735
endif WITH_STORAGE_LVM
1736

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

1745 1746 1747
storagebackend_LTLIBRARIES += libvirt_storage_backend_iscsi.la
libvirt_storage_backend_iscsi_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
1748
endif WITH_STORAGE_ISCSI
1749

1750
if WITH_STORAGE_SCSI
1751 1752 1753 1754 1755
libvirt_storage_backend_scsi_la_SOURCES = $(STORAGE_DRIVER_SCSI_SOURCES)
libvirt_storage_backend_scsi_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1756 1757 1758
storagebackend_LTLIBRARIES += libvirt_storage_backend_scsi.la
libvirt_storage_backend_scsi_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
1759
endif WITH_STORAGE_SCSI
1760

D
Dave Allan 已提交
1761
if WITH_STORAGE_MPATH
1762 1763 1764
libvirt_storage_backend_mpath_la_SOURCES = \
	$(STORAGE_DRIVER_MPATH_SOURCES)
libvirt_storage_backend_mpath_la_LIBADD = $(DEVMAPPER_LIBS)
1765
libvirt_storage_backend_mpath_la_CFLAGS = \
1766 1767 1768 1769
	-I$(srcdir)/conf \
	$(DEVMAPPER_CFLAGS) \
	$(AM_CFLAGS)

1770 1771 1772
storagebackend_LTLIBRARIES += libvirt_storage_backend_mpath.la
libvirt_storage_backend_mpath_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
1773
endif WITH_STORAGE_MPATH
D
Dave Allan 已提交
1774

1775
if WITH_STORAGE_DISK
1776
libvirt_storage_backend_disk_la_SOURCES = $(STORAGE_DRIVER_DISK_SOURCES)
1777
libvirt_storage_backend_disk_la_CFLAGS = \
1778 1779 1780
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1781 1782 1783
storagebackend_LTLIBRARIES += libvirt_storage_backend_disk.la
libvirt_storage_backend_disk_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
1784
endif WITH_STORAGE_DISK
1785

1786
if WITH_STORAGE_RBD
1787 1788 1789 1790 1791 1792 1793
libvirt_storage_backend_rbd_la_SOURCES = $(STORAGE_DRIVER_RBD_SOURCES)
libvirt_storage_backend_rbd_la_LIBADD = $(LIBRBD_LIBS)
libvirt_storage_backend_rbd_la_CFLAGS = \
	-I$(srcdir)/conf \
	-I$(srcdir)/secret \
	$(AM_CFLAGS)

1794 1795 1796
storagebackend_LTLIBRARIES += libvirt_storage_backend_rbd.la
libvirt_storage_backend_rbd_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
1797
endif WITH_STORAGE_RBD
1798

1799
if WITH_STORAGE_SHEEPDOG
1800 1801 1802 1803 1804 1805
libvirt_storage_backend_sheepdog_la_SOURCES = \
	$(STORAGE_DRIVER_SHEEPDOG_SOURCES)
libvirt_storage_backend_sheepdog_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816
libvirt_storage_backend_sheepdog_priv_la_SOURCES = \
	$(STORAGE_DRIVER_SHEEPDOG_SOURCES) \
	$(STORAGE_DRIVER_BACKEND_SOURCES)
libvirt_storage_backend_sheepdog_priv_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)
noinst_LTLIBRARIES += libvirt_storage_backend_sheepdog_priv.la

storagebackend_LTLIBRARIES += libvirt_storage_backend_sheepdog.la
libvirt_storage_backend_sheepdog_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
1817
endif WITH_STORAGE_SHEEPDOG
1818

1819
if WITH_STORAGE_GLUSTER
1820 1821 1822 1823 1824 1825 1826 1827
libvirt_storage_backend_gluster_la_SOURCES = \
	$(STORAGE_DRIVER_GLUSTER_SOURCES)
libvirt_storage_backend_gluster_la_LIBADD = $(GLUSTERFS_LIBS)
libvirt_storage_backend_gluster_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(GLUSTERFS_CFLAGS) \
	$(AM_CFLAGS)

1828 1829 1830
storagebackend_LTLIBRARIES += libvirt_storage_backend_gluster.la
libvirt_storage_backend_gluster_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
1831 1832
endif WITH_STORAGE_GLUSTER

R
Roman Bogorodskiy 已提交
1833
if WITH_STORAGE_ZFS
1834
libvirt_storage_backend_zfs_la_SOURCES = $(STORAGE_DRIVER_ZFS_SOURCES)
1835
libvirt_storage_backend_zfs_la_CFLAGS = \
1836 1837 1838
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1839 1840 1841
storagebackend_LTLIBRARIES += libvirt_storage_backend_zfs.la
libvirt_storage_backend_zfs_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
R
Roman Bogorodskiy 已提交
1842 1843
endif WITH_STORAGE_ZFS

1844
if WITH_STORAGE_VSTORAGE
1845 1846
libvirt_storage_backend_vstorage_la_SOURCES = \
	$(STORAGE_DRIVER_VSTORAGE_SOURCES)
1847
libvirt_storage_backend_vstorage_la_CFLAGS = \
1848 1849 1850
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1851 1852 1853
storagebackend_LTLIBRARIES += libvirt_storage_backend_vstorage.la
libvirt_storage_backend_vstorage_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
1854 1855
endif WITH_STORAGE_VSTORAGE

1856 1857 1858 1859 1860
if WITH_NODE_DEVICES
# Needed to keep automake quiet about conditionals
mod_LTLIBRARIES += libvirt_driver_nodedev.la
libvirt_driver_nodedev_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES)

1861
libvirt_driver_nodedev_la_CFLAGS = \
1862 1863
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1864
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1865
libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS)
1866
libvirt_driver_nodedev_la_LIBADD =
1867

D
Doug Goldstein 已提交
1868
if WITH_LIBVIRTD
1869
if WITH_HAL
1870 1871
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS)
1872
libvirt_driver_nodedev_la_LIBADD += $(HAL_LIBS)
1873
endif WITH_HAL
1874
if WITH_UDEV
1875
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES)
1876
libvirt_driver_nodedev_la_CFLAGS += $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS)
1877
libvirt_driver_nodedev_la_LIBADD += $(UDEV_LIBS) $(PCIACCESS_LIBS)
1878 1879
endif WITH_UDEV
endif WITH_LIBVIRTD
1880

1881
libvirt_driver_nodedev_la_LIBADD += ../gnulib/lib/libgnu.la
1882
libvirt_driver_nodedev_la_LDFLAGS += -module -avoid-version
1883
endif WITH_NODE_DEVICES
1884 1885


1886
if WITH_NWFILTER
1887 1888 1889
noinst_LTLIBRARIES += libvirt_driver_nwfilter_impl.la
libvirt_driver_nwfilter_la_SOURCES =
libvirt_driver_nwfilter_la_LIBADD = libvirt_driver_nwfilter_impl.la
1890
mod_LTLIBRARIES += libvirt_driver_nwfilter.la
1891
libvirt_driver_nwfilter_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1892
libvirt_driver_nwfilter_impl_la_CFLAGS = \
1893 1894 1895
		$(LIBPCAP_CFLAGS) \
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1896 1897
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1898
		$(AM_CFLAGS)
1899 1900 1901 1902 1903 1904 1905 1906
libvirt_driver_nwfilter_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_nwfilter_impl_la_LIBADD = \
		$(LIBPCAP_LIBS) \
		$(LIBNL_LIBS) \
		$(DBUS_LIBS)
libvirt_driver_nwfilter_impl_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_nwfilter_impl_la_LDFLAGS += -module -avoid-version
libvirt_driver_nwfilter_impl_la_SOURCES = $(NWFILTER_DRIVER_SOURCES)
1907
endif WITH_NWFILTER
1908 1909


1910 1911 1912 1913
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 = \
1914
		-I$(srcdir)/conf $(AM_CFLAGS)
1915
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
1916
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
1917
if WITH_SECDRIVER_SELINUX
1918 1919
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
1920
endif WITH_SECDRIVER_SELINUX
J
Jamie Strandboge 已提交
1921
if WITH_SECDRIVER_APPARMOR
1922 1923
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
1924
endif WITH_SECDRIVER_APPARMOR
1925

1926 1927
libvirt_driver_access_la_SOURCES = \
	$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
1928 1929 1930
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
1931
		-I$(srcdir)/conf $(AM_CFLAGS)
1932 1933 1934
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD =

1935 1936
EXTRA_DIST += access/genpolkit.pl

1937 1938 1939 1940
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
    $(srcdir)/access/genpolkit.pl Makefile.am
	$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@

1941 1942 1943 1944
if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)

polkitactiondir = $(datadir)/polkit-1/actions
1945
if WITH_LIBVIRTD
1946
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
1947
endif WITH_LIBVIRTD
1948 1949 1950

CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
1951
else ! WITH_POLKIT1
1952
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
1953
endif ! WITH_POLKIT1
1954

1955

1956 1957
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971

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

1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984
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 已提交
1985
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
1986 1987
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1988 1989 1990
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
1991 1992
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1993 1994
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
	  > $(srcdir)/access/viraccessapicheck.c
1995

E
Eric Blake 已提交
1996
access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
1997 1998
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1999 2000 2001
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheckqemu.h
access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
2002 2003
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
2004 2005
	  qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h \
	  > $(srcdir)/access/viraccessapicheckqemu.c
2006

E
Eric Blake 已提交
2007
access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
2008 2009
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
2010 2011 2012
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/access/viraccessapichecklxc.h
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
2013 2014
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
2015 2016
	  lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \
	  > $(srcdir)/access/viraccessapichecklxc.c
2017

2018
# Add all conditional sources just in case...
2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063
EXTRA_DIST += \
		$(TEST_DRIVER_SOURCES) \
		$(TEST_DRIVER_ASSETS) \
		$(REMOTE_DRIVER_SOURCES) \
		$(XEN_DRIVER_SOURCES) \
		$(QEMU_DRIVER_SOURCES) \
		$(LXC_DRIVER_SOURCES) \
		$(UML_DRIVER_SOURCES) \
		$(OPENVZ_DRIVER_SOURCES) \
		$(PHYP_DRIVER_SOURCES) \
		$(VBOX_DRIVER_SOURCES) \
		$(XENAPI_DRIVER_SOURCES) \
		$(LIBXL_DRIVER_SOURCES) \
		$(ESX_DRIVER_SOURCES) \
		$(ESX_DRIVER_EXTRA_DIST) \
		$(HYPERV_DRIVER_SOURCES) \
		$(HYPERV_DRIVER_EXTRA_DIST) \
		$(VZ_DRIVER_SOURCES) \
		$(BHYVE_DRIVER_SOURCES) \
		$(NETWORK_DRIVER_SOURCES) \
		$(INTERFACE_DRIVER_SOURCES) \
		$(STORAGE_DRIVER_SOURCES) \
		$(STORAGE_DRIVER_FS_SOURCES) \
		$(STORAGE_DRIVER_LVM_SOURCES) \
		$(STORAGE_DRIVER_ISCSI_SOURCES) \
		$(STORAGE_DRIVER_SCSI_SOURCES) \
		$(STORAGE_DRIVER_MPATH_SOURCES) \
		$(STORAGE_DRIVER_DISK_SOURCES) \
		$(STORAGE_DRIVER_RBD_SOURCES) \
		$(STORAGE_DRIVER_SHEEPDOG_SOURCES) \
		$(STORAGE_DRIVER_GLUSTER_SOURCES) \
		$(STORAGE_DRIVER_ZFS_SOURCES) \
		$(STORAGE_DRIVER_VSTORAGE_SOURCES) \
		$(NODE_DEVICE_DRIVER_SOURCES) \
		$(NODE_DEVICE_DRIVER_HAL_SOURCES) \
		$(NODE_DEVICE_DRIVER_UDEV_SOURCES) \
		$(NWFILTER_DRIVER_SOURCES) \
		$(SECURITY_DRIVER_SELINUX_SOURCES) \
		$(SECURITY_DRIVER_APPARMOR_SOURCES) \
		$(SECRET_DRIVER_SOURCES) \
		$(SECRET_UTIL_SOURCES) \
		$(VBOX_DRIVER_EXTRA_DIST) \
		$(VMWARE_DRIVER_SOURCES) \
		$(XENCONFIG_SOURCES) \
		$(XENCONFIG_LIBXL_SOURCES) \
2064
		$(ACCESS_DRIVER_POLKIT_POLICY)
2065

2066 2067
check-local: check-augeas

2068 2069 2070 2071 2072
.PHONY: check-augeas \
	check-augeas-qemu \
	check-augeas-lxc \
	check-augeas-sanlock \
	check-augeas-lockd \
2073
	check-augeas-libxl \
2074
	check-augeas-bhyve \
2075
	$(NULL)
2076

2077
check-augeas: check-augeas-qemu check-augeas-lxc check-augeas-sanlock \
2078
	check-augeas-lockd check-augeas-virtlockd check-augeas-libxl \
2079
	check-augeas-bhyve check-augeas-virtlogd
2080

2081
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
2082
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
2083

2084
if WITH_QEMU
2085 2086
test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
		$(srcdir)/qemu/qemu.conf $(AUG_GENTEST)
E
Eric Blake 已提交
2087
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
2088

2089
check-augeas-qemu: test_libvirtd_qemu.aug
2090
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
2091
	    '$(AUGPARSE)' -I $(srcdir)/qemu test_libvirtd_qemu.aug; \
2092
	fi
2093
else ! WITH_QEMU
2094
check-augeas-qemu:
2095
endif ! WITH_QEMU
2096

2097
if WITH_LXC
2098 2099
test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
		$(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
E
Eric Blake 已提交
2100
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
2101

2102
check-augeas-lxc: test_libvirtd_lxc.aug
2103
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
2104
	    '$(AUGPARSE)' -I $(srcdir)/lxc test_libvirtd_lxc.aug; \
2105
	fi
2106
else ! WITH_LXC
2107
check-augeas-lxc:
2108
endif ! WITH_LXC
2109

2110
if WITH_SANLOCK
2111 2112
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
2113
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
2114

2115
check-augeas-sanlock: test_libvirt_sanlock.aug
2116
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
2117
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
2118
	fi
2119
else ! WITH_SANLOCK
2120
check-augeas-sanlock:
2121
endif ! WITH_SANLOCK
2122

2123
if WITH_QEMU
2124 2125 2126
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 $< $@
2127 2128 2129
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
2130

2131 2132
test_virtlockd.aug: locking/test_virtlockd.aug.in \
		locking/virtlockd.conf $(AUG_GENTEST)
2133
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
2134

2135
if WITH_QEMU
2136 2137 2138 2139
check-augeas-lockd: test_libvirt_lockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_lockd.aug; \
	fi
2140 2141 2142
else ! WITH_QEMU
check-augeas-lockd:
endif ! WITH_QEMU
2143

2144 2145 2146 2147 2148
check-augeas-virtlockd: test_virtlockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
	fi

2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161
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

2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174
if WITH_BHYVE
test_libvirtd_bhyve.aug: bhyve/test_libvirtd_bhyve.aug.in \
		$(srcdir)/bhyve/bhyve.conf $(AUG_GENTEST)
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/bhyve/bhyve.conf $< $@

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

2175 2176 2177 2178 2179 2180 2181 2182 2183
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

2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202
#
# 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.
#

2203
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
2204

2205
if WITH_LINUX
2206
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
2207
else ! WITH_LINUX
2208
SYM_FILES += $(srcdir)/libvirt_linux.syms
2209
endif ! WITH_LINUX
2210

2211
if WITH_ESX
2212
USED_SYM_FILES += $(srcdir)/libvirt_esx.syms
2213
else ! WITH_ESX
2214
SYM_FILES += $(srcdir)/libvirt_esx.syms
2215
endif ! WITH_ESX
2216

E
Eric Blake 已提交
2217 2218 2219 2220 2221 2222
if WITH_REMOTE
USED_SYM_FILES += $(srcdir)/libvirt_remote.syms
else ! WITH_REMOTE
SYM_FILES += $(srcdir)/libvirt_remote.syms
endif ! WITH_REMOTE

2223
if WITH_OPENVZ
2224
USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms
2225
else ! WITH_OPENVZ
2226
SYM_FILES += $(srcdir)/libvirt_openvz.syms
2227
endif ! WITH_OPENVZ
2228

2229
if WITH_VMX
2230
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
2231
else ! WITH_VMX
2232
SYM_FILES += $(srcdir)/libvirt_vmx.syms
2233
endif ! WITH_VMX
2234

2235 2236 2237 2238 2239 2240
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 已提交
2241 2242 2243 2244 2245
if WITH_XENCONFIG
USED_SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
else ! WITH_XENCONFIG
SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
endif ! WITH_XENCONFIG
2246

2247
if WITH_SASL
2248
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
2249
else ! WITH_SASL
2250
SYM_FILES += $(srcdir)/libvirt_sasl.syms
2251
endif ! WITH_SASL
E
Eric Blake 已提交
2252

2253 2254
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2255
else ! WITH_GNUTLS
2256
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2257
endif ! WITH_GNUTLS
2258

2259
if WITH_SSH2
2260
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2261
else ! WITH_SSH2
2262
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2263
endif ! WITH_SSH2
2264

2265
if WITH_ATOMIC_OPS_PTHREAD
2266
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
2267
else ! WITH_ATOMIC_OPS_PTHREAD
2268
SYM_FILES += $(srcdir)/libvirt_atomic.syms
2269
endif ! WITH_ATOMIC_OPS_PTHREAD
2270

2271 2272 2273 2274 2275 2276
if WITH_LIBSSH
USED_SYM_FILES += $(srcdir)/libvirt_libssh.syms
else ! WITH_LIBSSH
SYM_FILES += $(srcdir)/libvirt_libssh.syms
endif ! WITH_LIBSSH

2277
EXTRA_DIST += \
2278 2279 2280 2281 2282 2283
	libvirt_public.syms \
	libvirt_lxc.syms \
	libvirt_qemu.syms \
	libvirt_admin_public.syms \
	$(SYM_FILES) \
	$(ADMIN_SYM_FILES) \
2284
	$(NULL)
2285

2286
BUILT_SOURCES += $(GENERATED_SYM_FILES)
2287

2288 2289
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(ACCESS_DRIVER_SYM_FILES) \
2290
		$(top_builddir)/config.status
2291 2292 2293 2294 2295 2296
	$(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 && \
2297
	cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
2298 2299
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
2300
	mv $@-tmp libvirt.syms
2301

2302
%.def: %.syms
2303 2304
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
2305
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d' \
2306
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
2307
	chmod a-w $@-tmp && \
2308
	mv $@-tmp $@
2309

2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322
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

2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343

admin/admin_server_dispatch.c: admin/admin_server_dispatch_stubs.h

noinst_LTLIBRARIES += libvirt_driver_admin.la
libvirt_driver_admin_la_SOURCES = \
		admin/admin_protocol.c \
		admin/admin_protocol.h \
		admin/admin_server.c \
		admin/admin_server.h \
		admin/admin_server_dispatch.c \
		admin/admin_server_dispatch.h \
		admin/admin_server_dispatch_stubs.h \
		$(NULL)
libvirt_driver_admin_la_CFLAGS = \
		$(AM_CFLAGS) \
		-I$(top_srcdir)/src/util \
		-I$(top_srcdir)/src/admin \
		$(NULL)
libvirt_driver_admin_la_LIBADD = ../gnulib/lib/libgnu.la
libvirt_driver_admin_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)

2344 2345 2346 2347
# 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 已提交
2348 2349
lib_LTLIBRARIES += libvirt-admin.la
libvirt_admin_la_SOURCES = \
2350 2351
		libvirt-admin.c \
		$(ADMIN_PROTOCOL_GENERATED) \
M
Martin Kletzander 已提交
2352 2353 2354
		$(DATATYPES_SOURCES)

libvirt_admin_la_LDFLAGS = \
2355 2356
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_ADMIN_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
2357
		$(AM_LDFLAGS)
M
Martin Kletzander 已提交
2358 2359

libvirt_admin_la_LIBADD = \
2360
		libvirt.la \
M
Martin Kletzander 已提交
2361 2362 2363
		$(CYGWIN_EXTRA_LIBADD)

libvirt_admin_la_CFLAGS = \
2364 2365 2366
		$(AM_CFLAGS) \
		-I$(srcdir)/remote \
		-I$(srcdir)/rpc \
M
Martin Kletzander 已提交
2367 2368 2369
		-I$(srcdir)/admin

libvirt_admin_la_CFLAGS += \
2370 2371 2372 2373 2374 2375
		$(XDR_CFLAGS) \
		$(CAPNG_CFLAGS) \
		$(YAJL_CFLAGS) \
		$(SSH2_CFLAGS) \
		$(SASL_CFLAGS) \
		$(GNUTLS_CFLAGS) \
2376
		$(LIBSSH_CFLAGS)
M
Martin Kletzander 已提交
2377 2378

libvirt_admin_la_LIBADD += \
2379 2380 2381 2382 2383 2384 2385
		$(CAPNG_LIBS) \
		$(YAJL_LIBS) \
		$(DEVMAPPER_LIBS) \
		$(LIBXML_LIBS) \
		$(SSH2_LIBS) \
		$(SASL_LIBS) \
		$(GNUTLS_LIBS) \
2386
		$(LIBSSH_LIBS)
M
Martin Kletzander 已提交
2387

2388 2389
ADMIN_SYM_FILES = $(srcdir)/libvirt_admin_private.syms

M
Martin Kletzander 已提交
2390 2391 2392 2393
if WITH_DTRACE_PROBES
libvirt_admin_la_LIBADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

2394 2395
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
2396 2397 2398 2399 2400 2401
libvirt_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(LIBVIRT_NODELETE) \
		$(AM_LDFLAGS) \
		$(NULL)
2402
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
2403
libvirt_la_LIBADD += \
2404
		    $(DRIVER_MODULES_LIBS) \
2405
		    $(CYGWIN_EXTRA_LIBADD)
2406
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
2407 2408 2409 2410 2411 2412
# 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)
2413

2414
if WITH_DTRACE_PROBES
2415
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
2416
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
2417
nodist_libvirt_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2418
if WITH_REMOTE
E
Eric Blake 已提交
2419
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2420
endif WITH_REMOTE
2421
DTRACE2SYSTEMTAP_FLAGS = --with-modules
2422

2423 2424 2425
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

if WITH_QEMU
2426
libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.lo
2427
nodist_libvirt_driver_qemu_la_SOURCES = libvirt_qemu_probes.h
2428
BUILT_SOURCES += libvirt_qemu_probes.h
2429
endif WITH_QEMU
2430 2431

tapsetdir = $(datadir)/systemtap/tapset
2432
tapset_DATA = libvirt_probes.stp libvirt_qemu_probes.stp libvirt_functions.stp
2433

2434
%_probes.h: %_probes.d
2435 2436
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

E
Eric Blake 已提交
2437
.PRECIOUS: %_probes.o
2438
%_probes.o: %_probes.d
2439 2440
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

2441 2442 2443 2444 2445 2446 2447 2448 2449
%_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 已提交
2450
# Keep this list synced with PROTOCOL_STRUCTS
J
Jiri Denemark 已提交
2451 2452 2453
RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
2454
		  $(srcdir)/remote/lxc_protocol.x \
2455 2456
		  $(srcdir)/remote/qemu_protocol.x \
		  $(srcdir)/lxc/lxc_monitor_protocol.x \
M
Martin Kletzander 已提交
2457 2458
		  $(srcdir)/locking/lock_protocol.x \
		  $(srcdir)/admin/admin_protocol.x
2459 2460

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

2463 2464
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl \
		$(top_builddir)/config.status
2465
	$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
2466
	  $(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
2467

2468
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
2469
              libvirt_qemu_probes.h libvirt_qemu_probes.o \
2470
              libvirt_qemu_probes.lo\
2471 2472
              libvirt_functions.stp libvirt_probes.stp \
              libvirt_qemu_probes.stp
2473
endif WITH_DTRACE_PROBES
2474

2475
EXTRA_DIST += libvirt_probes.d libvirt_qemu_probes.d
2476

C
Chris Lalancette 已提交
2477
libvirt_qemu_la_SOURCES = libvirt-qemu.c
D
Daniel P. Berrange 已提交
2478 2479 2480 2481 2482
libvirt_qemu_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
2483
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
C
Chris Lalancette 已提交
2484
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
2485

2486
libvirt_lxc_la_SOURCES = libvirt-lxc.c
D
Daniel P. Berrange 已提交
2487 2488 2489 2490 2491
libvirt_lxc_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
2492 2493 2494
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)

2495 2496 2497 2498 2499 2500 2501
# 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
2502
if WITH_SETUID_RPC_CLIENT
2503 2504
noinst_LTLIBRARIES += libvirt-setuid-rpc-client.la

2505 2506
libvirt_setuid_rpc_client_la_SOURCES = \
		util/viralloc.c \
2507
		util/virarch.c \
2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572
		util/viratomic.c \
		util/viratomic.h \
		util/virbitmap.c \
		util/virbuffer.c \
		util/vircgroup.c \
		util/vircommand.c \
		util/virconf.c \
		util/virdbus.c \
		util/virerror.c \
		util/virevent.c \
		util/vireventpoll.c \
		util/virfile.c \
		util/virgettext.c \
		util/virhash.c \
		util/virhashcode.c \
		util/virhostcpu.c \
		util/virjson.c \
		util/virlog.c \
		util/virobject.c \
		util/virpidfile.c \
		util/virprocess.c \
		util/virrandom.c \
		util/virsocketaddr.c \
		util/virstring.c \
		util/virsystemd.c \
		util/virtime.c \
		util/virthread.c \
		util/virthreadjob.c \
		util/virtypedparam.c \
		util/viruri.c \
		util/virutil.c \
		util/viruuid.c \
		conf/domain_event.c \
		conf/network_event.c \
		conf/object_event.c \
		conf/storage_event.c \
		conf/node_device_event.c \
		conf/secret_event.c \
		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 \
		libvirt-domain.c \
		libvirt-domain-snapshot.c \
		libvirt-host.c \
		libvirt-interface.c \
		libvirt-network.c \
		libvirt-nodedev.c \
		libvirt-nwfilter.c \
		libvirt-secret.c \
		libvirt-storage.c \
		libvirt-stream.c \
		libvirt-lxc.c \
2573 2574
		$(NULL)

2575 2576 2577 2578
libvirt_setuid_rpc_client_la_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(LIBXML_LIBS) \
		$(SECDRIVER_LIBS) \
2579
		$(NULL)
2580 2581 2582 2583 2584 2585 2586
libvirt_setuid_rpc_client_la_CFLAGS = \
		-DLIBVIRT_SETUID_RPC_CLIENT \
		-I$(srcdir)/conf \
		-I$(srcdir)/rpc \
		$(AM_CFLAGS) \
		$(SECDRIVER_CFLAGS) \
		$(XDR_CFLAGS) \
2587
		$(NULL)
2588
endif WITH_SETUID_RPC_CLIENT
2589

2590 2591 2592
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

2593
if WITH_LIBVIRTD
2594 2595 2596 2597 2598
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
		$(LOCK_DRIVER_LOCKD_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
		$(NULL)
2599
lockd_la_CFLAGS = -I$(srcdir)/conf \
E
Eric Blake 已提交
2600 2601
		$(XDR_CFLAGS) \
		$(AM_CFLAGS)
2602
lockd_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
2603 2604 2605 2606
lockd_la_LIBADD = ../gnulib/lib/libgnu.la \
	libvirt-net-rpc.la \
	libvirt-net-rpc-client.la \
	$(NULL)
J
Jiri Denemark 已提交
2607
augeas_DATA += locking/libvirt_lockd.aug
2608 2609
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
2610
endif WITH_DTRACE_PROBES
2611
if WITH_QEMU
2612 2613
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
2614
nodist_conf_DATA += locking/qemu-lockd.conf
2615 2616
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
2617
endif WITH_QEMU
2618

2619 2620 2621 2622 2623 2624
if WITH_LIBXL
nodist_conf_DATA += locking/libxl-lockd.conf
BUILT_SOURCES += locking/libxl-lockd.conf
DISTCLEANFILES += locking/libxl-lockd.conf
endif WITH_LIBXL

2625 2626 2627 2628 2629
locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
	$(AM_V_GEN)$(MKDIR_P) locking ; \
	cp $< $@


2630
sbin_PROGRAMS = virtlockd virtlogd
2631

2632 2633 2634
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
2635
		$(LOCK_DAEMON_GENERATED) \
2636
		$(NULL)
2637 2638
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
2639
		$(PIE_CFLAGS) \
2640
		$(XDR_CFLAGS) \
2641 2642 2643
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
2644
		$(PIE_LDFLAGS) \
2645 2646 2647 2648 2649 2650 2651 2652 2653 2654
		$(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
2655
endif WITH_DTRACE_PROBES
2656

2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682

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

2683
else ! WITH_LIBVIRTD
2684
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
2685 2686
              $(LOCK_DRIVER_LOCKD_SOURCES) \
	      $(LOG_DAEMON_SOURCES)
2687
endif ! WITH_LIBVIRTD
2688

2689 2690
EXTRA_DIST += \
	locking/virtlockd.sysconf \
J
Jiri Denemark 已提交
2691 2692
	locking/lockd.conf \
	locking/libvirt_lockd.aug \
2693
	locking/test_libvirt_lockd.aug.in \
2694
	logging/virtlogd.sysconf
2695 2696

install-sysconfig:
E
Eric Blake 已提交
2697
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
2698 2699
	$(INSTALL_DATA) $(srcdir)/locking/virtlockd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
2700 2701
	$(INSTALL_DATA) $(srcdir)/logging/virtlogd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlogd
2702 2703

uninstall-sysconfig:
2704
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlogd
2705
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
E
Eric Blake 已提交
2706
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
2707

2708
EXTRA_DIST += locking/virtlockd.init.in logging/virtlogd.init.in
2709 2710 2711

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_RED_HAT
2712
install-init:: virtlockd.init virtlogd.init install-sysconfig
E
Eric Blake 已提交
2713
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
2714 2715
	$(INSTALL_SCRIPT) virtlockd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
2716 2717
	$(INSTALL_SCRIPT) virtlogd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlogd
2718 2719

uninstall-init:: uninstall-sysconfig
E
Eric Blake 已提交
2720
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
2721
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlogd
E
Eric Blake 已提交
2722
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
2723

2724 2725
BUILT_SOURCES += virtlockd.init virtlogd.init
DISTCLEANFILES += virtlockd.init virtlogd.init
2726
else ! LIBVIRT_INIT_SCRIPT_RED_HAT
2727 2728
install-init::
uninstall-init::
2729 2730
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
else ! WITH_LIBVIRTD
2731 2732
install-init::
uninstall-init::
2733
endif ! WITH_LIBVIRTD
2734 2735

virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
2736 2737 2738 2739 2740 2741
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    < $< > $@-t && \
	    chmod a+x $@-t && \
2742 2743
	    mv $@-t $@

2744
virtlogd.init: logging/virtlogd.init.in $(top_builddir)/config.status
2745 2746 2747 2748 2749 2750
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    < $< > $@-t && \
	    chmod a+x $@-t && \
2751 2752
	    mv $@-t $@

2753
virtlockd.8.in: locking/virtlockd.pod
2754 2755 2756 2757 2758 2759 2760 2761
	$(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 $@
2762

2763
virtlogd.8.in: logging/virtlogd.pod
2764 2765 2766 2767 2768 2769 2770 2771
	$(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 $@
2772

2773
%.8: %.8.in $(top_srcdir)/configure.ac
2774
	$(AM_V_GEN)sed \
2775 2776 2777
		-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
		-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
		< $< > $@-t && \
2778 2779
	mv $@-t $@

2780
if WITH_LIBVIRTD
2781
man8_MANS = virtlockd.8 virtlogd.8
2782

2783
conf_DATA += locking/virtlockd.conf logging/virtlogd.conf
2784

2785 2786
augeas_DATA += locking/virtlockd.aug logging/virtlogd.aug
augeastest_DATA += test_virtlockd.aug test_virtlogd.aug
2787
endif WITH_LIBVIRTD
2788

A
Andrea Bolognani 已提交
2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800
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)
2801 2802 2803 2804

EXTRA_DIST += \
        locking/virtlockd.service.in \
        locking/virtlockd.socket.in \
2805 2806 2807
        locking/virtlockd.aug \
        locking/virtlockd.conf \
        locking/test_virtlockd.aug.in \
2808 2809 2810 2811 2812
        logging/virtlogd.service.in \
        logging/virtlogd.socket.in \
        logging/virtlogd.aug \
        logging/virtlogd.conf \
        logging/test_virtlogd.aug.in \
A
Andrea Bolognani 已提交
2813 2814
        $(PODFILES) \
        $(MANINFILES) \
2815
        $(NULL)
2816

2817 2818 2819 2820

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

2821
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
2822

2823 2824 2825 2826
BUILT_SOURCES += virtlockd.service virtlockd.socket \
		 virtlogd.service virtlogd.socket
DISTCLEANFILES += virtlockd.service virtlockd.socket \
		  virtlogd.service virtlogd.socket
2827

2828 2829
install-systemd: virtlockd.service virtlockd.socket \
                 virtlogd.service virtlogd.socket install-sysconfig
E
Eric Blake 已提交
2830
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
2831
	$(INSTALL_DATA) virtlockd.service \
2832
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2833
	$(INSTALL_DATA) virtlockd.socket \
2834
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2835 2836 2837 2838
	$(INSTALL_DATA) virtlogd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
	$(INSTALL_DATA) virtlogd.socket \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2839 2840

uninstall-systemd: uninstall-sysconfig
E
Eric Blake 已提交
2841 2842
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.socket
2843 2844
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlogd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlogd.socket
E
Eric Blake 已提交
2845
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
2846
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
2847 2848
install-systemd:
uninstall-systemd:
2849 2850
endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
else ! WITH_LIBVIRTD
2851 2852
install-systemd:
uninstall-systemd:
2853
endif ! WITH_LIBVIRTD
2854 2855

virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
2856 2857 2858
	$(AM_V_GEN)sed \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    < $< > $@-t && \
2859 2860 2861
	    mv $@-t $@

virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
2862 2863 2864
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
2865 2866
	    mv $@-t $@

2867
virtlogd.service: logging/virtlogd.service.in $(top_builddir)/config.status
2868 2869 2870
	$(AM_V_GEN)sed \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    < $< > $@-t && \
2871 2872 2873
	    mv $@-t $@

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

2879

2880
if WITH_SANLOCK
2881
lockdriver_LTLIBRARIES += sanlock.la
2882
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
2883
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
2884
sanlock_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
2885
sanlock_la_LIBADD = -lsanlock_client \
2886 2887 2888
		../gnulib/lib/libgnu.la

augeas_DATA += locking/libvirt_sanlock.aug
2889 2890
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
2891

E
Eric Blake 已提交
2892
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
2893
	$(AM_V_GEN)$(MKDIR_P) locking ; \
2894 2895 2896
	cp $< $@

if WITH_QEMU
2897
nodist_conf_DATA += locking/qemu-sanlock.conf
2898
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
2899
DISTCLEANFILES += locking/qemu-sanlock.conf
2900
endif WITH_QEMU
2901 2902 2903 2904 2905 2906

if WITH_LIBXL
nodist_conf_DATA += locking/libxl-sanlock.conf
BUILT_SOURCES += locking/libxl-sanlock.conf
DISTCLEANFILES += locking/libxl-sanlock.conf
endif WITH_LIBXL
2907
else ! WITH_SANLOCK
2908
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
2909
endif ! WITH_SANLOCK
2910 2911
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
2912
	locking/test_libvirt_sanlock.aug.in
2913

2914 2915 2916 2917
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
2918

2919
EXTRA_DIST += \
E
Eric Blake 已提交
2920 2921 2922 2923
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
2924 2925
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
2926

E
Eric Blake 已提交
2927
VIR_NET_RPC_GENERATED = \
2928 2929 2930 2931
	rpc/virnetprotocol.h \
	rpc/virnetprotocol.c \
	rpc/virkeepaliveprotocol.h \
	rpc/virkeepaliveprotocol.c
2932

2933
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2934

2935
libvirt_net_rpc_la_SOURCES = \
2936
	rpc/virnetmessage.h rpc/virnetmessage.c \
2937
	rpc/virnetsocket.h rpc/virnetsocket.c \
2938 2939
	rpc/virkeepalive.h rpc/virkeepalive.c \
	$(VIR_NET_RPC_GENERATED)
2940
if WITH_SSH2
2941 2942
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2943
else ! WITH_SSH2
2944 2945
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2946
endif ! WITH_SSH2
2947
if WITH_GNUTLS
2948 2949
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2950
else ! WITH_GNUTLS
2951 2952
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2953
endif ! WITH_GNUTLS
2954
if WITH_SASL
2955 2956
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2957
else ! WITH_SASL
2958 2959
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2960
endif ! WITH_SASL
2961 2962 2963 2964 2965 2966 2967
if WITH_LIBSSH
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetlibsshsession.h rpc/virnetlibsshsession.c
else ! WITH_LIBSSH
EXTRA_DIST += \
	rpc/virnetlibsshsession.h rpc/virnetlibsshsession.c
endif ! WITH_LIBSSH
2968
libvirt_net_rpc_la_CFLAGS = \
2969
			$(GNUTLS_CFLAGS) \
2970
			$(SASL_CFLAGS) \
2971
			$(SSH2_CFLAGS) \
2972
			$(LIBSSH_CFLAGS) \
2973
			$(XDR_CFLAGS) \
2974 2975
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
2976
			$(GNUTLS_LIBS) \
2977
			$(SASL_LIBS) \
2978
			$(SSH2_LIBS)\
2979
			$(LIBSSH_LIBS) \
J
Jim Fehlig 已提交
2980
			$(SECDRIVER_LIBS) \
2981
			$(AM_LDFLAGS) \
2982
			$(NULL)
2983 2984 2985
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2986 2987 2988 2989
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
2990
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
2991
	rpc/virnetdaemon.h rpc/virnetdaemon.c \
2992 2993
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
2994
			$(AVAHI_CFLAGS) \
2995
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
2996
			$(XDR_CFLAGS) \
2997
			$(AM_CFLAGS)
2998 2999
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
3000
			$(AVAHI_LIBS) \
3001
			$(DBUS_LIBS) \
3002
			$(NULL)
3003 3004 3005
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

3006 3007 3008 3009 3010
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 已提交
3011 3012
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
3013
libvirt_net_rpc_client_la_LDFLAGS = $(AM_LDFLAGS)
3014 3015
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
3016

3017 3018
libexec_PROGRAMS =

3019
if WITH_LIBVIRTD
3020 3021
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
3022 3023 3024 3025
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3026 3027
libvirt_iohelper_LDADD = \
		libvirt_util.la \
3028
		../gnulib/lib/libgnu.la
3029 3030
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
3031
endif WITH_DTRACE_PROBES
3032

D
Daniel P. Berrange 已提交
3033 3034 3035 3036
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
3037 3038 3039 3040

if WITH_NETWORK
libexec_PROGRAMS += libvirt_leaseshelper
libvirt_leaseshelper_SOURCES = $(NETWORK_LEASES_HELPER_SOURCES)
3041 3042 3043 3044
libvirt_leaseshelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3045 3046
libvirt_leaseshelper_LDADD = \
               libvirt_util.la \
3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059
               ../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

3060
endif WITH_LIBVIRTD
3061

3062
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
3063
if WITH_LIBVIRTD
3064
libexec_PROGRAMS += libvirt_parthelper
3065

3066
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
D
Daniel P. Berrange 已提交
3067 3068 3069 3070
libvirt_parthelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3071 3072 3073
libvirt_parthelper_LDADD = \
		$(LIBPARTED_LIBS) \
		libvirt_util.la \
3074
		../gnulib/lib/libgnu.la
3075 3076
if WITH_DTRACE_PROBES
libvirt_parthelper_LDADD += libvirt_probes.lo
3077
endif WITH_DTRACE_PROBES
3078

D
Daniel P. Berrange 已提交
3079 3080 3081 3082 3083
libvirt_parthelper_CFLAGS = \
		$(LIBPARTED_CFLAGS) \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
3084 3085
endif WITH_LIBVIRTD
endif WITH_STORAGE_DISK
3086 3087
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)

3088

3089
if WITH_SANLOCK
3090 3091 3092
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
3093
libvirt_sanlock_helper_CFLAGS = \
3094
		-I$(srcdir)/conf \
D
Daniel P. Berrange 已提交
3095 3096 3097 3098 3099 3100 3101
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3102
libvirt_sanlock_helper_LDADD = libvirt.la
3103
endif WITH_SANLOCK
3104

3105 3106 3107 3108
if WITH_LXC
if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_lxc

3109 3110
libvirt_lxc_SOURCES = \
		$(LXC_CONTROLLER_SOURCES) \
O
Osier Yang 已提交
3111
		$(DATATYPES_SOURCES)
D
Daniel P. Berrange 已提交
3112 3113 3114 3115
libvirt_lxc_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3116
libvirt_lxc_LDADD = \
G
Gao feng 已提交
3117
		$(FUSE_LIBS) \
3118 3119
		libvirt-net-rpc-server.la \
		libvirt-net-rpc.la \
3120
		libvirt_security_manager.la \
3121 3122
		libvirt_conf.la \
		libvirt_util.la \
3123
		../gnulib/lib/libgnu.la
3124
if WITH_DTRACE_PROBES
3125
libvirt_lxc_LDADD += libvirt_probes.lo
3126
endif WITH_DTRACE_PROBES
3127
libvirt_lxc_LDADD += $(SECDRIVER_LIBS)
3128 3129 3130 3131 3132 3133 3134 3135
libvirt_lxc_CFLAGS = \
		-I$(srcdir)/conf \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(LIBNL_CFLAGS) \
		$(FUSE_CFLAGS) \
		$(DBUS_CFLAGS) \
		$(XDR_CFLAGS) \
D
Daniel P. Berrange 已提交
3136
		$(NULL)
3137
if WITH_BLKID
3138 3139
libvirt_lxc_CFLAGS += $(BLKID_CFLAGS)
libvirt_lxc_LDADD += $(BLKID_LIBS)
3140
endif WITH_BLKID
J
Jim Fehlig 已提交
3141
libvirt_lxc_CFLAGS += $(SECDRIVER_CFLAGS)
3142 3143
endif WITH_LIBVIRTD
endif WITH_LXC
3144 3145
EXTRA_DIST += $(LXC_CONTROLLER_SOURCES)

J
Jamie Strandboge 已提交
3146 3147 3148 3149 3150 3151
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 已提交
3152 3153 3154 3155
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3156 3157 3158 3159 3160
virt_aa_helper_LDADD = \
		libvirt.la \
		libvirt_conf.la \
		libvirt_util.la \
		libvirt_driver_storage_impl.la \
C
Chris Lalancette 已提交
3161
		../gnulib/lib/libgnu.la
3162
if WITH_DTRACE_PROBES
3163
virt_aa_helper_LDADD += libvirt_probes.lo
3164
endif WITH_DTRACE_PROBES
3165 3166 3167 3168 3169
virt_aa_helper_CFLAGS = \
		-I$(srcdir)/conf \
		-I$(srcdir)/security \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
D
Daniel P. Berrange 已提交
3170
		$(NULL)
3171 3172
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
J
Jamie Strandboge 已提交
3173 3174
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

3175
if WITH_NSS
3176 3177
noinst_LTLIBRARIES += libvirt-nss.la

3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226
libvirt_nss_la_SOURCES = \
		util/viralloc.c \
		util/viralloc.h \
		util/viratomic.c \
		util/viratomic.h \
		util/virbitmap.c \
		util/virbitmap.h \
		util/virbuffer.c \
		util/virbuffer.h \
		util/vircommand.c \
		util/vircommand.h \
		util/virerror.c \
		util/virerror.h \
		util/virfile.c \
		util/virfile.h \
		util/virhash.c \
		util/virhash.h \
		util/virhashcode.c \
		util/virhashcode.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/virmacmap.c \
		util/virmacmap.h \
		util/virobject.c \
		util/virobject.h \
		util/virpidfile.c \
		util/virpidfile.h \
		util/virprocess.c \
		util/virprocess.h \
		util/virrandom.c \
		util/virrandom.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 \
3227 3228
		$(NULL)

3229 3230 3231 3232
libvirt_nss_la_CFLAGS = \
		-DLIBVIRT_NSS \
		$(AM_CFLAGS) \
		$(YAJL_CFLAGS) \
3233
		$(NULL)
3234 3235
libvirt_nss_la_LDFLAGS = \
		$(AM_LDFLAGS) \
3236 3237
		$(NULL)

3238 3239
libvirt_nss_la_LIBADD = \
		$(YAJL_LIBS) \
3240
		$(NULL)
3241
endif WITH_NSS
3242 3243


3244
install-data-local: install-init install-systemd
3245 3246
if WITH_LIBVIRTD
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
3247
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
3248
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
3249
endif WITH_LIBVIRTD
3250 3251
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
3252
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
3253
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
3254
if WITH_SANLOCK
3255
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
3256
endif WITH_SANLOCK
3257
if WITH_QEMU
3258
	$(MKDIR_P) -m 0751 "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu"
3259
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu"
3260
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu"
3261
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu"
3262
endif WITH_QEMU
3263 3264 3265
if WITH_LXC
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lxc"
3266
endif WITH_LXC
J
Jim Fehlig 已提交
3267 3268 3269
if WITH_LIBXL
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/libxl"
J
Jim Fehlig 已提交
3270
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl"
3271
endif WITH_LIBXL
3272 3273 3274
if WITH_UML
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/uml"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/uml"
3275
endif WITH_UML
3276 3277
if WITH_XEN
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/xen"
3278
endif WITH_XEN
3279 3280
if WITH_NETWORK
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network"
3281
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq"
3282
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/network"
3283
	$(MKDIR_P) "$(DESTDIR)$(confdir)/qemu/networks/autostart"
3284
	$(INSTALL_DATA) $(srcdir)/network/default.xml \
3285
	  $(DESTDIR)$(confdir)/qemu/networks/default.xml
3286
	test -z "$(UUID)" || \
3287 3288 3289
	  { sed -e "s,</name>,</name>;  <uuid>$(UUID)</uuid>," \
	      $(DESTDIR)$(confdir)/qemu/networks/default.xml | \
	      tr ";" "\n" > \
3290 3291 3292 3293
	      $(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 已提交
3294
	( cd $(DESTDIR)$(confdir)/qemu/networks/autostart && \
3295 3296
	  rm -f default.xml && \
	  $(LN_S) ../default.xml default.xml )
3297
endif WITH_NETWORK
3298

3299
uninstall-local:: uninstall-init uninstall-systemd
3300
if WITH_LIBVIRTD
3301
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
3302 3303
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
3304
endif WITH_LIBVIRTD
3305 3306
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
3307
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
3308
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
3309
if WITH_SANLOCK
3310
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
3311
endif WITH_SANLOCK
3312 3313 3314 3315 3316
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" ||:
3317
endif WITH_QEMU
3318 3319 3320
if WITH_LXC
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||:
3321
endif WITH_LXC
J
Jim Fehlig 已提交
3322 3323 3324
if WITH_LIBXL
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||:
J
Jim Fehlig 已提交
3325
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||:
3326
endif WITH_LIBXL
3327 3328 3329
if WITH_UML
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/uml" ||:
3330
endif WITH_UML
3331 3332
if WITH_XEN
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/xen" ||:
3333
endif WITH_XEN
3334
if WITH_NETWORK
3335 3336 3337 3338
	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" || :
3339 3340
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||:
3341
endif WITH_NETWORK
3342
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
3343

3344 3345
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
3346
MAINTAINERCLEANFILES += $(REMOTE_DRIVER_GENERATED) $(VIR_NET_RPC_GENERATED)