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

3
## Copyright (C) 2005-2018 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 67 68 69 70
DRIVER_SOURCE_FILES =
STATEFUL_DRIVER_SOURCE_FILES =
noinst_LTLIBRARIES =
mod_LTLIBRARIES =
INSTALL_DATA_DIRS =
71
libvirt_la_BUILT_LIBADD =
72 73 74
SYM_FILES =
USED_SYM_FILES =
GENERATED_SYM_FILES =
75 76

include uml/Makefile.inc.am
77
include phyp/Makefile.inc.am
78
include test/Makefile.inc.am
79
include esx/Makefile.inc.am
80
include hyperv/Makefile.inc.am
81
include vmware/Makefile.inc.am
82
include vbox/Makefile.inc.am
83 84 85 86

install-data-extra: $(INSTALL_DATA_DIRS:%=install-data-%)
uninstall-data-extra: $(INSTALL_DATA_DIRS:%=install-data-%)

87

E
Eric Blake 已提交
88 89
THREAD_LIBS = $(LIB_PTHREAD) $(LTLIBMULTITHREAD)

J
Jim Fehlig 已提交
90
SECDRIVER_CFLAGS =
91 92
SECDRIVER_LIBS =
if WITH_SECDRIVER_SELINUX
J
Jim Fehlig 已提交
93
SECDRIVER_CFLAGS += $(SELINUX_CFLAGS)
94
SECDRIVER_LIBS += $(SELINUX_LIBS)
95
endif WITH_SECDRIVER_SELINUX
96
if WITH_SECDRIVER_APPARMOR
J
Jim Fehlig 已提交
97
SECDRIVER_CFLAGS += $(APPARMOR_CFLAGS)
98
SECDRIVER_LIBS += $(APPARMOR_LIBS)
99
endif WITH_SECDRIVER_APPARMOR
100

101 102
if WITH_NETWORK
UUID=$(shell uuidgen 2>/dev/null)
103
endif WITH_NETWORK
104

105
lib_LTLIBRARIES = libvirt.la libvirt-qemu.la libvirt-lxc.la
106

107
moddir = $(libdir)/libvirt/connection-driver
108
sbin_PROGRAMS =
109

A
Amy Griffis 已提交
110
confdir = $(sysconfdir)/libvirt
111
conf_DATA = libvirt.conf libvirt-admin.conf
112

113 114 115 116 117 118
augeasdir = $(datadir)/augeas/lenses
augeas_DATA =

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

119 120
# These files are not related to driver APIs. Simply generic
# helper APIs for various purposes
121 122 123 124 125 126 127 128 129 130 131 132
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 \
133
		util/vircommand.c util/vircommand.h util/vircommandpriv.h \
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
		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 \
154
		util/virhostcpu.c util/virhostcpu.h util/virhostcpupriv.h \
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
		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 \
170
		util/virnetdevbandwidth.h util/virnetdevbandwidth.c \
171 172 173
		util/virnetdevbridge.h util/virnetdevbridge.c \
		util/virnetdevip.h util/virnetdevip.c \
		util/virnetdevmacvlan.c util/virnetdevmacvlan.h \
174
		util/virnetdevmidonet.h util/virnetdevmidonet.c \
A
Ansis Atteka 已提交
175
		util/virnetdevopenvswitch.h util/virnetdevopenvswitch.c \
176 177 178
		util/virnetdevtap.h util/virnetdevtap.c \
		util/virnetdevveth.h util/virnetdevveth.c \
		util/virnetdevvlan.h util/virnetdevvlan.c \
179
		util/virnetdevvportprofile.h util/virnetdevvportprofile.c \
180 181 182 183 184 185 186 187
		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 已提交
188
		util/virportallocator.c util/virportallocator.h \
189 190 191 192
		util/virprobe.h \
		util/virprocess.c util/virprocess.h \
		util/virqemu.c util/virqemu.h \
		util/virrandom.h util/virrandom.c \
193
		util/virresctrl.h util/virresctrl.c util/virresctrlpriv.h \
194 195 196 197 198 199 200 201
		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 \
202
		util/virstorageencryption.c util/virstorageencryption.h \
203
		util/virstoragefile.c util/virstoragefile.h \
204
		util/virstoragefilebackend.c util/virstoragefilebackend.h \
205 206
		util/virstring.h util/virstring.c \
		util/virsysinfo.c util/virsysinfo.h util/virsysinfopriv.h \
207
		util/virsystemd.c util/virsystemd.h util/virsystemdpriv.h \
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222
		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 \
223
		$(NULL)
L
Lai Jiangshan 已提交
224

225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249
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

250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279
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 $@

280
KEYCODES = linux osx atset1 atset2 atset3 xtkbd usb win32 rfb
281 282 283 284 285 286 287
KEYNAMES = linux osx win32

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

288 289 290 291 292 293
KEYPODS = $(KEYCODES:%=util/virkeycode-%.pod) \
	  $(KEYNAMES:%=util/virkeyname-%.pod)
KEYMANS = $(KEYPODS:%.pod=%.7)

man7_MANS = $(KEYMANS)

294 295 296
UTIL_SOURCES += $(KEYTABLES)
BUILT_SOURCES += $(KEYTABLES)
MAINTAINERCLEANFILES += $(KEYTABLES)
297
CLEANFILES += $(KEYMANS) $(KEYPODS)
L
Lai Jiangshan 已提交
298

299
# Internal generic driver infrastructure
O
Osier Yang 已提交
300
DATATYPES_SOURCES = datatypes.h datatypes.c
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329
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 \
330
		$(NULL)
331

332 333 334
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

335 336
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
337

338
LOCK_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
339 340
		locking/lock_protocol.h \
		locking/lock_protocol.c \
341 342
		$(NULL)

343 344 345
LOCK_PROTOCOL = $(srcdir)/locking/lock_protocol.x
EXTRA_DIST += $(LOCK_PROTOCOL) \
	$(LOCK_PROTOCOL_GENERATED)
346 347 348
BUILT_SOURCES += $(LOCK_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(LOCK_PROTOCOL_GENERATED)

349
LOCK_DAEMON_GENERATED = \
350
		locking/lock_daemon_dispatch_stubs.h
351 352 353
		$(NULL)

BUILT_SOURCES += $(LOCK_DAEMON_GENERATED)
354
EXTRA_DIST += $(LOCK_DAEMON_GENERATED)
355 356
MAINTAINERCLEANFILES += $(LOCK_DAEMON_GENERATED)

357 358
LOCK_DRIVER_LOCKD_SOURCES = \
		locking/lock_driver_lockd.c \
359
		locking/lock_driver_lockd.h \
360 361
		$(NULL)

362 363 364 365 366
LOCK_DAEMON_SOURCES = \
		locking/lock_daemon.h \
		locking/lock_daemon.c \
		locking/lock_daemon_config.h \
		locking/lock_daemon_config.c \
367 368
		locking/lock_daemon_dispatch.c \
		locking/lock_daemon_dispatch.h \
369 370
		$(NULL)

E
Eric Blake 已提交
371
locking/lock_daemon_dispatch_stubs.h: $(LOCK_PROTOCOL) \
372
		$(srcdir)/rpc/gendispatch.pl Makefile.am
373 374
	$(AM_V_GEN)perl -w $(srcdir)/rpc/gendispatch.pl --mode=server \
	    virLockSpaceProtocol VIR_LOCK_SPACE_PROTOCOL \
E
Eric Blake 已提交
375
	    $(LOCK_PROTOCOL) > $(srcdir)/locking/lock_daemon_dispatch_stubs.h
376 377


378 379 380 381 382
LOG_PROTOCOL_GENERATED = \
		logging/log_protocol.h \
		logging/log_protocol.c \
		$(NULL)

383 384
DRIVER_SOURCES += $(LOG_PROTOCOL_GENERATED)

385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405
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 \
406 407
		logging/log_handler.c \
		logging/log_handler.h \
408 409 410 411 412 413 414 415 416
		$(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


417
NETDEV_CONF_SOURCES = \
418
		conf/netdev_bandwidth_conf.h conf/netdev_bandwidth_conf.c \
419 420
		conf/netdev_vport_profile_conf.h conf/netdev_vport_profile_conf.c \
		conf/netdev_vlan_conf.h conf/netdev_vlan_conf.c
421

422
# XML configuration format handling sources
423
# Domain driver generic impl APIs
424 425 426 427 428 429 430 431 432 433
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 \
434
		conf/virdomainobjlist.c conf/virdomainobjlist.h
435

436
OBJECT_EVENT_SOURCES = \
437 438 439
		conf/object_event.c conf/object_event.h \
		conf/object_event_private.h

440
DOMAIN_EVENT_SOURCES = \
441
		conf/domain_event.c conf/domain_event.h
442

443
NETWORK_EVENT_SOURCES = \
444 445
		conf/network_event.c conf/network_event.h

446
STORAGE_EVENT_SOURCES = \
447 448
                conf/storage_event.c conf/storage_event.h

449
NODE_DEVICE_EVENT_SOURCES = \
450 451
                conf/node_device_event.c conf/node_device_event.h

452
SECRET_EVENT_SOURCES = \
453 454
                conf/secret_event.c conf/secret_event.h

455
# Network driver generic impl APIs
456 457 458
NETWORK_CONF_SOURCES = \
		conf/network_conf.c conf/network_conf.h \
		conf/virnetworkobj.c conf/virnetworkobj.h \
459
		conf/networkcommon_conf.c conf/networkcommon_conf.h
460

461
# Network filter driver generic impl APIs
462 463 464 465 466
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 已提交
467
		conf/virnwfilterobj.h
468

469 470 471
NWFILTER_CONF_SOURCES = \
		$(NWFILTER_PARAM_CONF_SOURCES) \
		conf/nwfilter_conf.c conf/nwfilter_conf.h \
J
John Ferlan 已提交
472
		conf/virnwfilterobj.c conf/virnwfilterobj.h
473

474
# Storage driver generic impl APIs
475
STORAGE_CONF_SOURCES = \
476
		conf/storage_adapter_conf.h conf/storage_adapter_conf.c \
477
		conf/storage_conf.h conf/storage_conf.c \
J
John Ferlan 已提交
478
		conf/virstorageobj.h conf/virstorageobj.c
479

480
# Interface driver generic impl APIs
481 482
INTERFACE_CONF_SOURCES = \
		conf/interface_conf.c conf/interface_conf.h \
J
John Ferlan 已提交
483
		conf/virinterfaceobj.c conf/virinterfaceobj.h
484

485
# Secret driver generic impl APIs
486 487
SECRET_CONF_SOURCES = \
		conf/secret_conf.h conf/secret_conf.c \
488
		conf/virsecretobj.h conf/virsecretobj.c
489 490

# Network driver generic impl APIs
491
NODE_DEVICE_CONF_SOURCES = \
J
John Ferlan 已提交
492 493
		conf/node_device_conf.c conf/node_device_conf.h \
		conf/virnodedeviceobj.c conf/virnodedeviceobj.h
494

495
CPU_CONF_SOURCES = \
496
		conf/cpu_conf.c conf/cpu_conf.h
497

498
# Safe character device handling helper APIs
499
CHRDEV_CONF_SOURCES = \
500
		conf/virchrdev.c conf/virchrdev.h
501

502
# Device Helper APIs
503
DEVICE_CONF_SOURCES = \
504 505
		conf/device_conf.c conf/device_conf.h

506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522
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) \
523
		$(DEVICE_CONF_SOURCES)
524

525
# The remote RPC driver, covering domains, storage, networks, etc
526
REMOTE_DRIVER_GENERATED = \
527 528 529 530 531 532 533 534 535
		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 已提交
536
		$(NULL)
E
Eric Blake 已提交
537 538

REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x
539
LXC_PROTOCOL = $(srcdir)/remote/lxc_protocol.x
E
Eric Blake 已提交
540
QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x
541
REMOTE_DRIVER_PROTOCOL = $(REMOTE_PROTOCOL) $(QEMU_PROTOCOL) $(LXC_PROTOCOL)
542

E
Eric Blake 已提交
543
remote/remote_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
544
		$(REMOTE_PROTOCOL) Makefile.am
545
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
546 547
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/remote/remote_client_bodies.h
548

E
Eric Blake 已提交
549
remote/lxc_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
550
		$(LXC_PROTOCOL) Makefile.am
551
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
552 553
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/remote/lxc_client_bodies.h
554

E
Eric Blake 已提交
555
remote/qemu_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
556
		$(QEMU_PROTOCOL) Makefile.am
557
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
558 559
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/remote/qemu_client_bodies.h
560

561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578
remote/remote_daemon_dispatch_stubs.h: $(srcdir)/rpc/gendispatch.pl \
		$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
	  --mode=server remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/remote/remote_daemon_dispatch_stubs.h

remote/remote_daemon_dispatch_lxc_stubs.h: $(srcdir)/rpc/gendispatch.pl \
		$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
	  --mode=server lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/remote/remote_daemon_dispatch_lxc_stubs.h

remote/remote_daemon_dispatch_qemu_stubs.h: $(srcdir)/rpc/gendispatch.pl \
		$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
	  --mode=server qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/remote/remote_daemon_dispatch_qemu_stubs.h

579 580
REMOTE_DRIVER_SOURCES = \
		remote/remote_driver.c remote/remote_driver.h \
581
		$(REMOTE_DRIVER_GENERATED)
582

583 584 585 586 587 588 589 590 591 592 593 594 595
LIBVIRTD_GENERATED = \
		remote/remote_daemon_dispatch_stubs.h \
		remote/remote_daemon_dispatch_lxc_stubs.h \
		remote/remote_daemon_dispatch_qemu_stubs.h \
		$(NULL)

LIBVIRTD_SOURCES = \
		remote/remote_daemon.c remote/remote_daemon.h \
		remote/remote_daemon_config.c remote/remote_daemon_config.h \
		remote/remote_daemon_dispatch.c remote/remote_daemon_dispatch.h \
		remote/remote_daemon_stream.c remote/remote_daemon_stream.h \
		$(LIBVIRTD_GENERATED)

596
EXTRA_DIST +=  $(REMOTE_DRIVER_PROTOCOL) \
597 598 599
		$(REMOTE_DRIVER_GENERATED) \
		$(LIBVIRTD_SOURCES) \
		$(NULL)
600

M
Martin Kletzander 已提交
601 602 603
ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x

ADMIN_PROTOCOL_GENERATED = \
604 605
		admin/admin_protocol.c \
		admin/admin_protocol.h \
606 607 608
		admin/admin_client.h \
		admin/admin_server_dispatch_stubs.h \
		$(NULL)
609 610 611 612 613 614

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

616 617 618 619 620 621
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 已提交
622 623 624 625
EXTRA_DIST += $(ADMIN_PROTOCOL) $(ADMIN_PROTOCOL_GENERATED)
BUILT_SOURCES += $(ADMIN_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(ADMIN_PROTOCOL_GENERATED)

626 627 628 629 630 631 632 633 634 635
# 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
636 637 638 639

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

650
# Depending on configure options, libtool creates one or both of
E
Eric Blake 已提交
651 652
# remote/{,.libs/}libvirt_driver_remote_la-remote_protocol.o.  We want
# the newest of the two, in case configure options changed and a stale
653
# file is left around from an earlier build.
654
PDWTAGS = \
655 656 657 658 659 660 661 662
	$(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?; \
663
	    echo 'WARNING: pdwtags appears broken; skipping the $@ test' >&2;\
664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681
	  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) {' \
682
		-e '    warn "WARNING: your pdwtags program is too old\n";' \
683
		-e '    warn "WARNING: skipping the $@ test\n";' \
684
		-e '    warn "WARNING: install dwarves-1.3 or newer\n";' \
685 686 687 688
		-e '    exit 8;' \
		-e '  }' \
		-e '}' \
		< $(@F)-t1 > $(@F)-t3; \
689
	    case $$? in 8) rm -f $(@F)-t?; exit 0;; 0) ;; *) exit 1;; esac;\
690 691 692 693
	    diff -u $(@)s $(@F)-t3; st=$$?; rm -f $(@F)-t?; exit $$st; \
	  fi; \
	else \
	  echo 'WARNING: you lack pdwtags; skipping the $@ test' >&2; \
694
	  echo 'WARNING: install the dwarves package to get pdwtags' >&2; \
695
	fi
696

697
# .libs/libvirt.so is built by libtool as a side-effect of the Makefile
698 699
# rule for libvirt.la.  However, checking symbols relies on Linux ELF layout
if WITH_LINUX
700 701 702
check-symfile: libvirt.syms libvirt.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt.syms \
	  .libs/libvirt.so
703 704 705
check-admin-symfile: libvirt_admin.syms libvirt-admin.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt_admin.syms \
	  .libs/libvirt-admin.so
706
else ! WITH_LINUX
707
check-symfile:
708
check-admin-symfile:
709
endif ! WITH_LINUX
710
check-symsorting:
711
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
712
		$(srcdir) $(SYM_FILES)
713 714 715
check-admin-symsorting:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
		$(srcdir) $(ADMIN_SYM_FILES)
J
Jiri Denemark 已提交
716
EXTRA_DIST += check-symfile.pl check-symsorting.pl
717

E
Eric Blake 已提交
718
# Keep this list synced with RPC_PROBE_FILES
719 720
PROTOCOL_STRUCTS = \
	$(srcdir)/remote_protocol-structs \
721
	$(srcdir)/lxc_protocol-structs \
722
	$(srcdir)/qemu_protocol-structs \
J
Jiri Denemark 已提交
723
	$(srcdir)/virnetprotocol-structs \
E
Eric Blake 已提交
724 725 726
	$(srcdir)/virkeepaliveprotocol-structs \
	$(srcdir)/lxc_monitor_protocol-structs \
	$(srcdir)/lock_protocol-structs \
M
Martin Kletzander 已提交
727
	$(srcdir)/admin_protocol-structs \
E
Eric Blake 已提交
728 729
	$(NULL)

730
if WITH_REMOTE
731 732
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)

733 734
# 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.
735 736 737
$(srcdir)/remote_protocol-struct \
	$(srcdir)/qemu_protocol-struct \
	$(srcdir)/lxc_protocol-struct: \
E
Eric Blake 已提交
738
		$(srcdir)/%-struct: remote/libvirt_driver_remote_la-%.lo
739
	$(PDWTAGS)
740
$(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \
E
Eric Blake 已提交
741
		$(srcdir)/%-struct: rpc/libvirt_net_rpc_la-%.lo
742
	$(PDWTAGS)
E
Eric Blake 已提交
743
$(srcdir)/lxc_monitor_protocol-struct: \
E
Eric Blake 已提交
744
		$(srcdir)/%-struct: lxc/libvirt_driver_lxc_impl_la-%.lo
E
Eric Blake 已提交
745 746
	$(PDWTAGS)
$(srcdir)/lock_protocol-struct: \
E
Eric Blake 已提交
747
		$(srcdir)/%-struct: locking/lockd_la-%.lo
E
Eric Blake 已提交
748
	$(PDWTAGS)
M
Martin Kletzander 已提交
749 750 751
$(srcdir)/admin_protocol-struct: \
		$(srcdir)/%-struct: admin/libvirt_admin_la-%.lo
	$(PDWTAGS)
E
Eric Blake 已提交
752

753
else !WITH_REMOTE
754 755 756
# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be
# re-generated when configured --without-remote.
check-protocol:
757
endif !WITH_REMOTE
J
Jiri Denemark 已提交
758
EXTRA_DIST += $(PROTOCOL_STRUCTS)
759 760 761 762 763

check-drivername:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-drivername.pl \
		$(srcdir)/driver.h \
		$(srcdir)/libvirt_public.syms \
764
		$(srcdir)/libvirt_admin_public.syms \
765 766 767 768 769
		$(srcdir)/libvirt_qemu.syms \
		$(srcdir)/libvirt_lxc.syms

EXTRA_DIST += check-drivername.pl

770
DRIVER_SOURCE_FILES += \
771 772 773 774 775 776 777 778 779
	$(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) \
780
	$(VZ_DRIVER_SOURCES) \
781 782 783 784 785 786
	$(QEMU_DRIVER_SOURCES) \
	$(REMOTE_DRIVER_SOURCES) \
	$(SECRET_DRIVER_SOURCES) \
	$(STORAGE_DRIVER_SOURCES) \
	$(XEN_DRIVER_SOURCES) \
	$(XENAPI_DRIVER_SOURCES) \
787 788
	$(NULL)

789
STATEFUL_DRIVER_SOURCE_FILES += \
R
Roman Bogorodskiy 已提交
790
	$(BHYVE_DRIVER_SOURCES) \
791 792 793 794 795 796 797 798 799 800
	$(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) \
	$(XEN_DRIVER_SOURCES) \
801
	$(VZ_DRIVER_SOURCES) \
802 803
	$(NULL)

804 805 806

check-driverimpls:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-driverimpls.pl \
807
		$(filter /%,$(DRIVER_SOURCE_FILES)) \
E
Eric Blake 已提交
808 809 810
		$(filter $(srcdir)/%,$(DRIVER_SOURCE_FILES)) \
		$(addprefix $(srcdir)/,$(filter-out $(srcdir)/%, \
			$(filter-out /%,$(DRIVER_SOURCE_FILES))))
811

812 813
check-aclrules:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclrules.pl \
E
Eric Blake 已提交
814
		$(REMOTE_PROTOCOL) \
815
		$(addprefix $(srcdir)/,$(filter-out /%,$(STATEFUL_DRIVER_SOURCE_FILES)))
816

817 818 819 820 821
check-aclperms:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclperms.pl \
		$(srcdir)/access/viraccessperm.h \
		$(srcdir)/access/viraccessperm.c

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

824
check-local: check-protocol check-symfile check-symsorting \
825
	check-drivername check-driverimpls check-aclrules \
826
	check-aclperms check-admin-symfile check-admin-symsorting
827
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
828

829
# Now the Hypervisor specific drivers
830 831 832 833 834 835
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 \
836
		xen/xs_internal.c xen/xs_internal.h
837
if WITH_XEN_INOTIFY
838
XEN_DRIVER_SOURCES += xen/xen_inotify.c xen/xen_inotify.h
839
endif WITH_XEN_INOTIFY
840

841
LXC_MONITOR_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
842 843
	lxc/lxc_monitor_protocol.h \
	lxc/lxc_monitor_protocol.c \
844 845 846
	$(NULL)

LXC_MONITOR_GENERATED = \
E
Eric Blake 已提交
847
	lxc/lxc_monitor_dispatch.h \
848 849 850
	$(NULL)

LXC_CONTROLLER_GENERATED = \
E
Eric Blake 已提交
851
	lxc/lxc_controller_dispatch.h \
852 853 854
	$(NULL)

LXC_GENERATED = \
855
	$(LXC_MONITOR_PROTOCOL_GENERATED) \
856 857 858 859
	$(LXC_MONITOR_GENERATED) \
	$(LXC_CONTROLLER_GENERATED) \
	$(NULL)

860
LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x
861

E
Eric Blake 已提交
862
lxc/lxc_monitor_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
863
		$(LXC_MONITOR_PROTOCOL) Makefile.am
864
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
865 866
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_monitor_dispatch.h
867

E
Eric Blake 已提交
868
lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
869
		$(REMOTE_PROTOCOL) Makefile.am
870
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \
E
Eric Blake 已提交
871 872
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_controller_dispatch.h
873 874

EXTRA_DIST += \
875
	$(LXC_MONITOR_PROTOCOL) \
876 877 878 879 880
	$(LXC_GENERATED) \
	$(NULL)

BUILT_SOURCES += $(LXC_GENERATED)

881 882
CLEANFILES += $(LXC_GENERATED)

883 884 885 886 887 888 889 890 891 892 893 894
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 \
895
		lxc/lxc_driver.c lxc/lxc_driver.h
896

897 898 899 900 901 902 903 904
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 \
905
		lxc/lxc_controller.c
906

907 908
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES = \
		$(DATATYPES_SOURCES) \
J
Jamie Strandboge 已提交
909 910
		security/virt-aa-helper.c

911 912 913
OPENVZ_DRIVER_SOURCES = \
		openvz/openvz_conf.c openvz/openvz_conf.h \
		openvz/openvz_driver.c openvz/openvz_driver.h \
914
		openvz/openvz_util.c openvz/openvz_util.h
915

916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933
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 \
934
		qemu/qemu_migration_cookie.c qemu/qemu_migration_cookie.h \
935 936 937 938 939 940 941 942
		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 \
943
		qemu/qemu_security.c qemu/qemu_security.h
R
Richard W.M. Jones 已提交
944

945 946 947
XENAPI_DRIVER_SOURCES = \
		xenapi/xenapi_driver.c xenapi/xenapi_driver.h \
		xenapi/xenapi_driver_private.h \
948 949
		xenapi/xenapi_utils.c xenapi/xenapi_utils.h

950 951 952 953 954 955
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 已提交
956
		libxl/libxl_migration.c libxl/libxl_migration.h
J
Jim Fehlig 已提交
957

958 959 960 961 962 963
VZ_DRIVER_SOURCES = \
		vz/vz_driver.h \
		vz/vz_driver.c \
		vz/vz_utils.c \
		vz/vz_utils.h \
		vz/vz_sdk.h \
964
		vz/vz_sdk.c
D
Dmitry Guryanov 已提交
965

966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985
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 已提交
986 987
		$(NULL)

988
NETWORK_DRIVER_SOURCES = \
989
		network/bridge_driver.h network/bridge_driver.c \
990 991
		network/bridge_driver_platform.h \
		network/bridge_driver_platform.c \
992 993
		$(NULL)
EXTRA_DIST += network/bridge_driver_linux.c network/bridge_driver_nop.c
994

995 996 997
INTERFACE_DRIVER_SOURCES =

if WITH_INTERFACE
998 999
INTERFACE_DRIVER_SOURCES += \
		interface/interface_driver.h \
1000
		interface/interface_driver.c
1001 1002

if WITH_NETCF
1003
INTERFACE_DRIVER_SOURCES += \
1004
		interface/interface_backend_netcf.c
1005
endif WITH_NETCF
1006
if WITH_UDEV
1007
INTERFACE_DRIVER_SOURCES += \
1008
		interface/interface_backend_udev.c
1009 1010
endif WITH_UDEV
endif WITH_INTERFACE
1011

1012
SECRET_UTIL_SOURCES = \
1013 1014
		secret/secret_util.h secret/secret_util.c

1015
SECRET_DRIVER_SOURCES = \
1016
		secret/secret_driver.h secret/secret_driver.c
1017

1018
# Storage backend specific impls
1019 1020 1021
STORAGE_DRIVER_BACKEND_SOURCES = \
		storage/storage_backend.h storage/storage_backend.c

1022 1023
STORAGE_DRIVER_SOURCES = \
		storage/storage_driver.h storage/storage_driver.c \
1024
		$(STORAGE_DRIVER_BACKEND_SOURCES) \
1025
		storage/storage_util.h storage/storage_util.c
1026

1027
STORAGE_DRIVER_FS_SOURCES = \
1028
		storage/storage_backend_fs.h storage/storage_backend_fs.c
R
Richard W.M. Jones 已提交
1029

1030 1031
STORAGE_DRIVER_LVM_SOURCES = \
		storage/storage_backend_logical.h \
1032
		storage/storage_backend_logical.c
1033

1034
STORAGE_DRIVER_ISCSI_SOURCES = \
1035
		storage/storage_backend_iscsi.h storage/storage_backend_iscsi.c
1036

1037
STORAGE_DRIVER_SCSI_SOURCES = \
1038
		storage/storage_backend_scsi.h storage/storage_backend_scsi.c
1039

1040
STORAGE_DRIVER_MPATH_SOURCES = \
1041
		storage/storage_backend_mpath.h storage/storage_backend_mpath.c
D
Dave Allan 已提交
1042

1043
STORAGE_DRIVER_DISK_SOURCES = \
1044
		storage/storage_backend_disk.h storage/storage_backend_disk.c
1045

1046
STORAGE_DRIVER_RBD_SOURCES = \
1047 1048
		storage/storage_backend_rbd.h storage/storage_backend_rbd.c

1049
STORAGE_DRIVER_SHEEPDOG_SOURCES = \
1050 1051
		storage/storage_backend_sheepdog.h storage/storage_backend_sheepdog.c \
		storage/storage_backend_sheepdog_priv.h
1052

1053
STORAGE_DRIVER_GLUSTER_SOURCES = \
1054 1055
		storage/storage_backend_gluster.h storage/storage_backend_gluster.c

1056
STORAGE_DRIVER_ZFS_SOURCES = \
R
Roman Bogorodskiy 已提交
1057 1058
                storage/storage_backend_zfs.h storage/storage_backend_zfs.c

1059 1060
STORAGE_DRIVER_VSTORAGE_SOURCES = \
                storage/storage_backend_vstorage.h \
1061 1062
                storage/storage_backend_vstorage.c

1063
STORAGE_HELPER_DISK_SOURCES = \
1064
		storage/parthelper.c
1065

1066
UTIL_IO_HELPER_SOURCES = \
1067 1068
		util/iohelper.c

1069
NETWORK_LEASES_HELPER_SOURCES = \
1070 1071
               network/leaseshelper.c

1072
# Network filters
1073 1074 1075 1076 1077 1078 1079 1080 1081 1082
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 \
1083
		nwfilter/nwfilter_learnipaddr.h
1084

1085

1086
# Security framework and drivers for various models
1087 1088 1089 1090 1091
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 \
1092
		security/security_manager.h security/security_manager.c
1093

1094
SECURITY_DRIVER_SELINUX_SOURCES = \
1095
		security/security_selinux.h security/security_selinux.c
1096

1097
SECURITY_DRIVER_APPARMOR_SOURCES = \
J
Jamie Strandboge 已提交
1098 1099
		security/security_apparmor.h security/security_apparmor.c

1100
ACCESS_DRIVER_GENERATED = \
E
Eric Blake 已提交
1101 1102 1103 1104 1105 1106 1107
		access/viraccessapicheck.h \
		access/viraccessapicheck.c \
		access/viraccessapicheckqemu.h \
		access/viraccessapicheckqemu.c \
		access/viraccessapichecklxc.h \
		access/viraccessapichecklxc.c \
		$(NULL)
1108

1109
ACCESS_DRIVER_SYM_FILES = \
1110 1111 1112
		libvirt_access.syms \
		libvirt_access_qemu.syms \
		libvirt_access_lxc.syms
1113

1114 1115 1116 1117 1118
ACCESS_DRIVER_API_FILES = \
		libvirt_access.xml \
		libvirt_access_qemu.xml \
		libvirt_access_lxc.xml

1119 1120 1121 1122 1123 1124 1125
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

1126 1127 1128 1129
ACCESS_DRIVER_POLKIT_SOURCES = \
		access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c

ACCESS_DRIVER_POLKIT_POLICY = \
1130
		$(srcdir)/access/org.libvirt.api.policy
1131 1132


1133 1134
NODE_DEVICE_DRIVER_SOURCES = \
		node_device/node_device_driver.c \
1135
		node_device/node_device_driver.h
1136

1137 1138
NODE_DEVICE_DRIVER_HAL_SOURCES = \
		node_device/node_device_hal.c \
1139
		node_device/node_device_hal.h
1140

1141 1142
NODE_DEVICE_DRIVER_UDEV_SOURCES = \
		node_device/node_device_udev.c \
D
Daniel Veillard 已提交
1143
		node_device/node_device_udev.h
1144

1145 1146 1147 1148 1149 1150 1151
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 \
1152
		cpu/cpu_map.h cpu/cpu_map.c
1153

1154
VMX_SOURCES = \
1155 1156
		vmx/vmx.c vmx/vmx.h

1157 1158 1159 1160
XENCONFIG_SOURCES = \
		xenconfig/xenxs_private.h \
		xenconfig/xen_common.c xenconfig/xen_common.h \
		xenconfig/xen_sxpr.c xenconfig/xen_sxpr.h \
1161
		xenconfig/xen_xm.c xenconfig/xen_xm.h
1162
if WITH_LIBXL
1163 1164
XENCONFIG_LIBXL_SOURCES = \
		$(XENCONFIG_SOURCES) \
1165 1166
		xenconfig/xen_xl.c xenconfig/xen_xl.h
endif WITH_LIBXL
1167

J
Jiri Denemark 已提交
1168 1169
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
1170
EXTRA_DIST +=	$(pkgdata_DATA)
1171

1172 1173 1174 1175 1176 1177
#########################
#
# Build up list of libvirt.la source files based on configure conditions
#
# First deal with sources usable in non-daemon context

1178
noinst_LTLIBRARIES += libvirt_util.la
1179
libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
1180
libvirt_la_BUILT_LIBADD += libvirt_util.la
1181
libvirt_util_la_SOURCES = \
1182
		$(UTIL_SOURCES)
1183
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
1184
		$(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
1185
		$(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS) \
1186
		$(POLKIT_CFLAGS) $(GNUTLS_CFLAGS) $(ACL_CFLAGS)
1187
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
1188
		$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
1189
		$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(WIN32_EXTRA_LIBS) $(LIBXML_LIBS) \
M
Michal Privoznik 已提交
1190
		$(SECDRIVER_LIBS) $(NUMACTL_LIBS) $(ACL_LIBS) \
1191
		$(POLKIT_LIBS) $(GNUTLS_LIBS)
1192

1193 1194

noinst_LTLIBRARIES += libvirt_conf.la
1195
libvirt_la_BUILT_LIBADD += libvirt_conf.la
1196
libvirt_conf_la_SOURCES = $(CONF_SOURCES)
1197 1198
libvirt_conf_la_CFLAGS = \
		-I$(srcdir)/conf $(AM_CFLAGS)
1199
libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS)
1200
libvirt_conf_la_LIBADD = $(LIBXML_LIBS)
1201

J
Jiri Denemark 已提交
1202
noinst_LTLIBRARIES += libvirt_cpu.la
1203
libvirt_la_BUILT_LIBADD += libvirt_cpu.la
J
Jiri Denemark 已提交
1204
libvirt_cpu_la_CFLAGS = \
1205
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jiri Denemark 已提交
1206 1207
libvirt_cpu_la_SOURCES = $(CPU_SOURCES)

1208 1209 1210 1211 1212 1213
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)

1214 1215 1216 1217
if WITH_VMX
noinst_LTLIBRARIES += libvirt_vmx.la
libvirt_la_BUILT_LIBADD += libvirt_vmx.la
libvirt_vmx_la_CFLAGS = \
1218
		-I$(srcdir)/conf $(AM_CFLAGS)
1219
libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
1220
endif WITH_VMX
1221

J
Jim Fehlig 已提交
1222 1223 1224 1225
if WITH_XENCONFIG
noinst_LTLIBRARIES += libvirt_xenconfig.la
libvirt_la_BUILT_LIBADD += libvirt_xenconfig.la
libvirt_xenconfig_la_CFLAGS = \
1226
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jim Fehlig 已提交
1227
libvirt_xenconfig_la_SOURCES = $(XENCONFIG_SOURCES)
1228 1229 1230 1231 1232 1233 1234 1235

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 已提交
1236
endif WITH_XENCONFIG
1237

1238

1239
noinst_LTLIBRARIES += libvirt_driver.la
1240
libvirt_la_BUILT_LIBADD += libvirt_driver.la
1241
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
1242

1243
libvirt_driver_la_CFLAGS = \
1244
		$(GNUTLS_CFLAGS) $(CURL_CFLAGS) $(XDR_CFLAGS) \
1245
		-I$(srcdir)/conf $(AM_CFLAGS)
1246
libvirt_driver_la_LIBADD = \
1247
		$(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS)
1248

1249 1250
# 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.
1251 1252 1253
SYM_FILES += $(USED_SYM_FILES)
USED_SYM_FILES += $(srcdir)/libvirt_private.syms
GENERATED_SYM_FILES += \
1254 1255
	$(ACCESS_DRIVER_SYM_FILES) \
	libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \
1256
	libvirt_admin.syms libvirt_admin.def \
1257
	$(NULL)
1258

1259
if WITH_REMOTE
1260
noinst_LTLIBRARIES += libvirt_driver_remote.la
1261
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
1262 1263 1264 1265
libvirt_driver_remote_la_CFLAGS = \
		$(XDR_CFLAGS) \
		-I$(srcdir)/conf \
		-I$(srcdir)/rpc \
1266 1267
		$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
1268
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
1269

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

1272 1273
endif WITH_REMOTE

1274 1275 1276 1277 1278 1279 1280

if WITH_LIBVIRTD

sbin_PROGRAMS += libvirtd

BUILT_SOURCES += $(LIBVIRTD_GENERATED)

1281 1282 1283 1284 1285 1286
augeas_DATA += remote/libvirtd.aug

augeastest_DATA += test_libvirtd.aug

conf_DATA += remote/libvirtd.conf

1287
CLEANFILES += test_libvirtd.aug
1288

1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299
if WITH_POLKIT
if WITH_POLKIT0
policydir = $(datadir)/PolicyKit/policy
policyauth = auth_admin_keep_session
else ! WITH_POLKIT0
policydir = $(datadir)/polkit-1/actions
policyauth = auth_admin_keep
endif ! WITH_POLKIT0
endif WITH_POLKIT

BUILT_SOURCES += libvirtd.policy
1300
CLEANFILES += libvirtd.policy
1301 1302 1303 1304 1305 1306 1307

libvirtd.policy: remote/libvirtd.policy.in $(top_builddir)/config.status
	$(AM_V_GEN) sed \
	    -e 's|[@]authaction[@]|$(policyauth)|g' \
	    < $< > $@-t && \
	mv $@-t $@

1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348
libvirtd_SOURCES = $(LIBVIRTD_SOURCES)

libvirtd_CFLAGS = \
	$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
	$(XDR_CFLAGS) $(DBUS_CFLAGS) $(LIBNL_CFLAGS) \
	$(WARN_CFLAGS) $(PIE_CFLAGS) \
	$(COVERAGE_CFLAGS) \
	-I$(srcdir)/access \
	-I$(srcdir)/conf \
	-I$(srcdir)/rpc \
	$(NULL)

libvirtd_LDFLAGS = \
	$(RELRO_LDFLAGS) \
	$(PIE_LDFLAGS) \
	$(COVERAGE_LDFLAGS) \
	$(NO_INDIRECT_LDFLAGS) \
	$(NO_UNDEFINED_LDFLAGS) \
	$(NULL)

libvirtd_LDADD = \
	$(LIBXML_LIBS) \
	$(GNUTLS_LIBS) \
	$(SASL_LIBS) \
	$(DBUS_LIBS) \
	$(LIBNL_LIBS) \
	$(NULL)

if WITH_DTRACE_PROBES
libvirtd_LDADD += ../src/libvirt_probes.lo
endif WITH_DTRACE_PROBES

libvirtd_LDADD += \
	libvirt_driver_admin.la \
	libvirt-lxc.la \
	libvirt-qemu.la \
	libvirt.la \
	../gnulib/lib/libgnu.la $(LIBSOCKET) \
	$(NULL)

endif WITH_LIBVIRTD
1349 1350 1351 1352
EXTRA_DIST += \
	remote/test_libvirtd.aug.in \
	remote/libvirtd.aug \
	remote/libvirtd.conf \
1353 1354 1355 1356
	remote/libvirtd.policy.in \
	remote/libvirtd.rules \
	remote/libvirtd.sasl \
	remote/libvirtd.sysctl \
1357
	$(NULL)
1358

1359
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
1360
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
1361
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1362

1363
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
1364
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
1365
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1366

1367
if WITH_XEN
E
Eric Blake 已提交
1368 1369 1370
noinst_LTLIBRARIES += libvirt_driver_xen_impl.la
libvirt_driver_xen_la_SOURCES =
libvirt_driver_xen_la_LIBADD = libvirt_driver_xen_impl.la
1371
mod_LTLIBRARIES += libvirt_driver_xen.la
1372
libvirt_driver_xen_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1373
libvirt_driver_xen_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1374

1375 1376 1377 1378 1379
libvirt_driver_xen_impl_la_CFLAGS = \
		$(XEN_CFLAGS) \
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
		-I$(srcdir)/xenconfig \
1380
		$(AM_CFLAGS)
E
Eric Blake 已提交
1381
libvirt_driver_xen_impl_la_LDFLAGS = $(AM_LDFLAGS)
P
Pavel Hrdina 已提交
1382
libvirt_driver_xen_impl_la_LIBADD = $(XEN_LIBS) libvirt_xenconfig.la
E
Eric Blake 已提交
1383
libvirt_driver_xen_impl_la_SOURCES = $(XEN_DRIVER_SOURCES)
1384
endif WITH_XEN
1385

1386
if WITH_OPENVZ
1387
noinst_LTLIBRARIES += libvirt_driver_openvz.la
1388
libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la
1389
libvirt_driver_openvz_la_CFLAGS = \
1390
		-I$(srcdir)/conf $(AM_CFLAGS)
1391
libvirt_driver_openvz_la_SOURCES = $(OPENVZ_DRIVER_SOURCES)
1392
endif WITH_OPENVZ
1393

1394 1395
if WITH_XENAPI
noinst_LTLIBRARIES += libvirt_driver_xenapi.la
1396
libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la
1397
libvirt_driver_xenapi_la_CFLAGS = $(XENAPI_CFLAGS) $(CURL_CFLAGS) \
P
Pavel Hrdina 已提交
1398
		-I$(srcdir)/conf -I$(srcdir)/xenconfig $(AM_CFLAGS)
1399
libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS)
1400
libvirt_driver_xenapi_la_LIBADD = $(XENAPI_LIBS) $(CURL_LIBS)
1401
libvirt_driver_xenapi_la_SOURCES = $(XENAPI_DRIVER_SOURCES)
1402
endif WITH_XENAPI
1403

J
Jim Fehlig 已提交
1404
if WITH_LIBXL
E
Eric Blake 已提交
1405 1406 1407
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 已提交
1408
mod_LTLIBRARIES += libvirt_driver_libxl.la
1409
libvirt_driver_libxl_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1410
libvirt_driver_libxl_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1411

1412 1413
libvirt_driver_libxl_impl_la_CFLAGS = \
		$(LIBXL_CFLAGS) \
1414
		$(LIBXML_CFLAGS) \
1415 1416 1417 1418
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
		-I$(srcdir)/secret \
		-I$(srcdir)/xenconfig \
1419
		$(AM_CFLAGS)
E
Eric Blake 已提交
1420
libvirt_driver_libxl_impl_la_LDFLAGS = $(AM_LDFLAGS)
1421
libvirt_driver_libxl_impl_la_LIBADD = $(LIBXL_LIBS) \
1422
				      $(LIBXML_LIBS) \
1423
				      libvirt_xenconfig_libxl.la
E
Eric Blake 已提交
1424
libvirt_driver_libxl_impl_la_SOURCES = $(LIBXL_DRIVER_SOURCES)
1425 1426 1427 1428 1429 1430

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

1431
endif WITH_LIBXL
1432 1433
EXTRA_DIST += libxl/libxl.conf libxl/libvirtd_libxl.aug \
		libxl/test_libvirtd_libxl.aug.in
J
Jim Fehlig 已提交
1434

1435
if WITH_QEMU
E
Eric Blake 已提交
1436 1437 1438
noinst_LTLIBRARIES += libvirt_driver_qemu_impl.la
libvirt_driver_qemu_la_SOURCES =
libvirt_driver_qemu_la_LIBADD = libvirt_driver_qemu_impl.la
1439
mod_LTLIBRARIES += libvirt_driver_qemu.la
1440
libvirt_driver_qemu_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1441
libvirt_driver_qemu_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1442

1443 1444 1445
libvirt_driver_qemu_impl_la_CFLAGS = \
		$(GNUTLS_CFLAGS) \
		$(LIBNL_CFLAGS) \
1446
		$(SELINUX_CFLAGS) \
1447
		$(XDR_CFLAGS) \
1448 1449
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1450
		-I$(srcdir)/secret \
1451
		$(AM_CFLAGS)
E
Eric Blake 已提交
1452
libvirt_driver_qemu_impl_la_LDFLAGS = $(AM_LDFLAGS)
1453
libvirt_driver_qemu_impl_la_LIBADD = $(CAPNG_LIBS) \
1454
                                $(GNUTLS_LIBS) \
1455
				$(LIBNL_LIBS) \
1456
				$(SELINUX_LIBS) \
1457 1458
				$(LIBXML_LIBS) \
				$(NULL)
E
Eric Blake 已提交
1459
libvirt_driver_qemu_impl_la_SOURCES = $(QEMU_DRIVER_SOURCES)
1460

A
Amy Griffis 已提交
1461
conf_DATA += qemu/qemu.conf
1462

1463
augeas_DATA += qemu/libvirtd_qemu.aug
1464 1465
augeastest_DATA += test_libvirtd_qemu.aug
CLEANFILES += test_libvirtd_qemu.aug
1466

1467
endif WITH_QEMU
1468
EXTRA_DIST += qemu/qemu.conf qemu/libvirtd_qemu.aug \
1469
		qemu/test_libvirtd_qemu.aug.in qemu/THREADS.txt
1470

1471 1472

if WITH_LXC
E
Eric Blake 已提交
1473 1474 1475
noinst_LTLIBRARIES += libvirt_driver_lxc_impl.la
libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = libvirt_driver_lxc_impl.la
1476
mod_LTLIBRARIES += libvirt_driver_lxc.la
1477
libvirt_driver_lxc_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1478
libvirt_driver_lxc_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1479 1480

libvirt_driver_lxc_impl_la_CFLAGS = \
S
Serge Hallyn 已提交
1481
		$(LIBNL_CFLAGS) \
G
Gao feng 已提交
1482
		$(FUSE_CFLAGS) \
P
Pavel Fedin 已提交
1483
		$(XDR_CFLAGS) \
1484 1485
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1486
		$(AM_CFLAGS)
I
ik.nitk 已提交
1487 1488 1489 1490 1491 1492
libvirt_driver_lxc_impl_la_LIBADD = \
               $(CAPNG_LIBS) \
               $(LIBNL_LIBS) \
               $(LIBXML_LIBS) \
               $(FUSE_LIBS)

1493
if WITH_BLKID
E
Eric Blake 已提交
1494 1495
libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS)
1496
endif WITH_BLKID
1497
libvirt_driver_lxc_impl_la_LIBADD += $(SECDRIVER_LIBS)
E
Eric Blake 已提交
1498
libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES)
A
Amy Griffis 已提交
1499 1500 1501

conf_DATA += lxc/lxc.conf

1502
augeas_DATA += lxc/libvirtd_lxc.aug
1503 1504
augeastest_DATA += test_libvirtd_lxc.aug
CLEANFILES += test_libvirtd_lxc.aug
1505

1506
endif WITH_LXC
1507
EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in
1508

1509

D
Daniel Veillard 已提交
1510

M
Matthias Bolte 已提交
1511 1512


1513
if WITH_VZ
1514 1515 1516 1517
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
1518
libvirt_driver_vz_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1519
libvirt_driver_vz_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1520
libvirt_driver_vz_impl_la_CFLAGS = \
1521 1522 1523
		-I$(srcdir)/conf \
		-I$(srcdir)/access \
		$(AM_CFLAGS) \
1524
		$(PARALLELS_SDK_CFLAGS) $(LIBNL_CFLAGS)
1525 1526
libvirt_driver_vz_impl_la_SOURCES = $(VZ_DRIVER_SOURCES)
libvirt_driver_vz_impl_la_LIBADD =  $(PARALLELS_SDK_LIBS) $(LIBNL_LIBS)
1527
endif WITH_VZ
D
Dmitry Guryanov 已提交
1528

R
Roman Bogorodskiy 已提交
1529 1530 1531 1532 1533
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
1534
libvirt_driver_bhyve_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1535
libvirt_driver_bhyve_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
R
Roman Bogorodskiy 已提交
1536 1537

libvirt_driver_bhyve_impl_la_CFLAGS = \
1538 1539
	-I$(srcdir)/access \
	-I$(srcdir)/conf \
R
Roman Bogorodskiy 已提交
1540 1541 1542
	$(AM_CFLAGS)
libvirt_driver_bhyve_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_bhyve_impl_la_SOURCES = $(BHYVE_DRIVER_SOURCES)
1543 1544 1545 1546

conf_DATA += bhyve/bhyve.conf
augeas_DATA += bhyve/libvirtd_bhyve.aug
augeastest_DATA += test_libvirtd_bhyve.aug
R
Roman Bogorodskiy 已提交
1547
endif WITH_BHYVE
1548 1549 1550
EXTRA_DIST += bhyve/bhyve.conf \
	bhyve/libvirtd_bhyve.aug \
	bhyve/test_libvirtd_bhyve.aug.in
R
Roman Bogorodskiy 已提交
1551

1552
if WITH_NETWORK
E
Eric Blake 已提交
1553 1554 1555
noinst_LTLIBRARIES += libvirt_driver_network_impl.la
libvirt_driver_network_la_SOURCES =
libvirt_driver_network_la_LIBADD = libvirt_driver_network_impl.la
1556
mod_LTLIBRARIES += libvirt_driver_network.la
1557
libvirt_driver_network_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la \
1558 1559 1560
	$(LIBNL_LIBS) \
	$(DBUS_LIBS) \
	$(NULL)
1561
libvirt_driver_network_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1562 1563

libvirt_driver_network_impl_la_CFLAGS = \
1564 1565
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1566 1567
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1568
		$(AM_CFLAGS)
E
Eric Blake 已提交
1569
libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
1570
libvirt_driver_network_impl_la_LIBADD  = $(DBUS_LIBS)
1571
endif WITH_NETWORK
1572 1573 1574
EXTRA_DIST += network/default.xml


1575
if WITH_INTERFACE
1576
mod_LTLIBRARIES += libvirt_driver_interface.la
1577
libvirt_driver_interface_la_CFLAGS = \
1578 1579
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1580
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1581
libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1582 1583 1584 1585
libvirt_driver_interface_la_LIBADD =
if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
1586
endif WITH_NETCF
1587
if WITH_UDEV
1588 1589
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
1590
endif WITH_UDEV
1591
libvirt_driver_interface_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1592
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
1593
endif WITH_INTERFACE
D
Daniel Veillard 已提交
1594

D
Daniel P. Berrange 已提交
1595
if WITH_SECRETS
1596
mod_LTLIBRARIES += libvirt_driver_secret.la
1597
libvirt_driver_secret_la_CFLAGS = \
1598 1599
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1600
		$(AM_CFLAGS)
1601
libvirt_driver_secret_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1602
libvirt_driver_secret_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1603
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
1604
endif WITH_SECRETS
1605

1606
# Needed to keep automake quiet about conditionals
1607 1608
libvirt_driver_storage_impl_la_SOURCES =
libvirt_driver_storage_impl_la_CFLAGS = \
1609 1610
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1611
		-I$(srcdir)/secret \
1612
		$(AM_CFLAGS)
1613 1614
libvirt_driver_storage_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_storage_impl_la_LIBADD =
1615
libvirt_driver_storage_impl_la_LIBADD += $(SECDRIVER_LIBS) $(LIBXML_LIBS)
1616
if WITH_BLKID
1617 1618
libvirt_driver_storage_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(BLKID_LIBS)
1619
endif WITH_BLKID
1620 1621 1622 1623

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

1624
if WITH_STORAGE
1625 1626 1627
noinst_LTLIBRARIES += libvirt_driver_storage_impl.la
libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_LIBADD = libvirt_driver_storage_impl.la
1628
mod_LTLIBRARIES += libvirt_driver_storage.la
1629
libvirt_driver_storage_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1630
libvirt_driver_storage_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1631
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
1632 1633 1634


libvirt_storage_backend_fs_la_SOURCES = $(STORAGE_DRIVER_FS_SOURCES)
1635
libvirt_storage_backend_fs_la_CFLAGS = \
1636 1637 1638
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1639
storagebackend_LTLIBRARIES += libvirt_storage_backend_fs.la
1640
libvirt_storage_backend_fs_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1641
libvirt_storage_backend_fs_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1642
endif WITH_STORAGE
1643

1644
if WITH_STORAGE_LVM
1645 1646 1647 1648 1649 1650
libvirt_storage_backend_logical_la_SOURCES = \
	$(STORAGE_DRIVER_LVM_SOURCES)
libvirt_storage_backend_logical_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1651
storagebackend_LTLIBRARIES += libvirt_storage_backend_logical.la
1652
libvirt_storage_backend_logical_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1653
libvirt_storage_backend_logical_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1654
endif WITH_STORAGE_LVM
1655

1656
if WITH_STORAGE_ISCSI
1657 1658 1659 1660 1661 1662 1663
libvirt_storage_backend_iscsi_la_SOURCES = \
	$(STORAGE_DRIVER_ISCSI_SOURCES)
libvirt_storage_backend_iscsi_la_CFLAGS = \
	-I$(srcdir)/conf \
	-I$(srcdir)/secret \
	$(AM_CFLAGS)

1664
storagebackend_LTLIBRARIES += libvirt_storage_backend_iscsi.la
1665
libvirt_storage_backend_iscsi_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1666
libvirt_storage_backend_iscsi_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1667
endif WITH_STORAGE_ISCSI
1668

1669
if WITH_STORAGE_SCSI
1670 1671 1672 1673 1674
libvirt_storage_backend_scsi_la_SOURCES = $(STORAGE_DRIVER_SCSI_SOURCES)
libvirt_storage_backend_scsi_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1675
storagebackend_LTLIBRARIES += libvirt_storage_backend_scsi.la
1676
libvirt_storage_backend_scsi_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1677
libvirt_storage_backend_scsi_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1678
endif WITH_STORAGE_SCSI
1679

D
Dave Allan 已提交
1680
if WITH_STORAGE_MPATH
1681 1682 1683
libvirt_storage_backend_mpath_la_SOURCES = \
	$(STORAGE_DRIVER_MPATH_SOURCES)
libvirt_storage_backend_mpath_la_LIBADD = $(DEVMAPPER_LIBS)
1684
libvirt_storage_backend_mpath_la_CFLAGS = \
1685 1686 1687 1688
	-I$(srcdir)/conf \
	$(DEVMAPPER_CFLAGS) \
	$(AM_CFLAGS)

1689
storagebackend_LTLIBRARIES += libvirt_storage_backend_mpath.la
1690
libvirt_storage_backend_mpath_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1691
libvirt_storage_backend_mpath_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1692
endif WITH_STORAGE_MPATH
D
Dave Allan 已提交
1693

1694
if WITH_STORAGE_DISK
1695
libvirt_storage_backend_disk_la_SOURCES = $(STORAGE_DRIVER_DISK_SOURCES)
1696
libvirt_storage_backend_disk_la_CFLAGS = \
1697 1698 1699
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1700
storagebackend_LTLIBRARIES += libvirt_storage_backend_disk.la
1701
libvirt_storage_backend_disk_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1702
libvirt_storage_backend_disk_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1703
endif WITH_STORAGE_DISK
1704

1705
if WITH_STORAGE_RBD
1706 1707 1708 1709 1710 1711 1712
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)

1713
storagebackend_LTLIBRARIES += libvirt_storage_backend_rbd.la
1714
libvirt_storage_backend_rbd_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1715
libvirt_storage_backend_rbd_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1716
endif WITH_STORAGE_RBD
1717

1718
if WITH_STORAGE_SHEEPDOG
1719 1720 1721 1722 1723 1724
libvirt_storage_backend_sheepdog_la_SOURCES = \
	$(STORAGE_DRIVER_SHEEPDOG_SOURCES)
libvirt_storage_backend_sheepdog_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1725 1726 1727 1728 1729 1730 1731 1732 1733
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
1734
libvirt_storage_backend_sheepdog_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1735
libvirt_storage_backend_sheepdog_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1736
endif WITH_STORAGE_SHEEPDOG
1737

1738
if WITH_STORAGE_GLUSTER
1739 1740 1741 1742 1743 1744 1745 1746
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)

1747
storagebackend_LTLIBRARIES += libvirt_storage_backend_gluster.la
1748
libvirt_storage_backend_gluster_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1749
libvirt_storage_backend_gluster_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1750 1751
endif WITH_STORAGE_GLUSTER

R
Roman Bogorodskiy 已提交
1752
if WITH_STORAGE_ZFS
1753
libvirt_storage_backend_zfs_la_SOURCES = $(STORAGE_DRIVER_ZFS_SOURCES)
1754
libvirt_storage_backend_zfs_la_CFLAGS = \
1755 1756 1757
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1758
storagebackend_LTLIBRARIES += libvirt_storage_backend_zfs.la
1759
libvirt_storage_backend_zfs_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1760
libvirt_storage_backend_zfs_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
R
Roman Bogorodskiy 已提交
1761 1762
endif WITH_STORAGE_ZFS

1763
if WITH_STORAGE_VSTORAGE
1764 1765
libvirt_storage_backend_vstorage_la_SOURCES = \
	$(STORAGE_DRIVER_VSTORAGE_SOURCES)
1766
libvirt_storage_backend_vstorage_la_CFLAGS = \
1767 1768 1769
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1770
storagebackend_LTLIBRARIES += libvirt_storage_backend_vstorage.la
1771
libvirt_storage_backend_vstorage_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1772
libvirt_storage_backend_vstorage_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1773 1774
endif WITH_STORAGE_VSTORAGE

1775 1776 1777 1778 1779
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)

1780
libvirt_driver_nodedev_la_CFLAGS = \
1781 1782
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1783
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1784
libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1785
libvirt_driver_nodedev_la_LIBADD =
1786

1787
if WITH_HAL
1788 1789
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS)
1790
libvirt_driver_nodedev_la_LIBADD += $(HAL_LIBS)
1791
endif WITH_HAL
1792
if WITH_UDEV
1793
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES)
1794
libvirt_driver_nodedev_la_CFLAGS += $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS)
1795
libvirt_driver_nodedev_la_LIBADD += $(UDEV_LIBS) $(PCIACCESS_LIBS)
1796
endif WITH_UDEV
1797

1798
libvirt_driver_nodedev_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1799
endif WITH_NODE_DEVICES
1800 1801


1802
if WITH_NWFILTER
1803 1804 1805
noinst_LTLIBRARIES += libvirt_driver_nwfilter_impl.la
libvirt_driver_nwfilter_la_SOURCES =
libvirt_driver_nwfilter_la_LIBADD = libvirt_driver_nwfilter_impl.la
1806
mod_LTLIBRARIES += libvirt_driver_nwfilter.la
1807
libvirt_driver_nwfilter_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1808
libvirt_driver_nwfilter_impl_la_CFLAGS = \
1809 1810 1811
		$(LIBPCAP_CFLAGS) \
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1812 1813
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1814
		$(AM_CFLAGS)
1815 1816 1817 1818 1819
libvirt_driver_nwfilter_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_nwfilter_impl_la_LIBADD = \
		$(LIBPCAP_LIBS) \
		$(LIBNL_LIBS) \
		$(DBUS_LIBS)
1820
libvirt_driver_nwfilter_impl_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1821
libvirt_driver_nwfilter_impl_la_SOURCES = $(NWFILTER_DRIVER_SOURCES)
1822
endif WITH_NWFILTER
1823 1824


1825 1826 1827 1828
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 = \
1829
		-I$(srcdir)/conf $(AM_CFLAGS)
1830
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
1831
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
1832
if WITH_SECDRIVER_SELINUX
1833 1834
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
1835
endif WITH_SECDRIVER_SELINUX
J
Jamie Strandboge 已提交
1836
if WITH_SECDRIVER_APPARMOR
1837 1838
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
1839
endif WITH_SECDRIVER_APPARMOR
1840

1841 1842
libvirt_driver_access_la_SOURCES = \
	$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
1843 1844 1845
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
1846
		-I$(srcdir)/conf $(AM_CFLAGS)
1847 1848 1849
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD =

1850 1851
EXTRA_DIST += access/genpolkit.pl

1852 1853 1854 1855
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
    $(srcdir)/access/genpolkit.pl Makefile.am
	$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@

1856 1857 1858 1859
if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)

polkitactiondir = $(datadir)/polkit-1/actions
1860
if WITH_LIBVIRTD
1861
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
1862
endif WITH_LIBVIRTD
1863 1864 1865

CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
1866
else ! WITH_POLKIT1
1867
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
1868
endif ! WITH_POLKIT1
1869

1870

1871 1872
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886

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

1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899
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 已提交
1900
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
1901 1902
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1903 1904 1905
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
1906 1907
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1908 1909
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
	  > $(srcdir)/access/viraccessapicheck.c
1910

E
Eric Blake 已提交
1911
access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
1912 1913
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1914 1915 1916
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheckqemu.h
access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
1917 1918
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1919 1920
	  qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h \
	  > $(srcdir)/access/viraccessapicheckqemu.c
1921

E
Eric Blake 已提交
1922
access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
1923 1924
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1925 1926 1927
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/access/viraccessapichecklxc.h
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
1928 1929
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1930 1931
	  lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \
	  > $(srcdir)/access/viraccessapichecklxc.c
1932

1933
# Add all conditional sources just in case...
1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967
EXTRA_DIST += \
		$(REMOTE_DRIVER_SOURCES) \
		$(XEN_DRIVER_SOURCES) \
		$(QEMU_DRIVER_SOURCES) \
		$(LXC_DRIVER_SOURCES) \
		$(OPENVZ_DRIVER_SOURCES) \
		$(XENAPI_DRIVER_SOURCES) \
		$(LIBXL_DRIVER_SOURCES) \
		$(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) \
		$(XENCONFIG_SOURCES) \
		$(XENCONFIG_LIBXL_SOURCES) \
1968
		$(ACCESS_DRIVER_POLKIT_POLICY)
1969

1970 1971
check-local: check-augeas

1972 1973 1974 1975 1976
.PHONY: check-augeas \
	check-augeas-qemu \
	check-augeas-lxc \
	check-augeas-sanlock \
	check-augeas-lockd \
1977
	check-augeas-libxl \
1978
	check-augeas-bhyve \
1979
	check-augeas-libvirtd \
1980
	$(NULL)
1981

1982
check-augeas: check-augeas-qemu check-augeas-lxc check-augeas-sanlock \
1983
	check-augeas-lockd check-augeas-virtlockd check-augeas-libxl \
1984
	check-augeas-bhyve check-augeas-virtlogd check-augeas-libvirtd
1985

1986
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
1987
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
1988

1989
if WITH_QEMU
1990 1991
test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
		$(srcdir)/qemu/qemu.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1992
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
1993

1994
check-augeas-qemu: test_libvirtd_qemu.aug
1995
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1996
	    '$(AUGPARSE)' -I $(srcdir)/qemu test_libvirtd_qemu.aug; \
1997
	fi
1998
else ! WITH_QEMU
1999
check-augeas-qemu:
2000
endif ! WITH_QEMU
2001

2002
if WITH_LXC
2003 2004
test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
		$(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
E
Eric Blake 已提交
2005
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
2006

2007
check-augeas-lxc: test_libvirtd_lxc.aug
2008
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
2009
	    '$(AUGPARSE)' -I $(srcdir)/lxc test_libvirtd_lxc.aug; \
2010
	fi
2011
else ! WITH_LXC
2012
check-augeas-lxc:
2013
endif ! WITH_LXC
2014

2015
if WITH_SANLOCK
2016 2017
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
2018
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
2019

2020
check-augeas-sanlock: test_libvirt_sanlock.aug
2021
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
2022
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
2023
	fi
2024
else ! WITH_SANLOCK
2025
check-augeas-sanlock:
2026
endif ! WITH_SANLOCK
2027

2028
if WITH_QEMU
2029 2030 2031
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 $< $@
2032 2033 2034
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
2035

2036 2037
test_virtlockd.aug: locking/test_virtlockd.aug.in \
		locking/virtlockd.conf $(AUG_GENTEST)
2038
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
2039

2040
if WITH_QEMU
2041 2042 2043 2044
check-augeas-lockd: test_libvirt_lockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_lockd.aug; \
	fi
2045 2046 2047
else ! WITH_QEMU
check-augeas-lockd:
endif ! WITH_QEMU
2048

2049 2050 2051 2052 2053
check-augeas-virtlockd: test_virtlockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
	fi

2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066
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

2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079
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

2080 2081 2082 2083 2084 2085 2086 2087 2088
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

2089 2090 2091
if WITH_LIBVIRTD
test_libvirtd.aug: remote/test_libvirtd.aug.in \
		remote/libvirtd.conf $(AUG_GENTEST)
2092
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/remote/libvirtd.conf $< $@
2093 2094 2095 2096 2097 2098 2099 2100

check-augeas-libvirtd: test_libvirtd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/remote test_libvirtd.aug; \
	fi
else ! WITH_LIBVIRTD
check-augeas-libvirtd:
endif ! WITH_LIBVIRTD
2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119
#
# 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.
#

2120
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
2121

2122
if WITH_LINUX
2123
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
2124
else ! WITH_LINUX
2125
SYM_FILES += $(srcdir)/libvirt_linux.syms
2126
endif ! WITH_LINUX
2127

E
Eric Blake 已提交
2128 2129 2130 2131 2132 2133
if WITH_REMOTE
USED_SYM_FILES += $(srcdir)/libvirt_remote.syms
else ! WITH_REMOTE
SYM_FILES += $(srcdir)/libvirt_remote.syms
endif ! WITH_REMOTE

2134
if WITH_OPENVZ
2135
USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms
2136
else ! WITH_OPENVZ
2137
SYM_FILES += $(srcdir)/libvirt_openvz.syms
2138
endif ! WITH_OPENVZ
2139

2140
if WITH_VMX
2141
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
2142
else ! WITH_VMX
2143
SYM_FILES += $(srcdir)/libvirt_vmx.syms
2144
endif ! WITH_VMX
2145

J
Jim Fehlig 已提交
2146 2147 2148 2149 2150
if WITH_XENCONFIG
USED_SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
else ! WITH_XENCONFIG
SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
endif ! WITH_XENCONFIG
2151

2152
if WITH_SASL
2153
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
2154
else ! WITH_SASL
2155
SYM_FILES += $(srcdir)/libvirt_sasl.syms
2156
endif ! WITH_SASL
E
Eric Blake 已提交
2157

2158 2159
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2160
else ! WITH_GNUTLS
2161
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2162
endif ! WITH_GNUTLS
2163

2164
if WITH_SSH2
2165
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2166
else ! WITH_SSH2
2167
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2168
endif ! WITH_SSH2
2169

2170
if WITH_ATOMIC_OPS_PTHREAD
2171
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
2172
else ! WITH_ATOMIC_OPS_PTHREAD
2173
SYM_FILES += $(srcdir)/libvirt_atomic.syms
2174
endif ! WITH_ATOMIC_OPS_PTHREAD
2175

2176 2177 2178 2179 2180 2181
if WITH_LIBSSH
USED_SYM_FILES += $(srcdir)/libvirt_libssh.syms
else ! WITH_LIBSSH
SYM_FILES += $(srcdir)/libvirt_libssh.syms
endif ! WITH_LIBSSH

2182
EXTRA_DIST += \
2183 2184 2185 2186 2187 2188
	libvirt_public.syms \
	libvirt_lxc.syms \
	libvirt_qemu.syms \
	libvirt_admin_public.syms \
	$(SYM_FILES) \
	$(ADMIN_SYM_FILES) \
2189
	$(NULL)
2190

2191
BUILT_SOURCES += $(GENERATED_SYM_FILES)
2192

2193 2194
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(ACCESS_DRIVER_SYM_FILES) \
2195
		$(top_builddir)/config.status
2196 2197 2198 2199 2200 2201
	$(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 && \
2202
	cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
2203 2204
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
2205
	mv $@-tmp libvirt.syms
2206

2207
%.def: %.syms
2208 2209
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
2210
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d' \
2211
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
2212
	chmod a-w $@-tmp && \
2213
	mv $@-tmp $@
2214

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

2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242

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) \
2243
		$(XDR_CFLAGS) \
2244 2245 2246 2247 2248 2249
		-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)

2250 2251 2252 2253
# 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 已提交
2254 2255
lib_LTLIBRARIES += libvirt-admin.la
libvirt_admin_la_SOURCES = \
2256 2257
		libvirt-admin.c \
		$(ADMIN_PROTOCOL_GENERATED) \
M
Martin Kletzander 已提交
2258 2259 2260
		$(DATATYPES_SOURCES)

libvirt_admin_la_LDFLAGS = \
2261 2262
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_ADMIN_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
2263
		$(AM_LDFLAGS)
M
Martin Kletzander 已提交
2264 2265

libvirt_admin_la_LIBADD = \
2266
		libvirt.la \
M
Martin Kletzander 已提交
2267 2268 2269
		$(CYGWIN_EXTRA_LIBADD)

libvirt_admin_la_CFLAGS = \
2270 2271 2272
		$(AM_CFLAGS) \
		-I$(srcdir)/remote \
		-I$(srcdir)/rpc \
M
Martin Kletzander 已提交
2273 2274 2275
		-I$(srcdir)/admin

libvirt_admin_la_CFLAGS += \
2276 2277 2278 2279 2280 2281
		$(XDR_CFLAGS) \
		$(CAPNG_CFLAGS) \
		$(YAJL_CFLAGS) \
		$(SSH2_CFLAGS) \
		$(SASL_CFLAGS) \
		$(GNUTLS_CFLAGS) \
2282
		$(LIBSSH_CFLAGS)
M
Martin Kletzander 已提交
2283 2284

libvirt_admin_la_LIBADD += \
2285 2286 2287 2288 2289 2290 2291
		$(CAPNG_LIBS) \
		$(YAJL_LIBS) \
		$(DEVMAPPER_LIBS) \
		$(LIBXML_LIBS) \
		$(SSH2_LIBS) \
		$(SASL_LIBS) \
		$(GNUTLS_LIBS) \
2292
		$(LIBSSH_LIBS)
M
Martin Kletzander 已提交
2293

2294 2295
ADMIN_SYM_FILES = $(srcdir)/libvirt_admin_private.syms

M
Martin Kletzander 已提交
2296 2297 2298 2299
if WITH_DTRACE_PROBES
libvirt_admin_la_LIBADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

2300 2301
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
2302 2303 2304 2305
libvirt_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(LIBVIRT_NODELETE) \
2306
		$(NO_UNDEFINED_LDFLAGS) \
D
Daniel P. Berrange 已提交
2307 2308
		$(AM_LDFLAGS) \
		$(NULL)
2309
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
2310
libvirt_la_LIBADD += \
2311
		    $(DRIVER_MODULES_LIBS) \
2312
		    $(CYGWIN_EXTRA_LIBADD)
2313
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
2314 2315 2316 2317 2318 2319
# 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)
2320

2321
if WITH_DTRACE_PROBES
2322
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
2323
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
2324
nodist_libvirt_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2325
if WITH_REMOTE
E
Eric Blake 已提交
2326
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2327
endif WITH_REMOTE
2328
DTRACE2SYSTEMTAP_FLAGS = --with-modules
2329

2330 2331 2332
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

if WITH_QEMU
2333
libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.lo
2334
nodist_libvirt_driver_qemu_la_SOURCES = libvirt_qemu_probes.h
2335
BUILT_SOURCES += libvirt_qemu_probes.h
2336
endif WITH_QEMU
2337 2338

tapsetdir = $(datadir)/systemtap/tapset
2339
tapset_DATA = libvirt_probes.stp libvirt_qemu_probes.stp libvirt_functions.stp
2340

2341
%_probes.h: %_probes.d
2342 2343
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

E
Eric Blake 已提交
2344
.PRECIOUS: %_probes.o
2345
%_probes.o: %_probes.d
2346 2347
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

2348 2349 2350 2351 2352 2353 2354 2355 2356
%_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 已提交
2357
# Keep this list synced with PROTOCOL_STRUCTS
J
Jiri Denemark 已提交
2358 2359 2360
RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
2361
		  $(srcdir)/remote/lxc_protocol.x \
2362 2363
		  $(srcdir)/remote/qemu_protocol.x \
		  $(srcdir)/lxc/lxc_monitor_protocol.x \
M
Martin Kletzander 已提交
2364 2365
		  $(srcdir)/locking/lock_protocol.x \
		  $(srcdir)/admin/admin_protocol.x
2366 2367

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

2370 2371
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl \
		$(top_builddir)/config.status
2372
	$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
2373
	  $(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
2374

2375
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
2376
              libvirt_qemu_probes.h libvirt_qemu_probes.o \
2377
              libvirt_qemu_probes.lo\
2378 2379
              libvirt_functions.stp libvirt_probes.stp \
              libvirt_qemu_probes.stp
2380
endif WITH_DTRACE_PROBES
2381

2382
EXTRA_DIST += libvirt_probes.d libvirt_qemu_probes.d
2383

C
Chris Lalancette 已提交
2384
libvirt_qemu_la_SOURCES = libvirt-qemu.c
D
Daniel P. Berrange 已提交
2385 2386 2387 2388 2389
libvirt_qemu_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
2390
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
C
Chris Lalancette 已提交
2391
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
2392

2393
libvirt_lxc_la_SOURCES = libvirt-lxc.c
D
Daniel P. Berrange 已提交
2394 2395 2396 2397 2398
libvirt_lxc_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
2399 2400 2401
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)

2402 2403 2404 2405 2406 2407 2408
# 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
2409
if WITH_SETUID_RPC_CLIENT
2410 2411
noinst_LTLIBRARIES += libvirt-setuid-rpc-client.la

2412 2413
libvirt_setuid_rpc_client_la_SOURCES = \
		util/viralloc.c \
2414
		util/virarch.c \
2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479
		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 \
2480 2481
		$(NULL)

2482 2483 2484 2485
libvirt_setuid_rpc_client_la_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(LIBXML_LIBS) \
		$(SECDRIVER_LIBS) \
2486
		$(NULL)
2487 2488 2489 2490 2491 2492 2493
libvirt_setuid_rpc_client_la_CFLAGS = \
		-DLIBVIRT_SETUID_RPC_CLIENT \
		-I$(srcdir)/conf \
		-I$(srcdir)/rpc \
		$(AM_CFLAGS) \
		$(SECDRIVER_CFLAGS) \
		$(XDR_CFLAGS) \
2494
		$(NULL)
2495
endif WITH_SETUID_RPC_CLIENT
2496

2497 2498 2499
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

2500
if WITH_LIBVIRTD
2501 2502 2503 2504 2505
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
		$(LOCK_DRIVER_LOCKD_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
		$(NULL)
2506
lockd_la_CFLAGS = -I$(srcdir)/conf \
E
Eric Blake 已提交
2507 2508
		$(XDR_CFLAGS) \
		$(AM_CFLAGS)
2509
lockd_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
2510
lockd_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
J
Jiri Denemark 已提交
2511
augeas_DATA += locking/libvirt_lockd.aug
2512 2513
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
2514
endif WITH_DTRACE_PROBES
2515
if WITH_QEMU
2516 2517
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
2518
nodist_conf_DATA += locking/qemu-lockd.conf
2519 2520
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
2521
endif WITH_QEMU
2522

2523 2524 2525 2526 2527 2528
if WITH_LIBXL
nodist_conf_DATA += locking/libxl-lockd.conf
BUILT_SOURCES += locking/libxl-lockd.conf
DISTCLEANFILES += locking/libxl-lockd.conf
endif WITH_LIBXL

2529 2530 2531 2532 2533
locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
	$(AM_V_GEN)$(MKDIR_P) locking ; \
	cp $< $@


2534
sbin_PROGRAMS += virtlockd virtlogd
2535

2536 2537 2538
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
2539
		$(LOCK_DAEMON_GENERATED) \
2540
		$(NULL)
2541 2542
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
2543
		$(PIE_CFLAGS) \
2544
		$(XDR_CFLAGS) \
2545 2546 2547
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
2548
		$(PIE_LDFLAGS) \
2549
		$(NO_UNDEFINED_LDFLAGS) \
2550 2551
		$(NULL)
virtlockd_LDADD = \
2552
		libvirt_driver_admin.la \
2553 2554 2555 2556 2557 2558 2559 2560
		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
2561
endif WITH_DTRACE_PROBES
2562

2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576

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) \
2577
		$(NO_UNDEFINED_LDFLAGS) \
2578 2579
		$(NULL)
virtlogd_LDADD = \
2580
		libvirt_driver_admin.la \
2581 2582 2583 2584 2585 2586 2587 2588 2589 2590
		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

2591
else ! WITH_LIBVIRTD
2592
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
2593 2594
              $(LOCK_DRIVER_LOCKD_SOURCES) \
	      $(LOG_DAEMON_SOURCES)
2595
endif ! WITH_LIBVIRTD
2596

2597
SYSCONF_FILES = \
2598
	locking/virtlockd.sysconf \
2599
	logging/virtlogd.sysconf \
2600
	remote/libvirtd.sysconf \
2601 2602 2603
	$(NULL)

EXTRA_DIST += \
J
Jiri Denemark 已提交
2604 2605
	locking/lockd.conf \
	locking/libvirt_lockd.aug \
2606
	locking/test_libvirt_lockd.aug.in \
2607 2608
	$(SYSCONF_FILES) \
	$(NULL)
2609 2610

install-sysconfig:
E
Eric Blake 已提交
2611
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
2612 2613 2614
	for f in $(SYSCONF_FILES:%.sysconf=%) ; \
	do \
	  tgt=`basename $$f`; \
2615 2616
	  $(INSTALL_SCRIPT) $(srcdir)/$$f.sysconf \
	      $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
2617
	done
2618 2619

uninstall-sysconfig:
2620 2621 2622 2623 2624
	for f in $(SYSCONF_FILES:%.sysconf=%) ; \
	do \
	  tgt=`basename $$f`; \
	  rm -f $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
	done
E
Eric Blake 已提交
2625
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
2626

2627 2628 2629
SYSVINIT_FILES_IN = \
	locking/virtlockd.init.in \
	logging/virtlogd.init.in \
2630
	remote/libvirtd.init.in \
2631 2632 2633 2634 2635
	$(NULL)

SYSVINIT_FILES = $(notdir $(SYSVINIT_FILES_IN:%.in=%))

EXTRA_DIST += $(SYSVINIT_FILES_IN)
2636

2637 2638 2639 2640 2641 2642 2643 2644 2645 2646
LOGROTATE_FILES_IN = \
	remote/libvirtd.qemu.logrotate.in \
	remote/libvirtd.lxc.logrotate.in \
	remote/libvirtd.libxl.logrotate.in \
	remote/libvirtd.uml.logrotate.in \
	remote/libvirtd.logrotate.in \
	$(NULL)

EXTRA_DIST += $(LOGROTATE_FILES_IN)

2647
if WITH_LIBVIRTD
2648

2649 2650 2651
LOGROTATE_FILES := $(LOGROTATE_FILES_IN:remote/%.in=%)

BUILT_SOURCES += $(LOGROTATE_FILES)
2652
CLEANFILES += $(LOGROTATE_FILES)
2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672

%.logrotate: remote/%.logrotate.in
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
	mv $@-t $@

install-logrotate: $(LOGROTATE_FILES)
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/logrotate.d/
	for f in $(LOGROTATE_FILES) ; \
	do \
	  tgt=`echo $$f | sed -e 's/.logrotate//'`; \
	  $(INSTALL_DATA) $$f \
		$(DESTDIR)$(sysconfdir)/logrotate.d/$$tgt; \
	done

uninstall-logrotate:
	rm -f $(LOGROTATE_FILES:%.logrotate=$(DESTDIR)$(sysconfdir)/logrotate.d/%)
	rmdir $(DESTDIR)$(sysconfdir)/logrotate.d || :

2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711
if WITH_SYSCTL
# Use $(prefix)/lib rather than $(libdir), since man sysctl.d insists on
# /usr/lib/sysctl.d/ even when libdir is /usr/lib64
install-sysctl:
	$(MKDIR_P) $(DESTDIR)$(prefix)/lib/sysctl.d
	$(INSTALL_DATA) $(srcdir)/remote/libvirtd.sysctl \
	  $(DESTDIR)$(prefix)/lib/sysctl.d/60-libvirtd.conf

uninstall-sysctl:
	rm -f $(DESTDIR)$(prefix)/lib/sysctl.d/60-libvirtd.conf
	rmdir $(DESTDIR)$(prefix)/lib/sysctl.d || :
else ! WITH_SYSCTL
install-sysctl:
uninstall-sysctl:
endif ! WITH_SYSCTL

if WITH_POLKIT
install-polkit::
	$(MKDIR_P) $(DESTDIR)$(policydir)
	$(INSTALL_DATA) libvirtd.policy $(DESTDIR)$(policydir)/org.libvirt.unix.policy
if ! WITH_POLKIT0
	$(MKDIR_P) $(DESTDIR)$(datadir)/polkit-1/rules.d
	$(INSTALL_DATA) $(srcdir)/remote/libvirtd.rules \
		$(DESTDIR)$(datadir)/polkit-1/rules.d/50-libvirt.rules
endif ! WITH_POLKIT0

uninstall-polkit::
	rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
	rmdir $(DESTDIR)$(policydir) || :
if ! WITH_POLKIT0
	rm -f $(DESTDIR)$(datadir)/polkit-1/rules.d/50-libvirt.rules
	rmdir $(DESTDIR)$(datadir)/polkit-1/rules.d || :
endif ! WITH_POLKIT0

else ! WITH_POLKIT
install-polkit::
uninstall-polkit::
endif ! WITH_POLKIT

2712
if LIBVIRT_INIT_SCRIPT_RED_HAT
2713
install-init:: $(SYSVINIT_FILES) install-sysconfig
E
Eric Blake 已提交
2714
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
2715 2716 2717 2718
	for f in $(SYSVINIT_FILES:%.init=%) ; \
	do \
	  $(INSTALL_SCRIPT) $$f.init $(DESTDIR)$(sysconfdir)/rc.d/init.d/$$f; \
	done
2719 2720

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

2724 2725
BUILT_SOURCES += $(SYSVINIT_FILES)
DISTCLEANFILES += $(SYSVINIT_FILES)
2726
else ! LIBVIRT_INIT_SCRIPT_RED_HAT
2727 2728
install-init::
uninstall-init::
2729 2730
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
else ! WITH_LIBVIRTD
2731 2732 2733 2734
install-polkit::
uninstall-polkit::
install-sysctl::
uninstall-sysctl::
2735 2736
install-init::
uninstall-init::
2737 2738
install-logrotate::
uninstall-logrotate::
2739
endif ! WITH_LIBVIRTD
2740

2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757
# This is needed for clients too, so can't wrap in
# the WITH_LIBVIRTD conditional
if WITH_SASL
install-sasl:
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sasl2/
	$(INSTALL_DATA) $(srcdir)/remote/libvirtd.sasl \
		$(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf

uninstall-sasl:
	rm -f $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
	rmdir $(DESTDIR)$(sysconfdir)/sasl2/ || :
else ! WITH_SASL
install-sasl:
uninstall-sasl:
endif ! WITH_SASL


2758 2759 2760 2761 2762 2763 2764 2765 2766
libvirtd.init: remote/libvirtd.init.in $(top_builddir)/config.status
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    < $< > $@-t && \
	    chmod a+x $@-t && \
	    mv $@-t $@

2767
virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
2768 2769 2770 2771 2772 2773
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    < $< > $@-t && \
	    chmod a+x $@-t && \
2774 2775
	    mv $@-t $@

2776
virtlogd.init: logging/virtlogd.init.in $(top_builddir)/config.status
2777 2778 2779 2780 2781 2782
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    < $< > $@-t && \
	    chmod a+x $@-t && \
2783 2784
	    mv $@-t $@

2785
virtlockd.8.in: locking/virtlockd.pod
2786 2787 2788 2789 2790 2791 2792 2793
	$(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 $@
2794

2795
virtlogd.8.in: logging/virtlogd.pod
2796 2797 2798 2799 2800 2801 2802 2803
	$(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 $@
2804

2805 2806 2807 2808 2809 2810 2811 2812 2813 2814
libvirtd.8.in: remote/libvirtd.pod
	$(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 $@

2815
%.8: %.8.in $(top_srcdir)/configure.ac
2816
	$(AM_V_GEN)sed \
2817 2818 2819
		-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
		-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
		< $< > $@-t && \
2820 2821
	mv $@-t $@

2822
if WITH_LIBVIRTD
2823
man8_MANS = virtlockd.8 virtlogd.8 libvirtd.8
2824

2825
conf_DATA += locking/virtlockd.conf logging/virtlogd.conf
2826

2827 2828
augeas_DATA += locking/virtlockd.aug logging/virtlogd.aug
augeastest_DATA += test_virtlockd.aug test_virtlogd.aug
2829
endif WITH_LIBVIRTD
2830

A
Andrea Bolognani 已提交
2831 2832 2833
PODFILES = \
	locking/virtlockd.pod \
	logging/virtlogd.pod \
2834
	remote/libvirtd.pod \
A
Andrea Bolognani 已提交
2835 2836 2837 2838 2839
	$(NULL)

MANINFILES = \
	virtlockd.8.in \
	virtlogd.8.in \
2840
	libvirtd.8.in \
A
Andrea Bolognani 已提交
2841 2842 2843 2844
	$(NULL)

CLEANFILES += test_virtlockd.aug test_virtlogd.aug $(man8_MANS)
MAINTAINERCLEANFILES += $(MANINFILES)
2845

2846 2847 2848 2849 2850 2851 2852
SYSTEMD_UNIT_FILES_IN = \
	locking/virtlockd.service.in \
	locking/virtlockd.socket.in \
	locking/virtlockd-admin.socket.in \
	logging/virtlogd.service.in \
	logging/virtlogd.socket.in \
	logging/virtlogd-admin.socket.in \
2853 2854
	remote/libvirtd.service.in \
	remote/virt-guest-shutdown.target.in \
2855 2856
	$(NULL)

2857
EXTRA_DIST += \
2858
        $(SYSTEMD_UNIT_FILES_IN) \
2859 2860 2861
        locking/virtlockd.aug \
        locking/virtlockd.conf \
        locking/test_virtlockd.aug.in \
2862 2863 2864
        logging/virtlogd.aug \
        logging/virtlogd.conf \
        logging/test_virtlogd.aug.in \
A
Andrea Bolognani 已提交
2865 2866
        $(PODFILES) \
        $(MANINFILES) \
2867
        $(NULL)
2868

2869 2870 2871 2872

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

2873
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
2874
SYSTEMD_UNIT_FILES = $(notdir $(SYSTEMD_UNIT_FILES_IN:%.in=%))
2875

2876 2877
BUILT_SOURCES += $(SYSTEMD_UNIT_FILES)
DISTCLEANFILES += $(SYSTEMD_UNIT_FILES)
2878

2879
install-systemd: $(SYSTEMD_UNIT_FILES) install-sysconfig
E
Eric Blake 已提交
2880
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
2881 2882 2883 2884
	for f in $(SYSTEMD_UNIT_FILES); \
	do \
	  $(INSTALL_DATA) $$f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/ ; \
	done
2885 2886

uninstall-systemd: uninstall-sysconfig
2887
	rm -f $(SYSTEMD_UNIT_FILES:%=$(DESTDIR)$(SYSTEMD_UNIT_DIR)/%)
E
Eric Blake 已提交
2888
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
2889
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
2890 2891
install-systemd:
uninstall-systemd:
2892 2893
endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
else ! WITH_LIBVIRTD
2894 2895
install-systemd:
uninstall-systemd:
2896
endif ! WITH_LIBVIRTD
2897

2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909
libvirtd.service: remote/libvirtd.service.in $(top_builddir)/config.status
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    < $< > $@-t && \
	    mv $@-t $@

virt-guest-shutdown.target: remote/virt-guest-shutdown.target.in \
			$(top_builddir)/config.status
	$(AM_V_GEN)cp $< $@

2910
virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
2911 2912 2913
	$(AM_V_GEN)sed \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    < $< > $@-t && \
2914 2915 2916
	    mv $@-t $@

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

J
John Ferlan 已提交
2922 2923 2924 2925 2926 2927 2928
virtlockd-admin.socket: locking/virtlockd-admin.socket.in \
                        $(top_builddir)/config.status
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
	    mv $@-t $@

2929
virtlogd.service: logging/virtlogd.service.in $(top_builddir)/config.status
2930 2931 2932
	$(AM_V_GEN)sed \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    < $< > $@-t && \
2933 2934 2935
	    mv $@-t $@

virtlogd.socket: logging/virtlogd.socket.in $(top_builddir)/config.status
J
John Ferlan 已提交
2936 2937 2938 2939 2940 2941 2942
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
	    mv $@-t $@

virtlogd-admin.socket: logging/virtlogd-admin.socket.in \
                       $(top_builddir)/config.status
2943 2944 2945
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
2946 2947
	    mv $@-t $@

2948

2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962
UPSTART_FILES = \
	remote/libvirtd.upstart \
	$(NULL)

EXTRA_DIST += $(UPSTART_FILES)

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_UPSTART

install-upstart: install-sysconfig
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/event.d
	for f in $(UPSTART_FILES:%.upstart=%); \
	do \
	  tgt=`basename $$f` ; \
2963 2964
	  $(INSTALL_SCRIPT) $(srcdir)/$$f.upstart \
	      $(DESTDIR)$(sysconfdir)/event.d/$$tgt ; \
2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982
	done

uninstall-upstart: uninstall-sysconfig
	for f in $(UPSTART_FILES:%.upstart=%); \
	do \
	  tgt=`basename $$f` ; \
	  rm -f $(DESTDIR)$(sysconfdir)/event.d/$$tgt ; \
	done
	rmdir $(DESTDIR)$(sysconfdir)/event.d || :
else ! LIBVIRT_INIT_SCRIPT_UPSTART
install-upstart:
uninstall-upstart:
endif ! LIBVIRT_INIT_SCRIPT_UPSTART
else ! WITH_LIBVIRTD
install-upstart:
uninstall-upstart:
endif ! WITH_LIBVIRTD

2983
if WITH_SANLOCK
2984
lockdriver_LTLIBRARIES += sanlock.la
2985
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
2986
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
2987
sanlock_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
2988
sanlock_la_LIBADD = -lsanlock_client libvirt.la ../gnulib/lib/libgnu.la
2989 2990

augeas_DATA += locking/libvirt_sanlock.aug
2991 2992
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
2993

E
Eric Blake 已提交
2994
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
2995
	$(AM_V_GEN)$(MKDIR_P) locking ; \
2996 2997 2998
	cp $< $@

if WITH_QEMU
2999
nodist_conf_DATA += locking/qemu-sanlock.conf
3000
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
3001
DISTCLEANFILES += locking/qemu-sanlock.conf
3002
endif WITH_QEMU
3003 3004 3005 3006 3007 3008

if WITH_LIBXL
nodist_conf_DATA += locking/libxl-sanlock.conf
BUILT_SOURCES += locking/libxl-sanlock.conf
DISTCLEANFILES += locking/libxl-sanlock.conf
endif WITH_LIBXL
3009
else ! WITH_SANLOCK
3010
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
3011
endif ! WITH_SANLOCK
3012 3013
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
3014
	locking/test_libvirt_sanlock.aug.in
3015

3016 3017 3018 3019
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
3020

3021 3022 3023 3024 3025
libvirt_la_BUILT_LIBADD += \
       libvirt-net-rpc.la \
       libvirt-net-rpc-server.la \
       libvirt-net-rpc-client.la

3026
EXTRA_DIST += \
E
Eric Blake 已提交
3027 3028 3029 3030
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
3031 3032
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
3033

E
Eric Blake 已提交
3034
VIR_NET_RPC_GENERATED = \
3035 3036 3037 3038
	rpc/virnetprotocol.h \
	rpc/virnetprotocol.c \
	rpc/virkeepaliveprotocol.h \
	rpc/virkeepaliveprotocol.c
3039

3040
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
3041

3042
libvirt_net_rpc_la_SOURCES = \
3043
	rpc/virnetmessage.h rpc/virnetmessage.c \
3044
	rpc/virnetsocket.h rpc/virnetsocket.c \
3045 3046
	rpc/virkeepalive.h rpc/virkeepalive.c \
	$(VIR_NET_RPC_GENERATED)
3047
if WITH_SSH2
3048 3049
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
3050
else ! WITH_SSH2
3051 3052
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
3053
endif ! WITH_SSH2
3054
if WITH_GNUTLS
3055 3056
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
3057
else ! WITH_GNUTLS
3058 3059
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
3060
endif ! WITH_GNUTLS
3061
if WITH_SASL
3062 3063
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
3064
else ! WITH_SASL
3065 3066
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
3067
endif ! WITH_SASL
3068 3069 3070 3071 3072 3073 3074
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
3075
libvirt_net_rpc_la_CFLAGS = \
3076
			$(GNUTLS_CFLAGS) \
3077
			$(SASL_CFLAGS) \
3078
			$(SSH2_CFLAGS) \
3079
			$(LIBSSH_CFLAGS) \
3080
			$(XDR_CFLAGS) \
3081 3082
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
3083
			$(GNUTLS_LIBS) \
3084
			$(SASL_LIBS) \
3085
			$(SSH2_LIBS)\
3086
			$(LIBSSH_LIBS) \
J
Jim Fehlig 已提交
3087
			$(SECDRIVER_LIBS) \
3088
			$(AM_LDFLAGS) \
3089
			$(NULL)
3090 3091 3092
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

3093 3094 3095 3096
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
3097
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
3098
	rpc/virnetdaemon.h rpc/virnetdaemon.c \
3099 3100
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
3101
			$(AVAHI_CFLAGS) \
3102
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
3103
			$(XDR_CFLAGS) \
3104
			$(AM_CFLAGS)
3105 3106
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
3107
			$(AVAHI_LIBS) \
3108
			$(DBUS_LIBS) \
3109
			$(NULL)
3110 3111 3112
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

3113 3114 3115 3116 3117
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 已提交
3118 3119
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
3120
libvirt_net_rpc_client_la_LDFLAGS = $(AM_LDFLAGS)
3121 3122
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
3123

3124 3125
libexec_PROGRAMS =

3126
if WITH_LIBVIRTD
3127 3128
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
3129 3130 3131 3132
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3133 3134
libvirt_iohelper_LDADD = \
		libvirt_util.la \
3135
		../gnulib/lib/libgnu.la
3136 3137
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
3138
endif WITH_DTRACE_PROBES
3139

D
Daniel P. Berrange 已提交
3140 3141 3142 3143
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
3144 3145 3146 3147

if WITH_NETWORK
libexec_PROGRAMS += libvirt_leaseshelper
libvirt_leaseshelper_SOURCES = $(NETWORK_LEASES_HELPER_SOURCES)
3148 3149 3150 3151
libvirt_leaseshelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3152 3153
libvirt_leaseshelper_LDADD = \
               libvirt_util.la \
3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166
               ../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

3167
endif WITH_LIBVIRTD
3168

3169
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
3170
if WITH_LIBVIRTD
3171
libexec_PROGRAMS += libvirt_parthelper
3172

3173
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
D
Daniel P. Berrange 已提交
3174 3175 3176 3177
libvirt_parthelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3178 3179 3180
libvirt_parthelper_LDADD = \
		$(LIBPARTED_LIBS) \
		libvirt_util.la \
3181
		../gnulib/lib/libgnu.la
3182 3183
if WITH_DTRACE_PROBES
libvirt_parthelper_LDADD += libvirt_probes.lo
3184
endif WITH_DTRACE_PROBES
3185

D
Daniel P. Berrange 已提交
3186 3187 3188 3189 3190
libvirt_parthelper_CFLAGS = \
		$(LIBPARTED_CFLAGS) \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
3191 3192
endif WITH_LIBVIRTD
endif WITH_STORAGE_DISK
3193 3194
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)

3195

3196
if WITH_SANLOCK
3197 3198 3199
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
3200
libvirt_sanlock_helper_CFLAGS = \
3201
		-I$(srcdir)/conf \
D
Daniel P. Berrange 已提交
3202 3203 3204 3205 3206 3207 3208
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3209
libvirt_sanlock_helper_LDADD = libvirt.la
3210
endif WITH_SANLOCK
3211

3212 3213 3214 3215
if WITH_LXC
if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_lxc

3216 3217
libvirt_lxc_SOURCES = \
		$(LXC_CONTROLLER_SOURCES) \
O
Osier Yang 已提交
3218
		$(DATATYPES_SOURCES)
D
Daniel P. Berrange 已提交
3219 3220 3221
libvirt_lxc_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
3222 3223
		$(CAPNG_LIBS) \
		$(LIBXML_LIBS) \
D
Daniel P. Berrange 已提交
3224
		$(NULL)
3225
libvirt_lxc_LDADD = \
G
Gao feng 已提交
3226
		$(FUSE_LIBS) \
3227
		libvirt.la \
3228
		../gnulib/lib/libgnu.la
3229
if WITH_DTRACE_PROBES
3230
libvirt_lxc_LDADD += libvirt_probes.lo
3231
endif WITH_DTRACE_PROBES
3232
libvirt_lxc_LDADD += $(SECDRIVER_LIBS)
3233 3234 3235 3236
libvirt_lxc_CFLAGS = \
		-I$(srcdir)/conf \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
3237 3238
		$(CAPNG_CFLAGS) \
		$(LIBXML_CFLAGS) \
3239 3240 3241 3242
		$(LIBNL_CFLAGS) \
		$(FUSE_CFLAGS) \
		$(DBUS_CFLAGS) \
		$(XDR_CFLAGS) \
D
Daniel P. Berrange 已提交
3243
		$(NULL)
3244
if WITH_BLKID
3245 3246
libvirt_lxc_CFLAGS += $(BLKID_CFLAGS)
libvirt_lxc_LDADD += $(BLKID_LIBS)
3247
endif WITH_BLKID
J
Jim Fehlig 已提交
3248
libvirt_lxc_CFLAGS += $(SECDRIVER_CFLAGS)
3249 3250
endif WITH_LIBVIRTD
endif WITH_LXC
3251 3252
EXTRA_DIST += $(LXC_CONTROLLER_SOURCES)

J
Jamie Strandboge 已提交
3253 3254 3255 3256 3257 3258
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 已提交
3259 3260 3261 3262
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3263 3264 3265 3266 3267
virt_aa_helper_LDADD = \
		libvirt.la \
		libvirt_conf.la \
		libvirt_util.la \
		libvirt_driver_storage_impl.la \
C
Chris Lalancette 已提交
3268
		../gnulib/lib/libgnu.la
3269
if WITH_DTRACE_PROBES
3270
virt_aa_helper_LDADD += libvirt_probes.lo
3271
endif WITH_DTRACE_PROBES
3272 3273 3274 3275 3276
virt_aa_helper_CFLAGS = \
		-I$(srcdir)/conf \
		-I$(srcdir)/security \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
D
Daniel P. Berrange 已提交
3277
		$(NULL)
3278 3279
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
J
Jamie Strandboge 已提交
3280 3281
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

3282
if WITH_NSS
3283 3284
noinst_LTLIBRARIES += libvirt-nss.la

3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333
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 \
3334 3335
		$(NULL)

3336 3337 3338 3339
libvirt_nss_la_CFLAGS = \
		-DLIBVIRT_NSS \
		$(AM_CFLAGS) \
		$(YAJL_CFLAGS) \
3340
		$(NULL)
3341 3342
libvirt_nss_la_LDFLAGS = \
		$(AM_LDFLAGS) \
3343 3344
		$(NULL)

3345 3346
libvirt_nss_la_LIBADD = \
		$(YAJL_LIBS) \
3347
		$(NULL)
3348
endif WITH_NSS
3349 3350


3351
install-data-local: install-init install-systemd install-upstart \
3352
		install-sysctl install-polkit install-sasl \
3353
		install-logrotate install-data-extra
3354
if WITH_LIBVIRTD
3355
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt"
3356
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
3357
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
3358
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
3359
endif WITH_LIBVIRTD
3360 3361
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
3362
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
3363
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
3364
if WITH_SANLOCK
3365
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
3366
endif WITH_SANLOCK
3367
if WITH_QEMU
3368
	$(MKDIR_P) -m 0751 "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu"
3369
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu"
3370
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu"
3371
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu"
3372
endif WITH_QEMU
3373 3374 3375
if WITH_LXC
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lxc"
3376
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/lxc"
3377
endif WITH_LXC
J
Jim Fehlig 已提交
3378 3379 3380
if WITH_LIBXL
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/libxl"
J
Jim Fehlig 已提交
3381
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl"
3382
endif WITH_LIBXL
3383 3384
if WITH_XEN
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/xen"
3385
endif WITH_XEN
3386 3387
if WITH_NETWORK
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network"
3388
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq"
3389
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/network"
3390
	$(MKDIR_P) "$(DESTDIR)$(confdir)/qemu/networks/autostart"
3391
	$(INSTALL_DATA) $(srcdir)/network/default.xml \
3392
	  $(DESTDIR)$(confdir)/qemu/networks/default.xml
3393
	test -z "$(UUID)" || \
3394 3395 3396
	  { sed -e "s,</name>,</name>;  <uuid>$(UUID)</uuid>," \
	      $(DESTDIR)$(confdir)/qemu/networks/default.xml | \
	      tr ";" "\n" > \
3397 3398 3399 3400
	      $(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 已提交
3401
	( cd $(DESTDIR)$(confdir)/qemu/networks/autostart && \
3402 3403
	  rm -f default.xml && \
	  $(LN_S) ../default.xml default.xml )
3404
endif WITH_NETWORK
3405

3406
uninstall-local:: uninstall-init uninstall-systemd uninstall-upstart \
3407
		uninstall-sysctl uninstall-polkit uninstall-sasl \
3408
		uninstall-logrotate uninstall-data-extra
3409
if WITH_LIBVIRTD
3410
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt" ||:
3411
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
3412 3413
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
3414
endif WITH_LIBVIRTD
3415 3416
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
3417
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
3418
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
3419
if WITH_SANLOCK
3420
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
3421
endif WITH_SANLOCK
3422 3423 3424 3425 3426
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" ||:
3427
endif WITH_QEMU
3428 3429 3430
if WITH_LXC
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||:
3431
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/lxc" ||:
3432
endif WITH_LXC
J
Jim Fehlig 已提交
3433 3434 3435
if WITH_LIBXL
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||:
J
Jim Fehlig 已提交
3436
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||:
3437
endif WITH_LIBXL
3438 3439
if WITH_XEN
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/xen" ||:
3440
endif WITH_XEN
3441
if WITH_NETWORK
3442 3443 3444 3445
	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" || :
3446 3447
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||:
3448
endif WITH_NETWORK
3449
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
3450

3451 3452
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
3453 3454 3455 3456 3457
MAINTAINERCLEANFILES += \
	$(REMOTE_DRIVER_GENERATED) \
	$(LIBVIRTD_GENERATED) \
	$(VIR_NET_RPC_GENERATED) \
	$(NULL)