Makefile.am 79.8 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
libexec_PROGRAMS =
RPC_PROBE_FILES =
84 85

include uml/Makefile.inc.am
86
include phyp/Makefile.inc.am
87
include test/Makefile.inc.am
88
include esx/Makefile.inc.am
89
include hyperv/Makefile.inc.am
90
include vmware/Makefile.inc.am
91
include vbox/Makefile.inc.am
92
include openvz/Makefile.inc.am
93
include qemu/Makefile.inc.am
94
include bhyve/Makefile.inc.am
95
include xenconfig/Makefile.inc.am
96
include libxl/Makefile.inc.am
97
include xen/Makefile.inc.am
98
include xenapi/Makefile.inc.am
99
include vz/Makefile.inc.am
100
include lxc/Makefile.inc.am
101
include interface/Makefile.inc.am
102
include network/Makefile.inc.am
103
include nwfilter/Makefile.inc.am
104
include node_device/Makefile.inc.am
105
include secret/Makefile.inc.am
106

107

E
Eric Blake 已提交
108 109
THREAD_LIBS = $(LIB_PTHREAD) $(LTLIBMULTITHREAD)

J
Jim Fehlig 已提交
110
SECDRIVER_CFLAGS =
111 112
SECDRIVER_LIBS =
if WITH_SECDRIVER_SELINUX
J
Jim Fehlig 已提交
113
SECDRIVER_CFLAGS += $(SELINUX_CFLAGS)
114
SECDRIVER_LIBS += $(SELINUX_LIBS)
115
endif WITH_SECDRIVER_SELINUX
116
if WITH_SECDRIVER_APPARMOR
J
Jim Fehlig 已提交
117
SECDRIVER_CFLAGS += $(APPARMOR_CFLAGS)
118
SECDRIVER_LIBS += $(APPARMOR_LIBS)
119
endif WITH_SECDRIVER_APPARMOR
120

121

122
lib_LTLIBRARIES = libvirt.la libvirt-qemu.la libvirt-lxc.la
123

124
moddir = $(libdir)/libvirt/connection-driver
125
sbin_PROGRAMS =
126

A
Amy Griffis 已提交
127
confdir = $(sysconfdir)/libvirt
128
conf_DATA += libvirt.conf libvirt-admin.conf
129

130 131 132 133
augeasdir = $(datadir)/augeas/lenses

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

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

240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264
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

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 290 291 292 293 294
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 $@

295
KEYCODES = linux osx atset1 atset2 atset3 xtkbd usb win32 rfb
296 297 298 299 300 301 302
KEYNAMES = linux osx win32

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

303 304 305 306 307 308
KEYPODS = $(KEYCODES:%=util/virkeycode-%.pod) \
	  $(KEYNAMES:%=util/virkeyname-%.pod)
KEYMANS = $(KEYPODS:%.pod=%.7)

man7_MANS = $(KEYMANS)

309 310 311
UTIL_SOURCES += $(KEYTABLES)
BUILT_SOURCES += $(KEYTABLES)
MAINTAINERCLEANFILES += $(KEYTABLES)
312
CLEANFILES += $(KEYMANS) $(KEYPODS)
L
Lai Jiangshan 已提交
313

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

347 348 349
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

350 351
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
352

353
LOCK_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
354 355
		locking/lock_protocol.h \
		locking/lock_protocol.c \
356 357
		$(NULL)

358 359 360
LOCK_PROTOCOL = $(srcdir)/locking/lock_protocol.x
EXTRA_DIST += $(LOCK_PROTOCOL) \
	$(LOCK_PROTOCOL_GENERATED)
361 362 363
BUILT_SOURCES += $(LOCK_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(LOCK_PROTOCOL_GENERATED)

364
LOCK_DAEMON_GENERATED = \
365
		locking/lock_daemon_dispatch_stubs.h
366 367 368
		$(NULL)

BUILT_SOURCES += $(LOCK_DAEMON_GENERATED)
369
EXTRA_DIST += $(LOCK_DAEMON_GENERATED)
370 371
MAINTAINERCLEANFILES += $(LOCK_DAEMON_GENERATED)

372 373
LOCK_DRIVER_LOCKD_SOURCES = \
		locking/lock_driver_lockd.c \
374
		locking/lock_driver_lockd.h \
375 376
		$(NULL)

377 378 379 380 381
LOCK_DAEMON_SOURCES = \
		locking/lock_daemon.h \
		locking/lock_daemon.c \
		locking/lock_daemon_config.h \
		locking/lock_daemon_config.c \
382 383
		locking/lock_daemon_dispatch.c \
		locking/lock_daemon_dispatch.h \
384 385
		$(NULL)

E
Eric Blake 已提交
386
locking/lock_daemon_dispatch_stubs.h: $(LOCK_PROTOCOL) \
387
		$(srcdir)/rpc/gendispatch.pl Makefile.am
388 389
	$(AM_V_GEN)perl -w $(srcdir)/rpc/gendispatch.pl --mode=server \
	    virLockSpaceProtocol VIR_LOCK_SPACE_PROTOCOL \
E
Eric Blake 已提交
390
	    $(LOCK_PROTOCOL) > $(srcdir)/locking/lock_daemon_dispatch_stubs.h
391 392


393 394 395 396 397
LOG_PROTOCOL_GENERATED = \
		logging/log_protocol.h \
		logging/log_protocol.c \
		$(NULL)

398 399
DRIVER_SOURCES += $(LOG_PROTOCOL_GENERATED)

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


432
NETDEV_CONF_SOURCES = \
433
		conf/netdev_bandwidth_conf.h conf/netdev_bandwidth_conf.c \
434 435
		conf/netdev_vport_profile_conf.h conf/netdev_vport_profile_conf.c \
		conf/netdev_vlan_conf.h conf/netdev_vlan_conf.c
436

437
# XML configuration format handling sources
438
# Domain driver generic impl APIs
439 440 441 442 443 444 445 446 447 448
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 \
449
		conf/virdomainobjlist.c conf/virdomainobjlist.h
450

451
OBJECT_EVENT_SOURCES = \
452 453 454
		conf/object_event.c conf/object_event.h \
		conf/object_event_private.h

455
DOMAIN_EVENT_SOURCES = \
456
		conf/domain_event.c conf/domain_event.h
457

458
NETWORK_EVENT_SOURCES = \
459 460
		conf/network_event.c conf/network_event.h

461
STORAGE_EVENT_SOURCES = \
462 463
                conf/storage_event.c conf/storage_event.h

464
NODE_DEVICE_EVENT_SOURCES = \
465 466
                conf/node_device_event.c conf/node_device_event.h

467
SECRET_EVENT_SOURCES = \
468 469
                conf/secret_event.c conf/secret_event.h

470
# Network driver generic impl APIs
471 472 473
NETWORK_CONF_SOURCES = \
		conf/network_conf.c conf/network_conf.h \
		conf/virnetworkobj.c conf/virnetworkobj.h \
474
		conf/networkcommon_conf.c conf/networkcommon_conf.h
475

476
# Network filter driver generic impl APIs
477 478 479 480 481
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 已提交
482
		conf/virnwfilterobj.h
483

484 485 486
NWFILTER_CONF_SOURCES = \
		$(NWFILTER_PARAM_CONF_SOURCES) \
		conf/nwfilter_conf.c conf/nwfilter_conf.h \
J
John Ferlan 已提交
487
		conf/virnwfilterobj.c conf/virnwfilterobj.h
488

489
# Storage driver generic impl APIs
490
STORAGE_CONF_SOURCES = \
491
		conf/storage_adapter_conf.h conf/storage_adapter_conf.c \
492
		conf/storage_conf.h conf/storage_conf.c \
J
John Ferlan 已提交
493
		conf/virstorageobj.h conf/virstorageobj.c
494

495
# Interface driver generic impl APIs
496 497
INTERFACE_CONF_SOURCES = \
		conf/interface_conf.c conf/interface_conf.h \
J
John Ferlan 已提交
498
		conf/virinterfaceobj.c conf/virinterfaceobj.h
499

500
# Secret driver generic impl APIs
501 502
SECRET_CONF_SOURCES = \
		conf/secret_conf.h conf/secret_conf.c \
503
		conf/virsecretobj.h conf/virsecretobj.c
504 505

# Network driver generic impl APIs
506
NODE_DEVICE_CONF_SOURCES = \
J
John Ferlan 已提交
507 508
		conf/node_device_conf.c conf/node_device_conf.h \
		conf/virnodedeviceobj.c conf/virnodedeviceobj.h
509

510
CPU_CONF_SOURCES = \
511
		conf/cpu_conf.c conf/cpu_conf.h
512

513
# Safe character device handling helper APIs
514
CHRDEV_CONF_SOURCES = \
515
		conf/virchrdev.c conf/virchrdev.h
516

517
# Device Helper APIs
518
DEVICE_CONF_SOURCES = \
519 520
		conf/device_conf.c conf/device_conf.h

521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537
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) \
538
		$(DEVICE_CONF_SOURCES)
539

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

REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x
554
LXC_PROTOCOL = $(srcdir)/remote/lxc_protocol.x
E
Eric Blake 已提交
555
QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x
556
REMOTE_DRIVER_PROTOCOL = $(REMOTE_PROTOCOL) $(QEMU_PROTOCOL) $(LXC_PROTOCOL)
557

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

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

E
Eric Blake 已提交
570
remote/qemu_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
571
		$(QEMU_PROTOCOL) Makefile.am
572
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
573 574
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/remote/qemu_client_bodies.h
575

576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593
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

594 595
REMOTE_DRIVER_SOURCES = \
		remote/remote_driver.c remote/remote_driver.h \
596
		$(REMOTE_DRIVER_GENERATED)
597

598 599 600 601 602 603 604 605 606 607 608 609 610
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)

611
EXTRA_DIST +=  $(REMOTE_DRIVER_PROTOCOL) \
612 613 614
		$(REMOTE_DRIVER_GENERATED) \
		$(LIBVIRTD_SOURCES) \
		$(NULL)
615

M
Martin Kletzander 已提交
616 617 618
ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x

ADMIN_PROTOCOL_GENERATED = \
619 620
		admin/admin_protocol.c \
		admin/admin_protocol.h \
621 622 623
		admin/admin_client.h \
		admin/admin_server_dispatch_stubs.h \
		$(NULL)
624 625 626 627 628 629

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

631 632 633 634 635 636
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 已提交
637 638 639 640
EXTRA_DIST += $(ADMIN_PROTOCOL) $(ADMIN_PROTOCOL_GENERATED)
BUILT_SOURCES += $(ADMIN_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(ADMIN_PROTOCOL_GENERATED)

641 642 643 644 645 646 647 648 649 650
# 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
651 652 653 654

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

665
# Depending on configure options, libtool creates one or both of
E
Eric Blake 已提交
666 667
# remote/{,.libs/}libvirt_driver_remote_la-remote_protocol.o.  We want
# the newest of the two, in case configure options changed and a stale
668
# file is left around from an earlier build.
669 670 671
# The pdwtags output is completely different when building with clang
# which causes the comparison against expected output to fail, so skip
# if using clang as CC.
672
PDWTAGS = \
A
Andrea Bolognani 已提交
673
	$(AM_V_GEN)if $(CC) -v 2>&1 | grep -q clang; then \
674 675 676 677
	   echo 'WARNING: skipping pdwtags test with Clang' >&2; \
	   exit 0; \
	fi; \
	if (pdwtags --help) > /dev/null 2>&1; then \
678 679 680 681 682 683 684
	  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?; \
685
	    echo 'WARNING: pdwtags appears broken; skipping the $@ test' >&2;\
686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703
	  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) {' \
704
		-e '    warn "WARNING: your pdwtags program is too old\n";' \
705
		-e '    warn "WARNING: skipping the $@ test\n";' \
706
		-e '    warn "WARNING: install dwarves-1.3 or newer\n";' \
707 708 709 710
		-e '    exit 8;' \
		-e '  }' \
		-e '}' \
		< $(@F)-t1 > $(@F)-t3; \
711
	    case $$? in 8) rm -f $(@F)-t?; exit 0;; 0) ;; *) exit 1;; esac;\
712 713 714 715
	    diff -u $(@)s $(@F)-t3; st=$$?; rm -f $(@F)-t?; exit $$st; \
	  fi; \
	else \
	  echo 'WARNING: you lack pdwtags; skipping the $@ test' >&2; \
716
	  echo 'WARNING: install the dwarves package to get pdwtags' >&2; \
717
	fi
718

719
# .libs/libvirt.so is built by libtool as a side-effect of the Makefile
720 721
# rule for libvirt.la.  However, checking symbols relies on Linux ELF layout
if WITH_LINUX
722 723 724
check-symfile: libvirt.syms libvirt.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt.syms \
	  .libs/libvirt.so
725 726 727
check-admin-symfile: libvirt_admin.syms libvirt-admin.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt_admin.syms \
	  .libs/libvirt-admin.so
728
else ! WITH_LINUX
729
check-symfile:
730
check-admin-symfile:
731
endif ! WITH_LINUX
732
check-symsorting:
733
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
734
		$(srcdir) $(SYM_FILES)
735 736 737
check-admin-symsorting:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
		$(srcdir) $(ADMIN_SYM_FILES)
J
Jiri Denemark 已提交
738
EXTRA_DIST += check-symfile.pl check-symsorting.pl
739

E
Eric Blake 已提交
740
# Keep this list synced with RPC_PROBE_FILES
741 742
PROTOCOL_STRUCTS = \
	$(srcdir)/remote_protocol-structs \
743
	$(srcdir)/lxc_protocol-structs \
744
	$(srcdir)/qemu_protocol-structs \
J
Jiri Denemark 已提交
745
	$(srcdir)/virnetprotocol-structs \
E
Eric Blake 已提交
746 747 748
	$(srcdir)/virkeepaliveprotocol-structs \
	$(srcdir)/lxc_monitor_protocol-structs \
	$(srcdir)/lock_protocol-structs \
M
Martin Kletzander 已提交
749
	$(srcdir)/admin_protocol-structs \
E
Eric Blake 已提交
750 751
	$(NULL)

752
if WITH_REMOTE
753 754
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)

755 756
# 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.
757 758 759
$(srcdir)/remote_protocol-struct \
	$(srcdir)/qemu_protocol-struct \
	$(srcdir)/lxc_protocol-struct: \
E
Eric Blake 已提交
760
		$(srcdir)/%-struct: remote/libvirt_driver_remote_la-%.lo
761
	$(PDWTAGS)
762
$(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \
E
Eric Blake 已提交
763
		$(srcdir)/%-struct: rpc/libvirt_net_rpc_la-%.lo
764
	$(PDWTAGS)
E
Eric Blake 已提交
765
$(srcdir)/lxc_monitor_protocol-struct: \
E
Eric Blake 已提交
766
		$(srcdir)/%-struct: lxc/libvirt_driver_lxc_impl_la-%.lo
E
Eric Blake 已提交
767 768
	$(PDWTAGS)
$(srcdir)/lock_protocol-struct: \
E
Eric Blake 已提交
769
		$(srcdir)/%-struct: locking/lockd_la-%.lo
E
Eric Blake 已提交
770
	$(PDWTAGS)
M
Martin Kletzander 已提交
771 772 773
$(srcdir)/admin_protocol-struct: \
		$(srcdir)/%-struct: admin/libvirt_admin_la-%.lo
	$(PDWTAGS)
E
Eric Blake 已提交
774

775
else !WITH_REMOTE
776 777 778
# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be
# re-generated when configured --without-remote.
check-protocol:
779
endif !WITH_REMOTE
J
Jiri Denemark 已提交
780
EXTRA_DIST += $(PROTOCOL_STRUCTS)
781 782 783 784 785

check-drivername:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-drivername.pl \
		$(srcdir)/driver.h \
		$(srcdir)/libvirt_public.syms \
786
		$(srcdir)/libvirt_admin_public.syms \
787 788 789 790 791
		$(srcdir)/libvirt_qemu.syms \
		$(srcdir)/libvirt_lxc.syms

EXTRA_DIST += check-drivername.pl

792
DRIVER_SOURCE_FILES += \
793 794
	$(REMOTE_DRIVER_SOURCES) \
	$(STORAGE_DRIVER_SOURCES) \
795 796
	$(NULL)

797
STATEFUL_DRIVER_SOURCE_FILES += \
798 799 800
	$(STORAGE_DRIVER_SOURCES) \
	$(NULL)

801 802 803

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

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

814 815 816 817 818
check-aclperms:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclperms.pl \
		$(srcdir)/access/viraccessperm.h \
		$(srcdir)/access/viraccessperm.c

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

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

826

827 828
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES = \
		$(DATATYPES_SOURCES) \
J
Jamie Strandboge 已提交
829 830
		security/virt-aa-helper.c

831

832
# Storage backend specific impls
833 834 835
STORAGE_DRIVER_BACKEND_SOURCES = \
		storage/storage_backend.h storage/storage_backend.c

836 837
STORAGE_DRIVER_SOURCES = \
		storage/storage_driver.h storage/storage_driver.c \
838
		$(STORAGE_DRIVER_BACKEND_SOURCES) \
839
		storage/storage_util.h storage/storage_util.c
840

841
STORAGE_DRIVER_FS_SOURCES = \
842
		storage/storage_backend_fs.h storage/storage_backend_fs.c
R
Richard W.M. Jones 已提交
843

844 845
STORAGE_DRIVER_LVM_SOURCES = \
		storage/storage_backend_logical.h \
846
		storage/storage_backend_logical.c
847

848
STORAGE_DRIVER_ISCSI_SOURCES = \
849
		storage/storage_backend_iscsi.h storage/storage_backend_iscsi.c
850

851
STORAGE_DRIVER_SCSI_SOURCES = \
852
		storage/storage_backend_scsi.h storage/storage_backend_scsi.c
853

854
STORAGE_DRIVER_MPATH_SOURCES = \
855
		storage/storage_backend_mpath.h storage/storage_backend_mpath.c
D
Dave Allan 已提交
856

857
STORAGE_DRIVER_DISK_SOURCES = \
858
		storage/storage_backend_disk.h storage/storage_backend_disk.c
859

860
STORAGE_DRIVER_RBD_SOURCES = \
861 862
		storage/storage_backend_rbd.h storage/storage_backend_rbd.c

863
STORAGE_DRIVER_SHEEPDOG_SOURCES = \
864 865
		storage/storage_backend_sheepdog.h storage/storage_backend_sheepdog.c \
		storage/storage_backend_sheepdog_priv.h
866

867
STORAGE_DRIVER_GLUSTER_SOURCES = \
868 869
		storage/storage_backend_gluster.h storage/storage_backend_gluster.c

870
STORAGE_DRIVER_ZFS_SOURCES = \
R
Roman Bogorodskiy 已提交
871 872
                storage/storage_backend_zfs.h storage/storage_backend_zfs.c

873 874
STORAGE_DRIVER_VSTORAGE_SOURCES = \
                storage/storage_backend_vstorage.h \
875 876
                storage/storage_backend_vstorage.c

877
STORAGE_HELPER_DISK_SOURCES = \
878
		storage/parthelper.c
879

880
UTIL_IO_HELPER_SOURCES = \
881 882
		util/iohelper.c

883

884
# Security framework and drivers for various models
885 886 887 888 889
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 \
890
		security/security_manager.h security/security_manager.c
891

892
SECURITY_DRIVER_SELINUX_SOURCES = \
893
		security/security_selinux.h security/security_selinux.c
894

895
SECURITY_DRIVER_APPARMOR_SOURCES = \
J
Jamie Strandboge 已提交
896 897
		security/security_apparmor.h security/security_apparmor.c

898
ACCESS_DRIVER_GENERATED = \
E
Eric Blake 已提交
899 900 901 902 903 904 905
		access/viraccessapicheck.h \
		access/viraccessapicheck.c \
		access/viraccessapicheckqemu.h \
		access/viraccessapicheckqemu.c \
		access/viraccessapichecklxc.h \
		access/viraccessapichecklxc.c \
		$(NULL)
906

907
ACCESS_DRIVER_SYM_FILES = \
908 909 910
		libvirt_access.syms \
		libvirt_access_qemu.syms \
		libvirt_access_lxc.syms
911

912 913 914 915 916
ACCESS_DRIVER_API_FILES = \
		libvirt_access.xml \
		libvirt_access_qemu.xml \
		libvirt_access_lxc.xml

917 918 919 920 921 922 923
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

924 925 926 927
ACCESS_DRIVER_POLKIT_SOURCES = \
		access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c

ACCESS_DRIVER_POLKIT_POLICY = \
928
		$(srcdir)/access/org.libvirt.api.policy
929 930


931 932 933 934 935 936 937
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 \
938
		cpu/cpu_map.h cpu/cpu_map.c
939

940
VMX_SOURCES = \
941 942
		vmx/vmx.c vmx/vmx.h

943

J
Jiri Denemark 已提交
944 945
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
946
EXTRA_DIST +=	$(pkgdata_DATA)
947

948 949 950 951 952 953
#########################
#
# Build up list of libvirt.la source files based on configure conditions
#
# First deal with sources usable in non-daemon context

954
noinst_LTLIBRARIES += libvirt_util.la
955
libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
956
libvirt_la_BUILT_LIBADD += libvirt_util.la
957
libvirt_util_la_SOURCES = \
958
		$(UTIL_SOURCES)
959
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
960
		$(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
961
		$(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS) \
962
		$(POLKIT_CFLAGS) $(GNUTLS_CFLAGS) $(ACL_CFLAGS)
963
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
964
		$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
965
		$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(WIN32_EXTRA_LIBS) $(LIBXML_LIBS) \
M
Michal Privoznik 已提交
966
		$(SECDRIVER_LIBS) $(NUMACTL_LIBS) $(ACL_LIBS) \
967
		$(POLKIT_LIBS) $(GNUTLS_LIBS)
968

969 970

noinst_LTLIBRARIES += libvirt_conf.la
971
libvirt_la_BUILT_LIBADD += libvirt_conf.la
972
libvirt_conf_la_SOURCES = $(CONF_SOURCES)
973 974
libvirt_conf_la_CFLAGS = \
		-I$(srcdir)/conf $(AM_CFLAGS)
975
libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS)
976
libvirt_conf_la_LIBADD = $(LIBXML_LIBS)
977

J
Jiri Denemark 已提交
978
noinst_LTLIBRARIES += libvirt_cpu.la
979
libvirt_la_BUILT_LIBADD += libvirt_cpu.la
J
Jiri Denemark 已提交
980
libvirt_cpu_la_CFLAGS = \
981
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jiri Denemark 已提交
982 983
libvirt_cpu_la_SOURCES = $(CPU_SOURCES)

984 985 986 987
if WITH_VMX
noinst_LTLIBRARIES += libvirt_vmx.la
libvirt_la_BUILT_LIBADD += libvirt_vmx.la
libvirt_vmx_la_CFLAGS = \
988
		-I$(srcdir)/conf $(AM_CFLAGS)
989
libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
990
endif WITH_VMX
991

992

993
noinst_LTLIBRARIES += libvirt_driver.la
994
libvirt_la_BUILT_LIBADD += libvirt_driver.la
995
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
996

997
libvirt_driver_la_CFLAGS = \
998
		$(GNUTLS_CFLAGS) $(CURL_CFLAGS) $(XDR_CFLAGS) \
999
		-I$(srcdir)/conf $(AM_CFLAGS)
1000
libvirt_driver_la_LIBADD = \
1001
		$(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS)
1002

1003 1004
# 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.
1005 1006 1007
SYM_FILES += $(USED_SYM_FILES)
USED_SYM_FILES += $(srcdir)/libvirt_private.syms
GENERATED_SYM_FILES += \
1008 1009
	$(ACCESS_DRIVER_SYM_FILES) \
	libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \
1010
	libvirt_admin.syms libvirt_admin.def \
1011
	$(NULL)
1012

1013
if WITH_REMOTE
1014
noinst_LTLIBRARIES += libvirt_driver_remote.la
1015
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
1016 1017 1018 1019
libvirt_driver_remote_la_CFLAGS = \
		$(XDR_CFLAGS) \
		-I$(srcdir)/conf \
		-I$(srcdir)/rpc \
1020 1021
		$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
1022
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
1023

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

1026 1027
endif WITH_REMOTE

1028 1029 1030 1031 1032 1033 1034

if WITH_LIBVIRTD

sbin_PROGRAMS += libvirtd

BUILT_SOURCES += $(LIBVIRTD_GENERATED)

1035 1036 1037 1038 1039 1040
augeas_DATA += remote/libvirtd.aug

augeastest_DATA += test_libvirtd.aug

conf_DATA += remote/libvirtd.conf

1041
CLEANFILES += test_libvirtd.aug
1042

1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053
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
1054
CLEANFILES += libvirtd.policy
1055 1056 1057 1058 1059 1060 1061

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

1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082
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 = \
J
Jan Palus 已提交
1083 1084 1085
	libvirt-lxc.la \
	libvirt-qemu.la \
	libvirt.la \
1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102
	$(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 \
	../gnulib/lib/libgnu.la $(LIBSOCKET) \
	$(NULL)

endif WITH_LIBVIRTD
1103 1104 1105 1106
EXTRA_DIST += \
	remote/test_libvirtd.aug.in \
	remote/libvirtd.aug \
	remote/libvirtd.conf \
1107 1108 1109 1110
	remote/libvirtd.policy.in \
	remote/libvirtd.rules \
	remote/libvirtd.sasl \
	remote/libvirtd.sysctl \
1111
	$(NULL)
1112

1113
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
1114
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
1115
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1116

1117
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
1118
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
1119
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1120

1121

1122

1123
# Needed to keep automake quiet about conditionals
1124 1125
libvirt_driver_storage_impl_la_SOURCES =
libvirt_driver_storage_impl_la_CFLAGS = \
1126 1127
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1128
		-I$(srcdir)/secret \
1129
		$(AM_CFLAGS)
1130 1131
libvirt_driver_storage_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_storage_impl_la_LIBADD =
1132
libvirt_driver_storage_impl_la_LIBADD += $(SECDRIVER_LIBS) $(LIBXML_LIBS)
1133
if WITH_BLKID
1134 1135
libvirt_driver_storage_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(BLKID_LIBS)
1136
endif WITH_BLKID
1137 1138 1139 1140

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

1141
if WITH_STORAGE
1142 1143 1144
noinst_LTLIBRARIES += libvirt_driver_storage_impl.la
libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_LIBADD = libvirt_driver_storage_impl.la
1145
mod_LTLIBRARIES += libvirt_driver_storage.la
1146
libvirt_driver_storage_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
1147
libvirt_driver_storage_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1148
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
1149 1150 1151


libvirt_storage_backend_fs_la_SOURCES = $(STORAGE_DRIVER_FS_SOURCES)
1152
libvirt_storage_backend_fs_la_CFLAGS = \
1153 1154 1155
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1156
storagebackend_LTLIBRARIES += libvirt_storage_backend_fs.la
1157
libvirt_storage_backend_fs_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1158
libvirt_storage_backend_fs_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1159
endif WITH_STORAGE
1160

1161
if WITH_STORAGE_LVM
1162 1163 1164 1165 1166 1167
libvirt_storage_backend_logical_la_SOURCES = \
	$(STORAGE_DRIVER_LVM_SOURCES)
libvirt_storage_backend_logical_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1168
storagebackend_LTLIBRARIES += libvirt_storage_backend_logical.la
1169
libvirt_storage_backend_logical_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1170
libvirt_storage_backend_logical_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1171
endif WITH_STORAGE_LVM
1172

1173
if WITH_STORAGE_ISCSI
1174 1175 1176 1177 1178 1179 1180
libvirt_storage_backend_iscsi_la_SOURCES = \
	$(STORAGE_DRIVER_ISCSI_SOURCES)
libvirt_storage_backend_iscsi_la_CFLAGS = \
	-I$(srcdir)/conf \
	-I$(srcdir)/secret \
	$(AM_CFLAGS)

1181
storagebackend_LTLIBRARIES += libvirt_storage_backend_iscsi.la
1182
libvirt_storage_backend_iscsi_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1183
libvirt_storage_backend_iscsi_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1184
endif WITH_STORAGE_ISCSI
1185

1186
if WITH_STORAGE_SCSI
1187 1188 1189 1190 1191
libvirt_storage_backend_scsi_la_SOURCES = $(STORAGE_DRIVER_SCSI_SOURCES)
libvirt_storage_backend_scsi_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1192
storagebackend_LTLIBRARIES += libvirt_storage_backend_scsi.la
1193
libvirt_storage_backend_scsi_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1194
libvirt_storage_backend_scsi_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1195
endif WITH_STORAGE_SCSI
1196

D
Dave Allan 已提交
1197
if WITH_STORAGE_MPATH
1198 1199
libvirt_storage_backend_mpath_la_SOURCES = \
	$(STORAGE_DRIVER_MPATH_SOURCES)
J
Jan Palus 已提交
1200
libvirt_storage_backend_mpath_la_LIBADD = libvirt.la $(DEVMAPPER_LIBS)
1201
libvirt_storage_backend_mpath_la_CFLAGS = \
1202 1203 1204 1205
	-I$(srcdir)/conf \
	$(DEVMAPPER_CFLAGS) \
	$(AM_CFLAGS)

1206
storagebackend_LTLIBRARIES += libvirt_storage_backend_mpath.la
1207
libvirt_storage_backend_mpath_la_LDFLAGS = $(AM_LDFLAGS_MOD)
J
Jan Palus 已提交
1208
libvirt_storage_backend_mpath_la_LIBADD += ../gnulib/lib/libgnu.la
1209
endif WITH_STORAGE_MPATH
D
Dave Allan 已提交
1210

1211
if WITH_STORAGE_DISK
1212
libvirt_storage_backend_disk_la_SOURCES = $(STORAGE_DRIVER_DISK_SOURCES)
1213
libvirt_storage_backend_disk_la_CFLAGS = \
1214 1215 1216
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1217
storagebackend_LTLIBRARIES += libvirt_storage_backend_disk.la
1218
libvirt_storage_backend_disk_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1219
libvirt_storage_backend_disk_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1220
endif WITH_STORAGE_DISK
1221

1222
if WITH_STORAGE_RBD
1223
libvirt_storage_backend_rbd_la_SOURCES = $(STORAGE_DRIVER_RBD_SOURCES)
J
Jan Palus 已提交
1224
libvirt_storage_backend_rbd_la_LIBADD = libvirt.la $(LIBRBD_LIBS)
1225 1226 1227 1228 1229
libvirt_storage_backend_rbd_la_CFLAGS = \
	-I$(srcdir)/conf \
	-I$(srcdir)/secret \
	$(AM_CFLAGS)

1230
storagebackend_LTLIBRARIES += libvirt_storage_backend_rbd.la
1231
libvirt_storage_backend_rbd_la_LDFLAGS = $(AM_LDFLAGS_MOD)
J
Jan Palus 已提交
1232
libvirt_storage_backend_rbd_la_LIBADD += ../gnulib/lib/libgnu.la
1233
endif WITH_STORAGE_RBD
1234

1235
if WITH_STORAGE_SHEEPDOG
1236 1237 1238 1239 1240 1241
libvirt_storage_backend_sheepdog_la_SOURCES = \
	$(STORAGE_DRIVER_SHEEPDOG_SOURCES)
libvirt_storage_backend_sheepdog_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1242
libvirt_storage_backend_sheepdog_priv_la_SOURCES = \
1243
	$(STORAGE_DRIVER_SHEEPDOG_SOURCES)
1244 1245 1246 1247 1248 1249
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
1250
libvirt_storage_backend_sheepdog_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1251
libvirt_storage_backend_sheepdog_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1252
endif WITH_STORAGE_SHEEPDOG
1253

1254
if WITH_STORAGE_GLUSTER
1255 1256
libvirt_storage_backend_gluster_la_SOURCES = \
	$(STORAGE_DRIVER_GLUSTER_SOURCES)
J
Jan Palus 已提交
1257
libvirt_storage_backend_gluster_la_LIBADD = libvirt.la $(GLUSTERFS_LIBS)
1258 1259 1260 1261 1262
libvirt_storage_backend_gluster_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(GLUSTERFS_CFLAGS) \
	$(AM_CFLAGS)

1263
storagebackend_LTLIBRARIES += libvirt_storage_backend_gluster.la
1264
libvirt_storage_backend_gluster_la_LDFLAGS = $(AM_LDFLAGS_MOD)
J
Jan Palus 已提交
1265
libvirt_storage_backend_gluster_la_LIBADD += ../gnulib/lib/libgnu.la
1266 1267
endif WITH_STORAGE_GLUSTER

R
Roman Bogorodskiy 已提交
1268
if WITH_STORAGE_ZFS
1269
libvirt_storage_backend_zfs_la_SOURCES = $(STORAGE_DRIVER_ZFS_SOURCES)
1270
libvirt_storage_backend_zfs_la_CFLAGS = \
1271 1272 1273
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1274
storagebackend_LTLIBRARIES += libvirt_storage_backend_zfs.la
1275
libvirt_storage_backend_zfs_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1276
libvirt_storage_backend_zfs_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
R
Roman Bogorodskiy 已提交
1277 1278
endif WITH_STORAGE_ZFS

1279
if WITH_STORAGE_VSTORAGE
1280 1281
libvirt_storage_backend_vstorage_la_SOURCES = \
	$(STORAGE_DRIVER_VSTORAGE_SOURCES)
1282
libvirt_storage_backend_vstorage_la_CFLAGS = \
1283 1284 1285
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1286
storagebackend_LTLIBRARIES += libvirt_storage_backend_vstorage.la
1287
libvirt_storage_backend_vstorage_la_LDFLAGS = $(AM_LDFLAGS_MOD)
1288
libvirt_storage_backend_vstorage_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
1289 1290
endif WITH_STORAGE_VSTORAGE

1291

1292

1293 1294 1295 1296
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 = \
1297
		-I$(srcdir)/conf $(AM_CFLAGS)
1298
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
1299
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
1300
if WITH_SECDRIVER_SELINUX
1301 1302
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
1303
endif WITH_SECDRIVER_SELINUX
J
Jamie Strandboge 已提交
1304
if WITH_SECDRIVER_APPARMOR
1305 1306
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
1307
endif WITH_SECDRIVER_APPARMOR
1308

1309 1310
libvirt_driver_access_la_SOURCES = \
	$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
1311 1312 1313
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
1314
		-I$(srcdir)/conf $(AM_CFLAGS)
1315 1316 1317
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD =

1318 1319
EXTRA_DIST += access/genpolkit.pl

1320 1321 1322 1323
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
    $(srcdir)/access/genpolkit.pl Makefile.am
	$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@

1324 1325 1326 1327
if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)

polkitactiondir = $(datadir)/polkit-1/actions
1328
if WITH_LIBVIRTD
1329
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
1330
endif WITH_LIBVIRTD
1331 1332 1333

CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
1334
else ! WITH_POLKIT1
1335
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
1336
endif ! WITH_POLKIT1
1337

1338

1339 1340
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354

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

1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367
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 已提交
1368
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
1369 1370
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1371 1372 1373
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
1374 1375
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1376 1377
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
	  > $(srcdir)/access/viraccessapicheck.c
1378

E
Eric Blake 已提交
1379
access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
1380 1381
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1382 1383 1384
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheckqemu.h
access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
1385 1386
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1387 1388
	  qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h \
	  > $(srcdir)/access/viraccessapicheckqemu.c
1389

E
Eric Blake 已提交
1390
access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
1391 1392
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1393 1394 1395
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/access/viraccessapichecklxc.h
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
1396 1397
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1398 1399
	  lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \
	  > $(srcdir)/access/viraccessapichecklxc.c
1400

1401
# Add all conditional sources just in case...
1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417
EXTRA_DIST += \
		$(REMOTE_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) \
		$(SECURITY_DRIVER_SELINUX_SOURCES) \
		$(SECURITY_DRIVER_APPARMOR_SOURCES) \
1418
		$(ACCESS_DRIVER_POLKIT_POLICY)
1419

1420 1421
check-local: check-augeas

1422 1423 1424
.PHONY: check-augeas \
	check-augeas-sanlock \
	check-augeas-lockd \
1425
	check-augeas-libvirtd \
1426
	$(NULL)
1427

1428
check-augeas: $(AUGEAS_DIRS:%=check-augeas-%) \
1429
	check-augeas-sanlock \
1430
	check-augeas-lockd check-augeas-virtlockd \
1431
	check-augeas-virtlogd check-augeas-libvirtd
1432

1433
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
1434
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
1435

1436

1437
if WITH_SANLOCK
1438 1439
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1440
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
1441

1442
check-augeas-sanlock: test_libvirt_sanlock.aug
1443
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1444
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
1445
	fi
1446
else ! WITH_SANLOCK
1447
check-augeas-sanlock:
1448
endif ! WITH_SANLOCK
1449

1450
if WITH_QEMU
1451 1452 1453
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 $< $@
1454 1455 1456
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
1457

1458 1459
test_virtlockd.aug: locking/test_virtlockd.aug.in \
		locking/virtlockd.conf $(AUG_GENTEST)
1460
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
1461

1462
if WITH_QEMU
1463 1464 1465 1466
check-augeas-lockd: test_libvirt_lockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_lockd.aug; \
	fi
1467 1468 1469
else ! WITH_QEMU
check-augeas-lockd:
endif ! WITH_QEMU
1470

1471 1472 1473 1474 1475
check-augeas-virtlockd: test_virtlockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
	fi

1476

1477 1478 1479 1480 1481 1482 1483 1484 1485
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

1486 1487 1488
if WITH_LIBVIRTD
test_libvirtd.aug: remote/test_libvirtd.aug.in \
		remote/libvirtd.conf $(AUG_GENTEST)
1489
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/remote/libvirtd.conf $< $@
1490 1491 1492 1493 1494 1495 1496 1497

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
1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516
#
# 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.
#

1517
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
1518

1519
if WITH_LINUX
1520
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
1521
else ! WITH_LINUX
1522
SYM_FILES += $(srcdir)/libvirt_linux.syms
1523
endif ! WITH_LINUX
1524

E
Eric Blake 已提交
1525 1526 1527 1528 1529 1530
if WITH_REMOTE
USED_SYM_FILES += $(srcdir)/libvirt_remote.syms
else ! WITH_REMOTE
SYM_FILES += $(srcdir)/libvirt_remote.syms
endif ! WITH_REMOTE

1531
if WITH_VMX
1532
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
1533
else ! WITH_VMX
1534
SYM_FILES += $(srcdir)/libvirt_vmx.syms
1535
endif ! WITH_VMX
1536

1537
if WITH_SASL
1538
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
1539
else ! WITH_SASL
1540
SYM_FILES += $(srcdir)/libvirt_sasl.syms
1541
endif ! WITH_SASL
E
Eric Blake 已提交
1542

1543 1544
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
1545
else ! WITH_GNUTLS
1546
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
1547
endif ! WITH_GNUTLS
1548

1549
if WITH_SSH2
1550
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
1551
else ! WITH_SSH2
1552
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
1553
endif ! WITH_SSH2
1554

1555
if WITH_ATOMIC_OPS_PTHREAD
1556
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
1557
else ! WITH_ATOMIC_OPS_PTHREAD
1558
SYM_FILES += $(srcdir)/libvirt_atomic.syms
1559
endif ! WITH_ATOMIC_OPS_PTHREAD
1560

1561 1562 1563 1564 1565 1566
if WITH_LIBSSH
USED_SYM_FILES += $(srcdir)/libvirt_libssh.syms
else ! WITH_LIBSSH
SYM_FILES += $(srcdir)/libvirt_libssh.syms
endif ! WITH_LIBSSH

1567
EXTRA_DIST += \
1568 1569 1570 1571 1572 1573
	libvirt_public.syms \
	libvirt_lxc.syms \
	libvirt_qemu.syms \
	libvirt_admin_public.syms \
	$(SYM_FILES) \
	$(ADMIN_SYM_FILES) \
1574
	$(NULL)
1575

1576
BUILT_SOURCES += $(GENERATED_SYM_FILES)
1577

1578 1579
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(ACCESS_DRIVER_SYM_FILES) \
1580
		$(top_builddir)/config.status
1581 1582 1583 1584 1585 1586
	$(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 && \
1587
	cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
1588 1589
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
1590
	mv $@-tmp libvirt.syms
1591

1592
%.def: %.syms
1593 1594
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
1595
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d' \
1596
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
1597
	chmod a-w $@-tmp && \
1598
	mv $@-tmp $@
1599

1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612
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

1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627

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) \
1628
		$(XDR_CFLAGS) \
1629 1630 1631 1632 1633 1634
		-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)

1635 1636 1637 1638
# 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 已提交
1639 1640
lib_LTLIBRARIES += libvirt-admin.la
libvirt_admin_la_SOURCES = \
1641 1642
		libvirt-admin.c \
		$(ADMIN_PROTOCOL_GENERATED) \
M
Martin Kletzander 已提交
1643 1644 1645
		$(DATATYPES_SOURCES)

libvirt_admin_la_LDFLAGS = \
1646 1647
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_ADMIN_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
1648
		$(AM_LDFLAGS)
M
Martin Kletzander 已提交
1649 1650

libvirt_admin_la_LIBADD = \
1651
		libvirt.la \
M
Martin Kletzander 已提交
1652 1653 1654
		$(CYGWIN_EXTRA_LIBADD)

libvirt_admin_la_CFLAGS = \
1655 1656 1657
		$(AM_CFLAGS) \
		-I$(srcdir)/remote \
		-I$(srcdir)/rpc \
M
Martin Kletzander 已提交
1658 1659 1660
		-I$(srcdir)/admin

libvirt_admin_la_CFLAGS += \
1661 1662 1663 1664 1665 1666
		$(XDR_CFLAGS) \
		$(CAPNG_CFLAGS) \
		$(YAJL_CFLAGS) \
		$(SSH2_CFLAGS) \
		$(SASL_CFLAGS) \
		$(GNUTLS_CFLAGS) \
1667
		$(LIBSSH_CFLAGS)
M
Martin Kletzander 已提交
1668 1669

libvirt_admin_la_LIBADD += \
1670 1671 1672 1673 1674 1675 1676
		$(CAPNG_LIBS) \
		$(YAJL_LIBS) \
		$(DEVMAPPER_LIBS) \
		$(LIBXML_LIBS) \
		$(SSH2_LIBS) \
		$(SASL_LIBS) \
		$(GNUTLS_LIBS) \
1677
		$(LIBSSH_LIBS)
M
Martin Kletzander 已提交
1678

1679 1680
ADMIN_SYM_FILES = $(srcdir)/libvirt_admin_private.syms

M
Martin Kletzander 已提交
1681 1682 1683 1684
if WITH_DTRACE_PROBES
libvirt_admin_la_LIBADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

1685 1686
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
1687 1688 1689 1690
libvirt_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(LIBVIRT_NODELETE) \
1691
		$(NO_UNDEFINED_LDFLAGS) \
D
Daniel P. Berrange 已提交
1692 1693
		$(AM_LDFLAGS) \
		$(NULL)
1694
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
1695
libvirt_la_LIBADD += \
1696
		    $(DRIVER_MODULES_LIBS) \
1697
		    $(CYGWIN_EXTRA_LIBADD)
1698
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
1699 1700 1701 1702 1703 1704
# 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)
1705

1706
if WITH_DTRACE_PROBES
1707
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
1708
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
1709
nodist_libvirt_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
1710
if WITH_REMOTE
E
Eric Blake 已提交
1711
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
1712
endif WITH_REMOTE
1713
DTRACE2SYSTEMTAP_FLAGS = --with-modules
1714

1715 1716
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

1717 1718

tapsetdir = $(datadir)/systemtap/tapset
1719
tapset_DATA += libvirt_probes.stp libvirt_functions.stp
1720

1721
%_probes.h: %_probes.d
1722 1723
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

E
Eric Blake 已提交
1724
.PRECIOUS: %_probes.o
1725
%_probes.o: %_probes.d
1726 1727
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

1728 1729 1730 1731 1732 1733 1734 1735 1736
%_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 已提交
1737
# Keep this list synced with PROTOCOL_STRUCTS
1738
RPC_PROBE_FILES += $(srcdir)/rpc/virnetprotocol.x \
J
Jiri Denemark 已提交
1739 1740
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
1741
		  $(srcdir)/remote/lxc_protocol.x \
1742
		  $(srcdir)/remote/qemu_protocol.x \
M
Martin Kletzander 已提交
1743 1744
		  $(srcdir)/locking/lock_protocol.x \
		  $(srcdir)/admin/admin_protocol.x
1745 1746

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

1749 1750
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl \
		$(top_builddir)/config.status
1751
	$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
1752
	  $(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
1753

1754
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
1755
              libvirt_functions.stp libvirt_probes.stp
1756
endif WITH_DTRACE_PROBES
1757

1758
EXTRA_DIST += libvirt_probes.d
1759

C
Chris Lalancette 已提交
1760
libvirt_qemu_la_SOURCES = libvirt-qemu.c
D
Daniel P. Berrange 已提交
1761 1762 1763 1764 1765
libvirt_qemu_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
1766
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
C
Chris Lalancette 已提交
1767
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
1768

1769
libvirt_lxc_la_SOURCES = libvirt-lxc.c
D
Daniel P. Berrange 已提交
1770 1771 1772 1773 1774
libvirt_lxc_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
1775 1776 1777
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)

1778 1779 1780 1781 1782 1783 1784
# 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
1785
if WITH_SETUID_RPC_CLIENT
1786 1787
noinst_LTLIBRARIES += libvirt-setuid-rpc-client.la

1788 1789
libvirt_setuid_rpc_client_la_SOURCES = \
		util/viralloc.c \
1790
		util/virarch.c \
1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855
		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 \
1856 1857
		$(NULL)

1858 1859 1860 1861
libvirt_setuid_rpc_client_la_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(LIBXML_LIBS) \
		$(SECDRIVER_LIBS) \
1862
		$(NULL)
1863 1864 1865 1866 1867 1868 1869
libvirt_setuid_rpc_client_la_CFLAGS = \
		-DLIBVIRT_SETUID_RPC_CLIENT \
		-I$(srcdir)/conf \
		-I$(srcdir)/rpc \
		$(AM_CFLAGS) \
		$(SECDRIVER_CFLAGS) \
		$(XDR_CFLAGS) \
1870
		$(NULL)
1871
endif WITH_SETUID_RPC_CLIENT
1872

1873 1874 1875
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

1876
if WITH_LIBVIRTD
1877 1878 1879 1880 1881
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
		$(LOCK_DRIVER_LOCKD_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
		$(NULL)
1882
lockd_la_CFLAGS = -I$(srcdir)/conf \
E
Eric Blake 已提交
1883 1884
		$(XDR_CFLAGS) \
		$(AM_CFLAGS)
1885
lockd_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1886
lockd_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
J
Jiri Denemark 已提交
1887
augeas_DATA += locking/libvirt_lockd.aug
1888 1889
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
1890
endif WITH_DTRACE_PROBES
1891
if WITH_QEMU
1892 1893
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
1894
nodist_conf_DATA += locking/qemu-lockd.conf
1895 1896
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
1897
endif WITH_QEMU
1898

1899 1900 1901 1902 1903 1904
if WITH_LIBXL
nodist_conf_DATA += locking/libxl-lockd.conf
BUILT_SOURCES += locking/libxl-lockd.conf
DISTCLEANFILES += locking/libxl-lockd.conf
endif WITH_LIBXL

1905 1906 1907 1908 1909
locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
	$(AM_V_GEN)$(MKDIR_P) locking ; \
	cp $< $@


1910
sbin_PROGRAMS += virtlockd virtlogd
1911

1912 1913 1914
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
1915
		$(LOCK_DAEMON_GENERATED) \
1916
		$(NULL)
1917 1918
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
1919
		$(PIE_CFLAGS) \
1920
		$(XDR_CFLAGS) \
1921 1922 1923
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
1924
		$(PIE_LDFLAGS) \
1925
		$(NO_UNDEFINED_LDFLAGS) \
1926 1927
		$(NULL)
virtlockd_LDADD = \
1928
		libvirt_driver_admin.la \
1929 1930 1931 1932 1933 1934 1935 1936
		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
1937
endif WITH_DTRACE_PROBES
1938

1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952

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) \
1953
		$(NO_UNDEFINED_LDFLAGS) \
1954 1955
		$(NULL)
virtlogd_LDADD = \
1956
		libvirt_driver_admin.la \
1957 1958 1959 1960 1961 1962 1963 1964 1965 1966
		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

1967
else ! WITH_LIBVIRTD
1968
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
1969 1970
              $(LOCK_DRIVER_LOCKD_SOURCES) \
	      $(LOG_DAEMON_SOURCES)
1971
endif ! WITH_LIBVIRTD
1972

1973
SYSCONF_FILES = \
1974
	locking/virtlockd.sysconf \
1975
	logging/virtlogd.sysconf \
1976
	remote/libvirtd.sysconf \
1977 1978 1979
	$(NULL)

EXTRA_DIST += \
J
Jiri Denemark 已提交
1980 1981
	locking/lockd.conf \
	locking/libvirt_lockd.aug \
1982
	locking/test_libvirt_lockd.aug.in \
1983 1984
	$(SYSCONF_FILES) \
	$(NULL)
1985 1986

install-sysconfig:
E
Eric Blake 已提交
1987
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
1988 1989 1990
	for f in $(SYSCONF_FILES:%.sysconf=%) ; \
	do \
	  tgt=`basename $$f`; \
1991 1992
	  $(INSTALL_SCRIPT) $(srcdir)/$$f.sysconf \
	      $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
1993
	done
1994 1995

uninstall-sysconfig:
1996 1997 1998 1999 2000
	for f in $(SYSCONF_FILES:%.sysconf=%) ; \
	do \
	  tgt=`basename $$f`; \
	  rm -f $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
	done
E
Eric Blake 已提交
2001
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
2002

2003 2004 2005
SYSVINIT_FILES_IN = \
	locking/virtlockd.init.in \
	logging/virtlogd.init.in \
2006
	remote/libvirtd.init.in \
2007 2008 2009 2010 2011
	$(NULL)

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

EXTRA_DIST += $(SYSVINIT_FILES_IN)
2012

2013 2014 2015 2016 2017 2018 2019 2020 2021 2022
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)

2023
if WITH_LIBVIRTD
2024

2025 2026 2027
LOGROTATE_FILES := $(LOGROTATE_FILES_IN:remote/%.in=%)

BUILT_SOURCES += $(LOGROTATE_FILES)
2028
CLEANFILES += $(LOGROTATE_FILES)
2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048

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

2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087
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

2088
if LIBVIRT_INIT_SCRIPT_RED_HAT
2089
install-init:: $(SYSVINIT_FILES) install-sysconfig
E
Eric Blake 已提交
2090
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
2091 2092 2093 2094
	for f in $(SYSVINIT_FILES:%.init=%) ; \
	do \
	  $(INSTALL_SCRIPT) $$f.init $(DESTDIR)$(sysconfdir)/rc.d/init.d/$$f; \
	done
2095 2096

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

2100 2101
BUILT_SOURCES += $(SYSVINIT_FILES)
DISTCLEANFILES += $(SYSVINIT_FILES)
2102
else ! LIBVIRT_INIT_SCRIPT_RED_HAT
2103 2104
install-init::
uninstall-init::
2105 2106
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
else ! WITH_LIBVIRTD
2107 2108 2109 2110
install-polkit::
uninstall-polkit::
install-sysctl::
uninstall-sysctl::
2111 2112
install-init::
uninstall-init::
2113 2114
install-logrotate::
uninstall-logrotate::
2115
endif ! WITH_LIBVIRTD
2116

2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133
# 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


2134 2135 2136 2137 2138 2139 2140 2141 2142
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 $@

2143
virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
2144 2145 2146 2147 2148 2149
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    < $< > $@-t && \
	    chmod a+x $@-t && \
2150 2151
	    mv $@-t $@

2152
virtlogd.init: logging/virtlogd.init.in $(top_builddir)/config.status
2153 2154 2155 2156 2157 2158
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    < $< > $@-t && \
	    chmod a+x $@-t && \
2159 2160
	    mv $@-t $@

2161
virtlockd.8.in: locking/virtlockd.pod
2162 2163 2164 2165 2166 2167 2168 2169
	$(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 $@
2170

2171
virtlogd.8.in: logging/virtlogd.pod
2172 2173 2174 2175 2176 2177 2178 2179
	$(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 $@
2180

2181 2182 2183 2184 2185 2186 2187 2188 2189 2190
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 $@

2191
%.8: %.8.in $(top_srcdir)/configure.ac
2192
	$(AM_V_GEN)sed \
2193 2194 2195
		-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
		-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
		< $< > $@-t && \
2196 2197
	mv $@-t $@

2198
if WITH_LIBVIRTD
2199
man8_MANS = virtlockd.8 virtlogd.8 libvirtd.8
2200

2201
conf_DATA += locking/virtlockd.conf logging/virtlogd.conf
2202

2203 2204
augeas_DATA += locking/virtlockd.aug logging/virtlogd.aug
augeastest_DATA += test_virtlockd.aug test_virtlogd.aug
2205
endif WITH_LIBVIRTD
2206

A
Andrea Bolognani 已提交
2207 2208 2209
PODFILES = \
	locking/virtlockd.pod \
	logging/virtlogd.pod \
2210
	remote/libvirtd.pod \
A
Andrea Bolognani 已提交
2211 2212 2213 2214 2215
	$(NULL)

MANINFILES = \
	virtlockd.8.in \
	virtlogd.8.in \
2216
	libvirtd.8.in \
A
Andrea Bolognani 已提交
2217 2218 2219 2220
	$(NULL)

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

2222 2223 2224 2225 2226 2227 2228
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 \
2229 2230
	remote/libvirtd.service.in \
	remote/virt-guest-shutdown.target.in \
2231 2232
	$(NULL)

2233
EXTRA_DIST += \
2234
        $(SYSTEMD_UNIT_FILES_IN) \
2235 2236 2237
        locking/virtlockd.aug \
        locking/virtlockd.conf \
        locking/test_virtlockd.aug.in \
2238 2239 2240
        logging/virtlogd.aug \
        logging/virtlogd.conf \
        logging/test_virtlogd.aug.in \
A
Andrea Bolognani 已提交
2241 2242
        $(PODFILES) \
        $(MANINFILES) \
2243
        $(NULL)
2244

2245 2246 2247 2248

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

2249
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
2250
SYSTEMD_UNIT_FILES = $(notdir $(SYSTEMD_UNIT_FILES_IN:%.in=%))
2251

2252 2253
BUILT_SOURCES += $(SYSTEMD_UNIT_FILES)
DISTCLEANFILES += $(SYSTEMD_UNIT_FILES)
2254

2255
install-systemd: $(SYSTEMD_UNIT_FILES) install-sysconfig
E
Eric Blake 已提交
2256
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
2257 2258 2259 2260
	for f in $(SYSTEMD_UNIT_FILES); \
	do \
	  $(INSTALL_DATA) $$f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/ ; \
	done
2261 2262

uninstall-systemd: uninstall-sysconfig
2263
	rm -f $(SYSTEMD_UNIT_FILES:%=$(DESTDIR)$(SYSTEMD_UNIT_DIR)/%)
E
Eric Blake 已提交
2264
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
2265
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
2266 2267
install-systemd:
uninstall-systemd:
2268 2269
endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
else ! WITH_LIBVIRTD
2270 2271
install-systemd:
uninstall-systemd:
2272
endif ! WITH_LIBVIRTD
2273

2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285
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 $< $@

2286
virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
2287 2288 2289
	$(AM_V_GEN)sed \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    < $< > $@-t && \
2290 2291 2292
	    mv $@-t $@

virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
2293 2294 2295
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
2296 2297
	    mv $@-t $@

J
John Ferlan 已提交
2298 2299 2300 2301 2302 2303 2304
virtlockd-admin.socket: locking/virtlockd-admin.socket.in \
                        $(top_builddir)/config.status
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
	    mv $@-t $@

2305
virtlogd.service: logging/virtlogd.service.in $(top_builddir)/config.status
2306 2307 2308
	$(AM_V_GEN)sed \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    < $< > $@-t && \
2309 2310 2311
	    mv $@-t $@

virtlogd.socket: logging/virtlogd.socket.in $(top_builddir)/config.status
J
John Ferlan 已提交
2312 2313 2314 2315 2316 2317 2318
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
	    mv $@-t $@

virtlogd-admin.socket: logging/virtlogd-admin.socket.in \
                       $(top_builddir)/config.status
2319 2320 2321
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
2322 2323
	    mv $@-t $@

2324

2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338
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` ; \
2339 2340
	  $(INSTALL_SCRIPT) $(srcdir)/$$f.upstart \
	      $(DESTDIR)$(sysconfdir)/event.d/$$tgt ; \
2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358
	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

2359
if WITH_SANLOCK
2360
lockdriver_LTLIBRARIES += sanlock.la
2361
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
2362
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
2363
sanlock_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
2364
sanlock_la_LIBADD = -lsanlock_client libvirt.la ../gnulib/lib/libgnu.la
2365 2366

augeas_DATA += locking/libvirt_sanlock.aug
2367 2368
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
2369

E
Eric Blake 已提交
2370
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
2371
	$(AM_V_GEN)$(MKDIR_P) locking ; \
2372 2373 2374
	cp $< $@

if WITH_QEMU
2375
nodist_conf_DATA += locking/qemu-sanlock.conf
2376
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
2377
DISTCLEANFILES += locking/qemu-sanlock.conf
2378
endif WITH_QEMU
2379 2380 2381 2382 2383 2384

if WITH_LIBXL
nodist_conf_DATA += locking/libxl-sanlock.conf
BUILT_SOURCES += locking/libxl-sanlock.conf
DISTCLEANFILES += locking/libxl-sanlock.conf
endif WITH_LIBXL
2385
else ! WITH_SANLOCK
2386
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
2387
endif ! WITH_SANLOCK
2388 2389
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
2390
	locking/test_libvirt_sanlock.aug.in
2391

2392 2393 2394 2395
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
2396

2397 2398 2399 2400 2401
libvirt_la_BUILT_LIBADD += \
       libvirt-net-rpc.la \
       libvirt-net-rpc-server.la \
       libvirt-net-rpc-client.la

2402
EXTRA_DIST += \
E
Eric Blake 已提交
2403 2404 2405 2406
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
2407 2408
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
2409

E
Eric Blake 已提交
2410
VIR_NET_RPC_GENERATED = \
2411 2412 2413 2414
	rpc/virnetprotocol.h \
	rpc/virnetprotocol.c \
	rpc/virkeepaliveprotocol.h \
	rpc/virkeepaliveprotocol.c
2415

2416
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2417

2418
libvirt_net_rpc_la_SOURCES = \
2419
	rpc/virnetmessage.h rpc/virnetmessage.c \
2420
	rpc/virnetsocket.h rpc/virnetsocket.c \
2421 2422
	rpc/virkeepalive.h rpc/virkeepalive.c \
	$(VIR_NET_RPC_GENERATED)
2423
if WITH_SSH2
2424 2425
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2426
else ! WITH_SSH2
2427 2428
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2429
endif ! WITH_SSH2
2430
if WITH_GNUTLS
2431 2432
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2433
else ! WITH_GNUTLS
2434 2435
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2436
endif ! WITH_GNUTLS
2437
if WITH_SASL
2438 2439
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2440
else ! WITH_SASL
2441 2442
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2443
endif ! WITH_SASL
2444 2445 2446 2447 2448 2449 2450
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
2451
libvirt_net_rpc_la_CFLAGS = \
2452
			$(GNUTLS_CFLAGS) \
2453
			$(SASL_CFLAGS) \
2454
			$(SSH2_CFLAGS) \
2455
			$(LIBSSH_CFLAGS) \
2456
			$(XDR_CFLAGS) \
2457 2458
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
2459
			$(GNUTLS_LIBS) \
2460
			$(SASL_LIBS) \
2461
			$(SSH2_LIBS)\
2462
			$(LIBSSH_LIBS) \
J
Jim Fehlig 已提交
2463
			$(SECDRIVER_LIBS) \
2464
			$(AM_LDFLAGS) \
2465
			$(NULL)
2466 2467 2468
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2469 2470 2471 2472
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
2473
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
2474
	rpc/virnetdaemon.h rpc/virnetdaemon.c \
2475 2476
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
2477
			$(AVAHI_CFLAGS) \
2478
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
2479
			$(XDR_CFLAGS) \
2480
			$(AM_CFLAGS)
2481 2482
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
2483
			$(AVAHI_LIBS) \
2484
			$(DBUS_LIBS) \
2485
			$(NULL)
2486 2487 2488
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2489 2490 2491 2492 2493
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 已提交
2494 2495
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
2496
libvirt_net_rpc_client_la_LDFLAGS = $(AM_LDFLAGS)
2497 2498
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
2499

2500
if WITH_LIBVIRTD
2501 2502
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2503 2504 2505 2506
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2507 2508
libvirt_iohelper_LDADD = \
		libvirt_util.la \
2509
		../gnulib/lib/libgnu.la
2510 2511
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
2512
endif WITH_DTRACE_PROBES
2513

D
Daniel P. Berrange 已提交
2514 2515 2516 2517
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2518 2519


2520
endif WITH_LIBVIRTD
2521

2522
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
2523
if WITH_LIBVIRTD
2524
libexec_PROGRAMS += libvirt_parthelper
2525

2526
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
D
Daniel P. Berrange 已提交
2527 2528 2529 2530
libvirt_parthelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2531 2532 2533
libvirt_parthelper_LDADD = \
		$(LIBPARTED_LIBS) \
		libvirt_util.la \
2534
		../gnulib/lib/libgnu.la
2535 2536
if WITH_DTRACE_PROBES
libvirt_parthelper_LDADD += libvirt_probes.lo
2537
endif WITH_DTRACE_PROBES
2538

D
Daniel P. Berrange 已提交
2539 2540 2541 2542 2543
libvirt_parthelper_CFLAGS = \
		$(LIBPARTED_CFLAGS) \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2544 2545
endif WITH_LIBVIRTD
endif WITH_STORAGE_DISK
2546 2547
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)

2548

2549
if WITH_SANLOCK
2550 2551 2552
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2553
libvirt_sanlock_helper_CFLAGS = \
2554
		-I$(srcdir)/conf \
D
Daniel P. Berrange 已提交
2555 2556 2557 2558 2559 2560 2561
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2562
libvirt_sanlock_helper_LDADD = libvirt.la
2563
endif WITH_SANLOCK
2564

2565

J
Jamie Strandboge 已提交
2566 2567 2568 2569 2570 2571
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 已提交
2572 2573 2574 2575
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2576 2577 2578 2579 2580
virt_aa_helper_LDADD = \
		libvirt.la \
		libvirt_conf.la \
		libvirt_util.la \
		libvirt_driver_storage_impl.la \
C
Chris Lalancette 已提交
2581
		../gnulib/lib/libgnu.la
2582
if WITH_DTRACE_PROBES
2583
virt_aa_helper_LDADD += libvirt_probes.lo
2584
endif WITH_DTRACE_PROBES
2585 2586 2587 2588 2589
virt_aa_helper_CFLAGS = \
		-I$(srcdir)/conf \
		-I$(srcdir)/security \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
D
Daniel P. Berrange 已提交
2590
		$(NULL)
2591 2592
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
J
Jamie Strandboge 已提交
2593 2594
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

2595
if WITH_NSS
2596 2597
noinst_LTLIBRARIES += libvirt-nss.la

2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646
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 \
2647 2648
		$(NULL)

2649 2650 2651 2652
libvirt_nss_la_CFLAGS = \
		-DLIBVIRT_NSS \
		$(AM_CFLAGS) \
		$(YAJL_CFLAGS) \
2653
		$(NULL)
2654 2655
libvirt_nss_la_LDFLAGS = \
		$(AM_LDFLAGS) \
2656 2657
		$(NULL)

2658 2659
libvirt_nss_la_LIBADD = \
		$(YAJL_LIBS) \
2660
		$(NULL)
2661
endif WITH_NSS
2662 2663


2664
install-data-local: install-init install-systemd install-upstart \
2665
		install-sysctl install-polkit install-sasl \
2666
		install-logrotate $(INSTALL_DATA_DIRS:%=install-data-%)
2667
if WITH_LIBVIRTD
2668
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt"
2669
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
2670
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
2671
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
2672
endif WITH_LIBVIRTD
2673 2674
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
2675
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
2676
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
2677
if WITH_SANLOCK
2678
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
2679
endif WITH_SANLOCK
2680

2681
uninstall-local:: uninstall-init uninstall-systemd uninstall-upstart \
2682
		uninstall-sysctl uninstall-polkit uninstall-sasl \
2683
		uninstall-logrotate $(INSTALL_DATA_DIRS:%=uninstall-data-%)
2684
if WITH_LIBVIRTD
2685
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt" ||:
2686
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
2687 2688
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
2689
endif WITH_LIBVIRTD
2690 2691
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
2692
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
2693
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
2694
if WITH_SANLOCK
2695
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
2696
endif WITH_SANLOCK
2697
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
2698

2699 2700
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
2701 2702 2703 2704 2705
MAINTAINERCLEANFILES += \
	$(REMOTE_DRIVER_GENERATED) \
	$(LIBVIRTD_GENERATED) \
	$(VIR_NET_RPC_GENERATED) \
	$(NULL)