Makefile.am 97.6 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 94 95 96

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

97

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

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

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

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

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

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

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

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

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

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

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

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

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

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

man7_MANS = $(KEYMANS)

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

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

340 341 342
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

343 344
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
345

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

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

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

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

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

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

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


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

391 392
DRIVER_SOURCES += $(LOG_PROTOCOL_GENERATED)

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

EXTRA_DIST += check-drivername.pl

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

795
STATEFUL_DRIVER_SOURCE_FILES += \
796 797 798 799 800 801 802 803 804
	$(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) \
805
	$(VZ_DRIVER_SOURCES) \
806 807
	$(NULL)

808 809 810

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

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

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

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

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

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

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

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

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

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

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

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

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

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

BUILT_SOURCES += $(LXC_GENERATED)

885 886
CLEANFILES += $(LXC_GENERATED)

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

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

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

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

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

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

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

943 944 945
INTERFACE_DRIVER_SOURCES =

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1011
STORAGE_HELPER_DISK_SOURCES = \
1012
		storage/parthelper.c
1013

1014
UTIL_IO_HELPER_SOURCES = \
1015 1016
		util/iohelper.c

1017
NETWORK_LEASES_HELPER_SOURCES = \
1018 1019
               network/leaseshelper.c

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

1033

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

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

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

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

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

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

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

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

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


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

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

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

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

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

1105 1106 1107 1108
XENCONFIG_SOURCES = \
		xenconfig/xenxs_private.h \
		xenconfig/xen_common.c xenconfig/xen_common.h \
		xenconfig/xen_sxpr.c xenconfig/xen_sxpr.h \
1109
		xenconfig/xen_xm.c xenconfig/xen_xm.h
1110
if WITH_LIBXL
1111 1112
XENCONFIG_LIBXL_SOURCES = \
		$(XENCONFIG_SOURCES) \
1113 1114
		xenconfig/xen_xl.c xenconfig/xen_xl.h
endif WITH_LIBXL
1115

J
Jiri Denemark 已提交
1116 1117
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
1118
EXTRA_DIST +=	$(pkgdata_DATA)
1119

1120 1121 1122 1123 1124 1125
#########################
#
# Build up list of libvirt.la source files based on configure conditions
#
# First deal with sources usable in non-daemon context

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

1141 1142

noinst_LTLIBRARIES += libvirt_conf.la
1143
libvirt_la_BUILT_LIBADD += libvirt_conf.la
1144
libvirt_conf_la_SOURCES = $(CONF_SOURCES)
1145 1146
libvirt_conf_la_CFLAGS = \
		-I$(srcdir)/conf $(AM_CFLAGS)
1147
libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS)
1148
libvirt_conf_la_LIBADD = $(LIBXML_LIBS)
1149

J
Jiri Denemark 已提交
1150
noinst_LTLIBRARIES += libvirt_cpu.la
1151
libvirt_la_BUILT_LIBADD += libvirt_cpu.la
J
Jiri Denemark 已提交
1152
libvirt_cpu_la_CFLAGS = \
1153
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jiri Denemark 已提交
1154 1155
libvirt_cpu_la_SOURCES = $(CPU_SOURCES)

1156 1157 1158 1159 1160 1161
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)

1162 1163 1164 1165
if WITH_VMX
noinst_LTLIBRARIES += libvirt_vmx.la
libvirt_la_BUILT_LIBADD += libvirt_vmx.la
libvirt_vmx_la_CFLAGS = \
1166
		-I$(srcdir)/conf $(AM_CFLAGS)
1167
libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
1168
endif WITH_VMX
1169

J
Jim Fehlig 已提交
1170 1171 1172 1173
if WITH_XENCONFIG
noinst_LTLIBRARIES += libvirt_xenconfig.la
libvirt_la_BUILT_LIBADD += libvirt_xenconfig.la
libvirt_xenconfig_la_CFLAGS = \
1174
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jim Fehlig 已提交
1175
libvirt_xenconfig_la_SOURCES = $(XENCONFIG_SOURCES)
1176 1177 1178 1179 1180 1181 1182 1183

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

1186

1187
noinst_LTLIBRARIES += libvirt_driver.la
1188
libvirt_la_BUILT_LIBADD += libvirt_driver.la
1189
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
1190

1191
libvirt_driver_la_CFLAGS = \
1192
		$(GNUTLS_CFLAGS) $(CURL_CFLAGS) $(XDR_CFLAGS) \
1193
		-I$(srcdir)/conf $(AM_CFLAGS)
1194
libvirt_driver_la_LIBADD = \
1195
		$(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS)
1196

1197 1198
# 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.
1199 1200 1201
SYM_FILES += $(USED_SYM_FILES)
USED_SYM_FILES += $(srcdir)/libvirt_private.syms
GENERATED_SYM_FILES += \
1202 1203
	$(ACCESS_DRIVER_SYM_FILES) \
	libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \
1204
	libvirt_admin.syms libvirt_admin.def \
1205
	$(NULL)
1206

1207
if WITH_REMOTE
1208
noinst_LTLIBRARIES += libvirt_driver_remote.la
1209
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
1210 1211 1212 1213
libvirt_driver_remote_la_CFLAGS = \
		$(XDR_CFLAGS) \
		-I$(srcdir)/conf \
		-I$(srcdir)/rpc \
1214 1215
		$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
1216
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
1217

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

1220 1221
endif WITH_REMOTE

1222 1223 1224 1225 1226 1227 1228

if WITH_LIBVIRTD

sbin_PROGRAMS += libvirtd

BUILT_SOURCES += $(LIBVIRTD_GENERATED)

1229 1230 1231 1232 1233 1234
augeas_DATA += remote/libvirtd.aug

augeastest_DATA += test_libvirtd.aug

conf_DATA += remote/libvirtd.conf

1235
CLEANFILES += test_libvirtd.aug
1236

1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247
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
1248
CLEANFILES += libvirtd.policy
1249 1250 1251 1252 1253 1254 1255

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

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 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296
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
1297 1298 1299 1300
EXTRA_DIST += \
	remote/test_libvirtd.aug.in \
	remote/libvirtd.aug \
	remote/libvirtd.conf \
1301 1302 1303 1304
	remote/libvirtd.policy.in \
	remote/libvirtd.rules \
	remote/libvirtd.sasl \
	remote/libvirtd.sysctl \
1305
	$(NULL)
1306

1307
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
1308
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
1309
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1310

1311
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
1312
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
1313
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1314

1315
if WITH_XEN
E
Eric Blake 已提交
1316 1317 1318
noinst_LTLIBRARIES += libvirt_driver_xen_impl.la
libvirt_driver_xen_la_SOURCES =
libvirt_driver_xen_la_LIBADD = libvirt_driver_xen_impl.la
1319
mod_LTLIBRARIES += libvirt_driver_xen.la
1320
libvirt_driver_xen_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1321
libvirt_driver_xen_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1322

1323 1324 1325 1326 1327
libvirt_driver_xen_impl_la_CFLAGS = \
		$(XEN_CFLAGS) \
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
		-I$(srcdir)/xenconfig \
1328
		$(AM_CFLAGS)
E
Eric Blake 已提交
1329
libvirt_driver_xen_impl_la_LDFLAGS = $(AM_LDFLAGS)
P
Pavel Hrdina 已提交
1330
libvirt_driver_xen_impl_la_LIBADD = $(XEN_LIBS) libvirt_xenconfig.la
E
Eric Blake 已提交
1331
libvirt_driver_xen_impl_la_SOURCES = $(XEN_DRIVER_SOURCES)
1332
endif WITH_XEN
1333

1334 1335
if WITH_XENAPI
noinst_LTLIBRARIES += libvirt_driver_xenapi.la
1336
libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la
1337
libvirt_driver_xenapi_la_CFLAGS = $(XENAPI_CFLAGS) $(CURL_CFLAGS) \
P
Pavel Hrdina 已提交
1338
		-I$(srcdir)/conf -I$(srcdir)/xenconfig $(AM_CFLAGS)
1339
libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS)
1340
libvirt_driver_xenapi_la_LIBADD = $(XENAPI_LIBS) $(CURL_LIBS)
1341
libvirt_driver_xenapi_la_SOURCES = $(XENAPI_DRIVER_SOURCES)
1342
endif WITH_XENAPI
1343

J
Jim Fehlig 已提交
1344
if WITH_LIBXL
E
Eric Blake 已提交
1345 1346 1347
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 已提交
1348
mod_LTLIBRARIES += libvirt_driver_libxl.la
1349
libvirt_driver_libxl_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1350
libvirt_driver_libxl_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1351

1352 1353
libvirt_driver_libxl_impl_la_CFLAGS = \
		$(LIBXL_CFLAGS) \
1354
		$(LIBXML_CFLAGS) \
1355 1356 1357 1358
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
		-I$(srcdir)/secret \
		-I$(srcdir)/xenconfig \
1359
		$(AM_CFLAGS)
E
Eric Blake 已提交
1360
libvirt_driver_libxl_impl_la_LDFLAGS = $(AM_LDFLAGS)
1361
libvirt_driver_libxl_impl_la_LIBADD = $(LIBXL_LIBS) \
1362
				      $(LIBXML_LIBS) \
1363
				      libvirt_xenconfig_libxl.la
E
Eric Blake 已提交
1364
libvirt_driver_libxl_impl_la_SOURCES = $(LIBXL_DRIVER_SOURCES)
1365 1366 1367 1368 1369 1370

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

1371
endif WITH_LIBXL
1372 1373
EXTRA_DIST += libxl/libxl.conf libxl/libvirtd_libxl.aug \
		libxl/test_libvirtd_libxl.aug.in
J
Jim Fehlig 已提交
1374

1375

1376 1377

if WITH_LXC
E
Eric Blake 已提交
1378 1379 1380
noinst_LTLIBRARIES += libvirt_driver_lxc_impl.la
libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = libvirt_driver_lxc_impl.la
1381
mod_LTLIBRARIES += libvirt_driver_lxc.la
1382
libvirt_driver_lxc_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1383
libvirt_driver_lxc_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1384 1385

libvirt_driver_lxc_impl_la_CFLAGS = \
S
Serge Hallyn 已提交
1386
		$(LIBNL_CFLAGS) \
G
Gao feng 已提交
1387
		$(FUSE_CFLAGS) \
P
Pavel Fedin 已提交
1388
		$(XDR_CFLAGS) \
1389 1390
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1391
		$(AM_CFLAGS)
I
ik.nitk 已提交
1392 1393 1394 1395 1396 1397
libvirt_driver_lxc_impl_la_LIBADD = \
               $(CAPNG_LIBS) \
               $(LIBNL_LIBS) \
               $(LIBXML_LIBS) \
               $(FUSE_LIBS)

1398
if WITH_BLKID
E
Eric Blake 已提交
1399 1400
libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS)
1401
endif WITH_BLKID
1402
libvirt_driver_lxc_impl_la_LIBADD += $(SECDRIVER_LIBS)
E
Eric Blake 已提交
1403
libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES)
A
Amy Griffis 已提交
1404 1405 1406

conf_DATA += lxc/lxc.conf

1407
augeas_DATA += lxc/libvirtd_lxc.aug
1408 1409
augeastest_DATA += test_libvirtd_lxc.aug
CLEANFILES += test_libvirtd_lxc.aug
1410

1411
endif WITH_LXC
1412
EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in
1413

1414

D
Daniel Veillard 已提交
1415

M
Matthias Bolte 已提交
1416 1417


1418
if WITH_VZ
1419 1420 1421 1422
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
1423
libvirt_driver_vz_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1424
libvirt_driver_vz_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1425
libvirt_driver_vz_impl_la_CFLAGS = \
1426 1427 1428
		-I$(srcdir)/conf \
		-I$(srcdir)/access \
		$(AM_CFLAGS) \
1429
		$(PARALLELS_SDK_CFLAGS) $(LIBNL_CFLAGS)
1430 1431
libvirt_driver_vz_impl_la_SOURCES = $(VZ_DRIVER_SOURCES)
libvirt_driver_vz_impl_la_LIBADD =  $(PARALLELS_SDK_LIBS) $(LIBNL_LIBS)
1432
endif WITH_VZ
D
Dmitry Guryanov 已提交
1433

R
Roman Bogorodskiy 已提交
1434

1435
if WITH_NETWORK
E
Eric Blake 已提交
1436 1437 1438
noinst_LTLIBRARIES += libvirt_driver_network_impl.la
libvirt_driver_network_la_SOURCES =
libvirt_driver_network_la_LIBADD = libvirt_driver_network_impl.la
1439
mod_LTLIBRARIES += libvirt_driver_network.la
1440
libvirt_driver_network_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la \
1441 1442 1443
	$(LIBNL_LIBS) \
	$(DBUS_LIBS) \
	$(NULL)
1444
libvirt_driver_network_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1445 1446

libvirt_driver_network_impl_la_CFLAGS = \
1447 1448
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1449 1450
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1451
		$(AM_CFLAGS)
E
Eric Blake 已提交
1452
libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
1453
libvirt_driver_network_impl_la_LIBADD  = $(DBUS_LIBS)
1454
endif WITH_NETWORK
1455 1456 1457
EXTRA_DIST += network/default.xml


1458
if WITH_INTERFACE
1459
mod_LTLIBRARIES += libvirt_driver_interface.la
1460
libvirt_driver_interface_la_CFLAGS = \
1461 1462
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1463
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1464
libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1465 1466 1467 1468
libvirt_driver_interface_la_LIBADD =
if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
1469
endif WITH_NETCF
1470
if WITH_UDEV
1471 1472
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
1473
endif WITH_UDEV
1474
libvirt_driver_interface_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1475
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
1476
endif WITH_INTERFACE
D
Daniel Veillard 已提交
1477

D
Daniel P. Berrange 已提交
1478
if WITH_SECRETS
1479
mod_LTLIBRARIES += libvirt_driver_secret.la
1480
libvirt_driver_secret_la_CFLAGS = \
1481 1482
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1483
		$(AM_CFLAGS)
1484
libvirt_driver_secret_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1485
libvirt_driver_secret_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1486
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
1487
endif WITH_SECRETS
1488

1489
# Needed to keep automake quiet about conditionals
1490 1491
libvirt_driver_storage_impl_la_SOURCES =
libvirt_driver_storage_impl_la_CFLAGS = \
1492 1493
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1494
		-I$(srcdir)/secret \
1495
		$(AM_CFLAGS)
1496 1497
libvirt_driver_storage_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_storage_impl_la_LIBADD =
1498
libvirt_driver_storage_impl_la_LIBADD += $(SECDRIVER_LIBS) $(LIBXML_LIBS)
1499
if WITH_BLKID
1500 1501
libvirt_driver_storage_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(BLKID_LIBS)
1502
endif WITH_BLKID
1503 1504 1505 1506

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

1507
if WITH_STORAGE
1508 1509 1510
noinst_LTLIBRARIES += libvirt_driver_storage_impl.la
libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_LIBADD = libvirt_driver_storage_impl.la
1511
mod_LTLIBRARIES += libvirt_driver_storage.la
1512
libvirt_driver_storage_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1513
libvirt_driver_storage_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1514
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
1515 1516 1517


libvirt_storage_backend_fs_la_SOURCES = $(STORAGE_DRIVER_FS_SOURCES)
1518
libvirt_storage_backend_fs_la_CFLAGS = \
1519 1520 1521
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1522
storagebackend_LTLIBRARIES += libvirt_storage_backend_fs.la
1523
libvirt_storage_backend_fs_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1524
libvirt_storage_backend_fs_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1525
endif WITH_STORAGE
1526

1527
if WITH_STORAGE_LVM
1528 1529 1530 1531 1532 1533
libvirt_storage_backend_logical_la_SOURCES = \
	$(STORAGE_DRIVER_LVM_SOURCES)
libvirt_storage_backend_logical_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1534
storagebackend_LTLIBRARIES += libvirt_storage_backend_logical.la
1535
libvirt_storage_backend_logical_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1536
libvirt_storage_backend_logical_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1537
endif WITH_STORAGE_LVM
1538

1539
if WITH_STORAGE_ISCSI
1540 1541 1542 1543 1544 1545 1546
libvirt_storage_backend_iscsi_la_SOURCES = \
	$(STORAGE_DRIVER_ISCSI_SOURCES)
libvirt_storage_backend_iscsi_la_CFLAGS = \
	-I$(srcdir)/conf \
	-I$(srcdir)/secret \
	$(AM_CFLAGS)

1547
storagebackend_LTLIBRARIES += libvirt_storage_backend_iscsi.la
1548
libvirt_storage_backend_iscsi_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1549
libvirt_storage_backend_iscsi_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1550
endif WITH_STORAGE_ISCSI
1551

1552
if WITH_STORAGE_SCSI
1553 1554 1555 1556 1557
libvirt_storage_backend_scsi_la_SOURCES = $(STORAGE_DRIVER_SCSI_SOURCES)
libvirt_storage_backend_scsi_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1558
storagebackend_LTLIBRARIES += libvirt_storage_backend_scsi.la
1559
libvirt_storage_backend_scsi_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1560
libvirt_storage_backend_scsi_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1561
endif WITH_STORAGE_SCSI
1562

D
Dave Allan 已提交
1563
if WITH_STORAGE_MPATH
1564 1565 1566
libvirt_storage_backend_mpath_la_SOURCES = \
	$(STORAGE_DRIVER_MPATH_SOURCES)
libvirt_storage_backend_mpath_la_LIBADD = $(DEVMAPPER_LIBS)
1567
libvirt_storage_backend_mpath_la_CFLAGS = \
1568 1569 1570 1571
	-I$(srcdir)/conf \
	$(DEVMAPPER_CFLAGS) \
	$(AM_CFLAGS)

1572
storagebackend_LTLIBRARIES += libvirt_storage_backend_mpath.la
1573
libvirt_storage_backend_mpath_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1574
libvirt_storage_backend_mpath_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1575
endif WITH_STORAGE_MPATH
D
Dave Allan 已提交
1576

1577
if WITH_STORAGE_DISK
1578
libvirt_storage_backend_disk_la_SOURCES = $(STORAGE_DRIVER_DISK_SOURCES)
1579
libvirt_storage_backend_disk_la_CFLAGS = \
1580 1581 1582
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1583
storagebackend_LTLIBRARIES += libvirt_storage_backend_disk.la
1584
libvirt_storage_backend_disk_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1585
libvirt_storage_backend_disk_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1586
endif WITH_STORAGE_DISK
1587

1588
if WITH_STORAGE_RBD
1589 1590 1591 1592 1593 1594 1595
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)

1596
storagebackend_LTLIBRARIES += libvirt_storage_backend_rbd.la
1597
libvirt_storage_backend_rbd_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1598
libvirt_storage_backend_rbd_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1599
endif WITH_STORAGE_RBD
1600

1601
if WITH_STORAGE_SHEEPDOG
1602 1603 1604 1605 1606 1607
libvirt_storage_backend_sheepdog_la_SOURCES = \
	$(STORAGE_DRIVER_SHEEPDOG_SOURCES)
libvirt_storage_backend_sheepdog_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1608 1609 1610 1611 1612 1613 1614 1615 1616
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
1617
libvirt_storage_backend_sheepdog_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1618
libvirt_storage_backend_sheepdog_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1619
endif WITH_STORAGE_SHEEPDOG
1620

1621
if WITH_STORAGE_GLUSTER
1622 1623 1624 1625 1626 1627 1628 1629
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)

1630
storagebackend_LTLIBRARIES += libvirt_storage_backend_gluster.la
1631
libvirt_storage_backend_gluster_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1632
libvirt_storage_backend_gluster_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1633 1634
endif WITH_STORAGE_GLUSTER

R
Roman Bogorodskiy 已提交
1635
if WITH_STORAGE_ZFS
1636
libvirt_storage_backend_zfs_la_SOURCES = $(STORAGE_DRIVER_ZFS_SOURCES)
1637
libvirt_storage_backend_zfs_la_CFLAGS = \
1638 1639 1640
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1641
storagebackend_LTLIBRARIES += libvirt_storage_backend_zfs.la
1642
libvirt_storage_backend_zfs_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1643
libvirt_storage_backend_zfs_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
R
Roman Bogorodskiy 已提交
1644 1645
endif WITH_STORAGE_ZFS

1646
if WITH_STORAGE_VSTORAGE
1647 1648
libvirt_storage_backend_vstorage_la_SOURCES = \
	$(STORAGE_DRIVER_VSTORAGE_SOURCES)
1649
libvirt_storage_backend_vstorage_la_CFLAGS = \
1650 1651 1652
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1653
storagebackend_LTLIBRARIES += libvirt_storage_backend_vstorage.la
1654
libvirt_storage_backend_vstorage_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1655
libvirt_storage_backend_vstorage_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1656 1657
endif WITH_STORAGE_VSTORAGE

1658 1659 1660 1661 1662
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)

1663
libvirt_driver_nodedev_la_CFLAGS = \
1664 1665
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1666
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1667
libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1668
libvirt_driver_nodedev_la_LIBADD =
1669

1670
if WITH_HAL
1671 1672
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS)
1673
libvirt_driver_nodedev_la_LIBADD += $(HAL_LIBS)
1674
endif WITH_HAL
1675
if WITH_UDEV
1676
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES)
1677
libvirt_driver_nodedev_la_CFLAGS += $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS)
1678
libvirt_driver_nodedev_la_LIBADD += $(UDEV_LIBS) $(PCIACCESS_LIBS)
1679
endif WITH_UDEV
1680

1681
libvirt_driver_nodedev_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1682
endif WITH_NODE_DEVICES
1683 1684


1685
if WITH_NWFILTER
1686 1687 1688
noinst_LTLIBRARIES += libvirt_driver_nwfilter_impl.la
libvirt_driver_nwfilter_la_SOURCES =
libvirt_driver_nwfilter_la_LIBADD = libvirt_driver_nwfilter_impl.la
1689
mod_LTLIBRARIES += libvirt_driver_nwfilter.la
1690
libvirt_driver_nwfilter_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1691
libvirt_driver_nwfilter_impl_la_CFLAGS = \
1692 1693 1694
		$(LIBPCAP_CFLAGS) \
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1695 1696
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1697
		$(AM_CFLAGS)
1698 1699 1700 1701 1702
libvirt_driver_nwfilter_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_nwfilter_impl_la_LIBADD = \
		$(LIBPCAP_LIBS) \
		$(LIBNL_LIBS) \
		$(DBUS_LIBS)
1703
libvirt_driver_nwfilter_impl_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1704
libvirt_driver_nwfilter_impl_la_SOURCES = $(NWFILTER_DRIVER_SOURCES)
1705
endif WITH_NWFILTER
1706 1707


1708 1709 1710 1711
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 = \
1712
		-I$(srcdir)/conf $(AM_CFLAGS)
1713
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
1714
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
1715
if WITH_SECDRIVER_SELINUX
1716 1717
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
1718
endif WITH_SECDRIVER_SELINUX
J
Jamie Strandboge 已提交
1719
if WITH_SECDRIVER_APPARMOR
1720 1721
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
1722
endif WITH_SECDRIVER_APPARMOR
1723

1724 1725
libvirt_driver_access_la_SOURCES = \
	$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
1726 1727 1728
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
1729
		-I$(srcdir)/conf $(AM_CFLAGS)
1730 1731 1732
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD =

1733 1734
EXTRA_DIST += access/genpolkit.pl

1735 1736 1737 1738
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
    $(srcdir)/access/genpolkit.pl Makefile.am
	$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@

1739 1740 1741 1742
if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)

polkitactiondir = $(datadir)/polkit-1/actions
1743
if WITH_LIBVIRTD
1744
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
1745
endif WITH_LIBVIRTD
1746 1747 1748

CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
1749
else ! WITH_POLKIT1
1750
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
1751
endif ! WITH_POLKIT1
1752

1753

1754 1755
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769

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

1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782
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 已提交
1783
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
1784 1785
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1786 1787 1788
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
1789 1790
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1791 1792
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
	  > $(srcdir)/access/viraccessapicheck.c
1793

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

E
Eric Blake 已提交
1805
access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
1806 1807
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1808 1809 1810
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/access/viraccessapichecklxc.h
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
1811 1812
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1813 1814
	  lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \
	  > $(srcdir)/access/viraccessapichecklxc.c
1815

1816
# Add all conditional sources just in case...
1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847
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_SOURCES) \
		$(XENCONFIG_LIBXL_SOURCES) \
1848
		$(ACCESS_DRIVER_POLKIT_POLICY)
1849

1850 1851
check-local: check-augeas

1852 1853 1854 1855
.PHONY: check-augeas \
	check-augeas-lxc \
	check-augeas-sanlock \
	check-augeas-lockd \
1856
	check-augeas-libxl \
1857
	check-augeas-libvirtd \
1858
	$(NULL)
1859

1860 1861
check-augeas: $(AUGEAS_DIRS:%=check-augeas-%) \
	check-augeas-lxc check-augeas-sanlock \
1862
	check-augeas-lockd check-augeas-virtlockd check-augeas-libxl \
1863
	check-augeas-virtlogd check-augeas-libvirtd
1864

1865
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
1866
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
1867

1868
if WITH_LXC
1869 1870
test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
		$(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1871
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
1872

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

1881
if WITH_SANLOCK
1882 1883
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1884
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
1885

1886
check-augeas-sanlock: test_libvirt_sanlock.aug
1887
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1888
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
1889
	fi
1890
else ! WITH_SANLOCK
1891
check-augeas-sanlock:
1892
endif ! WITH_SANLOCK
1893

1894
if WITH_QEMU
1895 1896 1897
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 $< $@
1898 1899 1900
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
1901

1902 1903
test_virtlockd.aug: locking/test_virtlockd.aug.in \
		locking/virtlockd.conf $(AUG_GENTEST)
1904
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
1905

1906
if WITH_QEMU
1907 1908 1909 1910
check-augeas-lockd: test_libvirt_lockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_lockd.aug; \
	fi
1911 1912 1913
else ! WITH_QEMU
check-augeas-lockd:
endif ! WITH_QEMU
1914

1915 1916 1917 1918 1919
check-augeas-virtlockd: test_virtlockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
	fi

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

1933

1934 1935 1936 1937 1938 1939 1940 1941 1942
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

1943 1944 1945
if WITH_LIBVIRTD
test_libvirtd.aug: remote/test_libvirtd.aug.in \
		remote/libvirtd.conf $(AUG_GENTEST)
1946
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/remote/libvirtd.conf $< $@
1947 1948 1949 1950 1951 1952 1953 1954

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
1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973
#
# 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.
#

1974
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
1975

1976
if WITH_LINUX
1977
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
1978
else ! WITH_LINUX
1979
SYM_FILES += $(srcdir)/libvirt_linux.syms
1980
endif ! WITH_LINUX
1981

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

1988
if WITH_VMX
1989
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
1990
else ! WITH_VMX
1991
SYM_FILES += $(srcdir)/libvirt_vmx.syms
1992
endif ! WITH_VMX
1993

J
Jim Fehlig 已提交
1994 1995 1996 1997 1998
if WITH_XENCONFIG
USED_SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
else ! WITH_XENCONFIG
SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
endif ! WITH_XENCONFIG
1999

2000
if WITH_SASL
2001
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
2002
else ! WITH_SASL
2003
SYM_FILES += $(srcdir)/libvirt_sasl.syms
2004
endif ! WITH_SASL
E
Eric Blake 已提交
2005

2006 2007
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2008
else ! WITH_GNUTLS
2009
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2010
endif ! WITH_GNUTLS
2011

2012
if WITH_SSH2
2013
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2014
else ! WITH_SSH2
2015
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2016
endif ! WITH_SSH2
2017

2018
if WITH_ATOMIC_OPS_PTHREAD
2019
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
2020
else ! WITH_ATOMIC_OPS_PTHREAD
2021
SYM_FILES += $(srcdir)/libvirt_atomic.syms
2022
endif ! WITH_ATOMIC_OPS_PTHREAD
2023

2024 2025 2026 2027 2028 2029
if WITH_LIBSSH
USED_SYM_FILES += $(srcdir)/libvirt_libssh.syms
else ! WITH_LIBSSH
SYM_FILES += $(srcdir)/libvirt_libssh.syms
endif ! WITH_LIBSSH

2030
EXTRA_DIST += \
2031 2032 2033 2034 2035 2036
	libvirt_public.syms \
	libvirt_lxc.syms \
	libvirt_qemu.syms \
	libvirt_admin_public.syms \
	$(SYM_FILES) \
	$(ADMIN_SYM_FILES) \
2037
	$(NULL)
2038

2039
BUILT_SOURCES += $(GENERATED_SYM_FILES)
2040

2041 2042
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(ACCESS_DRIVER_SYM_FILES) \
2043
		$(top_builddir)/config.status
2044 2045 2046 2047 2048 2049
	$(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 && \
2050
	cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
2051 2052
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
2053
	mv $@-tmp libvirt.syms
2054

2055
%.def: %.syms
2056 2057
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
2058
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d' \
2059
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
2060
	chmod a-w $@-tmp && \
2061
	mv $@-tmp $@
2062

2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075
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

2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090

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) \
2091
		$(XDR_CFLAGS) \
2092 2093 2094 2095 2096 2097
		-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)

2098 2099 2100 2101
# 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 已提交
2102 2103
lib_LTLIBRARIES += libvirt-admin.la
libvirt_admin_la_SOURCES = \
2104 2105
		libvirt-admin.c \
		$(ADMIN_PROTOCOL_GENERATED) \
M
Martin Kletzander 已提交
2106 2107 2108
		$(DATATYPES_SOURCES)

libvirt_admin_la_LDFLAGS = \
2109 2110
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_ADMIN_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
2111
		$(AM_LDFLAGS)
M
Martin Kletzander 已提交
2112 2113

libvirt_admin_la_LIBADD = \
2114
		libvirt.la \
M
Martin Kletzander 已提交
2115 2116 2117
		$(CYGWIN_EXTRA_LIBADD)

libvirt_admin_la_CFLAGS = \
2118 2119 2120
		$(AM_CFLAGS) \
		-I$(srcdir)/remote \
		-I$(srcdir)/rpc \
M
Martin Kletzander 已提交
2121 2122 2123
		-I$(srcdir)/admin

libvirt_admin_la_CFLAGS += \
2124 2125 2126 2127 2128 2129
		$(XDR_CFLAGS) \
		$(CAPNG_CFLAGS) \
		$(YAJL_CFLAGS) \
		$(SSH2_CFLAGS) \
		$(SASL_CFLAGS) \
		$(GNUTLS_CFLAGS) \
2130
		$(LIBSSH_CFLAGS)
M
Martin Kletzander 已提交
2131 2132

libvirt_admin_la_LIBADD += \
2133 2134 2135 2136 2137 2138 2139
		$(CAPNG_LIBS) \
		$(YAJL_LIBS) \
		$(DEVMAPPER_LIBS) \
		$(LIBXML_LIBS) \
		$(SSH2_LIBS) \
		$(SASL_LIBS) \
		$(GNUTLS_LIBS) \
2140
		$(LIBSSH_LIBS)
M
Martin Kletzander 已提交
2141

2142 2143
ADMIN_SYM_FILES = $(srcdir)/libvirt_admin_private.syms

M
Martin Kletzander 已提交
2144 2145 2146 2147
if WITH_DTRACE_PROBES
libvirt_admin_la_LIBADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

2148 2149
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
2150 2151 2152 2153
libvirt_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(LIBVIRT_NODELETE) \
2154
		$(NO_UNDEFINED_LDFLAGS) \
D
Daniel P. Berrange 已提交
2155 2156
		$(AM_LDFLAGS) \
		$(NULL)
2157
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
2158
libvirt_la_LIBADD += \
2159
		    $(DRIVER_MODULES_LIBS) \
2160
		    $(CYGWIN_EXTRA_LIBADD)
2161
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
2162 2163 2164 2165 2166 2167
# 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)
2168

2169
if WITH_DTRACE_PROBES
2170
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
2171
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
2172
nodist_libvirt_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2173
if WITH_REMOTE
E
Eric Blake 已提交
2174
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2175
endif WITH_REMOTE
2176
DTRACE2SYSTEMTAP_FLAGS = --with-modules
2177

2178 2179
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

2180 2181

tapsetdir = $(datadir)/systemtap/tapset
2182
tapset_DATA += libvirt_probes.stp libvirt_functions.stp
2183

2184
%_probes.h: %_probes.d
2185 2186
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

E
Eric Blake 已提交
2187
.PRECIOUS: %_probes.o
2188
%_probes.o: %_probes.d
2189 2190
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

2191 2192 2193 2194 2195 2196 2197 2198 2199
%_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 已提交
2200
# Keep this list synced with PROTOCOL_STRUCTS
J
Jiri Denemark 已提交
2201 2202 2203
RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
2204
		  $(srcdir)/remote/lxc_protocol.x \
2205 2206
		  $(srcdir)/remote/qemu_protocol.x \
		  $(srcdir)/lxc/lxc_monitor_protocol.x \
M
Martin Kletzander 已提交
2207 2208
		  $(srcdir)/locking/lock_protocol.x \
		  $(srcdir)/admin/admin_protocol.x
2209 2210

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

2213 2214
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl \
		$(top_builddir)/config.status
2215
	$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
2216
	  $(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
2217

2218
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
2219
              libvirt_functions.stp libvirt_probes.stp
2220
endif WITH_DTRACE_PROBES
2221

2222
EXTRA_DIST += libvirt_probes.d
2223

C
Chris Lalancette 已提交
2224
libvirt_qemu_la_SOURCES = libvirt-qemu.c
D
Daniel P. Berrange 已提交
2225 2226 2227 2228 2229
libvirt_qemu_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
2230
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
C
Chris Lalancette 已提交
2231
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
2232

2233
libvirt_lxc_la_SOURCES = libvirt-lxc.c
D
Daniel P. Berrange 已提交
2234 2235 2236 2237 2238
libvirt_lxc_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
2239 2240 2241
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)

2242 2243 2244 2245 2246 2247 2248
# 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
2249
if WITH_SETUID_RPC_CLIENT
2250 2251
noinst_LTLIBRARIES += libvirt-setuid-rpc-client.la

2252 2253
libvirt_setuid_rpc_client_la_SOURCES = \
		util/viralloc.c \
2254
		util/virarch.c \
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 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319
		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 \
2320 2321
		$(NULL)

2322 2323 2324 2325
libvirt_setuid_rpc_client_la_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(LIBXML_LIBS) \
		$(SECDRIVER_LIBS) \
2326
		$(NULL)
2327 2328 2329 2330 2331 2332 2333
libvirt_setuid_rpc_client_la_CFLAGS = \
		-DLIBVIRT_SETUID_RPC_CLIENT \
		-I$(srcdir)/conf \
		-I$(srcdir)/rpc \
		$(AM_CFLAGS) \
		$(SECDRIVER_CFLAGS) \
		$(XDR_CFLAGS) \
2334
		$(NULL)
2335
endif WITH_SETUID_RPC_CLIENT
2336

2337 2338 2339
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

2340
if WITH_LIBVIRTD
2341 2342 2343 2344 2345
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
		$(LOCK_DRIVER_LOCKD_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
		$(NULL)
2346
lockd_la_CFLAGS = -I$(srcdir)/conf \
E
Eric Blake 已提交
2347 2348
		$(XDR_CFLAGS) \
		$(AM_CFLAGS)
2349
lockd_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
2350
lockd_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
J
Jiri Denemark 已提交
2351
augeas_DATA += locking/libvirt_lockd.aug
2352 2353
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
2354
endif WITH_DTRACE_PROBES
2355
if WITH_QEMU
2356 2357
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
2358
nodist_conf_DATA += locking/qemu-lockd.conf
2359 2360
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
2361
endif WITH_QEMU
2362

2363 2364 2365 2366 2367 2368
if WITH_LIBXL
nodist_conf_DATA += locking/libxl-lockd.conf
BUILT_SOURCES += locking/libxl-lockd.conf
DISTCLEANFILES += locking/libxl-lockd.conf
endif WITH_LIBXL

2369 2370 2371 2372 2373
locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
	$(AM_V_GEN)$(MKDIR_P) locking ; \
	cp $< $@


2374
sbin_PROGRAMS += virtlockd virtlogd
2375

2376 2377 2378
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
2379
		$(LOCK_DAEMON_GENERATED) \
2380
		$(NULL)
2381 2382
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
2383
		$(PIE_CFLAGS) \
2384
		$(XDR_CFLAGS) \
2385 2386 2387
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
2388
		$(PIE_LDFLAGS) \
2389
		$(NO_UNDEFINED_LDFLAGS) \
2390 2391
		$(NULL)
virtlockd_LDADD = \
2392
		libvirt_driver_admin.la \
2393 2394 2395 2396 2397 2398 2399 2400
		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
2401
endif WITH_DTRACE_PROBES
2402

2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416

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) \
2417
		$(NO_UNDEFINED_LDFLAGS) \
2418 2419
		$(NULL)
virtlogd_LDADD = \
2420
		libvirt_driver_admin.la \
2421 2422 2423 2424 2425 2426 2427 2428 2429 2430
		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

2431
else ! WITH_LIBVIRTD
2432
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
2433 2434
              $(LOCK_DRIVER_LOCKD_SOURCES) \
	      $(LOG_DAEMON_SOURCES)
2435
endif ! WITH_LIBVIRTD
2436

2437
SYSCONF_FILES = \
2438
	locking/virtlockd.sysconf \
2439
	logging/virtlogd.sysconf \
2440
	remote/libvirtd.sysconf \
2441 2442 2443
	$(NULL)

EXTRA_DIST += \
J
Jiri Denemark 已提交
2444 2445
	locking/lockd.conf \
	locking/libvirt_lockd.aug \
2446
	locking/test_libvirt_lockd.aug.in \
2447 2448
	$(SYSCONF_FILES) \
	$(NULL)
2449 2450

install-sysconfig:
E
Eric Blake 已提交
2451
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
2452 2453 2454
	for f in $(SYSCONF_FILES:%.sysconf=%) ; \
	do \
	  tgt=`basename $$f`; \
2455 2456
	  $(INSTALL_SCRIPT) $(srcdir)/$$f.sysconf \
	      $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
2457
	done
2458 2459

uninstall-sysconfig:
2460 2461 2462 2463 2464
	for f in $(SYSCONF_FILES:%.sysconf=%) ; \
	do \
	  tgt=`basename $$f`; \
	  rm -f $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
	done
E
Eric Blake 已提交
2465
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
2466

2467 2468 2469
SYSVINIT_FILES_IN = \
	locking/virtlockd.init.in \
	logging/virtlogd.init.in \
2470
	remote/libvirtd.init.in \
2471 2472 2473 2474 2475
	$(NULL)

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

EXTRA_DIST += $(SYSVINIT_FILES_IN)
2476

2477 2478 2479 2480 2481 2482 2483 2484 2485 2486
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)

2487
if WITH_LIBVIRTD
2488

2489 2490 2491
LOGROTATE_FILES := $(LOGROTATE_FILES_IN:remote/%.in=%)

BUILT_SOURCES += $(LOGROTATE_FILES)
2492
CLEANFILES += $(LOGROTATE_FILES)
2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512

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

2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551
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

2552
if LIBVIRT_INIT_SCRIPT_RED_HAT
2553
install-init:: $(SYSVINIT_FILES) install-sysconfig
E
Eric Blake 已提交
2554
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
2555 2556 2557 2558
	for f in $(SYSVINIT_FILES:%.init=%) ; \
	do \
	  $(INSTALL_SCRIPT) $$f.init $(DESTDIR)$(sysconfdir)/rc.d/init.d/$$f; \
	done
2559 2560

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

2564 2565
BUILT_SOURCES += $(SYSVINIT_FILES)
DISTCLEANFILES += $(SYSVINIT_FILES)
2566
else ! LIBVIRT_INIT_SCRIPT_RED_HAT
2567 2568
install-init::
uninstall-init::
2569 2570
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
else ! WITH_LIBVIRTD
2571 2572 2573 2574
install-polkit::
uninstall-polkit::
install-sysctl::
uninstall-sysctl::
2575 2576
install-init::
uninstall-init::
2577 2578
install-logrotate::
uninstall-logrotate::
2579
endif ! WITH_LIBVIRTD
2580

2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597
# 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


2598 2599 2600 2601 2602 2603 2604 2605 2606
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 $@

2607
virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
2608 2609 2610 2611 2612 2613
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    < $< > $@-t && \
	    chmod a+x $@-t && \
2614 2615
	    mv $@-t $@

2616
virtlogd.init: logging/virtlogd.init.in $(top_builddir)/config.status
2617 2618 2619 2620 2621 2622
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    < $< > $@-t && \
	    chmod a+x $@-t && \
2623 2624
	    mv $@-t $@

2625
virtlockd.8.in: locking/virtlockd.pod
2626 2627 2628 2629 2630 2631 2632 2633
	$(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 $@
2634

2635
virtlogd.8.in: logging/virtlogd.pod
2636 2637 2638 2639 2640 2641 2642 2643
	$(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 $@
2644

2645 2646 2647 2648 2649 2650 2651 2652 2653 2654
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 $@

2655
%.8: %.8.in $(top_srcdir)/configure.ac
2656
	$(AM_V_GEN)sed \
2657 2658 2659
		-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
		-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
		< $< > $@-t && \
2660 2661
	mv $@-t $@

2662
if WITH_LIBVIRTD
2663
man8_MANS = virtlockd.8 virtlogd.8 libvirtd.8
2664

2665
conf_DATA += locking/virtlockd.conf logging/virtlogd.conf
2666

2667 2668
augeas_DATA += locking/virtlockd.aug logging/virtlogd.aug
augeastest_DATA += test_virtlockd.aug test_virtlogd.aug
2669
endif WITH_LIBVIRTD
2670

A
Andrea Bolognani 已提交
2671 2672 2673
PODFILES = \
	locking/virtlockd.pod \
	logging/virtlogd.pod \
2674
	remote/libvirtd.pod \
A
Andrea Bolognani 已提交
2675 2676 2677 2678 2679
	$(NULL)

MANINFILES = \
	virtlockd.8.in \
	virtlogd.8.in \
2680
	libvirtd.8.in \
A
Andrea Bolognani 已提交
2681 2682 2683 2684
	$(NULL)

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

2686 2687 2688 2689 2690 2691 2692
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 \
2693 2694
	remote/libvirtd.service.in \
	remote/virt-guest-shutdown.target.in \
2695 2696
	$(NULL)

2697
EXTRA_DIST += \
2698
        $(SYSTEMD_UNIT_FILES_IN) \
2699 2700 2701
        locking/virtlockd.aug \
        locking/virtlockd.conf \
        locking/test_virtlockd.aug.in \
2702 2703 2704
        logging/virtlogd.aug \
        logging/virtlogd.conf \
        logging/test_virtlogd.aug.in \
A
Andrea Bolognani 已提交
2705 2706
        $(PODFILES) \
        $(MANINFILES) \
2707
        $(NULL)
2708

2709 2710 2711 2712

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

2713
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
2714
SYSTEMD_UNIT_FILES = $(notdir $(SYSTEMD_UNIT_FILES_IN:%.in=%))
2715

2716 2717
BUILT_SOURCES += $(SYSTEMD_UNIT_FILES)
DISTCLEANFILES += $(SYSTEMD_UNIT_FILES)
2718

2719
install-systemd: $(SYSTEMD_UNIT_FILES) install-sysconfig
E
Eric Blake 已提交
2720
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
2721 2722 2723 2724
	for f in $(SYSTEMD_UNIT_FILES); \
	do \
	  $(INSTALL_DATA) $$f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/ ; \
	done
2725 2726

uninstall-systemd: uninstall-sysconfig
2727
	rm -f $(SYSTEMD_UNIT_FILES:%=$(DESTDIR)$(SYSTEMD_UNIT_DIR)/%)
E
Eric Blake 已提交
2728
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
2729
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
2730 2731
install-systemd:
uninstall-systemd:
2732 2733
endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
else ! WITH_LIBVIRTD
2734 2735
install-systemd:
uninstall-systemd:
2736
endif ! WITH_LIBVIRTD
2737

2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749
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 $< $@

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

virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
2757 2758 2759
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
2760 2761
	    mv $@-t $@

J
John Ferlan 已提交
2762 2763 2764 2765 2766 2767 2768
virtlockd-admin.socket: locking/virtlockd-admin.socket.in \
                        $(top_builddir)/config.status
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
	    mv $@-t $@

2769
virtlogd.service: logging/virtlogd.service.in $(top_builddir)/config.status
2770 2771 2772
	$(AM_V_GEN)sed \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    < $< > $@-t && \
2773 2774 2775
	    mv $@-t $@

virtlogd.socket: logging/virtlogd.socket.in $(top_builddir)/config.status
J
John Ferlan 已提交
2776 2777 2778 2779 2780 2781 2782
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
	    mv $@-t $@

virtlogd-admin.socket: logging/virtlogd-admin.socket.in \
                       $(top_builddir)/config.status
2783 2784 2785
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
2786 2787
	    mv $@-t $@

2788

2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802
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` ; \
2803 2804
	  $(INSTALL_SCRIPT) $(srcdir)/$$f.upstart \
	      $(DESTDIR)$(sysconfdir)/event.d/$$tgt ; \
2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822
	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

2823
if WITH_SANLOCK
2824
lockdriver_LTLIBRARIES += sanlock.la
2825
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
2826
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
2827
sanlock_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
2828
sanlock_la_LIBADD = -lsanlock_client libvirt.la ../gnulib/lib/libgnu.la
2829 2830

augeas_DATA += locking/libvirt_sanlock.aug
2831 2832
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
2833

E
Eric Blake 已提交
2834
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
2835
	$(AM_V_GEN)$(MKDIR_P) locking ; \
2836 2837 2838
	cp $< $@

if WITH_QEMU
2839
nodist_conf_DATA += locking/qemu-sanlock.conf
2840
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
2841
DISTCLEANFILES += locking/qemu-sanlock.conf
2842
endif WITH_QEMU
2843 2844 2845 2846 2847 2848

if WITH_LIBXL
nodist_conf_DATA += locking/libxl-sanlock.conf
BUILT_SOURCES += locking/libxl-sanlock.conf
DISTCLEANFILES += locking/libxl-sanlock.conf
endif WITH_LIBXL
2849
else ! WITH_SANLOCK
2850
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
2851
endif ! WITH_SANLOCK
2852 2853
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
2854
	locking/test_libvirt_sanlock.aug.in
2855

2856 2857 2858 2859
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
2860

2861 2862 2863 2864 2865
libvirt_la_BUILT_LIBADD += \
       libvirt-net-rpc.la \
       libvirt-net-rpc-server.la \
       libvirt-net-rpc-client.la

2866
EXTRA_DIST += \
E
Eric Blake 已提交
2867 2868 2869 2870
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
2871 2872
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
2873

E
Eric Blake 已提交
2874
VIR_NET_RPC_GENERATED = \
2875 2876 2877 2878
	rpc/virnetprotocol.h \
	rpc/virnetprotocol.c \
	rpc/virkeepaliveprotocol.h \
	rpc/virkeepaliveprotocol.c
2879

2880
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2881

2882
libvirt_net_rpc_la_SOURCES = \
2883
	rpc/virnetmessage.h rpc/virnetmessage.c \
2884
	rpc/virnetsocket.h rpc/virnetsocket.c \
2885 2886
	rpc/virkeepalive.h rpc/virkeepalive.c \
	$(VIR_NET_RPC_GENERATED)
2887
if WITH_SSH2
2888 2889
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2890
else ! WITH_SSH2
2891 2892
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2893
endif ! WITH_SSH2
2894
if WITH_GNUTLS
2895 2896
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2897
else ! WITH_GNUTLS
2898 2899
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2900
endif ! WITH_GNUTLS
2901
if WITH_SASL
2902 2903
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2904
else ! WITH_SASL
2905 2906
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2907
endif ! WITH_SASL
2908 2909 2910 2911 2912 2913 2914
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
2915
libvirt_net_rpc_la_CFLAGS = \
2916
			$(GNUTLS_CFLAGS) \
2917
			$(SASL_CFLAGS) \
2918
			$(SSH2_CFLAGS) \
2919
			$(LIBSSH_CFLAGS) \
2920
			$(XDR_CFLAGS) \
2921 2922
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
2923
			$(GNUTLS_LIBS) \
2924
			$(SASL_LIBS) \
2925
			$(SSH2_LIBS)\
2926
			$(LIBSSH_LIBS) \
J
Jim Fehlig 已提交
2927
			$(SECDRIVER_LIBS) \
2928
			$(AM_LDFLAGS) \
2929
			$(NULL)
2930 2931 2932
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2933 2934 2935 2936
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
2937
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
2938
	rpc/virnetdaemon.h rpc/virnetdaemon.c \
2939 2940
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
2941
			$(AVAHI_CFLAGS) \
2942
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
2943
			$(XDR_CFLAGS) \
2944
			$(AM_CFLAGS)
2945 2946
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
2947
			$(AVAHI_LIBS) \
2948
			$(DBUS_LIBS) \
2949
			$(NULL)
2950 2951 2952
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2953 2954 2955 2956 2957
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 已提交
2958 2959
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
2960
libvirt_net_rpc_client_la_LDFLAGS = $(AM_LDFLAGS)
2961 2962
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
2963

2964 2965
libexec_PROGRAMS =

2966
if WITH_LIBVIRTD
2967 2968
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2969 2970 2971 2972
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2973 2974
libvirt_iohelper_LDADD = \
		libvirt_util.la \
2975
		../gnulib/lib/libgnu.la
2976 2977
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
2978
endif WITH_DTRACE_PROBES
2979

D
Daniel P. Berrange 已提交
2980 2981 2982 2983
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2984 2985 2986 2987

if WITH_NETWORK
libexec_PROGRAMS += libvirt_leaseshelper
libvirt_leaseshelper_SOURCES = $(NETWORK_LEASES_HELPER_SOURCES)
2988 2989 2990 2991
libvirt_leaseshelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2992 2993
libvirt_leaseshelper_LDADD = \
               libvirt_util.la \
2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006
               ../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

3007
endif WITH_LIBVIRTD
3008

3009
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
3010
if WITH_LIBVIRTD
3011
libexec_PROGRAMS += libvirt_parthelper
3012

3013
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
D
Daniel P. Berrange 已提交
3014 3015 3016 3017
libvirt_parthelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3018 3019 3020
libvirt_parthelper_LDADD = \
		$(LIBPARTED_LIBS) \
		libvirt_util.la \
3021
		../gnulib/lib/libgnu.la
3022 3023
if WITH_DTRACE_PROBES
libvirt_parthelper_LDADD += libvirt_probes.lo
3024
endif WITH_DTRACE_PROBES
3025

D
Daniel P. Berrange 已提交
3026 3027 3028 3029 3030
libvirt_parthelper_CFLAGS = \
		$(LIBPARTED_CFLAGS) \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
3031 3032
endif WITH_LIBVIRTD
endif WITH_STORAGE_DISK
3033 3034
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)

3035

3036
if WITH_SANLOCK
3037 3038 3039
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
3040
libvirt_sanlock_helper_CFLAGS = \
3041
		-I$(srcdir)/conf \
D
Daniel P. Berrange 已提交
3042 3043 3044 3045 3046 3047 3048
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3049
libvirt_sanlock_helper_LDADD = libvirt.la
3050
endif WITH_SANLOCK
3051

3052 3053 3054 3055
if WITH_LXC
if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_lxc

3056 3057
libvirt_lxc_SOURCES = \
		$(LXC_CONTROLLER_SOURCES) \
O
Osier Yang 已提交
3058
		$(DATATYPES_SOURCES)
D
Daniel P. Berrange 已提交
3059 3060 3061
libvirt_lxc_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
3062 3063
		$(CAPNG_LIBS) \
		$(LIBXML_LIBS) \
D
Daniel P. Berrange 已提交
3064
		$(NULL)
3065
libvirt_lxc_LDADD = \
G
Gao feng 已提交
3066
		$(FUSE_LIBS) \
3067
		libvirt.la \
3068
		../gnulib/lib/libgnu.la
3069
if WITH_DTRACE_PROBES
3070
libvirt_lxc_LDADD += libvirt_probes.lo
3071
endif WITH_DTRACE_PROBES
3072
libvirt_lxc_LDADD += $(SECDRIVER_LIBS)
3073 3074 3075 3076
libvirt_lxc_CFLAGS = \
		-I$(srcdir)/conf \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
3077 3078
		$(CAPNG_CFLAGS) \
		$(LIBXML_CFLAGS) \
3079 3080 3081 3082
		$(LIBNL_CFLAGS) \
		$(FUSE_CFLAGS) \
		$(DBUS_CFLAGS) \
		$(XDR_CFLAGS) \
D
Daniel P. Berrange 已提交
3083
		$(NULL)
3084
if WITH_BLKID
3085 3086
libvirt_lxc_CFLAGS += $(BLKID_CFLAGS)
libvirt_lxc_LDADD += $(BLKID_LIBS)
3087
endif WITH_BLKID
J
Jim Fehlig 已提交
3088
libvirt_lxc_CFLAGS += $(SECDRIVER_CFLAGS)
3089 3090
endif WITH_LIBVIRTD
endif WITH_LXC
3091 3092
EXTRA_DIST += $(LXC_CONTROLLER_SOURCES)

J
Jamie Strandboge 已提交
3093 3094 3095 3096 3097 3098
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 已提交
3099 3100 3101 3102
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3103 3104 3105 3106 3107
virt_aa_helper_LDADD = \
		libvirt.la \
		libvirt_conf.la \
		libvirt_util.la \
		libvirt_driver_storage_impl.la \
C
Chris Lalancette 已提交
3108
		../gnulib/lib/libgnu.la
3109
if WITH_DTRACE_PROBES
3110
virt_aa_helper_LDADD += libvirt_probes.lo
3111
endif WITH_DTRACE_PROBES
3112 3113 3114 3115 3116
virt_aa_helper_CFLAGS = \
		-I$(srcdir)/conf \
		-I$(srcdir)/security \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
D
Daniel P. Berrange 已提交
3117
		$(NULL)
3118 3119
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
J
Jamie Strandboge 已提交
3120 3121
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

3122
if WITH_NSS
3123 3124
noinst_LTLIBRARIES += libvirt-nss.la

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 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173
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 \
3174 3175
		$(NULL)

3176 3177 3178 3179
libvirt_nss_la_CFLAGS = \
		-DLIBVIRT_NSS \
		$(AM_CFLAGS) \
		$(YAJL_CFLAGS) \
3180
		$(NULL)
3181 3182
libvirt_nss_la_LDFLAGS = \
		$(AM_LDFLAGS) \
3183 3184
		$(NULL)

3185 3186
libvirt_nss_la_LIBADD = \
		$(YAJL_LIBS) \
3187
		$(NULL)
3188
endif WITH_NSS
3189 3190


3191
install-data-local: install-init install-systemd install-upstart \
3192
		install-sysctl install-polkit install-sasl \
3193
		install-logrotate install-data-extra
3194
if WITH_LIBVIRTD
3195
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt"
3196
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
3197
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
3198
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
3199
endif WITH_LIBVIRTD
3200 3201
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
3202
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
3203
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
3204
if WITH_SANLOCK
3205
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
3206
endif WITH_SANLOCK
3207 3208 3209
if WITH_LXC
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lxc"
3210
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/lxc"
3211
endif WITH_LXC
J
Jim Fehlig 已提交
3212 3213 3214
if WITH_LIBXL
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/libxl"
J
Jim Fehlig 已提交
3215
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl"
3216
endif WITH_LIBXL
3217 3218
if WITH_XEN
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/xen"
3219
endif WITH_XEN
3220 3221
if WITH_NETWORK
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network"
3222
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq"
3223
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/network"
3224
	$(MKDIR_P) "$(DESTDIR)$(confdir)/qemu/networks/autostart"
3225
	$(INSTALL_DATA) $(srcdir)/network/default.xml \
3226
	  $(DESTDIR)$(confdir)/qemu/networks/default.xml
3227
	test -z "$(UUID)" || \
3228 3229 3230
	  { sed -e "s,</name>,</name>;  <uuid>$(UUID)</uuid>," \
	      $(DESTDIR)$(confdir)/qemu/networks/default.xml | \
	      tr ";" "\n" > \
3231 3232 3233 3234
	      $(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 已提交
3235
	( cd $(DESTDIR)$(confdir)/qemu/networks/autostart && \
3236 3237
	  rm -f default.xml && \
	  $(LN_S) ../default.xml default.xml )
3238
endif WITH_NETWORK
3239

3240
uninstall-local:: uninstall-init uninstall-systemd uninstall-upstart \
3241
		uninstall-sysctl uninstall-polkit uninstall-sasl \
3242
		uninstall-logrotate uninstall-data-extra
3243
if WITH_LIBVIRTD
3244
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt" ||:
3245
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
3246 3247
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
3248
endif WITH_LIBVIRTD
3249 3250
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
3251
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
3252
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
3253
if WITH_SANLOCK
3254
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
3255
endif WITH_SANLOCK
3256 3257 3258
if WITH_LXC
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||:
3259
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/lxc" ||:
3260
endif WITH_LXC
J
Jim Fehlig 已提交
3261 3262 3263
if WITH_LIBXL
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||:
J
Jim Fehlig 已提交
3264
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||:
3265
endif WITH_LIBXL
3266 3267
if WITH_XEN
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/xen" ||:
3268
endif WITH_XEN
3269
if WITH_NETWORK
3270 3271 3272 3273
	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" || :
3274 3275
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||:
3276
endif WITH_NETWORK
3277
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
3278

3279 3280
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
3281 3282 3283 3284 3285
MAINTAINERCLEANFILES += \
	$(REMOTE_DRIVER_GENERATED) \
	$(LIBVIRTD_GENERATED) \
	$(VIR_NET_RPC_GENERATED) \
	$(NULL)