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

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

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

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

40 41
WARN_CFLAGS += $(STRICT_FRAME_LIMIT_CFLAGS)

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

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

59
EXTRA_DIST = $(conf_DATA)
60

61
BUILT_SOURCES =
62 63 64
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
65
nodist_conf_DATA =
66 67 68 69 70
DRIVER_SOURCE_FILES =
STATEFUL_DRIVER_SOURCE_FILES =
noinst_LTLIBRARIES =
mod_LTLIBRARIES =
INSTALL_DATA_DIRS =
71
libvirt_la_BUILT_LIBADD =
72 73 74
SYM_FILES =
USED_SYM_FILES =
GENERATED_SYM_FILES =
75 76 77 78 79 80 81
augeas_DATA =
augeastest_DATA =
conf_DATA =
AUGEAS_DIRS =
if WITH_DTRACE_PROBES
tapset_DATA =
endif WITH_DTRACE_PROBES
82 83

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

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

99

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

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

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

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

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

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

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

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

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

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

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

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

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

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

man7_MANS = $(KEYMANS)

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

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

342 343 344
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

345 346
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
347

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

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

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

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

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

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

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


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

393 394
DRIVER_SOURCES += $(LOG_PROTOCOL_GENERATED)

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

EXTRA_DIST += check-drivername.pl

780
DRIVER_SOURCE_FILES += \
781 782 783 784 785 786 787
	$(INTERFACE_DRIVER_SOURCES) \
	$(LXC_DRIVER_SOURCES) \
	$(NETWORK_DRIVER_SOURCES) \
	$(NODE_DEVICE_DRIVER_SOURCES) \
	$(NODE_DEVICE_DRIVER_HAL_SOURCES) \
	$(NODE_DEVICE_DRIVER_UDEV_SOURCES) \
	$(NWFILTER_DRIVER_SOURCES) \
788
	$(VZ_DRIVER_SOURCES) \
789 790 791 792 793
	$(REMOTE_DRIVER_SOURCES) \
	$(SECRET_DRIVER_SOURCES) \
	$(STORAGE_DRIVER_SOURCES) \
	$(XEN_DRIVER_SOURCES) \
	$(XENAPI_DRIVER_SOURCES) \
794 795
	$(NULL)

796
STATEFUL_DRIVER_SOURCE_FILES += \
797 798 799 800 801 802 803 804
	$(INTERFACE_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
VZ_DRIVER_SOURCES = \
		vz/vz_driver.h \
		vz/vz_driver.c \
		vz/vz_utils.c \
		vz/vz_utils.h \
		vz/vz_sdk.h \
926
		vz/vz_sdk.c
D
Dmitry Guryanov 已提交
927

928
NETWORK_DRIVER_SOURCES = \
929
		network/bridge_driver.h network/bridge_driver.c \
930 931
		network/bridge_driver_platform.h \
		network/bridge_driver_platform.c \
932 933
		$(NULL)
EXTRA_DIST += network/bridge_driver_linux.c network/bridge_driver_nop.c
934

935 936 937
INTERFACE_DRIVER_SOURCES =

if WITH_INTERFACE
938 939
INTERFACE_DRIVER_SOURCES += \
		interface/interface_driver.h \
940
		interface/interface_driver.c
941 942

if WITH_NETCF
943
INTERFACE_DRIVER_SOURCES += \
944
		interface/interface_backend_netcf.c
945
endif WITH_NETCF
946
if WITH_UDEV
947
INTERFACE_DRIVER_SOURCES += \
948
		interface/interface_backend_udev.c
949 950
endif WITH_UDEV
endif WITH_INTERFACE
951

952
SECRET_UTIL_SOURCES = \
953 954
		secret/secret_util.h secret/secret_util.c

955
SECRET_DRIVER_SOURCES = \
956
		secret/secret_driver.h secret/secret_driver.c
957

958
# Storage backend specific impls
959 960 961
STORAGE_DRIVER_BACKEND_SOURCES = \
		storage/storage_backend.h storage/storage_backend.c

962 963
STORAGE_DRIVER_SOURCES = \
		storage/storage_driver.h storage/storage_driver.c \
964
		$(STORAGE_DRIVER_BACKEND_SOURCES) \
965
		storage/storage_util.h storage/storage_util.c
966

967
STORAGE_DRIVER_FS_SOURCES = \
968
		storage/storage_backend_fs.h storage/storage_backend_fs.c
R
Richard W.M. Jones 已提交
969

970 971
STORAGE_DRIVER_LVM_SOURCES = \
		storage/storage_backend_logical.h \
972
		storage/storage_backend_logical.c
973

974
STORAGE_DRIVER_ISCSI_SOURCES = \
975
		storage/storage_backend_iscsi.h storage/storage_backend_iscsi.c
976

977
STORAGE_DRIVER_SCSI_SOURCES = \
978
		storage/storage_backend_scsi.h storage/storage_backend_scsi.c
979

980
STORAGE_DRIVER_MPATH_SOURCES = \
981
		storage/storage_backend_mpath.h storage/storage_backend_mpath.c
D
Dave Allan 已提交
982

983
STORAGE_DRIVER_DISK_SOURCES = \
984
		storage/storage_backend_disk.h storage/storage_backend_disk.c
985

986
STORAGE_DRIVER_RBD_SOURCES = \
987 988
		storage/storage_backend_rbd.h storage/storage_backend_rbd.c

989
STORAGE_DRIVER_SHEEPDOG_SOURCES = \
990 991
		storage/storage_backend_sheepdog.h storage/storage_backend_sheepdog.c \
		storage/storage_backend_sheepdog_priv.h
992

993
STORAGE_DRIVER_GLUSTER_SOURCES = \
994 995
		storage/storage_backend_gluster.h storage/storage_backend_gluster.c

996
STORAGE_DRIVER_ZFS_SOURCES = \
R
Roman Bogorodskiy 已提交
997 998
                storage/storage_backend_zfs.h storage/storage_backend_zfs.c

999 1000
STORAGE_DRIVER_VSTORAGE_SOURCES = \
                storage/storage_backend_vstorage.h \
1001 1002
                storage/storage_backend_vstorage.c

1003
STORAGE_HELPER_DISK_SOURCES = \
1004
		storage/parthelper.c
1005

1006
UTIL_IO_HELPER_SOURCES = \
1007 1008
		util/iohelper.c

1009
NETWORK_LEASES_HELPER_SOURCES = \
1010 1011
               network/leaseshelper.c

1012
# Network filters
1013 1014 1015 1016 1017 1018 1019 1020 1021 1022
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 \
1023
		nwfilter/nwfilter_learnipaddr.h
1024

1025

1026
# Security framework and drivers for various models
1027 1028 1029 1030 1031
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 \
1032
		security/security_manager.h security/security_manager.c
1033

1034
SECURITY_DRIVER_SELINUX_SOURCES = \
1035
		security/security_selinux.h security/security_selinux.c
1036

1037
SECURITY_DRIVER_APPARMOR_SOURCES = \
J
Jamie Strandboge 已提交
1038 1039
		security/security_apparmor.h security/security_apparmor.c

1040
ACCESS_DRIVER_GENERATED = \
E
Eric Blake 已提交
1041 1042 1043 1044 1045 1046 1047
		access/viraccessapicheck.h \
		access/viraccessapicheck.c \
		access/viraccessapicheckqemu.h \
		access/viraccessapicheckqemu.c \
		access/viraccessapichecklxc.h \
		access/viraccessapichecklxc.c \
		$(NULL)
1048

1049
ACCESS_DRIVER_SYM_FILES = \
1050 1051 1052
		libvirt_access.syms \
		libvirt_access_qemu.syms \
		libvirt_access_lxc.syms
1053

1054 1055 1056 1057 1058
ACCESS_DRIVER_API_FILES = \
		libvirt_access.xml \
		libvirt_access_qemu.xml \
		libvirt_access_lxc.xml

1059 1060 1061 1062 1063 1064 1065
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

1066 1067 1068 1069
ACCESS_DRIVER_POLKIT_SOURCES = \
		access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c

ACCESS_DRIVER_POLKIT_POLICY = \
1070
		$(srcdir)/access/org.libvirt.api.policy
1071 1072


1073 1074
NODE_DEVICE_DRIVER_SOURCES = \
		node_device/node_device_driver.c \
1075
		node_device/node_device_driver.h
1076

1077 1078
NODE_DEVICE_DRIVER_HAL_SOURCES = \
		node_device/node_device_hal.c \
1079
		node_device/node_device_hal.h
1080

1081 1082
NODE_DEVICE_DRIVER_UDEV_SOURCES = \
		node_device/node_device_udev.c \
D
Daniel Veillard 已提交
1083
		node_device/node_device_udev.h
1084

1085 1086 1087 1088 1089 1090 1091
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 \
1092
		cpu/cpu_map.h cpu/cpu_map.c
1093

1094
VMX_SOURCES = \
1095 1096
		vmx/vmx.c vmx/vmx.h

1097

J
Jiri Denemark 已提交
1098 1099
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
1100
EXTRA_DIST +=	$(pkgdata_DATA)
1101

1102 1103 1104 1105 1106 1107
#########################
#
# Build up list of libvirt.la source files based on configure conditions
#
# First deal with sources usable in non-daemon context

1108
noinst_LTLIBRARIES += libvirt_util.la
1109
libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
1110
libvirt_la_BUILT_LIBADD += libvirt_util.la
1111
libvirt_util_la_SOURCES = \
1112
		$(UTIL_SOURCES)
1113
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
1114
		$(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
1115
		$(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS) \
1116
		$(POLKIT_CFLAGS) $(GNUTLS_CFLAGS) $(ACL_CFLAGS)
1117
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
1118
		$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
1119
		$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(WIN32_EXTRA_LIBS) $(LIBXML_LIBS) \
M
Michal Privoznik 已提交
1120
		$(SECDRIVER_LIBS) $(NUMACTL_LIBS) $(ACL_LIBS) \
1121
		$(POLKIT_LIBS) $(GNUTLS_LIBS)
1122

1123 1124

noinst_LTLIBRARIES += libvirt_conf.la
1125
libvirt_la_BUILT_LIBADD += libvirt_conf.la
1126
libvirt_conf_la_SOURCES = $(CONF_SOURCES)
1127 1128
libvirt_conf_la_CFLAGS = \
		-I$(srcdir)/conf $(AM_CFLAGS)
1129
libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS)
1130
libvirt_conf_la_LIBADD = $(LIBXML_LIBS)
1131

J
Jiri Denemark 已提交
1132
noinst_LTLIBRARIES += libvirt_cpu.la
1133
libvirt_la_BUILT_LIBADD += libvirt_cpu.la
J
Jiri Denemark 已提交
1134
libvirt_cpu_la_CFLAGS = \
1135
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jiri Denemark 已提交
1136 1137
libvirt_cpu_la_SOURCES = $(CPU_SOURCES)

1138 1139 1140 1141 1142 1143
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)

1144 1145 1146 1147
if WITH_VMX
noinst_LTLIBRARIES += libvirt_vmx.la
libvirt_la_BUILT_LIBADD += libvirt_vmx.la
libvirt_vmx_la_CFLAGS = \
1148
		-I$(srcdir)/conf $(AM_CFLAGS)
1149
libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
1150
endif WITH_VMX
1151

1152

1153
noinst_LTLIBRARIES += libvirt_driver.la
1154
libvirt_la_BUILT_LIBADD += libvirt_driver.la
1155
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
1156

1157
libvirt_driver_la_CFLAGS = \
1158
		$(GNUTLS_CFLAGS) $(CURL_CFLAGS) $(XDR_CFLAGS) \
1159
		-I$(srcdir)/conf $(AM_CFLAGS)
1160
libvirt_driver_la_LIBADD = \
1161
		$(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS)
1162

1163 1164
# 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.
1165 1166 1167
SYM_FILES += $(USED_SYM_FILES)
USED_SYM_FILES += $(srcdir)/libvirt_private.syms
GENERATED_SYM_FILES += \
1168 1169
	$(ACCESS_DRIVER_SYM_FILES) \
	libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \
1170
	libvirt_admin.syms libvirt_admin.def \
1171
	$(NULL)
1172

1173
if WITH_REMOTE
1174
noinst_LTLIBRARIES += libvirt_driver_remote.la
1175
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
1176 1177 1178 1179
libvirt_driver_remote_la_CFLAGS = \
		$(XDR_CFLAGS) \
		-I$(srcdir)/conf \
		-I$(srcdir)/rpc \
1180 1181
		$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
1182
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
1183

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

1186 1187
endif WITH_REMOTE

1188 1189 1190 1191 1192 1193 1194

if WITH_LIBVIRTD

sbin_PROGRAMS += libvirtd

BUILT_SOURCES += $(LIBVIRTD_GENERATED)

1195 1196 1197 1198 1199 1200
augeas_DATA += remote/libvirtd.aug

augeastest_DATA += test_libvirtd.aug

conf_DATA += remote/libvirtd.conf

1201
CLEANFILES += test_libvirtd.aug
1202

1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213
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
1214
CLEANFILES += libvirtd.policy
1215 1216 1217 1218 1219 1220 1221

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

1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262
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
1263 1264 1265 1266
EXTRA_DIST += \
	remote/test_libvirtd.aug.in \
	remote/libvirtd.aug \
	remote/libvirtd.conf \
1267 1268 1269 1270
	remote/libvirtd.policy.in \
	remote/libvirtd.rules \
	remote/libvirtd.sasl \
	remote/libvirtd.sysctl \
1271
	$(NULL)
1272

1273
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
1274
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
1275
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1276

1277
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
1278
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
1279
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1280

1281
if WITH_XEN
E
Eric Blake 已提交
1282 1283 1284
noinst_LTLIBRARIES += libvirt_driver_xen_impl.la
libvirt_driver_xen_la_SOURCES =
libvirt_driver_xen_la_LIBADD = libvirt_driver_xen_impl.la
1285
mod_LTLIBRARIES += libvirt_driver_xen.la
1286
libvirt_driver_xen_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1287
libvirt_driver_xen_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1288

1289 1290 1291 1292 1293
libvirt_driver_xen_impl_la_CFLAGS = \
		$(XEN_CFLAGS) \
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
		-I$(srcdir)/xenconfig \
1294
		$(AM_CFLAGS)
E
Eric Blake 已提交
1295
libvirt_driver_xen_impl_la_LDFLAGS = $(AM_LDFLAGS)
P
Pavel Hrdina 已提交
1296
libvirt_driver_xen_impl_la_LIBADD = $(XEN_LIBS) libvirt_xenconfig.la
E
Eric Blake 已提交
1297
libvirt_driver_xen_impl_la_SOURCES = $(XEN_DRIVER_SOURCES)
1298
endif WITH_XEN
1299

1300 1301
if WITH_XENAPI
noinst_LTLIBRARIES += libvirt_driver_xenapi.la
1302
libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la
1303
libvirt_driver_xenapi_la_CFLAGS = $(XENAPI_CFLAGS) $(CURL_CFLAGS) \
P
Pavel Hrdina 已提交
1304
		-I$(srcdir)/conf -I$(srcdir)/xenconfig $(AM_CFLAGS)
1305
libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS)
1306
libvirt_driver_xenapi_la_LIBADD = $(XENAPI_LIBS) $(CURL_LIBS)
1307
libvirt_driver_xenapi_la_SOURCES = $(XENAPI_DRIVER_SOURCES)
1308
endif WITH_XENAPI
1309

J
Jim Fehlig 已提交
1310

1311

1312 1313

if WITH_LXC
E
Eric Blake 已提交
1314 1315 1316
noinst_LTLIBRARIES += libvirt_driver_lxc_impl.la
libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = libvirt_driver_lxc_impl.la
1317
mod_LTLIBRARIES += libvirt_driver_lxc.la
1318
libvirt_driver_lxc_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1319
libvirt_driver_lxc_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1320 1321

libvirt_driver_lxc_impl_la_CFLAGS = \
S
Serge Hallyn 已提交
1322
		$(LIBNL_CFLAGS) \
G
Gao feng 已提交
1323
		$(FUSE_CFLAGS) \
P
Pavel Fedin 已提交
1324
		$(XDR_CFLAGS) \
1325 1326
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1327
		$(AM_CFLAGS)
I
ik.nitk 已提交
1328 1329 1330 1331 1332 1333
libvirt_driver_lxc_impl_la_LIBADD = \
               $(CAPNG_LIBS) \
               $(LIBNL_LIBS) \
               $(LIBXML_LIBS) \
               $(FUSE_LIBS)

1334
if WITH_BLKID
E
Eric Blake 已提交
1335 1336
libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS)
1337
endif WITH_BLKID
1338
libvirt_driver_lxc_impl_la_LIBADD += $(SECDRIVER_LIBS)
E
Eric Blake 已提交
1339
libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES)
A
Amy Griffis 已提交
1340 1341 1342

conf_DATA += lxc/lxc.conf

1343
augeas_DATA += lxc/libvirtd_lxc.aug
1344 1345
augeastest_DATA += test_libvirtd_lxc.aug
CLEANFILES += test_libvirtd_lxc.aug
1346

1347
endif WITH_LXC
1348
EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in
1349

1350

D
Daniel Veillard 已提交
1351

M
Matthias Bolte 已提交
1352 1353


1354
if WITH_VZ
1355 1356 1357 1358
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
1359
libvirt_driver_vz_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1360
libvirt_driver_vz_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1361
libvirt_driver_vz_impl_la_CFLAGS = \
1362 1363 1364
		-I$(srcdir)/conf \
		-I$(srcdir)/access \
		$(AM_CFLAGS) \
1365
		$(PARALLELS_SDK_CFLAGS) $(LIBNL_CFLAGS)
1366 1367
libvirt_driver_vz_impl_la_SOURCES = $(VZ_DRIVER_SOURCES)
libvirt_driver_vz_impl_la_LIBADD =  $(PARALLELS_SDK_LIBS) $(LIBNL_LIBS)
1368
endif WITH_VZ
D
Dmitry Guryanov 已提交
1369

R
Roman Bogorodskiy 已提交
1370

1371
if WITH_NETWORK
E
Eric Blake 已提交
1372 1373 1374
noinst_LTLIBRARIES += libvirt_driver_network_impl.la
libvirt_driver_network_la_SOURCES =
libvirt_driver_network_la_LIBADD = libvirt_driver_network_impl.la
1375
mod_LTLIBRARIES += libvirt_driver_network.la
1376
libvirt_driver_network_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la \
1377 1378 1379
	$(LIBNL_LIBS) \
	$(DBUS_LIBS) \
	$(NULL)
1380
libvirt_driver_network_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
E
Eric Blake 已提交
1381 1382

libvirt_driver_network_impl_la_CFLAGS = \
1383 1384
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1385 1386
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1387
		$(AM_CFLAGS)
E
Eric Blake 已提交
1388
libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
1389
libvirt_driver_network_impl_la_LIBADD  = $(DBUS_LIBS)
1390
endif WITH_NETWORK
1391 1392 1393
EXTRA_DIST += network/default.xml


1394
if WITH_INTERFACE
1395
mod_LTLIBRARIES += libvirt_driver_interface.la
1396
libvirt_driver_interface_la_CFLAGS = \
1397 1398
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1399
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1400
libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1401 1402 1403 1404
libvirt_driver_interface_la_LIBADD =
if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
1405
endif WITH_NETCF
1406
if WITH_UDEV
1407 1408
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
1409
endif WITH_UDEV
1410
libvirt_driver_interface_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1411
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
1412
endif WITH_INTERFACE
D
Daniel Veillard 已提交
1413

D
Daniel P. Berrange 已提交
1414
if WITH_SECRETS
1415
mod_LTLIBRARIES += libvirt_driver_secret.la
1416
libvirt_driver_secret_la_CFLAGS = \
1417 1418
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1419
		$(AM_CFLAGS)
1420
libvirt_driver_secret_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1421
libvirt_driver_secret_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1422
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
1423
endif WITH_SECRETS
1424

1425
# Needed to keep automake quiet about conditionals
1426 1427
libvirt_driver_storage_impl_la_SOURCES =
libvirt_driver_storage_impl_la_CFLAGS = \
1428 1429
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1430
		-I$(srcdir)/secret \
1431
		$(AM_CFLAGS)
1432 1433
libvirt_driver_storage_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_storage_impl_la_LIBADD =
1434
libvirt_driver_storage_impl_la_LIBADD += $(SECDRIVER_LIBS) $(LIBXML_LIBS)
1435
if WITH_BLKID
1436 1437
libvirt_driver_storage_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(BLKID_LIBS)
1438
endif WITH_BLKID
1439 1440 1441 1442

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

1443
if WITH_STORAGE
1444 1445 1446
noinst_LTLIBRARIES += libvirt_driver_storage_impl.la
libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_LIBADD = libvirt_driver_storage_impl.la
1447
mod_LTLIBRARIES += libvirt_driver_storage.la
1448
libvirt_driver_storage_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1449
libvirt_driver_storage_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1450
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
1451 1452 1453


libvirt_storage_backend_fs_la_SOURCES = $(STORAGE_DRIVER_FS_SOURCES)
1454
libvirt_storage_backend_fs_la_CFLAGS = \
1455 1456 1457
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1458
storagebackend_LTLIBRARIES += libvirt_storage_backend_fs.la
1459
libvirt_storage_backend_fs_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1460
libvirt_storage_backend_fs_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1461
endif WITH_STORAGE
1462

1463
if WITH_STORAGE_LVM
1464 1465 1466 1467 1468 1469
libvirt_storage_backend_logical_la_SOURCES = \
	$(STORAGE_DRIVER_LVM_SOURCES)
libvirt_storage_backend_logical_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1470
storagebackend_LTLIBRARIES += libvirt_storage_backend_logical.la
1471
libvirt_storage_backend_logical_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1472
libvirt_storage_backend_logical_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1473
endif WITH_STORAGE_LVM
1474

1475
if WITH_STORAGE_ISCSI
1476 1477 1478 1479 1480 1481 1482
libvirt_storage_backend_iscsi_la_SOURCES = \
	$(STORAGE_DRIVER_ISCSI_SOURCES)
libvirt_storage_backend_iscsi_la_CFLAGS = \
	-I$(srcdir)/conf \
	-I$(srcdir)/secret \
	$(AM_CFLAGS)

1483
storagebackend_LTLIBRARIES += libvirt_storage_backend_iscsi.la
1484
libvirt_storage_backend_iscsi_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1485
libvirt_storage_backend_iscsi_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1486
endif WITH_STORAGE_ISCSI
1487

1488
if WITH_STORAGE_SCSI
1489 1490 1491 1492 1493
libvirt_storage_backend_scsi_la_SOURCES = $(STORAGE_DRIVER_SCSI_SOURCES)
libvirt_storage_backend_scsi_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1494
storagebackend_LTLIBRARIES += libvirt_storage_backend_scsi.la
1495
libvirt_storage_backend_scsi_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1496
libvirt_storage_backend_scsi_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1497
endif WITH_STORAGE_SCSI
1498

D
Dave Allan 已提交
1499
if WITH_STORAGE_MPATH
1500 1501 1502
libvirt_storage_backend_mpath_la_SOURCES = \
	$(STORAGE_DRIVER_MPATH_SOURCES)
libvirt_storage_backend_mpath_la_LIBADD = $(DEVMAPPER_LIBS)
1503
libvirt_storage_backend_mpath_la_CFLAGS = \
1504 1505 1506 1507
	-I$(srcdir)/conf \
	$(DEVMAPPER_CFLAGS) \
	$(AM_CFLAGS)

1508
storagebackend_LTLIBRARIES += libvirt_storage_backend_mpath.la
1509
libvirt_storage_backend_mpath_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1510
libvirt_storage_backend_mpath_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1511
endif WITH_STORAGE_MPATH
D
Dave Allan 已提交
1512

1513
if WITH_STORAGE_DISK
1514
libvirt_storage_backend_disk_la_SOURCES = $(STORAGE_DRIVER_DISK_SOURCES)
1515
libvirt_storage_backend_disk_la_CFLAGS = \
1516 1517 1518
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1519
storagebackend_LTLIBRARIES += libvirt_storage_backend_disk.la
1520
libvirt_storage_backend_disk_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1521
libvirt_storage_backend_disk_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1522
endif WITH_STORAGE_DISK
1523

1524
if WITH_STORAGE_RBD
1525 1526 1527 1528 1529 1530 1531
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)

1532
storagebackend_LTLIBRARIES += libvirt_storage_backend_rbd.la
1533
libvirt_storage_backend_rbd_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1534
libvirt_storage_backend_rbd_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1535
endif WITH_STORAGE_RBD
1536

1537
if WITH_STORAGE_SHEEPDOG
1538 1539 1540 1541 1542 1543
libvirt_storage_backend_sheepdog_la_SOURCES = \
	$(STORAGE_DRIVER_SHEEPDOG_SOURCES)
libvirt_storage_backend_sheepdog_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1544 1545 1546 1547 1548 1549 1550 1551 1552
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
1553
libvirt_storage_backend_sheepdog_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1554
libvirt_storage_backend_sheepdog_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1555
endif WITH_STORAGE_SHEEPDOG
1556

1557
if WITH_STORAGE_GLUSTER
1558 1559 1560 1561 1562 1563 1564 1565
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)

1566
storagebackend_LTLIBRARIES += libvirt_storage_backend_gluster.la
1567
libvirt_storage_backend_gluster_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1568
libvirt_storage_backend_gluster_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1569 1570
endif WITH_STORAGE_GLUSTER

R
Roman Bogorodskiy 已提交
1571
if WITH_STORAGE_ZFS
1572
libvirt_storage_backend_zfs_la_SOURCES = $(STORAGE_DRIVER_ZFS_SOURCES)
1573
libvirt_storage_backend_zfs_la_CFLAGS = \
1574 1575 1576
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1577
storagebackend_LTLIBRARIES += libvirt_storage_backend_zfs.la
1578
libvirt_storage_backend_zfs_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1579
libvirt_storage_backend_zfs_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
R
Roman Bogorodskiy 已提交
1580 1581
endif WITH_STORAGE_ZFS

1582
if WITH_STORAGE_VSTORAGE
1583 1584
libvirt_storage_backend_vstorage_la_SOURCES = \
	$(STORAGE_DRIVER_VSTORAGE_SOURCES)
1585
libvirt_storage_backend_vstorage_la_CFLAGS = \
1586 1587 1588
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1589
storagebackend_LTLIBRARIES += libvirt_storage_backend_vstorage.la
1590
libvirt_storage_backend_vstorage_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1591
libvirt_storage_backend_vstorage_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1592 1593
endif WITH_STORAGE_VSTORAGE

1594 1595 1596 1597 1598
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)

1599
libvirt_driver_nodedev_la_CFLAGS = \
1600 1601
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1602
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1603
libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1604
libvirt_driver_nodedev_la_LIBADD =
1605

1606
if WITH_HAL
1607 1608
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS)
1609
libvirt_driver_nodedev_la_LIBADD += $(HAL_LIBS)
1610
endif WITH_HAL
1611
if WITH_UDEV
1612
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES)
1613
libvirt_driver_nodedev_la_CFLAGS += $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS)
1614
libvirt_driver_nodedev_la_LIBADD += $(UDEV_LIBS) $(PCIACCESS_LIBS)
1615
endif WITH_UDEV
1616

1617
libvirt_driver_nodedev_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1618
endif WITH_NODE_DEVICES
1619 1620


1621
if WITH_NWFILTER
1622 1623 1624
noinst_LTLIBRARIES += libvirt_driver_nwfilter_impl.la
libvirt_driver_nwfilter_la_SOURCES =
libvirt_driver_nwfilter_la_LIBADD = libvirt_driver_nwfilter_impl.la
1625
mod_LTLIBRARIES += libvirt_driver_nwfilter.la
1626
libvirt_driver_nwfilter_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1627
libvirt_driver_nwfilter_impl_la_CFLAGS = \
1628 1629 1630
		$(LIBPCAP_CFLAGS) \
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1631 1632
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1633
		$(AM_CFLAGS)
1634 1635 1636 1637 1638
libvirt_driver_nwfilter_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_nwfilter_impl_la_LIBADD = \
		$(LIBPCAP_LIBS) \
		$(LIBNL_LIBS) \
		$(DBUS_LIBS)
1639
libvirt_driver_nwfilter_impl_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1640
libvirt_driver_nwfilter_impl_la_SOURCES = $(NWFILTER_DRIVER_SOURCES)
1641
endif WITH_NWFILTER
1642 1643


1644 1645 1646 1647
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 = \
1648
		-I$(srcdir)/conf $(AM_CFLAGS)
1649
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
1650
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
1651
if WITH_SECDRIVER_SELINUX
1652 1653
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
1654
endif WITH_SECDRIVER_SELINUX
J
Jamie Strandboge 已提交
1655
if WITH_SECDRIVER_APPARMOR
1656 1657
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
1658
endif WITH_SECDRIVER_APPARMOR
1659

1660 1661
libvirt_driver_access_la_SOURCES = \
	$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
1662 1663 1664
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
1665
		-I$(srcdir)/conf $(AM_CFLAGS)
1666 1667 1668
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD =

1669 1670
EXTRA_DIST += access/genpolkit.pl

1671 1672 1673 1674
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
    $(srcdir)/access/genpolkit.pl Makefile.am
	$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@

1675 1676 1677 1678
if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)

polkitactiondir = $(datadir)/polkit-1/actions
1679
if WITH_LIBVIRTD
1680
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
1681
endif WITH_LIBVIRTD
1682 1683 1684

CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
1685
else ! WITH_POLKIT1
1686
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
1687
endif ! WITH_POLKIT1
1688

1689

1690 1691
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705

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

1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718
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 已提交
1719
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
1720 1721
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1722 1723 1724
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
1725 1726
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1727 1728
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
	  > $(srcdir)/access/viraccessapicheck.c
1729

E
Eric Blake 已提交
1730
access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
1731 1732
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1733 1734 1735
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheckqemu.h
access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
1736 1737
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1738 1739
	  qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h \
	  > $(srcdir)/access/viraccessapicheckqemu.c
1740

E
Eric Blake 已提交
1741
access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
1742 1743
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1744 1745 1746
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/access/viraccessapichecklxc.h
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
1747 1748
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1749 1750
	  lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \
	  > $(srcdir)/access/viraccessapichecklxc.c
1751

1752
# Add all conditional sources just in case...
1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780
EXTRA_DIST += \
		$(REMOTE_DRIVER_SOURCES) \
		$(XEN_DRIVER_SOURCES) \
		$(LXC_DRIVER_SOURCES) \
		$(XENAPI_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) \
1781
		$(ACCESS_DRIVER_POLKIT_POLICY)
1782

1783 1784
check-local: check-augeas

1785 1786 1787 1788
.PHONY: check-augeas \
	check-augeas-lxc \
	check-augeas-sanlock \
	check-augeas-lockd \
1789
	check-augeas-libvirtd \
1790
	$(NULL)
1791

1792 1793
check-augeas: $(AUGEAS_DIRS:%=check-augeas-%) \
	check-augeas-lxc check-augeas-sanlock \
1794
	check-augeas-lockd check-augeas-virtlockd \
1795
	check-augeas-virtlogd check-augeas-libvirtd
1796

1797
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
1798
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
1799

1800
if WITH_LXC
1801 1802
test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
		$(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1803
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
1804

1805
check-augeas-lxc: test_libvirtd_lxc.aug
1806
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1807
	    '$(AUGPARSE)' -I $(srcdir)/lxc test_libvirtd_lxc.aug; \
1808
	fi
1809
else ! WITH_LXC
1810
check-augeas-lxc:
1811
endif ! WITH_LXC
1812

1813
if WITH_SANLOCK
1814 1815
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1816
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
1817

1818
check-augeas-sanlock: test_libvirt_sanlock.aug
1819
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1820
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
1821
	fi
1822
else ! WITH_SANLOCK
1823
check-augeas-sanlock:
1824
endif ! WITH_SANLOCK
1825

1826
if WITH_QEMU
1827 1828 1829
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 $< $@
1830 1831 1832
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
1833

1834 1835
test_virtlockd.aug: locking/test_virtlockd.aug.in \
		locking/virtlockd.conf $(AUG_GENTEST)
1836
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
1837

1838
if WITH_QEMU
1839 1840 1841 1842
check-augeas-lockd: test_libvirt_lockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_lockd.aug; \
	fi
1843 1844 1845
else ! WITH_QEMU
check-augeas-lockd:
endif ! WITH_QEMU
1846

1847 1848 1849 1850 1851
check-augeas-virtlockd: test_virtlockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
	fi

1852

1853 1854 1855 1856 1857 1858 1859 1860 1861
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

1862 1863 1864
if WITH_LIBVIRTD
test_libvirtd.aug: remote/test_libvirtd.aug.in \
		remote/libvirtd.conf $(AUG_GENTEST)
1865
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/remote/libvirtd.conf $< $@
1866 1867 1868 1869 1870 1871 1872 1873

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
1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892
#
# 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.
#

1893
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
1894

1895
if WITH_LINUX
1896
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
1897
else ! WITH_LINUX
1898
SYM_FILES += $(srcdir)/libvirt_linux.syms
1899
endif ! WITH_LINUX
1900

E
Eric Blake 已提交
1901 1902 1903 1904 1905 1906
if WITH_REMOTE
USED_SYM_FILES += $(srcdir)/libvirt_remote.syms
else ! WITH_REMOTE
SYM_FILES += $(srcdir)/libvirt_remote.syms
endif ! WITH_REMOTE

1907
if WITH_VMX
1908
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
1909
else ! WITH_VMX
1910
SYM_FILES += $(srcdir)/libvirt_vmx.syms
1911
endif ! WITH_VMX
1912

1913
if WITH_SASL
1914
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
1915
else ! WITH_SASL
1916
SYM_FILES += $(srcdir)/libvirt_sasl.syms
1917
endif ! WITH_SASL
E
Eric Blake 已提交
1918

1919 1920
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
1921
else ! WITH_GNUTLS
1922
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
1923
endif ! WITH_GNUTLS
1924

1925
if WITH_SSH2
1926
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
1927
else ! WITH_SSH2
1928
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
1929
endif ! WITH_SSH2
1930

1931
if WITH_ATOMIC_OPS_PTHREAD
1932
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
1933
else ! WITH_ATOMIC_OPS_PTHREAD
1934
SYM_FILES += $(srcdir)/libvirt_atomic.syms
1935
endif ! WITH_ATOMIC_OPS_PTHREAD
1936

1937 1938 1939 1940 1941 1942
if WITH_LIBSSH
USED_SYM_FILES += $(srcdir)/libvirt_libssh.syms
else ! WITH_LIBSSH
SYM_FILES += $(srcdir)/libvirt_libssh.syms
endif ! WITH_LIBSSH

1943
EXTRA_DIST += \
1944 1945 1946 1947 1948 1949
	libvirt_public.syms \
	libvirt_lxc.syms \
	libvirt_qemu.syms \
	libvirt_admin_public.syms \
	$(SYM_FILES) \
	$(ADMIN_SYM_FILES) \
1950
	$(NULL)
1951

1952
BUILT_SOURCES += $(GENERATED_SYM_FILES)
1953

1954 1955
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(ACCESS_DRIVER_SYM_FILES) \
1956
		$(top_builddir)/config.status
1957 1958 1959 1960 1961 1962
	$(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 && \
1963
	cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
1964 1965
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
1966
	mv $@-tmp libvirt.syms
1967

1968
%.def: %.syms
1969 1970
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
1971
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d' \
1972
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
1973
	chmod a-w $@-tmp && \
1974
	mv $@-tmp $@
1975

1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988
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

1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003

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) \
2004
		$(XDR_CFLAGS) \
2005 2006 2007 2008 2009 2010
		-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)

2011 2012 2013 2014
# 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 已提交
2015 2016
lib_LTLIBRARIES += libvirt-admin.la
libvirt_admin_la_SOURCES = \
2017 2018
		libvirt-admin.c \
		$(ADMIN_PROTOCOL_GENERATED) \
M
Martin Kletzander 已提交
2019 2020 2021
		$(DATATYPES_SOURCES)

libvirt_admin_la_LDFLAGS = \
2022 2023
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_ADMIN_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
2024
		$(AM_LDFLAGS)
M
Martin Kletzander 已提交
2025 2026

libvirt_admin_la_LIBADD = \
2027
		libvirt.la \
M
Martin Kletzander 已提交
2028 2029 2030
		$(CYGWIN_EXTRA_LIBADD)

libvirt_admin_la_CFLAGS = \
2031 2032 2033
		$(AM_CFLAGS) \
		-I$(srcdir)/remote \
		-I$(srcdir)/rpc \
M
Martin Kletzander 已提交
2034 2035 2036
		-I$(srcdir)/admin

libvirt_admin_la_CFLAGS += \
2037 2038 2039 2040 2041 2042
		$(XDR_CFLAGS) \
		$(CAPNG_CFLAGS) \
		$(YAJL_CFLAGS) \
		$(SSH2_CFLAGS) \
		$(SASL_CFLAGS) \
		$(GNUTLS_CFLAGS) \
2043
		$(LIBSSH_CFLAGS)
M
Martin Kletzander 已提交
2044 2045

libvirt_admin_la_LIBADD += \
2046 2047 2048 2049 2050 2051 2052
		$(CAPNG_LIBS) \
		$(YAJL_LIBS) \
		$(DEVMAPPER_LIBS) \
		$(LIBXML_LIBS) \
		$(SSH2_LIBS) \
		$(SASL_LIBS) \
		$(GNUTLS_LIBS) \
2053
		$(LIBSSH_LIBS)
M
Martin Kletzander 已提交
2054

2055 2056
ADMIN_SYM_FILES = $(srcdir)/libvirt_admin_private.syms

M
Martin Kletzander 已提交
2057 2058 2059 2060
if WITH_DTRACE_PROBES
libvirt_admin_la_LIBADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

2061 2062
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
2063 2064 2065 2066
libvirt_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(LIBVIRT_NODELETE) \
2067
		$(NO_UNDEFINED_LDFLAGS) \
D
Daniel P. Berrange 已提交
2068 2069
		$(AM_LDFLAGS) \
		$(NULL)
2070
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
2071
libvirt_la_LIBADD += \
2072
		    $(DRIVER_MODULES_LIBS) \
2073
		    $(CYGWIN_EXTRA_LIBADD)
2074
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
2075 2076 2077 2078 2079 2080
# 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)
2081

2082
if WITH_DTRACE_PROBES
2083
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
2084
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
2085
nodist_libvirt_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2086
if WITH_REMOTE
E
Eric Blake 已提交
2087
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2088
endif WITH_REMOTE
2089
DTRACE2SYSTEMTAP_FLAGS = --with-modules
2090

2091 2092
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

2093 2094

tapsetdir = $(datadir)/systemtap/tapset
2095
tapset_DATA += libvirt_probes.stp libvirt_functions.stp
2096

2097
%_probes.h: %_probes.d
2098 2099
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

E
Eric Blake 已提交
2100
.PRECIOUS: %_probes.o
2101
%_probes.o: %_probes.d
2102 2103
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

2104 2105 2106 2107 2108 2109 2110 2111 2112
%_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 已提交
2113
# Keep this list synced with PROTOCOL_STRUCTS
J
Jiri Denemark 已提交
2114 2115 2116
RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
2117
		  $(srcdir)/remote/lxc_protocol.x \
2118 2119
		  $(srcdir)/remote/qemu_protocol.x \
		  $(srcdir)/lxc/lxc_monitor_protocol.x \
M
Martin Kletzander 已提交
2120 2121
		  $(srcdir)/locking/lock_protocol.x \
		  $(srcdir)/admin/admin_protocol.x
2122 2123

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

2126 2127
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl \
		$(top_builddir)/config.status
2128
	$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
2129
	  $(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
2130

2131
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
2132
              libvirt_functions.stp libvirt_probes.stp
2133
endif WITH_DTRACE_PROBES
2134

2135
EXTRA_DIST += libvirt_probes.d
2136

C
Chris Lalancette 已提交
2137
libvirt_qemu_la_SOURCES = libvirt-qemu.c
D
Daniel P. Berrange 已提交
2138 2139 2140 2141 2142
libvirt_qemu_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
2143
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
C
Chris Lalancette 已提交
2144
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
2145

2146
libvirt_lxc_la_SOURCES = libvirt-lxc.c
D
Daniel P. Berrange 已提交
2147 2148 2149 2150 2151
libvirt_lxc_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
2152 2153 2154
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)

2155 2156 2157 2158 2159 2160 2161
# 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
2162
if WITH_SETUID_RPC_CLIENT
2163 2164
noinst_LTLIBRARIES += libvirt-setuid-rpc-client.la

2165 2166
libvirt_setuid_rpc_client_la_SOURCES = \
		util/viralloc.c \
2167
		util/virarch.c \
2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232
		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 \
2233 2234
		$(NULL)

2235 2236 2237 2238
libvirt_setuid_rpc_client_la_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(LIBXML_LIBS) \
		$(SECDRIVER_LIBS) \
2239
		$(NULL)
2240 2241 2242 2243 2244 2245 2246
libvirt_setuid_rpc_client_la_CFLAGS = \
		-DLIBVIRT_SETUID_RPC_CLIENT \
		-I$(srcdir)/conf \
		-I$(srcdir)/rpc \
		$(AM_CFLAGS) \
		$(SECDRIVER_CFLAGS) \
		$(XDR_CFLAGS) \
2247
		$(NULL)
2248
endif WITH_SETUID_RPC_CLIENT
2249

2250 2251 2252
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

2253
if WITH_LIBVIRTD
2254 2255 2256 2257 2258
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
		$(LOCK_DRIVER_LOCKD_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
		$(NULL)
2259
lockd_la_CFLAGS = -I$(srcdir)/conf \
E
Eric Blake 已提交
2260 2261
		$(XDR_CFLAGS) \
		$(AM_CFLAGS)
2262
lockd_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
2263
lockd_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
J
Jiri Denemark 已提交
2264
augeas_DATA += locking/libvirt_lockd.aug
2265 2266
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
2267
endif WITH_DTRACE_PROBES
2268
if WITH_QEMU
2269 2270
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
2271
nodist_conf_DATA += locking/qemu-lockd.conf
2272 2273
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
2274
endif WITH_QEMU
2275

2276 2277 2278 2279 2280 2281
if WITH_LIBXL
nodist_conf_DATA += locking/libxl-lockd.conf
BUILT_SOURCES += locking/libxl-lockd.conf
DISTCLEANFILES += locking/libxl-lockd.conf
endif WITH_LIBXL

2282 2283 2284 2285 2286
locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
	$(AM_V_GEN)$(MKDIR_P) locking ; \
	cp $< $@


2287
sbin_PROGRAMS += virtlockd virtlogd
2288

2289 2290 2291
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
2292
		$(LOCK_DAEMON_GENERATED) \
2293
		$(NULL)
2294 2295
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
2296
		$(PIE_CFLAGS) \
2297
		$(XDR_CFLAGS) \
2298 2299 2300
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
2301
		$(PIE_LDFLAGS) \
2302
		$(NO_UNDEFINED_LDFLAGS) \
2303 2304
		$(NULL)
virtlockd_LDADD = \
2305
		libvirt_driver_admin.la \
2306 2307 2308 2309 2310 2311 2312 2313
		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
2314
endif WITH_DTRACE_PROBES
2315

2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329

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) \
2330
		$(NO_UNDEFINED_LDFLAGS) \
2331 2332
		$(NULL)
virtlogd_LDADD = \
2333
		libvirt_driver_admin.la \
2334 2335 2336 2337 2338 2339 2340 2341 2342 2343
		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

2344
else ! WITH_LIBVIRTD
2345
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
2346 2347
              $(LOCK_DRIVER_LOCKD_SOURCES) \
	      $(LOG_DAEMON_SOURCES)
2348
endif ! WITH_LIBVIRTD
2349

2350
SYSCONF_FILES = \
2351
	locking/virtlockd.sysconf \
2352
	logging/virtlogd.sysconf \
2353
	remote/libvirtd.sysconf \
2354 2355 2356
	$(NULL)

EXTRA_DIST += \
J
Jiri Denemark 已提交
2357 2358
	locking/lockd.conf \
	locking/libvirt_lockd.aug \
2359
	locking/test_libvirt_lockd.aug.in \
2360 2361
	$(SYSCONF_FILES) \
	$(NULL)
2362 2363

install-sysconfig:
E
Eric Blake 已提交
2364
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
2365 2366 2367
	for f in $(SYSCONF_FILES:%.sysconf=%) ; \
	do \
	  tgt=`basename $$f`; \
2368 2369
	  $(INSTALL_SCRIPT) $(srcdir)/$$f.sysconf \
	      $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
2370
	done
2371 2372

uninstall-sysconfig:
2373 2374 2375 2376 2377
	for f in $(SYSCONF_FILES:%.sysconf=%) ; \
	do \
	  tgt=`basename $$f`; \
	  rm -f $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
	done
E
Eric Blake 已提交
2378
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
2379

2380 2381 2382
SYSVINIT_FILES_IN = \
	locking/virtlockd.init.in \
	logging/virtlogd.init.in \
2383
	remote/libvirtd.init.in \
2384 2385 2386 2387 2388
	$(NULL)

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

EXTRA_DIST += $(SYSVINIT_FILES_IN)
2389

2390 2391 2392 2393 2394 2395 2396 2397 2398 2399
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)

2400
if WITH_LIBVIRTD
2401

2402 2403 2404
LOGROTATE_FILES := $(LOGROTATE_FILES_IN:remote/%.in=%)

BUILT_SOURCES += $(LOGROTATE_FILES)
2405
CLEANFILES += $(LOGROTATE_FILES)
2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425

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

2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464
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

2465
if LIBVIRT_INIT_SCRIPT_RED_HAT
2466
install-init:: $(SYSVINIT_FILES) install-sysconfig
E
Eric Blake 已提交
2467
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
2468 2469 2470 2471
	for f in $(SYSVINIT_FILES:%.init=%) ; \
	do \
	  $(INSTALL_SCRIPT) $$f.init $(DESTDIR)$(sysconfdir)/rc.d/init.d/$$f; \
	done
2472 2473

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

2477 2478
BUILT_SOURCES += $(SYSVINIT_FILES)
DISTCLEANFILES += $(SYSVINIT_FILES)
2479
else ! LIBVIRT_INIT_SCRIPT_RED_HAT
2480 2481
install-init::
uninstall-init::
2482 2483
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
else ! WITH_LIBVIRTD
2484 2485 2486 2487
install-polkit::
uninstall-polkit::
install-sysctl::
uninstall-sysctl::
2488 2489
install-init::
uninstall-init::
2490 2491
install-logrotate::
uninstall-logrotate::
2492
endif ! WITH_LIBVIRTD
2493

2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510
# 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


2511 2512 2513 2514 2515 2516 2517 2518 2519
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 $@

2520
virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
2521 2522 2523 2524 2525 2526
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    < $< > $@-t && \
	    chmod a+x $@-t && \
2527 2528
	    mv $@-t $@

2529
virtlogd.init: logging/virtlogd.init.in $(top_builddir)/config.status
2530 2531 2532 2533 2534 2535
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    < $< > $@-t && \
	    chmod a+x $@-t && \
2536 2537
	    mv $@-t $@

2538
virtlockd.8.in: locking/virtlockd.pod
2539 2540 2541 2542 2543 2544 2545 2546
	$(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 $@
2547

2548
virtlogd.8.in: logging/virtlogd.pod
2549 2550 2551 2552 2553 2554 2555 2556
	$(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 $@
2557

2558 2559 2560 2561 2562 2563 2564 2565 2566 2567
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 $@

2568
%.8: %.8.in $(top_srcdir)/configure.ac
2569
	$(AM_V_GEN)sed \
2570 2571 2572
		-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
		-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
		< $< > $@-t && \
2573 2574
	mv $@-t $@

2575
if WITH_LIBVIRTD
2576
man8_MANS = virtlockd.8 virtlogd.8 libvirtd.8
2577

2578
conf_DATA += locking/virtlockd.conf logging/virtlogd.conf
2579

2580 2581
augeas_DATA += locking/virtlockd.aug logging/virtlogd.aug
augeastest_DATA += test_virtlockd.aug test_virtlogd.aug
2582
endif WITH_LIBVIRTD
2583

A
Andrea Bolognani 已提交
2584 2585 2586
PODFILES = \
	locking/virtlockd.pod \
	logging/virtlogd.pod \
2587
	remote/libvirtd.pod \
A
Andrea Bolognani 已提交
2588 2589 2590 2591 2592
	$(NULL)

MANINFILES = \
	virtlockd.8.in \
	virtlogd.8.in \
2593
	libvirtd.8.in \
A
Andrea Bolognani 已提交
2594 2595 2596 2597
	$(NULL)

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

2599 2600 2601 2602 2603 2604 2605
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 \
2606 2607
	remote/libvirtd.service.in \
	remote/virt-guest-shutdown.target.in \
2608 2609
	$(NULL)

2610
EXTRA_DIST += \
2611
        $(SYSTEMD_UNIT_FILES_IN) \
2612 2613 2614
        locking/virtlockd.aug \
        locking/virtlockd.conf \
        locking/test_virtlockd.aug.in \
2615 2616 2617
        logging/virtlogd.aug \
        logging/virtlogd.conf \
        logging/test_virtlogd.aug.in \
A
Andrea Bolognani 已提交
2618 2619
        $(PODFILES) \
        $(MANINFILES) \
2620
        $(NULL)
2621

2622 2623 2624 2625

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

2626
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
2627
SYSTEMD_UNIT_FILES = $(notdir $(SYSTEMD_UNIT_FILES_IN:%.in=%))
2628

2629 2630
BUILT_SOURCES += $(SYSTEMD_UNIT_FILES)
DISTCLEANFILES += $(SYSTEMD_UNIT_FILES)
2631

2632
install-systemd: $(SYSTEMD_UNIT_FILES) install-sysconfig
E
Eric Blake 已提交
2633
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
2634 2635 2636 2637
	for f in $(SYSTEMD_UNIT_FILES); \
	do \
	  $(INSTALL_DATA) $$f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/ ; \
	done
2638 2639

uninstall-systemd: uninstall-sysconfig
2640
	rm -f $(SYSTEMD_UNIT_FILES:%=$(DESTDIR)$(SYSTEMD_UNIT_DIR)/%)
E
Eric Blake 已提交
2641
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
2642
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
2643 2644
install-systemd:
uninstall-systemd:
2645 2646
endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
else ! WITH_LIBVIRTD
2647 2648
install-systemd:
uninstall-systemd:
2649
endif ! WITH_LIBVIRTD
2650

2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662
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 $< $@

2663
virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
2664 2665 2666
	$(AM_V_GEN)sed \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    < $< > $@-t && \
2667 2668 2669
	    mv $@-t $@

virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
2670 2671 2672
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
2673 2674
	    mv $@-t $@

J
John Ferlan 已提交
2675 2676 2677 2678 2679 2680 2681
virtlockd-admin.socket: locking/virtlockd-admin.socket.in \
                        $(top_builddir)/config.status
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
	    mv $@-t $@

2682
virtlogd.service: logging/virtlogd.service.in $(top_builddir)/config.status
2683 2684 2685
	$(AM_V_GEN)sed \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    < $< > $@-t && \
2686 2687 2688
	    mv $@-t $@

virtlogd.socket: logging/virtlogd.socket.in $(top_builddir)/config.status
J
John Ferlan 已提交
2689 2690 2691 2692 2693 2694 2695
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
	    mv $@-t $@

virtlogd-admin.socket: logging/virtlogd-admin.socket.in \
                       $(top_builddir)/config.status
2696 2697 2698
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
2699 2700
	    mv $@-t $@

2701

2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715
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` ; \
2716 2717
	  $(INSTALL_SCRIPT) $(srcdir)/$$f.upstart \
	      $(DESTDIR)$(sysconfdir)/event.d/$$tgt ; \
2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735
	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

2736
if WITH_SANLOCK
2737
lockdriver_LTLIBRARIES += sanlock.la
2738
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
2739
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
2740
sanlock_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
2741
sanlock_la_LIBADD = -lsanlock_client libvirt.la ../gnulib/lib/libgnu.la
2742 2743

augeas_DATA += locking/libvirt_sanlock.aug
2744 2745
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
2746

E
Eric Blake 已提交
2747
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
2748
	$(AM_V_GEN)$(MKDIR_P) locking ; \
2749 2750 2751
	cp $< $@

if WITH_QEMU
2752
nodist_conf_DATA += locking/qemu-sanlock.conf
2753
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
2754
DISTCLEANFILES += locking/qemu-sanlock.conf
2755
endif WITH_QEMU
2756 2757 2758 2759 2760 2761

if WITH_LIBXL
nodist_conf_DATA += locking/libxl-sanlock.conf
BUILT_SOURCES += locking/libxl-sanlock.conf
DISTCLEANFILES += locking/libxl-sanlock.conf
endif WITH_LIBXL
2762
else ! WITH_SANLOCK
2763
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
2764
endif ! WITH_SANLOCK
2765 2766
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
2767
	locking/test_libvirt_sanlock.aug.in
2768

2769 2770 2771 2772
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
2773

2774 2775 2776 2777 2778
libvirt_la_BUILT_LIBADD += \
       libvirt-net-rpc.la \
       libvirt-net-rpc-server.la \
       libvirt-net-rpc-client.la

2779
EXTRA_DIST += \
E
Eric Blake 已提交
2780 2781 2782 2783
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
2784 2785
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
2786

E
Eric Blake 已提交
2787
VIR_NET_RPC_GENERATED = \
2788 2789 2790 2791
	rpc/virnetprotocol.h \
	rpc/virnetprotocol.c \
	rpc/virkeepaliveprotocol.h \
	rpc/virkeepaliveprotocol.c
2792

2793
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2794

2795
libvirt_net_rpc_la_SOURCES = \
2796
	rpc/virnetmessage.h rpc/virnetmessage.c \
2797
	rpc/virnetsocket.h rpc/virnetsocket.c \
2798 2799
	rpc/virkeepalive.h rpc/virkeepalive.c \
	$(VIR_NET_RPC_GENERATED)
2800
if WITH_SSH2
2801 2802
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2803
else ! WITH_SSH2
2804 2805
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2806
endif ! WITH_SSH2
2807
if WITH_GNUTLS
2808 2809
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2810
else ! WITH_GNUTLS
2811 2812
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2813
endif ! WITH_GNUTLS
2814
if WITH_SASL
2815 2816
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2817
else ! WITH_SASL
2818 2819
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2820
endif ! WITH_SASL
2821 2822 2823 2824 2825 2826 2827
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
2828
libvirt_net_rpc_la_CFLAGS = \
2829
			$(GNUTLS_CFLAGS) \
2830
			$(SASL_CFLAGS) \
2831
			$(SSH2_CFLAGS) \
2832
			$(LIBSSH_CFLAGS) \
2833
			$(XDR_CFLAGS) \
2834 2835
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
2836
			$(GNUTLS_LIBS) \
2837
			$(SASL_LIBS) \
2838
			$(SSH2_LIBS)\
2839
			$(LIBSSH_LIBS) \
J
Jim Fehlig 已提交
2840
			$(SECDRIVER_LIBS) \
2841
			$(AM_LDFLAGS) \
2842
			$(NULL)
2843 2844 2845
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2846 2847 2848 2849
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
2850
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
2851
	rpc/virnetdaemon.h rpc/virnetdaemon.c \
2852 2853
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
2854
			$(AVAHI_CFLAGS) \
2855
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
2856
			$(XDR_CFLAGS) \
2857
			$(AM_CFLAGS)
2858 2859
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
2860
			$(AVAHI_LIBS) \
2861
			$(DBUS_LIBS) \
2862
			$(NULL)
2863 2864 2865
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2866 2867 2868 2869 2870
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 已提交
2871 2872
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
2873
libvirt_net_rpc_client_la_LDFLAGS = $(AM_LDFLAGS)
2874 2875
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
2876

2877 2878
libexec_PROGRAMS =

2879
if WITH_LIBVIRTD
2880 2881
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2882 2883 2884 2885
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2886 2887
libvirt_iohelper_LDADD = \
		libvirt_util.la \
2888
		../gnulib/lib/libgnu.la
2889 2890
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
2891
endif WITH_DTRACE_PROBES
2892

D
Daniel P. Berrange 已提交
2893 2894 2895 2896
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2897 2898 2899 2900

if WITH_NETWORK
libexec_PROGRAMS += libvirt_leaseshelper
libvirt_leaseshelper_SOURCES = $(NETWORK_LEASES_HELPER_SOURCES)
2901 2902 2903 2904
libvirt_leaseshelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2905 2906
libvirt_leaseshelper_LDADD = \
               libvirt_util.la \
2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919
               ../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

2920
endif WITH_LIBVIRTD
2921

2922
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
2923
if WITH_LIBVIRTD
2924
libexec_PROGRAMS += libvirt_parthelper
2925

2926
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
D
Daniel P. Berrange 已提交
2927 2928 2929 2930
libvirt_parthelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2931 2932 2933
libvirt_parthelper_LDADD = \
		$(LIBPARTED_LIBS) \
		libvirt_util.la \
2934
		../gnulib/lib/libgnu.la
2935 2936
if WITH_DTRACE_PROBES
libvirt_parthelper_LDADD += libvirt_probes.lo
2937
endif WITH_DTRACE_PROBES
2938

D
Daniel P. Berrange 已提交
2939 2940 2941 2942 2943
libvirt_parthelper_CFLAGS = \
		$(LIBPARTED_CFLAGS) \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2944 2945
endif WITH_LIBVIRTD
endif WITH_STORAGE_DISK
2946 2947
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)

2948

2949
if WITH_SANLOCK
2950 2951 2952
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2953
libvirt_sanlock_helper_CFLAGS = \
2954
		-I$(srcdir)/conf \
D
Daniel P. Berrange 已提交
2955 2956 2957 2958 2959 2960 2961
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2962
libvirt_sanlock_helper_LDADD = libvirt.la
2963
endif WITH_SANLOCK
2964

2965 2966 2967 2968
if WITH_LXC
if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_lxc

2969 2970
libvirt_lxc_SOURCES = \
		$(LXC_CONTROLLER_SOURCES) \
O
Osier Yang 已提交
2971
		$(DATATYPES_SOURCES)
D
Daniel P. Berrange 已提交
2972 2973 2974
libvirt_lxc_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
2975 2976
		$(CAPNG_LIBS) \
		$(LIBXML_LIBS) \
D
Daniel P. Berrange 已提交
2977
		$(NULL)
2978
libvirt_lxc_LDADD = \
G
Gao feng 已提交
2979
		$(FUSE_LIBS) \
2980
		libvirt.la \
2981
		../gnulib/lib/libgnu.la
2982
if WITH_DTRACE_PROBES
2983
libvirt_lxc_LDADD += libvirt_probes.lo
2984
endif WITH_DTRACE_PROBES
2985
libvirt_lxc_LDADD += $(SECDRIVER_LIBS)
2986 2987 2988 2989
libvirt_lxc_CFLAGS = \
		-I$(srcdir)/conf \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
2990 2991
		$(CAPNG_CFLAGS) \
		$(LIBXML_CFLAGS) \
2992 2993 2994 2995
		$(LIBNL_CFLAGS) \
		$(FUSE_CFLAGS) \
		$(DBUS_CFLAGS) \
		$(XDR_CFLAGS) \
D
Daniel P. Berrange 已提交
2996
		$(NULL)
2997
if WITH_BLKID
2998 2999
libvirt_lxc_CFLAGS += $(BLKID_CFLAGS)
libvirt_lxc_LDADD += $(BLKID_LIBS)
3000
endif WITH_BLKID
J
Jim Fehlig 已提交
3001
libvirt_lxc_CFLAGS += $(SECDRIVER_CFLAGS)
3002 3003
endif WITH_LIBVIRTD
endif WITH_LXC
3004 3005
EXTRA_DIST += $(LXC_CONTROLLER_SOURCES)

J
Jamie Strandboge 已提交
3006 3007 3008 3009 3010 3011
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 已提交
3012 3013 3014 3015
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3016 3017 3018 3019 3020
virt_aa_helper_LDADD = \
		libvirt.la \
		libvirt_conf.la \
		libvirt_util.la \
		libvirt_driver_storage_impl.la \
C
Chris Lalancette 已提交
3021
		../gnulib/lib/libgnu.la
3022
if WITH_DTRACE_PROBES
3023
virt_aa_helper_LDADD += libvirt_probes.lo
3024
endif WITH_DTRACE_PROBES
3025 3026 3027 3028 3029
virt_aa_helper_CFLAGS = \
		-I$(srcdir)/conf \
		-I$(srcdir)/security \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
D
Daniel P. Berrange 已提交
3030
		$(NULL)
3031 3032
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
J
Jamie Strandboge 已提交
3033 3034
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

3035
if WITH_NSS
3036 3037
noinst_LTLIBRARIES += libvirt-nss.la

3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086
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 \
3087 3088
		$(NULL)

3089 3090 3091 3092
libvirt_nss_la_CFLAGS = \
		-DLIBVIRT_NSS \
		$(AM_CFLAGS) \
		$(YAJL_CFLAGS) \
3093
		$(NULL)
3094 3095
libvirt_nss_la_LDFLAGS = \
		$(AM_LDFLAGS) \
3096 3097
		$(NULL)

3098 3099
libvirt_nss_la_LIBADD = \
		$(YAJL_LIBS) \
3100
		$(NULL)
3101
endif WITH_NSS
3102 3103


3104
install-data-local: install-init install-systemd install-upstart \
3105
		install-sysctl install-polkit install-sasl \
3106
		install-logrotate install-data-extra
3107
if WITH_LIBVIRTD
3108
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt"
3109
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
3110
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
3111
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
3112
endif WITH_LIBVIRTD
3113 3114
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
3115
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
3116
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
3117
if WITH_SANLOCK
3118
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
3119
endif WITH_SANLOCK
3120 3121 3122
if WITH_LXC
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lxc"
3123
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/lxc"
3124
endif WITH_LXC
3125 3126
if WITH_XEN
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/xen"
3127
endif WITH_XEN
3128 3129
if WITH_NETWORK
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network"
3130
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq"
3131
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/network"
3132
	$(MKDIR_P) "$(DESTDIR)$(confdir)/qemu/networks/autostart"
3133
	$(INSTALL_DATA) $(srcdir)/network/default.xml \
3134
	  $(DESTDIR)$(confdir)/qemu/networks/default.xml
3135
	test -z "$(UUID)" || \
3136 3137 3138
	  { sed -e "s,</name>,</name>;  <uuid>$(UUID)</uuid>," \
	      $(DESTDIR)$(confdir)/qemu/networks/default.xml | \
	      tr ";" "\n" > \
3139 3140 3141 3142
	      $(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 已提交
3143
	( cd $(DESTDIR)$(confdir)/qemu/networks/autostart && \
3144 3145
	  rm -f default.xml && \
	  $(LN_S) ../default.xml default.xml )
3146
endif WITH_NETWORK
3147

3148
uninstall-local:: uninstall-init uninstall-systemd uninstall-upstart \
3149
		uninstall-sysctl uninstall-polkit uninstall-sasl \
3150
		uninstall-logrotate uninstall-data-extra
3151
if WITH_LIBVIRTD
3152
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt" ||:
3153
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
3154 3155
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
3156
endif WITH_LIBVIRTD
3157 3158
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
3159
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
3160
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
3161
if WITH_SANLOCK
3162
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
3163
endif WITH_SANLOCK
3164 3165 3166
if WITH_LXC
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||:
3167
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/lxc" ||:
3168
endif WITH_LXC
3169 3170
if WITH_XEN
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/xen" ||:
3171
endif WITH_XEN
3172
if WITH_NETWORK
3173 3174 3175 3176
	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" || :
3177 3178
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||:
3179
endif WITH_NETWORK
3180
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
3181

3182 3183
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
3184 3185 3186 3187 3188
MAINTAINERCLEANFILES += \
	$(REMOTE_DRIVER_GENERATED) \
	$(LIBVIRTD_GENERATED) \
	$(VIR_NET_RPC_GENERATED) \
	$(NULL)