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

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

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

25 26
# No libraries with the exception of LIBXML should be listed
# here. List them against the individual XXX_la_CFLAGS targets
27
# that actually use them. Also keep GETTEXT_CPPFLAGS at the end.
28 29 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
AM_LDFLAGS_MOD = -module -avoid-version $(AM_LDFLAGS)
55
AM_LDFLAGS_MOD_NOUNDEF = $(AM_LDFLAGS_MOD) $(NO_UNDEFINED_LDFLAGS)
56

57 58
POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)"

59
EXTRA_DIST = $(conf_DATA)
60

61
BUILT_SOURCES =
62 63 64
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
65
nodist_conf_DATA =
66

E
Eric Blake 已提交
67 68
THREAD_LIBS = $(LIB_PTHREAD) $(LTLIBMULTITHREAD)

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

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

84
lib_LTLIBRARIES = libvirt.la libvirt-qemu.la libvirt-lxc.la
85

86
moddir = $(libdir)/libvirt/connection-driver
87 88
mod_LTLIBRARIES =

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

92 93 94 95 96 97
augeasdir = $(datadir)/augeas/lenses
augeas_DATA =

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

98 99
# These files are not related to driver APIs. Simply generic
# helper APIs for various purposes
100 101 102 103 104 105 106 107 108 109 110 111
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 \
112
		util/vircommand.c util/vircommand.h util/vircommandpriv.h \
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
		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 \
133
		util/virhostcpu.c util/virhostcpu.h util/virhostcpupriv.h \
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
		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 \
149
		util/virnetdevbandwidth.h util/virnetdevbandwidth.c \
150 151 152
		util/virnetdevbridge.h util/virnetdevbridge.c \
		util/virnetdevip.h util/virnetdevip.c \
		util/virnetdevmacvlan.c util/virnetdevmacvlan.h \
153
		util/virnetdevmidonet.h util/virnetdevmidonet.c \
A
Ansis Atteka 已提交
154
		util/virnetdevopenvswitch.h util/virnetdevopenvswitch.c \
155 156 157
		util/virnetdevtap.h util/virnetdevtap.c \
		util/virnetdevveth.h util/virnetdevveth.c \
		util/virnetdevvlan.h util/virnetdevvlan.c \
158
		util/virnetdevvportprofile.h util/virnetdevvportprofile.c \
159 160 161 162 163 164 165 166
		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 已提交
167
		util/virportallocator.c util/virportallocator.h \
168 169 170 171
		util/virprobe.h \
		util/virprocess.c util/virprocess.h \
		util/virqemu.c util/virqemu.h \
		util/virrandom.h util/virrandom.c \
172
		util/virresctrl.h util/virresctrl.c util/virresctrlpriv.h \
173 174 175 176 177 178 179 180
		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 \
181
		util/virstorageencryption.c util/virstorageencryption.h \
182
		util/virstoragefile.c util/virstoragefile.h \
183
		util/virstoragefilebackend.c util/virstoragefilebackend.h \
184 185
		util/virstring.h util/virstring.c \
		util/virsysinfo.c util/virsysinfo.h util/virsysinfopriv.h \
186
		util/virsystemd.c util/virsystemd.h util/virsystemdpriv.h \
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
		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 \
202
		$(NULL)
L
Lai Jiangshan 已提交
203

204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
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

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 256 257 258
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 $@

259
KEYCODES = linux osx atset1 atset2 atset3 xtkbd usb win32 rfb
260 261 262 263 264 265 266
KEYNAMES = linux osx win32

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

267 268 269 270 271 272
KEYPODS = $(KEYCODES:%=util/virkeycode-%.pod) \
	  $(KEYNAMES:%=util/virkeyname-%.pod)
KEYMANS = $(KEYPODS:%.pod=%.7)

man7_MANS = $(KEYMANS)

273 274 275
UTIL_SOURCES += $(KEYTABLES)
BUILT_SOURCES += $(KEYTABLES)
MAINTAINERCLEANFILES += $(KEYTABLES)
276
CLEANFILES += $(KEYMANS) $(KEYPODS)
L
Lai Jiangshan 已提交
277

278
# Internal generic driver infrastructure
O
Osier Yang 已提交
279
DATATYPES_SOURCES = datatypes.h datatypes.c
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 306 307 308
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 \
309
		$(NULL)
310

311 312 313
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

314 315
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
316

317
LOCK_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
318 319
		locking/lock_protocol.h \
		locking/lock_protocol.c \
320 321
		$(NULL)

322 323 324
LOCK_PROTOCOL = $(srcdir)/locking/lock_protocol.x
EXTRA_DIST += $(LOCK_PROTOCOL) \
	$(LOCK_PROTOCOL_GENERATED)
325 326 327
BUILT_SOURCES += $(LOCK_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(LOCK_PROTOCOL_GENERATED)

328
LOCK_DAEMON_GENERATED = \
329
		locking/lock_daemon_dispatch_stubs.h
330 331 332
		$(NULL)

BUILT_SOURCES += $(LOCK_DAEMON_GENERATED)
333
EXTRA_DIST += $(LOCK_DAEMON_GENERATED)
334 335
MAINTAINERCLEANFILES += $(LOCK_DAEMON_GENERATED)

336 337
LOCK_DRIVER_LOCKD_SOURCES = \
		locking/lock_driver_lockd.c \
338
		locking/lock_driver_lockd.h \
339 340
		$(NULL)

341 342 343 344 345
LOCK_DAEMON_SOURCES = \
		locking/lock_daemon.h \
		locking/lock_daemon.c \
		locking/lock_daemon_config.h \
		locking/lock_daemon_config.c \
346 347
		locking/lock_daemon_dispatch.c \
		locking/lock_daemon_dispatch.h \
348 349
		$(NULL)

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


357 358 359 360 361
LOG_PROTOCOL_GENERATED = \
		logging/log_protocol.h \
		logging/log_protocol.c \
		$(NULL)

362 363
DRIVER_SOURCES += $(LOG_PROTOCOL_GENERATED)

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


396
NETDEV_CONF_SOURCES = \
397
		conf/netdev_bandwidth_conf.h conf/netdev_bandwidth_conf.c \
398 399
		conf/netdev_vport_profile_conf.h conf/netdev_vport_profile_conf.c \
		conf/netdev_vlan_conf.h conf/netdev_vlan_conf.c
400

401
# XML configuration format handling sources
402
# Domain driver generic impl APIs
403 404 405 406 407 408 409 410 411 412
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 \
413
		conf/virdomainobjlist.c conf/virdomainobjlist.h
414

415
OBJECT_EVENT_SOURCES = \
416 417 418
		conf/object_event.c conf/object_event.h \
		conf/object_event_private.h

419
DOMAIN_EVENT_SOURCES = \
420
		conf/domain_event.c conf/domain_event.h
421

422
NETWORK_EVENT_SOURCES = \
423 424
		conf/network_event.c conf/network_event.h

425
STORAGE_EVENT_SOURCES = \
426 427
                conf/storage_event.c conf/storage_event.h

428
NODE_DEVICE_EVENT_SOURCES = \
429 430
                conf/node_device_event.c conf/node_device_event.h

431
SECRET_EVENT_SOURCES = \
432 433
                conf/secret_event.c conf/secret_event.h

434
# Network driver generic impl APIs
435 436 437
NETWORK_CONF_SOURCES = \
		conf/network_conf.c conf/network_conf.h \
		conf/virnetworkobj.c conf/virnetworkobj.h \
438
		conf/networkcommon_conf.c conf/networkcommon_conf.h
439

440
# Network filter driver generic impl APIs
441 442 443 444 445
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 已提交
446
		conf/virnwfilterobj.h
447

448 449 450
NWFILTER_CONF_SOURCES = \
		$(NWFILTER_PARAM_CONF_SOURCES) \
		conf/nwfilter_conf.c conf/nwfilter_conf.h \
J
John Ferlan 已提交
451
		conf/virnwfilterobj.c conf/virnwfilterobj.h
452

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

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

464
# Secret driver generic impl APIs
465 466
SECRET_CONF_SOURCES = \
		conf/secret_conf.h conf/secret_conf.c \
467
		conf/virsecretobj.h conf/virsecretobj.c
468 469

# Network driver generic impl APIs
470
NODE_DEVICE_CONF_SOURCES = \
J
John Ferlan 已提交
471 472
		conf/node_device_conf.c conf/node_device_conf.h \
		conf/virnodedeviceobj.c conf/virnodedeviceobj.h
473

474
CPU_CONF_SOURCES = \
475
		conf/cpu_conf.c conf/cpu_conf.h
476

477
# Safe character device handling helper APIs
478
CHRDEV_CONF_SOURCES = \
479
		conf/virchrdev.c conf/virchrdev.h
480

481
# Device Helper APIs
482
DEVICE_CONF_SOURCES = \
483 484
		conf/device_conf.c conf/device_conf.h

485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501
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) \
502
		$(DEVICE_CONF_SOURCES)
503

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

REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x
518
LXC_PROTOCOL = $(srcdir)/remote/lxc_protocol.x
E
Eric Blake 已提交
519
QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x
520
REMOTE_DRIVER_PROTOCOL = $(REMOTE_PROTOCOL) $(QEMU_PROTOCOL) $(LXC_PROTOCOL)
521

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

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

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

540 541
REMOTE_DRIVER_SOURCES = \
		remote/remote_driver.c remote/remote_driver.h \
542
		$(REMOTE_DRIVER_GENERATED)
543

544
EXTRA_DIST +=  $(REMOTE_DRIVER_PROTOCOL) \
545
		$(REMOTE_DRIVER_GENERATED)
546

M
Martin Kletzander 已提交
547 548 549
ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x

ADMIN_PROTOCOL_GENERATED = \
550 551
		admin/admin_protocol.c \
		admin/admin_protocol.h \
552 553 554
		admin/admin_client.h \
		admin/admin_server_dispatch_stubs.h \
		$(NULL)
555 556 557 558 559 560

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

562 563 564 565 566 567
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 已提交
568 569 570 571
EXTRA_DIST += $(ADMIN_PROTOCOL) $(ADMIN_PROTOCOL_GENERATED)
BUILT_SOURCES += $(ADMIN_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(ADMIN_PROTOCOL_GENERATED)

572 573 574 575 576 577 578 579 580 581
# 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
582 583 584 585

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

596
# Depending on configure options, libtool creates one or both of
E
Eric Blake 已提交
597 598
# remote/{,.libs/}libvirt_driver_remote_la-remote_protocol.o.  We want
# the newest of the two, in case configure options changed and a stale
599
# file is left around from an earlier build.
600
PDWTAGS = \
601 602 603 604 605 606 607 608
	$(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?; \
609
	    echo 'WARNING: pdwtags appears broken; skipping the $@ test' >&2;\
610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627
	  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) {' \
628
		-e '    warn "WARNING: your pdwtags program is too old\n";' \
629
		-e '    warn "WARNING: skipping the $@ test\n";' \
630
		-e '    warn "WARNING: install dwarves-1.3 or newer\n";' \
631 632 633 634
		-e '    exit 8;' \
		-e '  }' \
		-e '}' \
		< $(@F)-t1 > $(@F)-t3; \
635
	    case $$? in 8) rm -f $(@F)-t?; exit 0;; 0) ;; *) exit 1;; esac;\
636 637 638 639
	    diff -u $(@)s $(@F)-t3; st=$$?; rm -f $(@F)-t?; exit $$st; \
	  fi; \
	else \
	  echo 'WARNING: you lack pdwtags; skipping the $@ test' >&2; \
640
	  echo 'WARNING: install the dwarves package to get pdwtags' >&2; \
641
	fi
642

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

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

676
if WITH_REMOTE
677 678
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)

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

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

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

EXTRA_DIST += check-drivername.pl

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

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

759 760 761

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

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

772 773 774 775 776
check-aclperms:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclperms.pl \
		$(srcdir)/access/viraccessperm.h \
		$(srcdir)/access/viraccessperm.c

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

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

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

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

801
LXC_MONITOR_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
802 803
	lxc/lxc_monitor_protocol.h \
	lxc/lxc_monitor_protocol.c \
804 805 806
	$(NULL)

LXC_MONITOR_GENERATED = \
E
Eric Blake 已提交
807
	lxc/lxc_monitor_dispatch.h \
808 809 810
	$(NULL)

LXC_CONTROLLER_GENERATED = \
E
Eric Blake 已提交
811
	lxc/lxc_controller_dispatch.h \
812 813 814
	$(NULL)

LXC_GENERATED = \
815
	$(LXC_MONITOR_PROTOCOL_GENERATED) \
816 817 818 819
	$(LXC_MONITOR_GENERATED) \
	$(LXC_CONTROLLER_GENERATED) \
	$(NULL)

820
LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x
821

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

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

EXTRA_DIST += \
835
	$(LXC_MONITOR_PROTOCOL) \
836 837 838 839 840
	$(LXC_GENERATED) \
	$(NULL)

BUILT_SOURCES += $(LXC_GENERATED)

841 842
CLEANFILES += $(LXC_GENERATED)

843 844 845 846 847 848 849 850 851 852 853 854
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 \
855
		lxc/lxc_driver.c lxc/lxc_driver.h
856

857 858 859 860 861 862 863 864
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 \
865
		lxc/lxc_controller.c
866

867 868
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES = \
		$(DATATYPES_SOURCES) \
J
Jamie Strandboge 已提交
869 870
		security/virt-aa-helper.c

871
PHYP_DRIVER_SOURCES = \
872 873
		phyp/phyp_driver.c phyp/phyp_driver.h

874 875 876
OPENVZ_DRIVER_SOURCES = \
		openvz/openvz_conf.c openvz/openvz_conf.h \
		openvz/openvz_driver.c openvz/openvz_driver.h \
877
		openvz/openvz_util.c openvz/openvz_util.h
878

879 880
VMWARE_DRIVER_SOURCES = \
		vmware/vmware_driver.c vmware/vmware_driver.h \
881 882
		vmware/vmware_conf.c vmware/vmware_conf.h

883 884 885 886 887 888 889 890 891 892 893 894
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 已提交
895
	vbox/vbox_V5_2.c vbox/vbox_CAPI_v5_2.h \
896 897 898 899
	vbox/vbox_common.c vbox/vbox_common.h \
	vbox/vbox_uniformed_api.h \
	vbox/vbox_get_driver.h \
	vbox/vbox_network.c \
900
	vbox/vbox_storage.c
T
Taowei Luo 已提交
901

902 903 904
VBOX_DRIVER_EXTRA_DIST = \
		vbox/vbox_tmpl.c vbox/README \
		vbox/vbox_MSCOMGlue.c vbox/vbox_MSCOMGlue.h \
905
		vbox/vbox_XPCOMCGlue.c vbox/vbox_XPCOMCGlue.h
906

907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924
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 \
925
		qemu/qemu_migration_cookie.c qemu/qemu_migration_cookie.h \
926 927 928 929 930 931 932 933
		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 \
934
		qemu/qemu_security.c qemu/qemu_security.h
R
Richard W.M. Jones 已提交
935

936 937 938
XENAPI_DRIVER_SOURCES = \
		xenapi/xenapi_driver.c xenapi/xenapi_driver.h \
		xenapi/xenapi_driver_private.h \
939 940
		xenapi/xenapi_utils.c xenapi/xenapi_utils.h

941 942 943 944 945 946
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 已提交
947
		libxl/libxl_migration.c libxl/libxl_migration.h
J
Jim Fehlig 已提交
948

949 950
UML_DRIVER_SOURCES = \
		uml/uml_conf.c uml/uml_conf.h \
D
Daniel P. Berrange 已提交
951
		uml/uml_driver.c uml/uml_driver.h
952

953 954 955 956 957 958 959 960 961 962 963 964
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 \
965
		esx/esx_vi_types.c esx/esx_vi_types.h
966

967 968 969 970 971 972 973 974 975 976 977
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 \
978
		esx/esx_vi.generated.h
979

980 981 982 983
ESX_DRIVER_EXTRA_DIST = \
		esx/README \
		esx/esx_vi_generator.input \
		esx/esx_vi_generator.py \
984 985
		$(ESX_DRIVER_GENERATED)

986 987 988 989 990 991
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 \
992 993
		hyperv/openwsman.h

994 995 996
HYPERV_DRIVER_GENERATED = \
		hyperv/hyperv_wmi_classes.generated.c \
		hyperv/hyperv_wmi_classes.generated.h \
997 998
		hyperv/hyperv_wmi_classes.generated.typedef

999 1000 1001
HYPERV_DRIVER_EXTRA_DIST = \
		hyperv/hyperv_wmi_generator.input \
		hyperv/hyperv_wmi_generator.py \
1002 1003
		$(HYPERV_DRIVER_GENERATED)

1004 1005 1006 1007 1008 1009
VZ_DRIVER_SOURCES = \
		vz/vz_driver.h \
		vz/vz_driver.c \
		vz/vz_utils.c \
		vz/vz_utils.h \
		vz/vz_sdk.h \
1010
		vz/vz_sdk.c
D
Dmitry Guryanov 已提交
1011

1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031
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 已提交
1032 1033
		$(NULL)

1034
NETWORK_DRIVER_SOURCES = \
1035
		network/bridge_driver.h network/bridge_driver.c \
1036 1037
		network/bridge_driver_platform.h \
		network/bridge_driver_platform.c \
1038 1039
		$(NULL)
EXTRA_DIST += network/bridge_driver_linux.c network/bridge_driver_nop.c
1040

1041 1042 1043
INTERFACE_DRIVER_SOURCES =

if WITH_INTERFACE
1044 1045
INTERFACE_DRIVER_SOURCES += \
		interface/interface_driver.h \
1046
		interface/interface_driver.c
1047 1048

if WITH_NETCF
1049
INTERFACE_DRIVER_SOURCES += \
1050
		interface/interface_backend_netcf.c
1051
endif WITH_NETCF
1052
if WITH_UDEV
1053
INTERFACE_DRIVER_SOURCES += \
1054
		interface/interface_backend_udev.c
1055 1056
endif WITH_UDEV
endif WITH_INTERFACE
1057

1058
SECRET_UTIL_SOURCES = \
1059 1060
		secret/secret_util.h secret/secret_util.c

1061
SECRET_DRIVER_SOURCES = \
1062
		secret/secret_driver.h secret/secret_driver.c
1063

1064
# Storage backend specific impls
1065 1066 1067
STORAGE_DRIVER_BACKEND_SOURCES = \
		storage/storage_backend.h storage/storage_backend.c

1068 1069
STORAGE_DRIVER_SOURCES = \
		storage/storage_driver.h storage/storage_driver.c \
1070
		$(STORAGE_DRIVER_BACKEND_SOURCES) \
1071
		storage/storage_util.h storage/storage_util.c
1072

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

1076 1077
STORAGE_DRIVER_LVM_SOURCES = \
		storage/storage_backend_logical.h \
1078
		storage/storage_backend_logical.c
1079

1080
STORAGE_DRIVER_ISCSI_SOURCES = \
1081
		storage/storage_backend_iscsi.h storage/storage_backend_iscsi.c
1082

1083
STORAGE_DRIVER_SCSI_SOURCES = \
1084
		storage/storage_backend_scsi.h storage/storage_backend_scsi.c
1085

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

1089
STORAGE_DRIVER_DISK_SOURCES = \
1090
		storage/storage_backend_disk.h storage/storage_backend_disk.c
1091

1092
STORAGE_DRIVER_RBD_SOURCES = \
1093 1094
		storage/storage_backend_rbd.h storage/storage_backend_rbd.c

1095
STORAGE_DRIVER_SHEEPDOG_SOURCES = \
1096 1097
		storage/storage_backend_sheepdog.h storage/storage_backend_sheepdog.c \
		storage/storage_backend_sheepdog_priv.h
1098

1099
STORAGE_DRIVER_GLUSTER_SOURCES = \
1100 1101
		storage/storage_backend_gluster.h storage/storage_backend_gluster.c

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

1105 1106
STORAGE_DRIVER_VSTORAGE_SOURCES = \
                storage/storage_backend_vstorage.h \
1107 1108
                storage/storage_backend_vstorage.c

1109
STORAGE_HELPER_DISK_SOURCES = \
1110
		storage/parthelper.c
1111

1112
UTIL_IO_HELPER_SOURCES = \
1113 1114
		util/iohelper.c

1115
NETWORK_LEASES_HELPER_SOURCES = \
1116 1117
               network/leaseshelper.c

1118
# Network filters
1119 1120 1121 1122 1123 1124 1125 1126 1127 1128
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 \
1129
		nwfilter/nwfilter_learnipaddr.h
1130

1131

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

1140
SECURITY_DRIVER_SELINUX_SOURCES = \
1141
		security/security_selinux.h security/security_selinux.c
1142

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

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

1155
ACCESS_DRIVER_SYM_FILES = \
1156 1157 1158
		libvirt_access.syms \
		libvirt_access_qemu.syms \
		libvirt_access_lxc.syms
1159

1160 1161 1162 1163 1164
ACCESS_DRIVER_API_FILES = \
		libvirt_access.xml \
		libvirt_access_qemu.xml \
		libvirt_access_lxc.xml

1165 1166 1167 1168 1169 1170 1171
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

1172 1173 1174 1175
ACCESS_DRIVER_POLKIT_SOURCES = \
		access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c

ACCESS_DRIVER_POLKIT_POLICY = \
1176
		$(srcdir)/access/org.libvirt.api.policy
1177 1178


1179 1180
NODE_DEVICE_DRIVER_SOURCES = \
		node_device/node_device_driver.c \
1181
		node_device/node_device_driver.h
1182

1183 1184
NODE_DEVICE_DRIVER_HAL_SOURCES = \
		node_device/node_device_hal.c \
1185
		node_device/node_device_hal.h
1186

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

1191 1192 1193 1194 1195 1196 1197
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 \
1198
		cpu/cpu_map.h cpu/cpu_map.c
1199

1200
VMX_SOURCES = \
1201 1202
		vmx/vmx.c vmx/vmx.h

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

J
Jiri Denemark 已提交
1214 1215
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
1216
EXTRA_DIST +=	$(pkgdata_DATA)
1217

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

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

1239 1240

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

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

1254 1255 1256 1257 1258 1259
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)

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

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

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 已提交
1282
endif WITH_XENCONFIG
1283

1284

1285
noinst_LTLIBRARIES += libvirt_driver.la
1286
libvirt_la_BUILT_LIBADD += libvirt_driver.la
1287
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
1288

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

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

1305
if WITH_TEST
D
Daniel P. Berrange 已提交
1306 1307 1308 1309

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

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

if WITH_REMOTE
1318
noinst_LTLIBRARIES += libvirt_driver_remote.la
1319
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
1320 1321 1322 1323
libvirt_driver_remote_la_CFLAGS = \
		$(XDR_CFLAGS) \
		-I$(srcdir)/conf \
		-I$(srcdir)/rpc \
1324 1325
		$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
1326
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
1327

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

1330 1331
endif WITH_REMOTE

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

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

1340
if WITH_XEN
E
Eric Blake 已提交
1341 1342 1343
noinst_LTLIBRARIES += libvirt_driver_xen_impl.la
libvirt_driver_xen_la_SOURCES =
libvirt_driver_xen_la_LIBADD = libvirt_driver_xen_impl.la
1344
mod_LTLIBRARIES += libvirt_driver_xen.la
1345
libvirt_driver_xen_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1346
libvirt_driver_xen_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1347

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

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

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

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

1384
if WITH_VBOX
M
Michal Privoznik 已提交
1385
noinst_LTLIBRARIES += \
1386
		libvirt_driver_vbox_impl.la
1387 1388
libvirt_driver_vbox_la_SOURCES =
libvirt_driver_vbox_la_LIBADD = libvirt_driver_vbox_impl.la
M
Michal Privoznik 已提交
1389
mod_LTLIBRARIES += \
1390
		libvirt_driver_vbox.la
1391
libvirt_driver_vbox_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1392
libvirt_driver_vbox_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1393

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

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

J
Jim Fehlig 已提交
1415
if WITH_LIBXL
E
Eric Blake 已提交
1416 1417 1418
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 已提交
1419
mod_LTLIBRARIES += libvirt_driver_libxl.la
1420
libvirt_driver_libxl_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1421
libvirt_driver_libxl_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1422

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

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

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

1446
if WITH_QEMU
E
Eric Blake 已提交
1447 1448 1449
noinst_LTLIBRARIES += libvirt_driver_qemu_impl.la
libvirt_driver_qemu_la_SOURCES =
libvirt_driver_qemu_la_LIBADD = libvirt_driver_qemu_impl.la
1450
mod_LTLIBRARIES += libvirt_driver_qemu.la
1451
libvirt_driver_qemu_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1452
libvirt_driver_qemu_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1453

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

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

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

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

1482 1483

if WITH_LXC
E
Eric Blake 已提交
1484 1485 1486
noinst_LTLIBRARIES += libvirt_driver_lxc_impl.la
libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = libvirt_driver_lxc_impl.la
1487
mod_LTLIBRARIES += libvirt_driver_lxc.la
1488
libvirt_driver_lxc_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1489
libvirt_driver_lxc_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1490 1491

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

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

conf_DATA += lxc/lxc.conf

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

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

1520
if WITH_UML
E
Eric Blake 已提交
1521 1522 1523
noinst_LTLIBRARIES += libvirt_driver_uml_impl.la
libvirt_driver_uml_la_SOURCES =
libvirt_driver_uml_la_LIBADD = libvirt_driver_uml_impl.la
1524
mod_LTLIBRARIES += libvirt_driver_uml.la
1525
libvirt_driver_uml_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1526
libvirt_driver_uml_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1527

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

D
Daniel Veillard 已提交
1537

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

1540 1541
ESX_GENERATED_STAMP = .esx_vi_generator.stamp

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

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

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

MAINTAINERCLEANFILES += $(ESX_DRIVER_GENERATED) $(ESX_GENERATED_STAMP)

D
Daniel Veillard 已提交
1553

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

M
Matthias Bolte 已提交
1565

1566 1567
BUILT_SOURCES += $(HYPERV_DRIVER_GENERATED)

1568 1569
HYPERV_GENERATED_STAMP = .hyperv_wmi_generator.stamp

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

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

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

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

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

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

R
Roman Bogorodskiy 已提交
1608 1609 1610 1611 1612
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
1613
libvirt_driver_bhyve_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1614
libvirt_driver_bhyve_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
R
Roman Bogorodskiy 已提交
1615 1616

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

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

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

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


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

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

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

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

1703
if WITH_STORAGE
1704 1705 1706
noinst_LTLIBRARIES += libvirt_driver_storage_impl.la
libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_LIBADD = libvirt_driver_storage_impl.la
1707
mod_LTLIBRARIES += libvirt_driver_storage.la
1708
libvirt_driver_storage_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1709
libvirt_driver_storage_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1710
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
1711 1712 1713


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

1718
storagebackend_LTLIBRARIES += libvirt_storage_backend_fs.la
1719
libvirt_storage_backend_fs_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1720
libvirt_storage_backend_fs_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1721
endif WITH_STORAGE
1722

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

1730
storagebackend_LTLIBRARIES += libvirt_storage_backend_logical.la
1731
libvirt_storage_backend_logical_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1732
libvirt_storage_backend_logical_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1733
endif WITH_STORAGE_LVM
1734

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

1743
storagebackend_LTLIBRARIES += libvirt_storage_backend_iscsi.la
1744
libvirt_storage_backend_iscsi_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1745
libvirt_storage_backend_iscsi_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1746
endif WITH_STORAGE_ISCSI
1747

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

1754
storagebackend_LTLIBRARIES += libvirt_storage_backend_scsi.la
1755
libvirt_storage_backend_scsi_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1756
libvirt_storage_backend_scsi_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1757
endif WITH_STORAGE_SCSI
1758

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

1768
storagebackend_LTLIBRARIES += libvirt_storage_backend_mpath.la
1769
libvirt_storage_backend_mpath_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1770
libvirt_storage_backend_mpath_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1771
endif WITH_STORAGE_MPATH
D
Dave Allan 已提交
1772

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

1779
storagebackend_LTLIBRARIES += libvirt_storage_backend_disk.la
1780
libvirt_storage_backend_disk_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1781
libvirt_storage_backend_disk_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1782
endif WITH_STORAGE_DISK
1783

1784
if WITH_STORAGE_RBD
1785 1786 1787 1788 1789 1790 1791
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)

1792
storagebackend_LTLIBRARIES += libvirt_storage_backend_rbd.la
1793
libvirt_storage_backend_rbd_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1794
libvirt_storage_backend_rbd_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1795
endif WITH_STORAGE_RBD
1796

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

1804 1805 1806 1807 1808 1809 1810 1811 1812
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
1813
libvirt_storage_backend_sheepdog_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1814
libvirt_storage_backend_sheepdog_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1815
endif WITH_STORAGE_SHEEPDOG
1816

1817
if WITH_STORAGE_GLUSTER
1818 1819 1820 1821 1822 1823 1824 1825
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)

1826
storagebackend_LTLIBRARIES += libvirt_storage_backend_gluster.la
1827
libvirt_storage_backend_gluster_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1828
libvirt_storage_backend_gluster_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1829 1830
endif WITH_STORAGE_GLUSTER

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

1837
storagebackend_LTLIBRARIES += libvirt_storage_backend_zfs.la
1838
libvirt_storage_backend_zfs_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1839
libvirt_storage_backend_zfs_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
R
Roman Bogorodskiy 已提交
1840 1841
endif WITH_STORAGE_ZFS

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

1849
storagebackend_LTLIBRARIES += libvirt_storage_backend_vstorage.la
1850
libvirt_storage_backend_vstorage_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1851
libvirt_storage_backend_vstorage_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1852 1853
endif WITH_STORAGE_VSTORAGE

1854 1855 1856 1857 1858
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)

1859
libvirt_driver_nodedev_la_CFLAGS = \
1860 1861
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1862
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1863
libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1864
libvirt_driver_nodedev_la_LIBADD =
1865

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

1879
libvirt_driver_nodedev_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1880
endif WITH_NODE_DEVICES
1881 1882


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


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

1922 1923
libvirt_driver_access_la_SOURCES = \
	$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
1924 1925 1926
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
1927
		-I$(srcdir)/conf $(AM_CFLAGS)
1928 1929 1930
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD =

1931 1932
EXTRA_DIST += access/genpolkit.pl

1933 1934 1935 1936
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
    $(srcdir)/access/genpolkit.pl Makefile.am
	$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@

1937 1938 1939 1940
if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)

polkitactiondir = $(datadir)/polkit-1/actions
1941
if WITH_LIBVIRTD
1942
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
1943
endif WITH_LIBVIRTD
1944 1945 1946

CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
1947
else ! WITH_POLKIT1
1948
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
1949
endif ! WITH_POLKIT1
1950

1951

1952 1953
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967

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

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

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

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

2014
# Add all conditional sources just in case...
2015 2016 2017 2018 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
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) \
2060
		$(ACCESS_DRIVER_POLKIT_POLICY)
2061

2062 2063
check-local: check-augeas

2064 2065 2066 2067 2068
.PHONY: check-augeas \
	check-augeas-qemu \
	check-augeas-lxc \
	check-augeas-sanlock \
	check-augeas-lockd \
2069
	check-augeas-libxl \
2070
	check-augeas-bhyve \
2071
	$(NULL)
2072

2073
check-augeas: check-augeas-qemu check-augeas-lxc check-augeas-sanlock \
2074
	check-augeas-lockd check-augeas-virtlockd check-augeas-libxl \
2075
	check-augeas-bhyve check-augeas-virtlogd
2076

2077
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
2078
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
2079

2080
if WITH_QEMU
2081 2082
test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
		$(srcdir)/qemu/qemu.conf $(AUG_GENTEST)
E
Eric Blake 已提交
2083
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
2084

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

2093
if WITH_LXC
2094 2095
test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
		$(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
E
Eric Blake 已提交
2096
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
2097

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

2106
if WITH_SANLOCK
2107 2108
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
2109
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
2110

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

2119
if WITH_QEMU
2120 2121 2122
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 $< $@
2123 2124 2125
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
2126

2127 2128
test_virtlockd.aug: locking/test_virtlockd.aug.in \
		locking/virtlockd.conf $(AUG_GENTEST)
2129
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
2130

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

2140 2141 2142 2143 2144
check-augeas-virtlockd: test_virtlockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
	fi

2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157
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

2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170
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

2171 2172 2173 2174 2175 2176 2177 2178 2179
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

2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198
#
# 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.
#

2199
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
2200

2201
if WITH_LINUX
2202
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
2203
else ! WITH_LINUX
2204
SYM_FILES += $(srcdir)/libvirt_linux.syms
2205
endif ! WITH_LINUX
2206

2207
if WITH_ESX
2208
USED_SYM_FILES += $(srcdir)/libvirt_esx.syms
2209
else ! WITH_ESX
2210
SYM_FILES += $(srcdir)/libvirt_esx.syms
2211
endif ! WITH_ESX
2212

E
Eric Blake 已提交
2213 2214 2215 2216 2217 2218
if WITH_REMOTE
USED_SYM_FILES += $(srcdir)/libvirt_remote.syms
else ! WITH_REMOTE
SYM_FILES += $(srcdir)/libvirt_remote.syms
endif ! WITH_REMOTE

2219
if WITH_OPENVZ
2220
USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms
2221
else ! WITH_OPENVZ
2222
SYM_FILES += $(srcdir)/libvirt_openvz.syms
2223
endif ! WITH_OPENVZ
2224

2225
if WITH_VMX
2226
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
2227
else ! WITH_VMX
2228
SYM_FILES += $(srcdir)/libvirt_vmx.syms
2229
endif ! WITH_VMX
2230

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

2243
if WITH_SASL
2244
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
2245
else ! WITH_SASL
2246
SYM_FILES += $(srcdir)/libvirt_sasl.syms
2247
endif ! WITH_SASL
E
Eric Blake 已提交
2248

2249 2250
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2251
else ! WITH_GNUTLS
2252
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2253
endif ! WITH_GNUTLS
2254

2255
if WITH_SSH2
2256
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2257
else ! WITH_SSH2
2258
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2259
endif ! WITH_SSH2
2260

2261
if WITH_ATOMIC_OPS_PTHREAD
2262
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
2263
else ! WITH_ATOMIC_OPS_PTHREAD
2264
SYM_FILES += $(srcdir)/libvirt_atomic.syms
2265
endif ! WITH_ATOMIC_OPS_PTHREAD
2266

2267 2268 2269 2270 2271 2272
if WITH_LIBSSH
USED_SYM_FILES += $(srcdir)/libvirt_libssh.syms
else ! WITH_LIBSSH
SYM_FILES += $(srcdir)/libvirt_libssh.syms
endif ! WITH_LIBSSH

2273
EXTRA_DIST += \
2274 2275 2276 2277 2278 2279
	libvirt_public.syms \
	libvirt_lxc.syms \
	libvirt_qemu.syms \
	libvirt_admin_public.syms \
	$(SYM_FILES) \
	$(ADMIN_SYM_FILES) \
2280
	$(NULL)
2281

2282
BUILT_SOURCES += $(GENERATED_SYM_FILES)
2283

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

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

2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318
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

2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333

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) \
2334
		$(XDR_CFLAGS) \
2335 2336 2337 2338 2339 2340
		-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)

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

libvirt_admin_la_LDFLAGS = \
2352 2353
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_ADMIN_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
2354
		$(AM_LDFLAGS)
M
Martin Kletzander 已提交
2355 2356

libvirt_admin_la_LIBADD = \
2357
		libvirt.la \
M
Martin Kletzander 已提交
2358 2359 2360
		$(CYGWIN_EXTRA_LIBADD)

libvirt_admin_la_CFLAGS = \
2361 2362 2363
		$(AM_CFLAGS) \
		-I$(srcdir)/remote \
		-I$(srcdir)/rpc \
M
Martin Kletzander 已提交
2364 2365 2366
		-I$(srcdir)/admin

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

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

2385 2386
ADMIN_SYM_FILES = $(srcdir)/libvirt_admin_private.syms

M
Martin Kletzander 已提交
2387 2388 2389 2390
if WITH_DTRACE_PROBES
libvirt_admin_la_LIBADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

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

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

2421 2422 2423
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

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

tapsetdir = $(datadir)/systemtap/tapset
2430
tapset_DATA = libvirt_probes.stp libvirt_qemu_probes.stp libvirt_functions.stp
2431

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

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

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

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

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

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

2473
EXTRA_DIST += libvirt_probes.d libvirt_qemu_probes.d
2474

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

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

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

2503 2504
libvirt_setuid_rpc_client_la_SOURCES = \
		util/viralloc.c \
2505
		util/virarch.c \
2506 2507 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
		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 \
2571 2572
		$(NULL)

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

2588 2589 2590
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

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

2614 2615 2616 2617 2618 2619
if WITH_LIBXL
nodist_conf_DATA += locking/libxl-lockd.conf
BUILT_SOURCES += locking/libxl-lockd.conf
DISTCLEANFILES += locking/libxl-lockd.conf
endif WITH_LIBXL

2620 2621 2622 2623 2624
locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
	$(AM_V_GEN)$(MKDIR_P) locking ; \
	cp $< $@


2625
sbin_PROGRAMS = virtlockd virtlogd
2626

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

2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667

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) \
2668
		$(NO_UNDEFINED_LDFLAGS) \
2669 2670
		$(NULL)
virtlogd_LDADD = \
2671
		libvirt_driver_admin.la \
2672 2673 2674 2675 2676 2677 2678 2679 2680 2681
		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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

EXTRA_DIST += \
        locking/virtlockd.service.in \
        locking/virtlockd.socket.in \
2804 2805 2806
        locking/virtlockd.aug \
        locking/virtlockd.conf \
        locking/test_virtlockd.aug.in \
2807 2808
        logging/virtlogd.service.in \
        logging/virtlogd.socket.in \
J
John Ferlan 已提交
2809
        logging/virtlogd-admin.socket.in \
2810 2811 2812
        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
BUILT_SOURCES += virtlockd.service virtlockd.socket \
J
John Ferlan 已提交
2824
		 virtlogd.service virtlogd.socket virtlogd-admin.socket
2825
DISTCLEANFILES += virtlockd.service virtlockd.socket \
J
John Ferlan 已提交
2826
		  virtlogd.service virtlogd.socket virtlogd-admin.socket
2827

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

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

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

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

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

virtlogd.socket: logging/virtlogd.socket.in $(top_builddir)/config.status
J
John Ferlan 已提交
2878 2879 2880 2881 2882 2883 2884
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
	    mv $@-t $@

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

2890

2891
if WITH_SANLOCK
2892
lockdriver_LTLIBRARIES += sanlock.la
2893
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
2894
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
2895
sanlock_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
2896
sanlock_la_LIBADD = -lsanlock_client libvirt.la ../gnulib/lib/libgnu.la
2897 2898

augeas_DATA += locking/libvirt_sanlock.aug
2899 2900
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
2901

E
Eric Blake 已提交
2902
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
2903
	$(AM_V_GEN)$(MKDIR_P) locking ; \
2904 2905 2906
	cp $< $@

if WITH_QEMU
2907
nodist_conf_DATA += locking/qemu-sanlock.conf
2908
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
2909
DISTCLEANFILES += locking/qemu-sanlock.conf
2910
endif WITH_QEMU
2911 2912 2913 2914 2915 2916

if WITH_LIBXL
nodist_conf_DATA += locking/libxl-sanlock.conf
BUILT_SOURCES += locking/libxl-sanlock.conf
DISTCLEANFILES += locking/libxl-sanlock.conf
endif WITH_LIBXL
2917
else ! WITH_SANLOCK
2918
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
2919
endif ! WITH_SANLOCK
2920 2921
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
2922
	locking/test_libvirt_sanlock.aug.in
2923

2924 2925 2926 2927
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
2928

2929 2930 2931 2932 2933
libvirt_la_BUILT_LIBADD += \
       libvirt-net-rpc.la \
       libvirt-net-rpc-server.la \
       libvirt-net-rpc-client.la

2934
EXTRA_DIST += \
E
Eric Blake 已提交
2935 2936 2937 2938
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
2939 2940
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
2941

E
Eric Blake 已提交
2942
VIR_NET_RPC_GENERATED = \
2943 2944 2945 2946
	rpc/virnetprotocol.h \
	rpc/virnetprotocol.c \
	rpc/virkeepaliveprotocol.h \
	rpc/virkeepaliveprotocol.c
2947

2948
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2949

2950
libvirt_net_rpc_la_SOURCES = \
2951
	rpc/virnetmessage.h rpc/virnetmessage.c \
2952
	rpc/virnetsocket.h rpc/virnetsocket.c \
2953 2954
	rpc/virkeepalive.h rpc/virkeepalive.c \
	$(VIR_NET_RPC_GENERATED)
2955
if WITH_SSH2
2956 2957
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2958
else ! WITH_SSH2
2959 2960
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2961
endif ! WITH_SSH2
2962
if WITH_GNUTLS
2963 2964
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2965
else ! WITH_GNUTLS
2966 2967
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2968
endif ! WITH_GNUTLS
2969
if WITH_SASL
2970 2971
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2972
else ! WITH_SASL
2973 2974
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2975
endif ! WITH_SASL
2976 2977 2978 2979 2980 2981 2982
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
2983
libvirt_net_rpc_la_CFLAGS = \
2984
			$(GNUTLS_CFLAGS) \
2985
			$(SASL_CFLAGS) \
2986
			$(SSH2_CFLAGS) \
2987
			$(LIBSSH_CFLAGS) \
2988
			$(XDR_CFLAGS) \
2989 2990
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
2991
			$(GNUTLS_LIBS) \
2992
			$(SASL_LIBS) \
2993
			$(SSH2_LIBS)\
2994
			$(LIBSSH_LIBS) \
J
Jim Fehlig 已提交
2995
			$(SECDRIVER_LIBS) \
2996
			$(AM_LDFLAGS) \
2997
			$(NULL)
2998 2999 3000
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

3001 3002 3003 3004
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
3005
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
3006
	rpc/virnetdaemon.h rpc/virnetdaemon.c \
3007 3008
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
3009
			$(AVAHI_CFLAGS) \
3010
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
3011
			$(XDR_CFLAGS) \
3012
			$(AM_CFLAGS)
3013 3014
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
3015
			$(AVAHI_LIBS) \
3016
			$(DBUS_LIBS) \
3017
			$(NULL)
3018 3019 3020
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

3021 3022 3023 3024 3025
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 已提交
3026 3027
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
3028
libvirt_net_rpc_client_la_LDFLAGS = $(AM_LDFLAGS)
3029 3030
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
3031

3032 3033
libexec_PROGRAMS =

3034
if WITH_LIBVIRTD
3035 3036
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
3037 3038 3039 3040
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3041 3042
libvirt_iohelper_LDADD = \
		libvirt_util.la \
3043
		../gnulib/lib/libgnu.la
3044 3045
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
3046
endif WITH_DTRACE_PROBES
3047

D
Daniel P. Berrange 已提交
3048 3049 3050 3051
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
3052 3053 3054 3055

if WITH_NETWORK
libexec_PROGRAMS += libvirt_leaseshelper
libvirt_leaseshelper_SOURCES = $(NETWORK_LEASES_HELPER_SOURCES)
3056 3057 3058 3059
libvirt_leaseshelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3060 3061
libvirt_leaseshelper_LDADD = \
               libvirt_util.la \
3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074
               ../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

3075
endif WITH_LIBVIRTD
3076

3077
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
3078
if WITH_LIBVIRTD
3079
libexec_PROGRAMS += libvirt_parthelper
3080

3081
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
D
Daniel P. Berrange 已提交
3082 3083 3084 3085
libvirt_parthelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3086 3087 3088
libvirt_parthelper_LDADD = \
		$(LIBPARTED_LIBS) \
		libvirt_util.la \
3089
		../gnulib/lib/libgnu.la
3090 3091
if WITH_DTRACE_PROBES
libvirt_parthelper_LDADD += libvirt_probes.lo
3092
endif WITH_DTRACE_PROBES
3093

D
Daniel P. Berrange 已提交
3094 3095 3096 3097 3098
libvirt_parthelper_CFLAGS = \
		$(LIBPARTED_CFLAGS) \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
3099 3100
endif WITH_LIBVIRTD
endif WITH_STORAGE_DISK
3101 3102
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)

3103

3104
if WITH_SANLOCK
3105 3106 3107
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
3108
libvirt_sanlock_helper_CFLAGS = \
3109
		-I$(srcdir)/conf \
D
Daniel P. Berrange 已提交
3110 3111 3112 3113 3114 3115 3116
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3117
libvirt_sanlock_helper_LDADD = libvirt.la
3118
endif WITH_SANLOCK
3119

3120 3121 3122 3123
if WITH_LXC
if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_lxc

3124 3125
libvirt_lxc_SOURCES = \
		$(LXC_CONTROLLER_SOURCES) \
O
Osier Yang 已提交
3126
		$(DATATYPES_SOURCES)
D
Daniel P. Berrange 已提交
3127 3128 3129
libvirt_lxc_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
3130 3131
		$(CAPNG_LIBS) \
		$(LIBXML_LIBS) \
D
Daniel P. Berrange 已提交
3132
		$(NULL)
3133
libvirt_lxc_LDADD = \
G
Gao feng 已提交
3134
		$(FUSE_LIBS) \
3135
		libvirt.la \
3136
		../gnulib/lib/libgnu.la
3137
if WITH_DTRACE_PROBES
3138
libvirt_lxc_LDADD += libvirt_probes.lo
3139
endif WITH_DTRACE_PROBES
3140
libvirt_lxc_LDADD += $(SECDRIVER_LIBS)
3141 3142 3143 3144
libvirt_lxc_CFLAGS = \
		-I$(srcdir)/conf \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
3145 3146
		$(CAPNG_CFLAGS) \
		$(LIBXML_CFLAGS) \
3147 3148 3149 3150
		$(LIBNL_CFLAGS) \
		$(FUSE_CFLAGS) \
		$(DBUS_CFLAGS) \
		$(XDR_CFLAGS) \
D
Daniel P. Berrange 已提交
3151
		$(NULL)
3152
if WITH_BLKID
3153 3154
libvirt_lxc_CFLAGS += $(BLKID_CFLAGS)
libvirt_lxc_LDADD += $(BLKID_LIBS)
3155
endif WITH_BLKID
J
Jim Fehlig 已提交
3156
libvirt_lxc_CFLAGS += $(SECDRIVER_CFLAGS)
3157 3158
endif WITH_LIBVIRTD
endif WITH_LXC
3159 3160
EXTRA_DIST += $(LXC_CONTROLLER_SOURCES)

J
Jamie Strandboge 已提交
3161 3162 3163 3164 3165 3166
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 已提交
3167 3168 3169 3170
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3171 3172 3173 3174 3175
virt_aa_helper_LDADD = \
		libvirt.la \
		libvirt_conf.la \
		libvirt_util.la \
		libvirt_driver_storage_impl.la \
C
Chris Lalancette 已提交
3176
		../gnulib/lib/libgnu.la
3177
if WITH_DTRACE_PROBES
3178
virt_aa_helper_LDADD += libvirt_probes.lo
3179
endif WITH_DTRACE_PROBES
3180 3181 3182 3183 3184
virt_aa_helper_CFLAGS = \
		-I$(srcdir)/conf \
		-I$(srcdir)/security \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
D
Daniel P. Berrange 已提交
3185
		$(NULL)
3186 3187
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
J
Jamie Strandboge 已提交
3188 3189
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

3190
if WITH_NSS
3191 3192
noinst_LTLIBRARIES += libvirt-nss.la

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 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241
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 \
3242 3243
		$(NULL)

3244 3245 3246 3247
libvirt_nss_la_CFLAGS = \
		-DLIBVIRT_NSS \
		$(AM_CFLAGS) \
		$(YAJL_CFLAGS) \
3248
		$(NULL)
3249 3250
libvirt_nss_la_LDFLAGS = \
		$(AM_LDFLAGS) \
3251 3252
		$(NULL)

3253 3254
libvirt_nss_la_LIBADD = \
		$(YAJL_LIBS) \
3255
		$(NULL)
3256
endif WITH_NSS
3257 3258


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

3314
uninstall-local:: uninstall-init uninstall-systemd
3315
if WITH_LIBVIRTD
3316
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
3317 3318
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
3319
endif WITH_LIBVIRTD
3320 3321
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
3322
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
3323
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
3324
if WITH_SANLOCK
3325
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
3326
endif WITH_SANLOCK
3327 3328 3329 3330 3331
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" ||:
3332
endif WITH_QEMU
3333 3334 3335
if WITH_LXC
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||:
3336
endif WITH_LXC
J
Jim Fehlig 已提交
3337 3338 3339
if WITH_LIBXL
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||:
J
Jim Fehlig 已提交
3340
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||:
3341
endif WITH_LIBXL
3342 3343 3344
if WITH_UML
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/uml" ||:
3345
endif WITH_UML
3346 3347
if WITH_XEN
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/xen" ||:
3348
endif WITH_XEN
3349
if WITH_NETWORK
3350 3351 3352 3353
	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" || :
3354 3355
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||:
3356
endif WITH_NETWORK
3357
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
3358

3359 3360
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
3361
MAINTAINERCLEANFILES += $(REMOTE_DRIVER_GENERATED) $(VIR_NET_RPC_GENERATED)