Makefile.am 97.0 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 77 78 79 80 81
augeas_DATA =
augeastest_DATA =
conf_DATA =
AUGEAS_DIRS =
if WITH_DTRACE_PROBES
tapset_DATA =
endif WITH_DTRACE_PROBES
82 83

include uml/Makefile.inc.am
84
include phyp/Makefile.inc.am
85
include test/Makefile.inc.am
86
include esx/Makefile.inc.am
87
include hyperv/Makefile.inc.am
88
include vmware/Makefile.inc.am
89
include vbox/Makefile.inc.am
90
include openvz/Makefile.inc.am
91
include qemu/Makefile.inc.am
92
include bhyve/Makefile.inc.am
93
include xenconfig/Makefile.inc.am
94 95 96 97

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

98

E
Eric Blake 已提交
99 100
THREAD_LIBS = $(LIB_PTHREAD) $(LTLIBMULTITHREAD)

J
Jim Fehlig 已提交
101
SECDRIVER_CFLAGS =
102 103
SECDRIVER_LIBS =
if WITH_SECDRIVER_SELINUX
J
Jim Fehlig 已提交
104
SECDRIVER_CFLAGS += $(SELINUX_CFLAGS)
105
SECDRIVER_LIBS += $(SELINUX_LIBS)
106
endif WITH_SECDRIVER_SELINUX
107
if WITH_SECDRIVER_APPARMOR
J
Jim Fehlig 已提交
108
SECDRIVER_CFLAGS += $(APPARMOR_CFLAGS)
109
SECDRIVER_LIBS += $(APPARMOR_LIBS)
110
endif WITH_SECDRIVER_APPARMOR
111

112 113
if WITH_NETWORK
UUID=$(shell uuidgen 2>/dev/null)
114
endif WITH_NETWORK
115

116
lib_LTLIBRARIES = libvirt.la libvirt-qemu.la libvirt-lxc.la
117

118
moddir = $(libdir)/libvirt/connection-driver
119
sbin_PROGRAMS =
120

A
Amy Griffis 已提交
121
confdir = $(sysconfdir)/libvirt
122
conf_DATA += libvirt.conf libvirt-admin.conf
123

124 125 126 127
augeasdir = $(datadir)/augeas/lenses

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

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

234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258
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

259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288
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 $@

289
KEYCODES = linux osx atset1 atset2 atset3 xtkbd usb win32 rfb
290 291 292 293 294 295 296
KEYNAMES = linux osx win32

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

297 298 299 300 301 302
KEYPODS = $(KEYCODES:%=util/virkeycode-%.pod) \
	  $(KEYNAMES:%=util/virkeyname-%.pod)
KEYMANS = $(KEYPODS:%.pod=%.7)

man7_MANS = $(KEYMANS)

303 304 305
UTIL_SOURCES += $(KEYTABLES)
BUILT_SOURCES += $(KEYTABLES)
MAINTAINERCLEANFILES += $(KEYTABLES)
306
CLEANFILES += $(KEYMANS) $(KEYPODS)
L
Lai Jiangshan 已提交
307

308
# Internal generic driver infrastructure
O
Osier Yang 已提交
309
DATATYPES_SOURCES = datatypes.h datatypes.c
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338
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 \
339
		$(NULL)
340

341 342 343
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

344 345
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
346

347
LOCK_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
348 349
		locking/lock_protocol.h \
		locking/lock_protocol.c \
350 351
		$(NULL)

352 353 354
LOCK_PROTOCOL = $(srcdir)/locking/lock_protocol.x
EXTRA_DIST += $(LOCK_PROTOCOL) \
	$(LOCK_PROTOCOL_GENERATED)
355 356 357
BUILT_SOURCES += $(LOCK_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(LOCK_PROTOCOL_GENERATED)

358
LOCK_DAEMON_GENERATED = \
359
		locking/lock_daemon_dispatch_stubs.h
360 361 362
		$(NULL)

BUILT_SOURCES += $(LOCK_DAEMON_GENERATED)
363
EXTRA_DIST += $(LOCK_DAEMON_GENERATED)
364 365
MAINTAINERCLEANFILES += $(LOCK_DAEMON_GENERATED)

366 367
LOCK_DRIVER_LOCKD_SOURCES = \
		locking/lock_driver_lockd.c \
368
		locking/lock_driver_lockd.h \
369 370
		$(NULL)

371 372 373 374 375
LOCK_DAEMON_SOURCES = \
		locking/lock_daemon.h \
		locking/lock_daemon.c \
		locking/lock_daemon_config.h \
		locking/lock_daemon_config.c \
376 377
		locking/lock_daemon_dispatch.c \
		locking/lock_daemon_dispatch.h \
378 379
		$(NULL)

E
Eric Blake 已提交
380
locking/lock_daemon_dispatch_stubs.h: $(LOCK_PROTOCOL) \
381
		$(srcdir)/rpc/gendispatch.pl Makefile.am
382 383
	$(AM_V_GEN)perl -w $(srcdir)/rpc/gendispatch.pl --mode=server \
	    virLockSpaceProtocol VIR_LOCK_SPACE_PROTOCOL \
E
Eric Blake 已提交
384
	    $(LOCK_PROTOCOL) > $(srcdir)/locking/lock_daemon_dispatch_stubs.h
385 386


387 388 389 390 391
LOG_PROTOCOL_GENERATED = \
		logging/log_protocol.h \
		logging/log_protocol.c \
		$(NULL)

392 393
DRIVER_SOURCES += $(LOG_PROTOCOL_GENERATED)

394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414
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 \
415 416
		logging/log_handler.c \
		logging/log_handler.h \
417 418 419 420 421 422 423 424 425
		$(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


426
NETDEV_CONF_SOURCES = \
427
		conf/netdev_bandwidth_conf.h conf/netdev_bandwidth_conf.c \
428 429
		conf/netdev_vport_profile_conf.h conf/netdev_vport_profile_conf.c \
		conf/netdev_vlan_conf.h conf/netdev_vlan_conf.c
430

431
# XML configuration format handling sources
432
# Domain driver generic impl APIs
433 434 435 436 437 438 439 440 441 442
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 \
443
		conf/virdomainobjlist.c conf/virdomainobjlist.h
444

445
OBJECT_EVENT_SOURCES = \
446 447 448
		conf/object_event.c conf/object_event.h \
		conf/object_event_private.h

449
DOMAIN_EVENT_SOURCES = \
450
		conf/domain_event.c conf/domain_event.h
451

452
NETWORK_EVENT_SOURCES = \
453 454
		conf/network_event.c conf/network_event.h

455
STORAGE_EVENT_SOURCES = \
456 457
                conf/storage_event.c conf/storage_event.h

458
NODE_DEVICE_EVENT_SOURCES = \
459 460
                conf/node_device_event.c conf/node_device_event.h

461
SECRET_EVENT_SOURCES = \
462 463
                conf/secret_event.c conf/secret_event.h

464
# Network driver generic impl APIs
465 466 467
NETWORK_CONF_SOURCES = \
		conf/network_conf.c conf/network_conf.h \
		conf/virnetworkobj.c conf/virnetworkobj.h \
468
		conf/networkcommon_conf.c conf/networkcommon_conf.h
469

470
# Network filter driver generic impl APIs
471 472 473 474 475
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 已提交
476
		conf/virnwfilterobj.h
477

478 479 480
NWFILTER_CONF_SOURCES = \
		$(NWFILTER_PARAM_CONF_SOURCES) \
		conf/nwfilter_conf.c conf/nwfilter_conf.h \
J
John Ferlan 已提交
481
		conf/virnwfilterobj.c conf/virnwfilterobj.h
482

483
# Storage driver generic impl APIs
484
STORAGE_CONF_SOURCES = \
485
		conf/storage_adapter_conf.h conf/storage_adapter_conf.c \
486
		conf/storage_conf.h conf/storage_conf.c \
J
John Ferlan 已提交
487
		conf/virstorageobj.h conf/virstorageobj.c
488

489
# Interface driver generic impl APIs
490 491
INTERFACE_CONF_SOURCES = \
		conf/interface_conf.c conf/interface_conf.h \
J
John Ferlan 已提交
492
		conf/virinterfaceobj.c conf/virinterfaceobj.h
493

494
# Secret driver generic impl APIs
495 496
SECRET_CONF_SOURCES = \
		conf/secret_conf.h conf/secret_conf.c \
497
		conf/virsecretobj.h conf/virsecretobj.c
498 499

# Network driver generic impl APIs
500
NODE_DEVICE_CONF_SOURCES = \
J
John Ferlan 已提交
501 502
		conf/node_device_conf.c conf/node_device_conf.h \
		conf/virnodedeviceobj.c conf/virnodedeviceobj.h
503

504
CPU_CONF_SOURCES = \
505
		conf/cpu_conf.c conf/cpu_conf.h
506

507
# Safe character device handling helper APIs
508
CHRDEV_CONF_SOURCES = \
509
		conf/virchrdev.c conf/virchrdev.h
510

511
# Device Helper APIs
512
DEVICE_CONF_SOURCES = \
513 514
		conf/device_conf.c conf/device_conf.h

515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531
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) \
532
		$(DEVICE_CONF_SOURCES)
533

534
# The remote RPC driver, covering domains, storage, networks, etc
535
REMOTE_DRIVER_GENERATED = \
536 537 538 539 540 541 542 543 544
		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 已提交
545
		$(NULL)
E
Eric Blake 已提交
546 547

REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x
548
LXC_PROTOCOL = $(srcdir)/remote/lxc_protocol.x
E
Eric Blake 已提交
549
QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x
550
REMOTE_DRIVER_PROTOCOL = $(REMOTE_PROTOCOL) $(QEMU_PROTOCOL) $(LXC_PROTOCOL)
551

E
Eric Blake 已提交
552
remote/remote_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
553
		$(REMOTE_PROTOCOL) Makefile.am
554
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
555 556
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/remote/remote_client_bodies.h
557

E
Eric Blake 已提交
558
remote/lxc_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
559
		$(LXC_PROTOCOL) Makefile.am
560
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
561 562
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/remote/lxc_client_bodies.h
563

E
Eric Blake 已提交
564
remote/qemu_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
565
		$(QEMU_PROTOCOL) Makefile.am
566
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
567 568
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/remote/qemu_client_bodies.h
569

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

588 589
REMOTE_DRIVER_SOURCES = \
		remote/remote_driver.c remote/remote_driver.h \
590
		$(REMOTE_DRIVER_GENERATED)
591

592 593 594 595 596 597 598 599 600 601 602 603 604
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)

605
EXTRA_DIST +=  $(REMOTE_DRIVER_PROTOCOL) \
606 607 608
		$(REMOTE_DRIVER_GENERATED) \
		$(LIBVIRTD_SOURCES) \
		$(NULL)
609

M
Martin Kletzander 已提交
610 611 612
ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x

ADMIN_PROTOCOL_GENERATED = \
613 614
		admin/admin_protocol.c \
		admin/admin_protocol.h \
615 616 617
		admin/admin_client.h \
		admin/admin_server_dispatch_stubs.h \
		$(NULL)
618 619 620 621 622 623

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

625 626 627 628 629 630
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 已提交
631 632 633 634
EXTRA_DIST += $(ADMIN_PROTOCOL) $(ADMIN_PROTOCOL_GENERATED)
BUILT_SOURCES += $(ADMIN_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(ADMIN_PROTOCOL_GENERATED)

635 636 637 638 639 640 641 642 643 644
# 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
645 646 647 648

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

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

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

E
Eric Blake 已提交
727
# Keep this list synced with RPC_PROBE_FILES
728 729
PROTOCOL_STRUCTS = \
	$(srcdir)/remote_protocol-structs \
730
	$(srcdir)/lxc_protocol-structs \
731
	$(srcdir)/qemu_protocol-structs \
J
Jiri Denemark 已提交
732
	$(srcdir)/virnetprotocol-structs \
E
Eric Blake 已提交
733 734 735
	$(srcdir)/virkeepaliveprotocol-structs \
	$(srcdir)/lxc_monitor_protocol-structs \
	$(srcdir)/lock_protocol-structs \
M
Martin Kletzander 已提交
736
	$(srcdir)/admin_protocol-structs \
E
Eric Blake 已提交
737 738
	$(NULL)

739
if WITH_REMOTE
740 741
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)

742 743
# 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.
744 745 746
$(srcdir)/remote_protocol-struct \
	$(srcdir)/qemu_protocol-struct \
	$(srcdir)/lxc_protocol-struct: \
E
Eric Blake 已提交
747
		$(srcdir)/%-struct: remote/libvirt_driver_remote_la-%.lo
748
	$(PDWTAGS)
749
$(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \
E
Eric Blake 已提交
750
		$(srcdir)/%-struct: rpc/libvirt_net_rpc_la-%.lo
751
	$(PDWTAGS)
E
Eric Blake 已提交
752
$(srcdir)/lxc_monitor_protocol-struct: \
E
Eric Blake 已提交
753
		$(srcdir)/%-struct: lxc/libvirt_driver_lxc_impl_la-%.lo
E
Eric Blake 已提交
754 755
	$(PDWTAGS)
$(srcdir)/lock_protocol-struct: \
E
Eric Blake 已提交
756
		$(srcdir)/%-struct: locking/lockd_la-%.lo
E
Eric Blake 已提交
757
	$(PDWTAGS)
M
Martin Kletzander 已提交
758 759 760
$(srcdir)/admin_protocol-struct: \
		$(srcdir)/%-struct: admin/libvirt_admin_la-%.lo
	$(PDWTAGS)
E
Eric Blake 已提交
761

762
else !WITH_REMOTE
763 764 765
# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be
# re-generated when configured --without-remote.
check-protocol:
766
endif !WITH_REMOTE
J
Jiri Denemark 已提交
767
EXTRA_DIST += $(PROTOCOL_STRUCTS)
768 769 770 771 772

check-drivername:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-drivername.pl \
		$(srcdir)/driver.h \
		$(srcdir)/libvirt_public.syms \
773
		$(srcdir)/libvirt_admin_public.syms \
774 775 776 777 778
		$(srcdir)/libvirt_qemu.syms \
		$(srcdir)/libvirt_lxc.syms

EXTRA_DIST += check-drivername.pl

779
DRIVER_SOURCE_FILES += \
780 781 782 783 784 785 786 787
	$(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) \
788
	$(VZ_DRIVER_SOURCES) \
789 790 791 792 793
	$(REMOTE_DRIVER_SOURCES) \
	$(SECRET_DRIVER_SOURCES) \
	$(STORAGE_DRIVER_SOURCES) \
	$(XEN_DRIVER_SOURCES) \
	$(XENAPI_DRIVER_SOURCES) \
794 795
	$(NULL)

796
STATEFUL_DRIVER_SOURCE_FILES += \
797 798 799 800 801 802 803 804 805
	$(INTERFACE_DRIVER_SOURCES) \
	$(LIBXL_DRIVER_SOURCES) \
	$(LXC_DRIVER_SOURCES) \
	$(NETWORK_DRIVER_SOURCES) \
	$(NODE_DEVICE_DRIVER_SOURCES) \
	$(NWFILTER_DRIVER_SOURCES) \
	$(SECRET_DRIVER_SOURCES) \
	$(STORAGE_DRIVER_SOURCES) \
	$(XEN_DRIVER_SOURCES) \
806
	$(VZ_DRIVER_SOURCES) \
807 808
	$(NULL)

809 810 811

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

817 818
check-aclrules:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclrules.pl \
E
Eric Blake 已提交
819
		$(REMOTE_PROTOCOL) \
820
		$(addprefix $(srcdir)/,$(filter-out /%,$(STATEFUL_DRIVER_SOURCE_FILES)))
821

822 823 824 825 826
check-aclperms:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclperms.pl \
		$(srcdir)/access/viraccessperm.h \
		$(srcdir)/access/viraccessperm.c

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

829
check-local: check-protocol check-symfile check-symsorting \
830
	check-drivername check-driverimpls check-aclrules \
831
	check-aclperms check-admin-symfile check-admin-symsorting
832
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
833

834
# Now the Hypervisor specific drivers
835 836 837 838 839 840
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 \
841
		xen/xs_internal.c xen/xs_internal.h
842
if WITH_XEN_INOTIFY
843
XEN_DRIVER_SOURCES += xen/xen_inotify.c xen/xen_inotify.h
844
endif WITH_XEN_INOTIFY
845

846
LXC_MONITOR_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
847 848
	lxc/lxc_monitor_protocol.h \
	lxc/lxc_monitor_protocol.c \
849 850 851
	$(NULL)

LXC_MONITOR_GENERATED = \
E
Eric Blake 已提交
852
	lxc/lxc_monitor_dispatch.h \
853 854 855
	$(NULL)

LXC_CONTROLLER_GENERATED = \
E
Eric Blake 已提交
856
	lxc/lxc_controller_dispatch.h \
857 858 859
	$(NULL)

LXC_GENERATED = \
860
	$(LXC_MONITOR_PROTOCOL_GENERATED) \
861 862 863 864
	$(LXC_MONITOR_GENERATED) \
	$(LXC_CONTROLLER_GENERATED) \
	$(NULL)

865
LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x
866

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

E
Eric Blake 已提交
873
lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
874
		$(REMOTE_PROTOCOL) Makefile.am
875
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \
E
Eric Blake 已提交
876 877
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_controller_dispatch.h
878 879

EXTRA_DIST += \
880
	$(LXC_MONITOR_PROTOCOL) \
881 882 883 884 885
	$(LXC_GENERATED) \
	$(NULL)

BUILT_SOURCES += $(LXC_GENERATED)

886 887
CLEANFILES += $(LXC_GENERATED)

888 889 890 891 892 893 894 895 896 897 898 899
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 \
900
		lxc/lxc_driver.c lxc/lxc_driver.h
901

902 903 904 905 906 907 908 909
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 \
910
		lxc/lxc_controller.c
911

912 913
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES = \
		$(DATATYPES_SOURCES) \
J
Jamie Strandboge 已提交
914 915
		security/virt-aa-helper.c

916 917 918
XENAPI_DRIVER_SOURCES = \
		xenapi/xenapi_driver.c xenapi/xenapi_driver.h \
		xenapi/xenapi_driver_private.h \
919 920
		xenapi/xenapi_utils.c xenapi/xenapi_utils.h

921 922 923 924 925 926
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 已提交
927
		libxl/libxl_migration.c libxl/libxl_migration.h
J
Jim Fehlig 已提交
928

929 930 931 932 933 934
VZ_DRIVER_SOURCES = \
		vz/vz_driver.h \
		vz/vz_driver.c \
		vz/vz_utils.c \
		vz/vz_utils.h \
		vz/vz_sdk.h \
935
		vz/vz_sdk.c
D
Dmitry Guryanov 已提交
936

937
NETWORK_DRIVER_SOURCES = \
938
		network/bridge_driver.h network/bridge_driver.c \
939 940
		network/bridge_driver_platform.h \
		network/bridge_driver_platform.c \
941 942
		$(NULL)
EXTRA_DIST += network/bridge_driver_linux.c network/bridge_driver_nop.c
943

944 945 946
INTERFACE_DRIVER_SOURCES =

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

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

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

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

967
# Storage backend specific impls
968 969 970
STORAGE_DRIVER_BACKEND_SOURCES = \
		storage/storage_backend.h storage/storage_backend.c

971 972
STORAGE_DRIVER_SOURCES = \
		storage/storage_driver.h storage/storage_driver.c \
973
		$(STORAGE_DRIVER_BACKEND_SOURCES) \
974
		storage/storage_util.h storage/storage_util.c
975

976
STORAGE_DRIVER_FS_SOURCES = \
977
		storage/storage_backend_fs.h storage/storage_backend_fs.c
R
Richard W.M. Jones 已提交
978

979 980
STORAGE_DRIVER_LVM_SOURCES = \
		storage/storage_backend_logical.h \
981
		storage/storage_backend_logical.c
982

983
STORAGE_DRIVER_ISCSI_SOURCES = \
984
		storage/storage_backend_iscsi.h storage/storage_backend_iscsi.c
985

986
STORAGE_DRIVER_SCSI_SOURCES = \
987
		storage/storage_backend_scsi.h storage/storage_backend_scsi.c
988

989
STORAGE_DRIVER_MPATH_SOURCES = \
990
		storage/storage_backend_mpath.h storage/storage_backend_mpath.c
D
Dave Allan 已提交
991

992
STORAGE_DRIVER_DISK_SOURCES = \
993
		storage/storage_backend_disk.h storage/storage_backend_disk.c
994

995
STORAGE_DRIVER_RBD_SOURCES = \
996 997
		storage/storage_backend_rbd.h storage/storage_backend_rbd.c

998
STORAGE_DRIVER_SHEEPDOG_SOURCES = \
999 1000
		storage/storage_backend_sheepdog.h storage/storage_backend_sheepdog.c \
		storage/storage_backend_sheepdog_priv.h
1001

1002
STORAGE_DRIVER_GLUSTER_SOURCES = \
1003 1004
		storage/storage_backend_gluster.h storage/storage_backend_gluster.c

1005
STORAGE_DRIVER_ZFS_SOURCES = \
R
Roman Bogorodskiy 已提交
1006 1007
                storage/storage_backend_zfs.h storage/storage_backend_zfs.c

1008 1009
STORAGE_DRIVER_VSTORAGE_SOURCES = \
                storage/storage_backend_vstorage.h \
1010 1011
                storage/storage_backend_vstorage.c

1012
STORAGE_HELPER_DISK_SOURCES = \
1013
		storage/parthelper.c
1014

1015
UTIL_IO_HELPER_SOURCES = \
1016 1017
		util/iohelper.c

1018
NETWORK_LEASES_HELPER_SOURCES = \
1019 1020
               network/leaseshelper.c

1021
# Network filters
1022 1023 1024 1025 1026 1027 1028 1029 1030 1031
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 \
1032
		nwfilter/nwfilter_learnipaddr.h
1033

1034

1035
# Security framework and drivers for various models
1036 1037 1038 1039 1040
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 \
1041
		security/security_manager.h security/security_manager.c
1042

1043
SECURITY_DRIVER_SELINUX_SOURCES = \
1044
		security/security_selinux.h security/security_selinux.c
1045

1046
SECURITY_DRIVER_APPARMOR_SOURCES = \
J
Jamie Strandboge 已提交
1047 1048
		security/security_apparmor.h security/security_apparmor.c

1049
ACCESS_DRIVER_GENERATED = \
E
Eric Blake 已提交
1050 1051 1052 1053 1054 1055 1056
		access/viraccessapicheck.h \
		access/viraccessapicheck.c \
		access/viraccessapicheckqemu.h \
		access/viraccessapicheckqemu.c \
		access/viraccessapichecklxc.h \
		access/viraccessapichecklxc.c \
		$(NULL)
1057

1058
ACCESS_DRIVER_SYM_FILES = \
1059 1060 1061
		libvirt_access.syms \
		libvirt_access_qemu.syms \
		libvirt_access_lxc.syms
1062

1063 1064 1065 1066 1067
ACCESS_DRIVER_API_FILES = \
		libvirt_access.xml \
		libvirt_access_qemu.xml \
		libvirt_access_lxc.xml

1068 1069 1070 1071 1072 1073 1074
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

1075 1076 1077 1078
ACCESS_DRIVER_POLKIT_SOURCES = \
		access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c

ACCESS_DRIVER_POLKIT_POLICY = \
1079
		$(srcdir)/access/org.libvirt.api.policy
1080 1081


1082 1083
NODE_DEVICE_DRIVER_SOURCES = \
		node_device/node_device_driver.c \
1084
		node_device/node_device_driver.h
1085

1086 1087
NODE_DEVICE_DRIVER_HAL_SOURCES = \
		node_device/node_device_hal.c \
1088
		node_device/node_device_hal.h
1089

1090 1091
NODE_DEVICE_DRIVER_UDEV_SOURCES = \
		node_device/node_device_udev.c \
D
Daniel Veillard 已提交
1092
		node_device/node_device_udev.h
1093

1094 1095 1096 1097 1098 1099 1100
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 \
1101
		cpu/cpu_map.h cpu/cpu_map.c
1102

1103
VMX_SOURCES = \
1104 1105
		vmx/vmx.c vmx/vmx.h

1106
if WITH_LIBXL
1107 1108
XENCONFIG_LIBXL_SOURCES = \
		$(XENCONFIG_SOURCES) \
1109 1110
		xenconfig/xen_xl.c xenconfig/xen_xl.h
endif WITH_LIBXL
1111

J
Jiri Denemark 已提交
1112 1113
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
1114
EXTRA_DIST +=	$(pkgdata_DATA)
1115

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

1122
noinst_LTLIBRARIES += libvirt_util.la
1123
libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
1124
libvirt_la_BUILT_LIBADD += libvirt_util.la
1125
libvirt_util_la_SOURCES = \
1126
		$(UTIL_SOURCES)
1127
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
1128
		$(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
1129
		$(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS) \
1130
		$(POLKIT_CFLAGS) $(GNUTLS_CFLAGS) $(ACL_CFLAGS)
1131
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
1132
		$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
1133
		$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(WIN32_EXTRA_LIBS) $(LIBXML_LIBS) \
M
Michal Privoznik 已提交
1134
		$(SECDRIVER_LIBS) $(NUMACTL_LIBS) $(ACL_LIBS) \
1135
		$(POLKIT_LIBS) $(GNUTLS_LIBS)
1136

1137 1138

noinst_LTLIBRARIES += libvirt_conf.la
1139
libvirt_la_BUILT_LIBADD += libvirt_conf.la
1140
libvirt_conf_la_SOURCES = $(CONF_SOURCES)
1141 1142
libvirt_conf_la_CFLAGS = \
		-I$(srcdir)/conf $(AM_CFLAGS)
1143
libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS)
1144
libvirt_conf_la_LIBADD = $(LIBXML_LIBS)
1145

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

1152 1153 1154 1155 1156 1157
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)

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

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

1174

1175
noinst_LTLIBRARIES += libvirt_driver.la
1176
libvirt_la_BUILT_LIBADD += libvirt_driver.la
1177
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
1178

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

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

1195
if WITH_REMOTE
1196
noinst_LTLIBRARIES += libvirt_driver_remote.la
1197
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
1198 1199 1200 1201
libvirt_driver_remote_la_CFLAGS = \
		$(XDR_CFLAGS) \
		-I$(srcdir)/conf \
		-I$(srcdir)/rpc \
1202 1203
		$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
1204
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
1205

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

1208 1209
endif WITH_REMOTE

1210 1211 1212 1213 1214 1215 1216

if WITH_LIBVIRTD

sbin_PROGRAMS += libvirtd

BUILT_SOURCES += $(LIBVIRTD_GENERATED)

1217 1218 1219 1220 1221 1222
augeas_DATA += remote/libvirtd.aug

augeastest_DATA += test_libvirtd.aug

conf_DATA += remote/libvirtd.conf

1223
CLEANFILES += test_libvirtd.aug
1224

1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235
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
1236
CLEANFILES += libvirtd.policy
1237 1238 1239 1240 1241 1242 1243

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

1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284
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
1285 1286 1287 1288
EXTRA_DIST += \
	remote/test_libvirtd.aug.in \
	remote/libvirtd.aug \
	remote/libvirtd.conf \
1289 1290 1291 1292
	remote/libvirtd.policy.in \
	remote/libvirtd.rules \
	remote/libvirtd.sasl \
	remote/libvirtd.sysctl \
1293
	$(NULL)
1294

1295
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
1296
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
1297
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1298

1299
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
1300
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
1301
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1302

1303
if WITH_XEN
E
Eric Blake 已提交
1304 1305 1306
noinst_LTLIBRARIES += libvirt_driver_xen_impl.la
libvirt_driver_xen_la_SOURCES =
libvirt_driver_xen_la_LIBADD = libvirt_driver_xen_impl.la
1307
mod_LTLIBRARIES += libvirt_driver_xen.la
1308
libvirt_driver_xen_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1309
libvirt_driver_xen_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1310

1311 1312 1313 1314 1315
libvirt_driver_xen_impl_la_CFLAGS = \
		$(XEN_CFLAGS) \
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
		-I$(srcdir)/xenconfig \
1316
		$(AM_CFLAGS)
E
Eric Blake 已提交
1317
libvirt_driver_xen_impl_la_LDFLAGS = $(AM_LDFLAGS)
P
Pavel Hrdina 已提交
1318
libvirt_driver_xen_impl_la_LIBADD = $(XEN_LIBS) libvirt_xenconfig.la
E
Eric Blake 已提交
1319
libvirt_driver_xen_impl_la_SOURCES = $(XEN_DRIVER_SOURCES)
1320
endif WITH_XEN
1321

1322 1323
if WITH_XENAPI
noinst_LTLIBRARIES += libvirt_driver_xenapi.la
1324
libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la
1325
libvirt_driver_xenapi_la_CFLAGS = $(XENAPI_CFLAGS) $(CURL_CFLAGS) \
P
Pavel Hrdina 已提交
1326
		-I$(srcdir)/conf -I$(srcdir)/xenconfig $(AM_CFLAGS)
1327
libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS)
1328
libvirt_driver_xenapi_la_LIBADD = $(XENAPI_LIBS) $(CURL_LIBS)
1329
libvirt_driver_xenapi_la_SOURCES = $(XENAPI_DRIVER_SOURCES)
1330
endif WITH_XENAPI
1331

J
Jim Fehlig 已提交
1332
if WITH_LIBXL
E
Eric Blake 已提交
1333 1334 1335
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 已提交
1336
mod_LTLIBRARIES += libvirt_driver_libxl.la
1337
libvirt_driver_libxl_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1338
libvirt_driver_libxl_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1339

1340 1341
libvirt_driver_libxl_impl_la_CFLAGS = \
		$(LIBXL_CFLAGS) \
1342
		$(LIBXML_CFLAGS) \
1343 1344 1345 1346
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
		-I$(srcdir)/secret \
		-I$(srcdir)/xenconfig \
1347
		$(AM_CFLAGS)
E
Eric Blake 已提交
1348
libvirt_driver_libxl_impl_la_LDFLAGS = $(AM_LDFLAGS)
1349
libvirt_driver_libxl_impl_la_LIBADD = $(LIBXL_LIBS) \
1350
				      $(LIBXML_LIBS) \
1351
				      libvirt_xenconfig_libxl.la
E
Eric Blake 已提交
1352
libvirt_driver_libxl_impl_la_SOURCES = $(LIBXL_DRIVER_SOURCES)
1353 1354 1355 1356 1357 1358

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

1359
endif WITH_LIBXL
1360 1361
EXTRA_DIST += libxl/libxl.conf libxl/libvirtd_libxl.aug \
		libxl/test_libvirtd_libxl.aug.in
J
Jim Fehlig 已提交
1362

1363

1364 1365

if WITH_LXC
E
Eric Blake 已提交
1366 1367 1368
noinst_LTLIBRARIES += libvirt_driver_lxc_impl.la
libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = libvirt_driver_lxc_impl.la
1369
mod_LTLIBRARIES += libvirt_driver_lxc.la
1370
libvirt_driver_lxc_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1371
libvirt_driver_lxc_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1372 1373

libvirt_driver_lxc_impl_la_CFLAGS = \
S
Serge Hallyn 已提交
1374
		$(LIBNL_CFLAGS) \
G
Gao feng 已提交
1375
		$(FUSE_CFLAGS) \
P
Pavel Fedin 已提交
1376
		$(XDR_CFLAGS) \
1377 1378
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1379
		$(AM_CFLAGS)
I
ik.nitk 已提交
1380 1381 1382 1383 1384 1385
libvirt_driver_lxc_impl_la_LIBADD = \
               $(CAPNG_LIBS) \
               $(LIBNL_LIBS) \
               $(LIBXML_LIBS) \
               $(FUSE_LIBS)

1386
if WITH_BLKID
E
Eric Blake 已提交
1387 1388
libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS)
1389
endif WITH_BLKID
1390
libvirt_driver_lxc_impl_la_LIBADD += $(SECDRIVER_LIBS)
E
Eric Blake 已提交
1391
libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES)
A
Amy Griffis 已提交
1392 1393 1394

conf_DATA += lxc/lxc.conf

1395
augeas_DATA += lxc/libvirtd_lxc.aug
1396 1397
augeastest_DATA += test_libvirtd_lxc.aug
CLEANFILES += test_libvirtd_lxc.aug
1398

1399
endif WITH_LXC
1400
EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in
1401

1402

D
Daniel Veillard 已提交
1403

M
Matthias Bolte 已提交
1404 1405


1406
if WITH_VZ
1407 1408 1409 1410
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
1411
libvirt_driver_vz_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1412
libvirt_driver_vz_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1413
libvirt_driver_vz_impl_la_CFLAGS = \
1414 1415 1416
		-I$(srcdir)/conf \
		-I$(srcdir)/access \
		$(AM_CFLAGS) \
1417
		$(PARALLELS_SDK_CFLAGS) $(LIBNL_CFLAGS)
1418 1419
libvirt_driver_vz_impl_la_SOURCES = $(VZ_DRIVER_SOURCES)
libvirt_driver_vz_impl_la_LIBADD =  $(PARALLELS_SDK_LIBS) $(LIBNL_LIBS)
1420
endif WITH_VZ
D
Dmitry Guryanov 已提交
1421

R
Roman Bogorodskiy 已提交
1422

1423
if WITH_NETWORK
E
Eric Blake 已提交
1424 1425 1426
noinst_LTLIBRARIES += libvirt_driver_network_impl.la
libvirt_driver_network_la_SOURCES =
libvirt_driver_network_la_LIBADD = libvirt_driver_network_impl.la
1427
mod_LTLIBRARIES += libvirt_driver_network.la
1428
libvirt_driver_network_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la \
1429 1430 1431
	$(LIBNL_LIBS) \
	$(DBUS_LIBS) \
	$(NULL)
1432
libvirt_driver_network_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1433 1434

libvirt_driver_network_impl_la_CFLAGS = \
1435 1436
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1437 1438
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1439
		$(AM_CFLAGS)
E
Eric Blake 已提交
1440
libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
1441
libvirt_driver_network_impl_la_LIBADD  = $(DBUS_LIBS)
1442
endif WITH_NETWORK
1443 1444 1445
EXTRA_DIST += network/default.xml


1446
if WITH_INTERFACE
1447
mod_LTLIBRARIES += libvirt_driver_interface.la
1448
libvirt_driver_interface_la_CFLAGS = \
1449 1450
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1451
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1452
libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1453 1454 1455 1456
libvirt_driver_interface_la_LIBADD =
if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
1457
endif WITH_NETCF
1458
if WITH_UDEV
1459 1460
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
1461
endif WITH_UDEV
1462
libvirt_driver_interface_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1463
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
1464
endif WITH_INTERFACE
D
Daniel Veillard 已提交
1465

D
Daniel P. Berrange 已提交
1466
if WITH_SECRETS
1467
mod_LTLIBRARIES += libvirt_driver_secret.la
1468
libvirt_driver_secret_la_CFLAGS = \
1469 1470
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1471
		$(AM_CFLAGS)
1472
libvirt_driver_secret_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1473
libvirt_driver_secret_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1474
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
1475
endif WITH_SECRETS
1476

1477
# Needed to keep automake quiet about conditionals
1478 1479
libvirt_driver_storage_impl_la_SOURCES =
libvirt_driver_storage_impl_la_CFLAGS = \
1480 1481
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1482
		-I$(srcdir)/secret \
1483
		$(AM_CFLAGS)
1484 1485
libvirt_driver_storage_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_storage_impl_la_LIBADD =
1486
libvirt_driver_storage_impl_la_LIBADD += $(SECDRIVER_LIBS) $(LIBXML_LIBS)
1487
if WITH_BLKID
1488 1489
libvirt_driver_storage_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(BLKID_LIBS)
1490
endif WITH_BLKID
1491 1492 1493 1494

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

1495
if WITH_STORAGE
1496 1497 1498
noinst_LTLIBRARIES += libvirt_driver_storage_impl.la
libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_LIBADD = libvirt_driver_storage_impl.la
1499
mod_LTLIBRARIES += libvirt_driver_storage.la
1500
libvirt_driver_storage_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1501
libvirt_driver_storage_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1502
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
1503 1504 1505


libvirt_storage_backend_fs_la_SOURCES = $(STORAGE_DRIVER_FS_SOURCES)
1506
libvirt_storage_backend_fs_la_CFLAGS = \
1507 1508 1509
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1510
storagebackend_LTLIBRARIES += libvirt_storage_backend_fs.la
1511
libvirt_storage_backend_fs_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1512
libvirt_storage_backend_fs_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1513
endif WITH_STORAGE
1514

1515
if WITH_STORAGE_LVM
1516 1517 1518 1519 1520 1521
libvirt_storage_backend_logical_la_SOURCES = \
	$(STORAGE_DRIVER_LVM_SOURCES)
libvirt_storage_backend_logical_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1522
storagebackend_LTLIBRARIES += libvirt_storage_backend_logical.la
1523
libvirt_storage_backend_logical_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1524
libvirt_storage_backend_logical_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1525
endif WITH_STORAGE_LVM
1526

1527
if WITH_STORAGE_ISCSI
1528 1529 1530 1531 1532 1533 1534
libvirt_storage_backend_iscsi_la_SOURCES = \
	$(STORAGE_DRIVER_ISCSI_SOURCES)
libvirt_storage_backend_iscsi_la_CFLAGS = \
	-I$(srcdir)/conf \
	-I$(srcdir)/secret \
	$(AM_CFLAGS)

1535
storagebackend_LTLIBRARIES += libvirt_storage_backend_iscsi.la
1536
libvirt_storage_backend_iscsi_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1537
libvirt_storage_backend_iscsi_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1538
endif WITH_STORAGE_ISCSI
1539

1540
if WITH_STORAGE_SCSI
1541 1542 1543 1544 1545
libvirt_storage_backend_scsi_la_SOURCES = $(STORAGE_DRIVER_SCSI_SOURCES)
libvirt_storage_backend_scsi_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1546
storagebackend_LTLIBRARIES += libvirt_storage_backend_scsi.la
1547
libvirt_storage_backend_scsi_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1548
libvirt_storage_backend_scsi_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1549
endif WITH_STORAGE_SCSI
1550

D
Dave Allan 已提交
1551
if WITH_STORAGE_MPATH
1552 1553 1554
libvirt_storage_backend_mpath_la_SOURCES = \
	$(STORAGE_DRIVER_MPATH_SOURCES)
libvirt_storage_backend_mpath_la_LIBADD = $(DEVMAPPER_LIBS)
1555
libvirt_storage_backend_mpath_la_CFLAGS = \
1556 1557 1558 1559
	-I$(srcdir)/conf \
	$(DEVMAPPER_CFLAGS) \
	$(AM_CFLAGS)

1560
storagebackend_LTLIBRARIES += libvirt_storage_backend_mpath.la
1561
libvirt_storage_backend_mpath_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1562
libvirt_storage_backend_mpath_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1563
endif WITH_STORAGE_MPATH
D
Dave Allan 已提交
1564

1565
if WITH_STORAGE_DISK
1566
libvirt_storage_backend_disk_la_SOURCES = $(STORAGE_DRIVER_DISK_SOURCES)
1567
libvirt_storage_backend_disk_la_CFLAGS = \
1568 1569 1570
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1571
storagebackend_LTLIBRARIES += libvirt_storage_backend_disk.la
1572
libvirt_storage_backend_disk_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1573
libvirt_storage_backend_disk_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1574
endif WITH_STORAGE_DISK
1575

1576
if WITH_STORAGE_RBD
1577 1578 1579 1580 1581 1582 1583
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)

1584
storagebackend_LTLIBRARIES += libvirt_storage_backend_rbd.la
1585
libvirt_storage_backend_rbd_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1586
libvirt_storage_backend_rbd_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1587
endif WITH_STORAGE_RBD
1588

1589
if WITH_STORAGE_SHEEPDOG
1590 1591 1592 1593 1594 1595
libvirt_storage_backend_sheepdog_la_SOURCES = \
	$(STORAGE_DRIVER_SHEEPDOG_SOURCES)
libvirt_storage_backend_sheepdog_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1596 1597 1598 1599 1600 1601 1602 1603 1604
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
1605
libvirt_storage_backend_sheepdog_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1606
libvirt_storage_backend_sheepdog_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1607
endif WITH_STORAGE_SHEEPDOG
1608

1609
if WITH_STORAGE_GLUSTER
1610 1611 1612 1613 1614 1615 1616 1617
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)

1618
storagebackend_LTLIBRARIES += libvirt_storage_backend_gluster.la
1619
libvirt_storage_backend_gluster_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1620
libvirt_storage_backend_gluster_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1621 1622
endif WITH_STORAGE_GLUSTER

R
Roman Bogorodskiy 已提交
1623
if WITH_STORAGE_ZFS
1624
libvirt_storage_backend_zfs_la_SOURCES = $(STORAGE_DRIVER_ZFS_SOURCES)
1625
libvirt_storage_backend_zfs_la_CFLAGS = \
1626 1627 1628
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1629
storagebackend_LTLIBRARIES += libvirt_storage_backend_zfs.la
1630
libvirt_storage_backend_zfs_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1631
libvirt_storage_backend_zfs_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
R
Roman Bogorodskiy 已提交
1632 1633
endif WITH_STORAGE_ZFS

1634
if WITH_STORAGE_VSTORAGE
1635 1636
libvirt_storage_backend_vstorage_la_SOURCES = \
	$(STORAGE_DRIVER_VSTORAGE_SOURCES)
1637
libvirt_storage_backend_vstorage_la_CFLAGS = \
1638 1639 1640
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1641
storagebackend_LTLIBRARIES += libvirt_storage_backend_vstorage.la
1642
libvirt_storage_backend_vstorage_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1643
libvirt_storage_backend_vstorage_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1644 1645
endif WITH_STORAGE_VSTORAGE

1646 1647 1648 1649 1650
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)

1651
libvirt_driver_nodedev_la_CFLAGS = \
1652 1653
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1654
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1655
libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1656
libvirt_driver_nodedev_la_LIBADD =
1657

1658
if WITH_HAL
1659 1660
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS)
1661
libvirt_driver_nodedev_la_LIBADD += $(HAL_LIBS)
1662
endif WITH_HAL
1663
if WITH_UDEV
1664
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES)
1665
libvirt_driver_nodedev_la_CFLAGS += $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS)
1666
libvirt_driver_nodedev_la_LIBADD += $(UDEV_LIBS) $(PCIACCESS_LIBS)
1667
endif WITH_UDEV
1668

1669
libvirt_driver_nodedev_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1670
endif WITH_NODE_DEVICES
1671 1672


1673
if WITH_NWFILTER
1674 1675 1676
noinst_LTLIBRARIES += libvirt_driver_nwfilter_impl.la
libvirt_driver_nwfilter_la_SOURCES =
libvirt_driver_nwfilter_la_LIBADD = libvirt_driver_nwfilter_impl.la
1677
mod_LTLIBRARIES += libvirt_driver_nwfilter.la
1678
libvirt_driver_nwfilter_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1679
libvirt_driver_nwfilter_impl_la_CFLAGS = \
1680 1681 1682
		$(LIBPCAP_CFLAGS) \
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1683 1684
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1685
		$(AM_CFLAGS)
1686 1687 1688 1689 1690
libvirt_driver_nwfilter_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_nwfilter_impl_la_LIBADD = \
		$(LIBPCAP_LIBS) \
		$(LIBNL_LIBS) \
		$(DBUS_LIBS)
1691
libvirt_driver_nwfilter_impl_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1692
libvirt_driver_nwfilter_impl_la_SOURCES = $(NWFILTER_DRIVER_SOURCES)
1693
endif WITH_NWFILTER
1694 1695


1696 1697 1698 1699
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 = \
1700
		-I$(srcdir)/conf $(AM_CFLAGS)
1701
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
1702
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
1703
if WITH_SECDRIVER_SELINUX
1704 1705
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
1706
endif WITH_SECDRIVER_SELINUX
J
Jamie Strandboge 已提交
1707
if WITH_SECDRIVER_APPARMOR
1708 1709
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
1710
endif WITH_SECDRIVER_APPARMOR
1711

1712 1713
libvirt_driver_access_la_SOURCES = \
	$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
1714 1715 1716
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
1717
		-I$(srcdir)/conf $(AM_CFLAGS)
1718 1719 1720
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD =

1721 1722
EXTRA_DIST += access/genpolkit.pl

1723 1724 1725 1726
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
    $(srcdir)/access/genpolkit.pl Makefile.am
	$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@

1727 1728 1729 1730
if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)

polkitactiondir = $(datadir)/polkit-1/actions
1731
if WITH_LIBVIRTD
1732
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
1733
endif WITH_LIBVIRTD
1734 1735 1736

CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
1737
else ! WITH_POLKIT1
1738
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
1739
endif ! WITH_POLKIT1
1740

1741

1742 1743
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757

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

1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770
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 已提交
1771
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
1772 1773
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1774 1775 1776
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
1777 1778
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1779 1780
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
	  > $(srcdir)/access/viraccessapicheck.c
1781

E
Eric Blake 已提交
1782
access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
1783 1784
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1785 1786 1787
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheckqemu.h
access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
1788 1789
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1790 1791
	  qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h \
	  > $(srcdir)/access/viraccessapicheckqemu.c
1792

E
Eric Blake 已提交
1793
access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
1794 1795
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1796 1797 1798
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/access/viraccessapichecklxc.h
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
1799 1800
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1801 1802
	  lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \
	  > $(srcdir)/access/viraccessapichecklxc.c
1803

1804
# Add all conditional sources just in case...
1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834
EXTRA_DIST += \
		$(REMOTE_DRIVER_SOURCES) \
		$(XEN_DRIVER_SOURCES) \
		$(LXC_DRIVER_SOURCES) \
		$(XENAPI_DRIVER_SOURCES) \
		$(LIBXL_DRIVER_SOURCES) \
		$(VZ_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_LIBXL_SOURCES) \
1835
		$(ACCESS_DRIVER_POLKIT_POLICY)
1836

1837 1838
check-local: check-augeas

1839 1840 1841 1842
.PHONY: check-augeas \
	check-augeas-lxc \
	check-augeas-sanlock \
	check-augeas-lockd \
1843
	check-augeas-libxl \
1844
	check-augeas-libvirtd \
1845
	$(NULL)
1846

1847 1848
check-augeas: $(AUGEAS_DIRS:%=check-augeas-%) \
	check-augeas-lxc check-augeas-sanlock \
1849
	check-augeas-lockd check-augeas-virtlockd check-augeas-libxl \
1850
	check-augeas-virtlogd check-augeas-libvirtd
1851

1852
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
1853
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
1854

1855
if WITH_LXC
1856 1857
test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
		$(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1858
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
1859

1860
check-augeas-lxc: test_libvirtd_lxc.aug
1861
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1862
	    '$(AUGPARSE)' -I $(srcdir)/lxc test_libvirtd_lxc.aug; \
1863
	fi
1864
else ! WITH_LXC
1865
check-augeas-lxc:
1866
endif ! WITH_LXC
1867

1868
if WITH_SANLOCK
1869 1870
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1871
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
1872

1873
check-augeas-sanlock: test_libvirt_sanlock.aug
1874
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1875
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
1876
	fi
1877
else ! WITH_SANLOCK
1878
check-augeas-sanlock:
1879
endif ! WITH_SANLOCK
1880

1881
if WITH_QEMU
1882 1883 1884
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 $< $@
1885 1886 1887
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
1888

1889 1890
test_virtlockd.aug: locking/test_virtlockd.aug.in \
		locking/virtlockd.conf $(AUG_GENTEST)
1891
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
1892

1893
if WITH_QEMU
1894 1895 1896 1897
check-augeas-lockd: test_libvirt_lockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_lockd.aug; \
	fi
1898 1899 1900
else ! WITH_QEMU
check-augeas-lockd:
endif ! WITH_QEMU
1901

1902 1903 1904 1905 1906
check-augeas-virtlockd: test_virtlockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
	fi

1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919
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

1920

1921 1922 1923 1924 1925 1926 1927 1928 1929
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

1930 1931 1932
if WITH_LIBVIRTD
test_libvirtd.aug: remote/test_libvirtd.aug.in \
		remote/libvirtd.conf $(AUG_GENTEST)
1933
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/remote/libvirtd.conf $< $@
1934 1935 1936 1937 1938 1939 1940 1941

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
1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960
#
# 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.
#

1961
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
1962

1963
if WITH_LINUX
1964
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
1965
else ! WITH_LINUX
1966
SYM_FILES += $(srcdir)/libvirt_linux.syms
1967
endif ! WITH_LINUX
1968

E
Eric Blake 已提交
1969 1970 1971 1972 1973 1974
if WITH_REMOTE
USED_SYM_FILES += $(srcdir)/libvirt_remote.syms
else ! WITH_REMOTE
SYM_FILES += $(srcdir)/libvirt_remote.syms
endif ! WITH_REMOTE

1975
if WITH_VMX
1976
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
1977
else ! WITH_VMX
1978
SYM_FILES += $(srcdir)/libvirt_vmx.syms
1979
endif ! WITH_VMX
1980

1981
if WITH_SASL
1982
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
1983
else ! WITH_SASL
1984
SYM_FILES += $(srcdir)/libvirt_sasl.syms
1985
endif ! WITH_SASL
E
Eric Blake 已提交
1986

1987 1988
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
1989
else ! WITH_GNUTLS
1990
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
1991
endif ! WITH_GNUTLS
1992

1993
if WITH_SSH2
1994
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
1995
else ! WITH_SSH2
1996
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
1997
endif ! WITH_SSH2
1998

1999
if WITH_ATOMIC_OPS_PTHREAD
2000
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
2001
else ! WITH_ATOMIC_OPS_PTHREAD
2002
SYM_FILES += $(srcdir)/libvirt_atomic.syms
2003
endif ! WITH_ATOMIC_OPS_PTHREAD
2004

2005 2006 2007 2008 2009 2010
if WITH_LIBSSH
USED_SYM_FILES += $(srcdir)/libvirt_libssh.syms
else ! WITH_LIBSSH
SYM_FILES += $(srcdir)/libvirt_libssh.syms
endif ! WITH_LIBSSH

2011
EXTRA_DIST += \
2012 2013 2014 2015 2016 2017
	libvirt_public.syms \
	libvirt_lxc.syms \
	libvirt_qemu.syms \
	libvirt_admin_public.syms \
	$(SYM_FILES) \
	$(ADMIN_SYM_FILES) \
2018
	$(NULL)
2019

2020
BUILT_SOURCES += $(GENERATED_SYM_FILES)
2021

2022 2023
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(ACCESS_DRIVER_SYM_FILES) \
2024
		$(top_builddir)/config.status
2025 2026 2027 2028 2029 2030
	$(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 && \
2031
	cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
2032 2033
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
2034
	mv $@-tmp libvirt.syms
2035

2036
%.def: %.syms
2037 2038
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
2039
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d' \
2040
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
2041
	chmod a-w $@-tmp && \
2042
	mv $@-tmp $@
2043

2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056
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

2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071

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) \
2072
		$(XDR_CFLAGS) \
2073 2074 2075 2076 2077 2078
		-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)

2079 2080 2081 2082
# 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 已提交
2083 2084
lib_LTLIBRARIES += libvirt-admin.la
libvirt_admin_la_SOURCES = \
2085 2086
		libvirt-admin.c \
		$(ADMIN_PROTOCOL_GENERATED) \
M
Martin Kletzander 已提交
2087 2088 2089
		$(DATATYPES_SOURCES)

libvirt_admin_la_LDFLAGS = \
2090 2091
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_ADMIN_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
2092
		$(AM_LDFLAGS)
M
Martin Kletzander 已提交
2093 2094

libvirt_admin_la_LIBADD = \
2095
		libvirt.la \
M
Martin Kletzander 已提交
2096 2097 2098
		$(CYGWIN_EXTRA_LIBADD)

libvirt_admin_la_CFLAGS = \
2099 2100 2101
		$(AM_CFLAGS) \
		-I$(srcdir)/remote \
		-I$(srcdir)/rpc \
M
Martin Kletzander 已提交
2102 2103 2104
		-I$(srcdir)/admin

libvirt_admin_la_CFLAGS += \
2105 2106 2107 2108 2109 2110
		$(XDR_CFLAGS) \
		$(CAPNG_CFLAGS) \
		$(YAJL_CFLAGS) \
		$(SSH2_CFLAGS) \
		$(SASL_CFLAGS) \
		$(GNUTLS_CFLAGS) \
2111
		$(LIBSSH_CFLAGS)
M
Martin Kletzander 已提交
2112 2113

libvirt_admin_la_LIBADD += \
2114 2115 2116 2117 2118 2119 2120
		$(CAPNG_LIBS) \
		$(YAJL_LIBS) \
		$(DEVMAPPER_LIBS) \
		$(LIBXML_LIBS) \
		$(SSH2_LIBS) \
		$(SASL_LIBS) \
		$(GNUTLS_LIBS) \
2121
		$(LIBSSH_LIBS)
M
Martin Kletzander 已提交
2122

2123 2124
ADMIN_SYM_FILES = $(srcdir)/libvirt_admin_private.syms

M
Martin Kletzander 已提交
2125 2126 2127 2128
if WITH_DTRACE_PROBES
libvirt_admin_la_LIBADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

2129 2130
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
2131 2132 2133 2134
libvirt_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(LIBVIRT_NODELETE) \
2135
		$(NO_UNDEFINED_LDFLAGS) \
D
Daniel P. Berrange 已提交
2136 2137
		$(AM_LDFLAGS) \
		$(NULL)
2138
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
2139
libvirt_la_LIBADD += \
2140
		    $(DRIVER_MODULES_LIBS) \
2141
		    $(CYGWIN_EXTRA_LIBADD)
2142
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
2143 2144 2145 2146 2147 2148
# 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)
2149

2150
if WITH_DTRACE_PROBES
2151
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
2152
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
2153
nodist_libvirt_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2154
if WITH_REMOTE
E
Eric Blake 已提交
2155
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2156
endif WITH_REMOTE
2157
DTRACE2SYSTEMTAP_FLAGS = --with-modules
2158

2159 2160
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

2161 2162

tapsetdir = $(datadir)/systemtap/tapset
2163
tapset_DATA += libvirt_probes.stp libvirt_functions.stp
2164

2165
%_probes.h: %_probes.d
2166 2167
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

E
Eric Blake 已提交
2168
.PRECIOUS: %_probes.o
2169
%_probes.o: %_probes.d
2170 2171
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

2172 2173 2174 2175 2176 2177 2178 2179 2180
%_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 已提交
2181
# Keep this list synced with PROTOCOL_STRUCTS
J
Jiri Denemark 已提交
2182 2183 2184
RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
2185
		  $(srcdir)/remote/lxc_protocol.x \
2186 2187
		  $(srcdir)/remote/qemu_protocol.x \
		  $(srcdir)/lxc/lxc_monitor_protocol.x \
M
Martin Kletzander 已提交
2188 2189
		  $(srcdir)/locking/lock_protocol.x \
		  $(srcdir)/admin/admin_protocol.x
2190 2191

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

2194 2195
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl \
		$(top_builddir)/config.status
2196
	$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
2197
	  $(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
2198

2199
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
2200
              libvirt_functions.stp libvirt_probes.stp
2201
endif WITH_DTRACE_PROBES
2202

2203
EXTRA_DIST += libvirt_probes.d
2204

C
Chris Lalancette 已提交
2205
libvirt_qemu_la_SOURCES = libvirt-qemu.c
D
Daniel P. Berrange 已提交
2206 2207 2208 2209 2210
libvirt_qemu_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
2211
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
C
Chris Lalancette 已提交
2212
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
2213

2214
libvirt_lxc_la_SOURCES = libvirt-lxc.c
D
Daniel P. Berrange 已提交
2215 2216 2217 2218 2219
libvirt_lxc_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
2220 2221 2222
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)

2223 2224 2225 2226 2227 2228 2229
# 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
2230
if WITH_SETUID_RPC_CLIENT
2231 2232
noinst_LTLIBRARIES += libvirt-setuid-rpc-client.la

2233 2234
libvirt_setuid_rpc_client_la_SOURCES = \
		util/viralloc.c \
2235
		util/virarch.c \
2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300
		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 \
2301 2302
		$(NULL)

2303 2304 2305 2306
libvirt_setuid_rpc_client_la_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(LIBXML_LIBS) \
		$(SECDRIVER_LIBS) \
2307
		$(NULL)
2308 2309 2310 2311 2312 2313 2314
libvirt_setuid_rpc_client_la_CFLAGS = \
		-DLIBVIRT_SETUID_RPC_CLIENT \
		-I$(srcdir)/conf \
		-I$(srcdir)/rpc \
		$(AM_CFLAGS) \
		$(SECDRIVER_CFLAGS) \
		$(XDR_CFLAGS) \
2315
		$(NULL)
2316
endif WITH_SETUID_RPC_CLIENT
2317

2318 2319 2320
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

2321
if WITH_LIBVIRTD
2322 2323 2324 2325 2326
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
		$(LOCK_DRIVER_LOCKD_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
		$(NULL)
2327
lockd_la_CFLAGS = -I$(srcdir)/conf \
E
Eric Blake 已提交
2328 2329
		$(XDR_CFLAGS) \
		$(AM_CFLAGS)
2330
lockd_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
2331
lockd_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
J
Jiri Denemark 已提交
2332
augeas_DATA += locking/libvirt_lockd.aug
2333 2334
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
2335
endif WITH_DTRACE_PROBES
2336
if WITH_QEMU
2337 2338
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
2339
nodist_conf_DATA += locking/qemu-lockd.conf
2340 2341
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
2342
endif WITH_QEMU
2343

2344 2345 2346 2347 2348 2349
if WITH_LIBXL
nodist_conf_DATA += locking/libxl-lockd.conf
BUILT_SOURCES += locking/libxl-lockd.conf
DISTCLEANFILES += locking/libxl-lockd.conf
endif WITH_LIBXL

2350 2351 2352 2353 2354
locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
	$(AM_V_GEN)$(MKDIR_P) locking ; \
	cp $< $@


2355
sbin_PROGRAMS += virtlockd virtlogd
2356

2357 2358 2359
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
2360
		$(LOCK_DAEMON_GENERATED) \
2361
		$(NULL)
2362 2363
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
2364
		$(PIE_CFLAGS) \
2365
		$(XDR_CFLAGS) \
2366 2367 2368
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
2369
		$(PIE_LDFLAGS) \
2370
		$(NO_UNDEFINED_LDFLAGS) \
2371 2372
		$(NULL)
virtlockd_LDADD = \
2373
		libvirt_driver_admin.la \
2374 2375 2376 2377 2378 2379 2380 2381
		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
2382
endif WITH_DTRACE_PROBES
2383

2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397

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) \
2398
		$(NO_UNDEFINED_LDFLAGS) \
2399 2400
		$(NULL)
virtlogd_LDADD = \
2401
		libvirt_driver_admin.la \
2402 2403 2404 2405 2406 2407 2408 2409 2410 2411
		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

2412
else ! WITH_LIBVIRTD
2413
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
2414 2415
              $(LOCK_DRIVER_LOCKD_SOURCES) \
	      $(LOG_DAEMON_SOURCES)
2416
endif ! WITH_LIBVIRTD
2417

2418
SYSCONF_FILES = \
2419
	locking/virtlockd.sysconf \
2420
	logging/virtlogd.sysconf \
2421
	remote/libvirtd.sysconf \
2422 2423 2424
	$(NULL)

EXTRA_DIST += \
J
Jiri Denemark 已提交
2425 2426
	locking/lockd.conf \
	locking/libvirt_lockd.aug \
2427
	locking/test_libvirt_lockd.aug.in \
2428 2429
	$(SYSCONF_FILES) \
	$(NULL)
2430 2431

install-sysconfig:
E
Eric Blake 已提交
2432
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
2433 2434 2435
	for f in $(SYSCONF_FILES:%.sysconf=%) ; \
	do \
	  tgt=`basename $$f`; \
2436 2437
	  $(INSTALL_SCRIPT) $(srcdir)/$$f.sysconf \
	      $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
2438
	done
2439 2440

uninstall-sysconfig:
2441 2442 2443 2444 2445
	for f in $(SYSCONF_FILES:%.sysconf=%) ; \
	do \
	  tgt=`basename $$f`; \
	  rm -f $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
	done
E
Eric Blake 已提交
2446
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
2447

2448 2449 2450
SYSVINIT_FILES_IN = \
	locking/virtlockd.init.in \
	logging/virtlogd.init.in \
2451
	remote/libvirtd.init.in \
2452 2453 2454 2455 2456
	$(NULL)

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

EXTRA_DIST += $(SYSVINIT_FILES_IN)
2457

2458 2459 2460 2461 2462 2463 2464 2465 2466 2467
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)

2468
if WITH_LIBVIRTD
2469

2470 2471 2472
LOGROTATE_FILES := $(LOGROTATE_FILES_IN:remote/%.in=%)

BUILT_SOURCES += $(LOGROTATE_FILES)
2473
CLEANFILES += $(LOGROTATE_FILES)
2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493

%.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 || :

2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532
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

2533
if LIBVIRT_INIT_SCRIPT_RED_HAT
2534
install-init:: $(SYSVINIT_FILES) install-sysconfig
E
Eric Blake 已提交
2535
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
2536 2537 2538 2539
	for f in $(SYSVINIT_FILES:%.init=%) ; \
	do \
	  $(INSTALL_SCRIPT) $$f.init $(DESTDIR)$(sysconfdir)/rc.d/init.d/$$f; \
	done
2540 2541

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

2545 2546
BUILT_SOURCES += $(SYSVINIT_FILES)
DISTCLEANFILES += $(SYSVINIT_FILES)
2547
else ! LIBVIRT_INIT_SCRIPT_RED_HAT
2548 2549
install-init::
uninstall-init::
2550 2551
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
else ! WITH_LIBVIRTD
2552 2553 2554 2555
install-polkit::
uninstall-polkit::
install-sysctl::
uninstall-sysctl::
2556 2557
install-init::
uninstall-init::
2558 2559
install-logrotate::
uninstall-logrotate::
2560
endif ! WITH_LIBVIRTD
2561

2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578
# 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


2579 2580 2581 2582 2583 2584 2585 2586 2587
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 $@

2588
virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
2589 2590 2591 2592 2593 2594
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    < $< > $@-t && \
	    chmod a+x $@-t && \
2595 2596
	    mv $@-t $@

2597
virtlogd.init: logging/virtlogd.init.in $(top_builddir)/config.status
2598 2599 2600 2601 2602 2603
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    < $< > $@-t && \
	    chmod a+x $@-t && \
2604 2605
	    mv $@-t $@

2606
virtlockd.8.in: locking/virtlockd.pod
2607 2608 2609 2610 2611 2612 2613 2614
	$(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 $@
2615

2616
virtlogd.8.in: logging/virtlogd.pod
2617 2618 2619 2620 2621 2622 2623 2624
	$(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 $@
2625

2626 2627 2628 2629 2630 2631 2632 2633 2634 2635
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 $@

2636
%.8: %.8.in $(top_srcdir)/configure.ac
2637
	$(AM_V_GEN)sed \
2638 2639 2640
		-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
		-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
		< $< > $@-t && \
2641 2642
	mv $@-t $@

2643
if WITH_LIBVIRTD
2644
man8_MANS = virtlockd.8 virtlogd.8 libvirtd.8
2645

2646
conf_DATA += locking/virtlockd.conf logging/virtlogd.conf
2647

2648 2649
augeas_DATA += locking/virtlockd.aug logging/virtlogd.aug
augeastest_DATA += test_virtlockd.aug test_virtlogd.aug
2650
endif WITH_LIBVIRTD
2651

A
Andrea Bolognani 已提交
2652 2653 2654
PODFILES = \
	locking/virtlockd.pod \
	logging/virtlogd.pod \
2655
	remote/libvirtd.pod \
A
Andrea Bolognani 已提交
2656 2657 2658 2659 2660
	$(NULL)

MANINFILES = \
	virtlockd.8.in \
	virtlogd.8.in \
2661
	libvirtd.8.in \
A
Andrea Bolognani 已提交
2662 2663 2664 2665
	$(NULL)

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

2667 2668 2669 2670 2671 2672 2673
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 \
2674 2675
	remote/libvirtd.service.in \
	remote/virt-guest-shutdown.target.in \
2676 2677
	$(NULL)

2678
EXTRA_DIST += \
2679
        $(SYSTEMD_UNIT_FILES_IN) \
2680 2681 2682
        locking/virtlockd.aug \
        locking/virtlockd.conf \
        locking/test_virtlockd.aug.in \
2683 2684 2685
        logging/virtlogd.aug \
        logging/virtlogd.conf \
        logging/test_virtlogd.aug.in \
A
Andrea Bolognani 已提交
2686 2687
        $(PODFILES) \
        $(MANINFILES) \
2688
        $(NULL)
2689

2690 2691 2692 2693

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

2694
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
2695
SYSTEMD_UNIT_FILES = $(notdir $(SYSTEMD_UNIT_FILES_IN:%.in=%))
2696

2697 2698
BUILT_SOURCES += $(SYSTEMD_UNIT_FILES)
DISTCLEANFILES += $(SYSTEMD_UNIT_FILES)
2699

2700
install-systemd: $(SYSTEMD_UNIT_FILES) install-sysconfig
E
Eric Blake 已提交
2701
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
2702 2703 2704 2705
	for f in $(SYSTEMD_UNIT_FILES); \
	do \
	  $(INSTALL_DATA) $$f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/ ; \
	done
2706 2707

uninstall-systemd: uninstall-sysconfig
2708
	rm -f $(SYSTEMD_UNIT_FILES:%=$(DESTDIR)$(SYSTEMD_UNIT_DIR)/%)
E
Eric Blake 已提交
2709
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
2710
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
2711 2712
install-systemd:
uninstall-systemd:
2713 2714
endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
else ! WITH_LIBVIRTD
2715 2716
install-systemd:
uninstall-systemd:
2717
endif ! WITH_LIBVIRTD
2718

2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730
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 $< $@

2731
virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
2732 2733 2734
	$(AM_V_GEN)sed \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    < $< > $@-t && \
2735 2736 2737
	    mv $@-t $@

virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
2738 2739 2740
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
2741 2742
	    mv $@-t $@

J
John Ferlan 已提交
2743 2744 2745 2746 2747 2748 2749
virtlockd-admin.socket: locking/virtlockd-admin.socket.in \
                        $(top_builddir)/config.status
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
	    mv $@-t $@

2750
virtlogd.service: logging/virtlogd.service.in $(top_builddir)/config.status
2751 2752 2753
	$(AM_V_GEN)sed \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    < $< > $@-t && \
2754 2755 2756
	    mv $@-t $@

virtlogd.socket: logging/virtlogd.socket.in $(top_builddir)/config.status
J
John Ferlan 已提交
2757 2758 2759 2760 2761 2762 2763
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
	    mv $@-t $@

virtlogd-admin.socket: logging/virtlogd-admin.socket.in \
                       $(top_builddir)/config.status
2764 2765 2766
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
2767 2768
	    mv $@-t $@

2769

2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783
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` ; \
2784 2785
	  $(INSTALL_SCRIPT) $(srcdir)/$$f.upstart \
	      $(DESTDIR)$(sysconfdir)/event.d/$$tgt ; \
2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803
	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

2804
if WITH_SANLOCK
2805
lockdriver_LTLIBRARIES += sanlock.la
2806
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
2807
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
2808
sanlock_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
2809
sanlock_la_LIBADD = -lsanlock_client libvirt.la ../gnulib/lib/libgnu.la
2810 2811

augeas_DATA += locking/libvirt_sanlock.aug
2812 2813
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
2814

E
Eric Blake 已提交
2815
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
2816
	$(AM_V_GEN)$(MKDIR_P) locking ; \
2817 2818 2819
	cp $< $@

if WITH_QEMU
2820
nodist_conf_DATA += locking/qemu-sanlock.conf
2821
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
2822
DISTCLEANFILES += locking/qemu-sanlock.conf
2823
endif WITH_QEMU
2824 2825 2826 2827 2828 2829

if WITH_LIBXL
nodist_conf_DATA += locking/libxl-sanlock.conf
BUILT_SOURCES += locking/libxl-sanlock.conf
DISTCLEANFILES += locking/libxl-sanlock.conf
endif WITH_LIBXL
2830
else ! WITH_SANLOCK
2831
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
2832
endif ! WITH_SANLOCK
2833 2834
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
2835
	locking/test_libvirt_sanlock.aug.in
2836

2837 2838 2839 2840
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
2841

2842 2843 2844 2845 2846
libvirt_la_BUILT_LIBADD += \
       libvirt-net-rpc.la \
       libvirt-net-rpc-server.la \
       libvirt-net-rpc-client.la

2847
EXTRA_DIST += \
E
Eric Blake 已提交
2848 2849 2850 2851
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
2852 2853
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
2854

E
Eric Blake 已提交
2855
VIR_NET_RPC_GENERATED = \
2856 2857 2858 2859
	rpc/virnetprotocol.h \
	rpc/virnetprotocol.c \
	rpc/virkeepaliveprotocol.h \
	rpc/virkeepaliveprotocol.c
2860

2861
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2862

2863
libvirt_net_rpc_la_SOURCES = \
2864
	rpc/virnetmessage.h rpc/virnetmessage.c \
2865
	rpc/virnetsocket.h rpc/virnetsocket.c \
2866 2867
	rpc/virkeepalive.h rpc/virkeepalive.c \
	$(VIR_NET_RPC_GENERATED)
2868
if WITH_SSH2
2869 2870
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2871
else ! WITH_SSH2
2872 2873
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2874
endif ! WITH_SSH2
2875
if WITH_GNUTLS
2876 2877
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2878
else ! WITH_GNUTLS
2879 2880
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2881
endif ! WITH_GNUTLS
2882
if WITH_SASL
2883 2884
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2885
else ! WITH_SASL
2886 2887
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2888
endif ! WITH_SASL
2889 2890 2891 2892 2893 2894 2895
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
2896
libvirt_net_rpc_la_CFLAGS = \
2897
			$(GNUTLS_CFLAGS) \
2898
			$(SASL_CFLAGS) \
2899
			$(SSH2_CFLAGS) \
2900
			$(LIBSSH_CFLAGS) \
2901
			$(XDR_CFLAGS) \
2902 2903
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
2904
			$(GNUTLS_LIBS) \
2905
			$(SASL_LIBS) \
2906
			$(SSH2_LIBS)\
2907
			$(LIBSSH_LIBS) \
J
Jim Fehlig 已提交
2908
			$(SECDRIVER_LIBS) \
2909
			$(AM_LDFLAGS) \
2910
			$(NULL)
2911 2912 2913
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2914 2915 2916 2917
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
2918
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
2919
	rpc/virnetdaemon.h rpc/virnetdaemon.c \
2920 2921
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
2922
			$(AVAHI_CFLAGS) \
2923
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
2924
			$(XDR_CFLAGS) \
2925
			$(AM_CFLAGS)
2926 2927
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
2928
			$(AVAHI_LIBS) \
2929
			$(DBUS_LIBS) \
2930
			$(NULL)
2931 2932 2933
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2934 2935 2936 2937 2938
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 已提交
2939 2940
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
2941
libvirt_net_rpc_client_la_LDFLAGS = $(AM_LDFLAGS)
2942 2943
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
2944

2945 2946
libexec_PROGRAMS =

2947
if WITH_LIBVIRTD
2948 2949
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2950 2951 2952 2953
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2954 2955
libvirt_iohelper_LDADD = \
		libvirt_util.la \
2956
		../gnulib/lib/libgnu.la
2957 2958
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
2959
endif WITH_DTRACE_PROBES
2960

D
Daniel P. Berrange 已提交
2961 2962 2963 2964
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2965 2966 2967 2968

if WITH_NETWORK
libexec_PROGRAMS += libvirt_leaseshelper
libvirt_leaseshelper_SOURCES = $(NETWORK_LEASES_HELPER_SOURCES)
2969 2970 2971 2972
libvirt_leaseshelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2973 2974
libvirt_leaseshelper_LDADD = \
               libvirt_util.la \
2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987
               ../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

2988
endif WITH_LIBVIRTD
2989

2990
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
2991
if WITH_LIBVIRTD
2992
libexec_PROGRAMS += libvirt_parthelper
2993

2994
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
D
Daniel P. Berrange 已提交
2995 2996 2997 2998
libvirt_parthelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2999 3000 3001
libvirt_parthelper_LDADD = \
		$(LIBPARTED_LIBS) \
		libvirt_util.la \
3002
		../gnulib/lib/libgnu.la
3003 3004
if WITH_DTRACE_PROBES
libvirt_parthelper_LDADD += libvirt_probes.lo
3005
endif WITH_DTRACE_PROBES
3006

D
Daniel P. Berrange 已提交
3007 3008 3009 3010 3011
libvirt_parthelper_CFLAGS = \
		$(LIBPARTED_CFLAGS) \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
3012 3013
endif WITH_LIBVIRTD
endif WITH_STORAGE_DISK
3014 3015
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)

3016

3017
if WITH_SANLOCK
3018 3019 3020
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
3021
libvirt_sanlock_helper_CFLAGS = \
3022
		-I$(srcdir)/conf \
D
Daniel P. Berrange 已提交
3023 3024 3025 3026 3027 3028 3029
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3030
libvirt_sanlock_helper_LDADD = libvirt.la
3031
endif WITH_SANLOCK
3032

3033 3034 3035 3036
if WITH_LXC
if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_lxc

3037 3038
libvirt_lxc_SOURCES = \
		$(LXC_CONTROLLER_SOURCES) \
O
Osier Yang 已提交
3039
		$(DATATYPES_SOURCES)
D
Daniel P. Berrange 已提交
3040 3041 3042
libvirt_lxc_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
3043 3044
		$(CAPNG_LIBS) \
		$(LIBXML_LIBS) \
D
Daniel P. Berrange 已提交
3045
		$(NULL)
3046
libvirt_lxc_LDADD = \
G
Gao feng 已提交
3047
		$(FUSE_LIBS) \
3048
		libvirt.la \
3049
		../gnulib/lib/libgnu.la
3050
if WITH_DTRACE_PROBES
3051
libvirt_lxc_LDADD += libvirt_probes.lo
3052
endif WITH_DTRACE_PROBES
3053
libvirt_lxc_LDADD += $(SECDRIVER_LIBS)
3054 3055 3056 3057
libvirt_lxc_CFLAGS = \
		-I$(srcdir)/conf \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
3058 3059
		$(CAPNG_CFLAGS) \
		$(LIBXML_CFLAGS) \
3060 3061 3062 3063
		$(LIBNL_CFLAGS) \
		$(FUSE_CFLAGS) \
		$(DBUS_CFLAGS) \
		$(XDR_CFLAGS) \
D
Daniel P. Berrange 已提交
3064
		$(NULL)
3065
if WITH_BLKID
3066 3067
libvirt_lxc_CFLAGS += $(BLKID_CFLAGS)
libvirt_lxc_LDADD += $(BLKID_LIBS)
3068
endif WITH_BLKID
J
Jim Fehlig 已提交
3069
libvirt_lxc_CFLAGS += $(SECDRIVER_CFLAGS)
3070 3071
endif WITH_LIBVIRTD
endif WITH_LXC
3072 3073
EXTRA_DIST += $(LXC_CONTROLLER_SOURCES)

J
Jamie Strandboge 已提交
3074 3075 3076 3077 3078 3079
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 已提交
3080 3081 3082 3083
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3084 3085 3086 3087 3088
virt_aa_helper_LDADD = \
		libvirt.la \
		libvirt_conf.la \
		libvirt_util.la \
		libvirt_driver_storage_impl.la \
C
Chris Lalancette 已提交
3089
		../gnulib/lib/libgnu.la
3090
if WITH_DTRACE_PROBES
3091
virt_aa_helper_LDADD += libvirt_probes.lo
3092
endif WITH_DTRACE_PROBES
3093 3094 3095 3096 3097
virt_aa_helper_CFLAGS = \
		-I$(srcdir)/conf \
		-I$(srcdir)/security \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
D
Daniel P. Berrange 已提交
3098
		$(NULL)
3099 3100
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
J
Jamie Strandboge 已提交
3101 3102
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

3103
if WITH_NSS
3104 3105
noinst_LTLIBRARIES += libvirt-nss.la

3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154
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 \
3155 3156
		$(NULL)

3157 3158 3159 3160
libvirt_nss_la_CFLAGS = \
		-DLIBVIRT_NSS \
		$(AM_CFLAGS) \
		$(YAJL_CFLAGS) \
3161
		$(NULL)
3162 3163
libvirt_nss_la_LDFLAGS = \
		$(AM_LDFLAGS) \
3164 3165
		$(NULL)

3166 3167
libvirt_nss_la_LIBADD = \
		$(YAJL_LIBS) \
3168
		$(NULL)
3169
endif WITH_NSS
3170 3171


3172
install-data-local: install-init install-systemd install-upstart \
3173
		install-sysctl install-polkit install-sasl \
3174
		install-logrotate install-data-extra
3175
if WITH_LIBVIRTD
3176
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt"
3177
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
3178
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
3179
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
3180
endif WITH_LIBVIRTD
3181 3182
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
3183
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
3184
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
3185
if WITH_SANLOCK
3186
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
3187
endif WITH_SANLOCK
3188 3189 3190
if WITH_LXC
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lxc"
3191
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/lxc"
3192
endif WITH_LXC
J
Jim Fehlig 已提交
3193 3194 3195
if WITH_LIBXL
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/libxl"
J
Jim Fehlig 已提交
3196
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl"
3197
endif WITH_LIBXL
3198 3199
if WITH_XEN
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/xen"
3200
endif WITH_XEN
3201 3202
if WITH_NETWORK
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network"
3203
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq"
3204
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/network"
3205
	$(MKDIR_P) "$(DESTDIR)$(confdir)/qemu/networks/autostart"
3206
	$(INSTALL_DATA) $(srcdir)/network/default.xml \
3207
	  $(DESTDIR)$(confdir)/qemu/networks/default.xml
3208
	test -z "$(UUID)" || \
3209 3210 3211
	  { sed -e "s,</name>,</name>;  <uuid>$(UUID)</uuid>," \
	      $(DESTDIR)$(confdir)/qemu/networks/default.xml | \
	      tr ";" "\n" > \
3212 3213 3214 3215
	      $(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 已提交
3216
	( cd $(DESTDIR)$(confdir)/qemu/networks/autostart && \
3217 3218
	  rm -f default.xml && \
	  $(LN_S) ../default.xml default.xml )
3219
endif WITH_NETWORK
3220

3221
uninstall-local:: uninstall-init uninstall-systemd uninstall-upstart \
3222
		uninstall-sysctl uninstall-polkit uninstall-sasl \
3223
		uninstall-logrotate uninstall-data-extra
3224
if WITH_LIBVIRTD
3225
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt" ||:
3226
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
3227 3228
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
3229
endif WITH_LIBVIRTD
3230 3231
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
3232
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
3233
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
3234
if WITH_SANLOCK
3235
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
3236
endif WITH_SANLOCK
3237 3238 3239
if WITH_LXC
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||:
3240
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/lxc" ||:
3241
endif WITH_LXC
J
Jim Fehlig 已提交
3242 3243 3244
if WITH_LIBXL
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||:
J
Jim Fehlig 已提交
3245
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||:
3246
endif WITH_LIBXL
3247 3248
if WITH_XEN
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/xen" ||:
3249
endif WITH_XEN
3250
if WITH_NETWORK
3251 3252 3253 3254
	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" || :
3255 3256
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||:
3257
endif WITH_NETWORK
3258
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
3259

3260 3261
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
3262 3263 3264 3265 3266
MAINTAINERCLEANFILES += \
	$(REMOTE_DRIVER_GENERATED) \
	$(LIBVIRTD_GENERATED) \
	$(VIR_NET_RPC_GENERATED) \
	$(NULL)