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

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

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

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

40 41
WARN_CFLAGS += $(STRICT_FRAME_LIMIT_CFLAGS)

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

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

59
EXTRA_DIST = $(conf_DATA)
60

61
BUILT_SOURCES =
62 63 64
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
65
nodist_conf_DATA =
66 67 68 69 70
DRIVER_SOURCE_FILES =
STATEFUL_DRIVER_SOURCE_FILES =
noinst_LTLIBRARIES =
mod_LTLIBRARIES =
INSTALL_DATA_DIRS =
71
libvirt_la_BUILT_LIBADD =
72 73 74
SYM_FILES =
USED_SYM_FILES =
GENERATED_SYM_FILES =
75 76 77 78 79 80 81
augeas_DATA =
augeastest_DATA =
conf_DATA =
AUGEAS_DIRS =
if WITH_DTRACE_PROBES
tapset_DATA =
endif WITH_DTRACE_PROBES
82 83
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
include storage/Makefile.inc.am
107

108

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

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

122

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

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

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

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

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

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

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

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

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

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

man7_MANS = $(KEYMANS)

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

315
# Internal generic driver infrastructure
O
Osier Yang 已提交
316
DATATYPES_SOURCES = datatypes.h datatypes.c
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 345
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 \
346
		$(NULL)
347

348 349 350
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

351 352
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
353

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

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

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

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

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

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

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


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

399 400
DRIVER_SOURCES += $(LOG_PROTOCOL_GENERATED)

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

EXTRA_DIST += check-drivername.pl

793
DRIVER_SOURCE_FILES += \
794
	$(REMOTE_DRIVER_SOURCES) \
795 796 797 798
	$(NULL)

check-driverimpls:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-driverimpls.pl \
799
		$(filter /%,$(DRIVER_SOURCE_FILES)) \
E
Eric Blake 已提交
800 801 802
		$(filter $(srcdir)/%,$(DRIVER_SOURCE_FILES)) \
		$(addprefix $(srcdir)/,$(filter-out $(srcdir)/%, \
			$(filter-out /%,$(DRIVER_SOURCE_FILES))))
803

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

809 810 811 812 813
check-aclperms:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclperms.pl \
		$(srcdir)/access/viraccessperm.h \
		$(srcdir)/access/viraccessperm.c

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

816
check-local: check-protocol check-symfile check-symsorting \
817
	check-drivername check-driverimpls check-aclrules \
818
	check-aclperms check-admin-symfile check-admin-symsorting
819
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
820

821

822 823
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES = \
		$(DATATYPES_SOURCES) \
J
Jamie Strandboge 已提交
824 825
		security/virt-aa-helper.c

826 827


828
UTIL_IO_HELPER_SOURCES = \
829 830
		util/iohelper.c

831

832
# Security framework and drivers for various models
833 834 835 836 837
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 \
838
		security/security_manager.h security/security_manager.c
839

840
SECURITY_DRIVER_SELINUX_SOURCES = \
841
		security/security_selinux.h security/security_selinux.c
842

843
SECURITY_DRIVER_APPARMOR_SOURCES = \
J
Jamie Strandboge 已提交
844 845
		security/security_apparmor.h security/security_apparmor.c

846
ACCESS_DRIVER_GENERATED = \
E
Eric Blake 已提交
847 848 849 850 851 852 853
		access/viraccessapicheck.h \
		access/viraccessapicheck.c \
		access/viraccessapicheckqemu.h \
		access/viraccessapicheckqemu.c \
		access/viraccessapichecklxc.h \
		access/viraccessapichecklxc.c \
		$(NULL)
854

855
ACCESS_DRIVER_SYM_FILES = \
856 857 858
		libvirt_access.syms \
		libvirt_access_qemu.syms \
		libvirt_access_lxc.syms
859

860 861 862 863 864
ACCESS_DRIVER_API_FILES = \
		libvirt_access.xml \
		libvirt_access_qemu.xml \
		libvirt_access_lxc.xml

865 866 867 868 869 870 871
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

872 873 874 875
ACCESS_DRIVER_POLKIT_SOURCES = \
		access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c

ACCESS_DRIVER_POLKIT_POLICY = \
876
		$(srcdir)/access/org.libvirt.api.policy
877 878


879 880 881 882 883 884 885
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 \
886
		cpu/cpu_map.h cpu/cpu_map.c
887

888
VMX_SOURCES = \
889 890
		vmx/vmx.c vmx/vmx.h

891

J
Jiri Denemark 已提交
892 893
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
894
EXTRA_DIST +=	$(pkgdata_DATA)
895

896 897 898 899 900 901
#########################
#
# Build up list of libvirt.la source files based on configure conditions
#
# First deal with sources usable in non-daemon context

902
noinst_LTLIBRARIES += libvirt_util.la
903
libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
904
libvirt_la_BUILT_LIBADD += libvirt_util.la
905
libvirt_util_la_SOURCES = \
906
		$(UTIL_SOURCES)
907
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
908
		$(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
909
		$(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS) \
910
		$(POLKIT_CFLAGS) $(GNUTLS_CFLAGS) $(ACL_CFLAGS)
911
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
912
		$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
913
		$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(WIN32_EXTRA_LIBS) $(LIBXML_LIBS) \
M
Michal Privoznik 已提交
914
		$(SECDRIVER_LIBS) $(NUMACTL_LIBS) $(ACL_LIBS) \
915
		$(POLKIT_LIBS) $(GNUTLS_LIBS)
916

917 918

noinst_LTLIBRARIES += libvirt_conf.la
919
libvirt_la_BUILT_LIBADD += libvirt_conf.la
920
libvirt_conf_la_SOURCES = $(CONF_SOURCES)
921 922
libvirt_conf_la_CFLAGS = \
		-I$(srcdir)/conf $(AM_CFLAGS)
923
libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS)
924
libvirt_conf_la_LIBADD = $(LIBXML_LIBS)
925

J
Jiri Denemark 已提交
926
noinst_LTLIBRARIES += libvirt_cpu.la
927
libvirt_la_BUILT_LIBADD += libvirt_cpu.la
J
Jiri Denemark 已提交
928
libvirt_cpu_la_CFLAGS = \
929
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jiri Denemark 已提交
930 931
libvirt_cpu_la_SOURCES = $(CPU_SOURCES)

932 933 934 935
if WITH_VMX
noinst_LTLIBRARIES += libvirt_vmx.la
libvirt_la_BUILT_LIBADD += libvirt_vmx.la
libvirt_vmx_la_CFLAGS = \
936
		-I$(srcdir)/conf $(AM_CFLAGS)
937
libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
938
endif WITH_VMX
939

940

941
noinst_LTLIBRARIES += libvirt_driver.la
942
libvirt_la_BUILT_LIBADD += libvirt_driver.la
943
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
944

945
libvirt_driver_la_CFLAGS = \
946
		$(GNUTLS_CFLAGS) $(CURL_CFLAGS) $(XDR_CFLAGS) \
947
		-I$(srcdir)/conf $(AM_CFLAGS)
948
libvirt_driver_la_LIBADD = \
949
		$(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS)
950

951 952
# 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.
953 954 955
SYM_FILES += $(USED_SYM_FILES)
USED_SYM_FILES += $(srcdir)/libvirt_private.syms
GENERATED_SYM_FILES += \
956 957
	$(ACCESS_DRIVER_SYM_FILES) \
	libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \
958
	libvirt_admin.syms libvirt_admin.def \
959
	$(NULL)
960

961
if WITH_REMOTE
962
noinst_LTLIBRARIES += libvirt_driver_remote.la
963
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
964 965 966 967
libvirt_driver_remote_la_CFLAGS = \
		$(XDR_CFLAGS) \
		-I$(srcdir)/conf \
		-I$(srcdir)/rpc \
968 969
		$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
970
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
971

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

974 975
endif WITH_REMOTE

976 977 978 979 980 981 982

if WITH_LIBVIRTD

sbin_PROGRAMS += libvirtd

BUILT_SOURCES += $(LIBVIRTD_GENERATED)

983 984 985 986 987 988
augeas_DATA += remote/libvirtd.aug

augeastest_DATA += test_libvirtd.aug

conf_DATA += remote/libvirtd.conf

989
CLEANFILES += test_libvirtd.aug
990

991 992 993 994 995 996 997 998 999 1000 1001
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
1002
CLEANFILES += libvirtd.policy
1003 1004 1005 1006 1007 1008 1009

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

1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030
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 已提交
1031 1032 1033
	libvirt-lxc.la \
	libvirt-qemu.la \
	libvirt.la \
1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050
	$(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
1051 1052 1053 1054
EXTRA_DIST += \
	remote/test_libvirtd.aug.in \
	remote/libvirtd.aug \
	remote/libvirtd.conf \
1055 1056 1057 1058
	remote/libvirtd.policy.in \
	remote/libvirtd.rules \
	remote/libvirtd.sasl \
	remote/libvirtd.sysctl \
1059
	$(NULL)
1060

1061
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
1062
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
1063
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1064

1065
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
1066
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
1067
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1068

1069

1070

1071

1072

1073

1074 1075 1076 1077
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 = \
1078
		-I$(srcdir)/conf $(AM_CFLAGS)
1079
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
1080
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
1081
if WITH_SECDRIVER_SELINUX
1082 1083
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
1084
endif WITH_SECDRIVER_SELINUX
J
Jamie Strandboge 已提交
1085
if WITH_SECDRIVER_APPARMOR
1086 1087
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
1088
endif WITH_SECDRIVER_APPARMOR
1089

1090 1091
libvirt_driver_access_la_SOURCES = \
	$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
1092 1093 1094
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
1095
		-I$(srcdir)/conf $(AM_CFLAGS)
1096 1097 1098
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD =

1099 1100
EXTRA_DIST += access/genpolkit.pl

1101 1102 1103 1104
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
    $(srcdir)/access/genpolkit.pl Makefile.am
	$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@

1105 1106 1107 1108
if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)

polkitactiondir = $(datadir)/polkit-1/actions
1109
if WITH_LIBVIRTD
1110
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
1111
endif WITH_LIBVIRTD
1112 1113 1114

CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
1115
else ! WITH_POLKIT1
1116
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
1117
endif ! WITH_POLKIT1
1118

1119

1120 1121
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135

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

1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148
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 已提交
1149
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
1150 1151
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1152 1153 1154
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
1155 1156
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1157 1158
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
	  > $(srcdir)/access/viraccessapicheck.c
1159

E
Eric Blake 已提交
1160
access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
1161 1162
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1163 1164 1165
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheckqemu.h
access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
1166 1167
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1168 1169
	  qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h \
	  > $(srcdir)/access/viraccessapicheckqemu.c
1170

E
Eric Blake 已提交
1171
access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
1172 1173
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1174 1175 1176
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/access/viraccessapichecklxc.h
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
1177 1178
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1179 1180
	  lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \
	  > $(srcdir)/access/viraccessapichecklxc.c
1181

1182
# Add all conditional sources just in case...
1183 1184 1185 1186
EXTRA_DIST += \
		$(REMOTE_DRIVER_SOURCES) \
		$(SECURITY_DRIVER_SELINUX_SOURCES) \
		$(SECURITY_DRIVER_APPARMOR_SOURCES) \
1187
		$(ACCESS_DRIVER_POLKIT_POLICY)
1188

1189 1190
check-local: check-augeas

1191 1192 1193
.PHONY: check-augeas \
	check-augeas-sanlock \
	check-augeas-lockd \
1194
	check-augeas-libvirtd \
1195
	$(NULL)
1196

1197
check-augeas: $(AUGEAS_DIRS:%=check-augeas-%) \
1198
	check-augeas-sanlock \
1199
	check-augeas-lockd check-augeas-virtlockd \
1200
	check-augeas-virtlogd check-augeas-libvirtd
1201

1202
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
1203
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
1204

1205

1206
if WITH_SANLOCK
1207 1208
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1209
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
1210

1211
check-augeas-sanlock: test_libvirt_sanlock.aug
1212
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1213
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
1214
	fi
1215
else ! WITH_SANLOCK
1216
check-augeas-sanlock:
1217
endif ! WITH_SANLOCK
1218

1219
if WITH_QEMU
1220 1221 1222
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 $< $@
1223 1224 1225
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
1226

1227 1228
test_virtlockd.aug: locking/test_virtlockd.aug.in \
		locking/virtlockd.conf $(AUG_GENTEST)
1229
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
1230

1231
if WITH_QEMU
1232 1233 1234 1235
check-augeas-lockd: test_libvirt_lockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_lockd.aug; \
	fi
1236 1237 1238
else ! WITH_QEMU
check-augeas-lockd:
endif ! WITH_QEMU
1239

1240 1241 1242 1243 1244
check-augeas-virtlockd: test_virtlockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
	fi

1245

1246 1247 1248 1249 1250 1251 1252 1253 1254
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

1255 1256 1257
if WITH_LIBVIRTD
test_libvirtd.aug: remote/test_libvirtd.aug.in \
		remote/libvirtd.conf $(AUG_GENTEST)
1258
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/remote/libvirtd.conf $< $@
1259 1260 1261 1262 1263 1264 1265 1266

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
1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285
#
# 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.
#

1286
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
1287

1288
if WITH_LINUX
1289
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
1290
else ! WITH_LINUX
1291
SYM_FILES += $(srcdir)/libvirt_linux.syms
1292
endif ! WITH_LINUX
1293

E
Eric Blake 已提交
1294 1295 1296 1297 1298 1299
if WITH_REMOTE
USED_SYM_FILES += $(srcdir)/libvirt_remote.syms
else ! WITH_REMOTE
SYM_FILES += $(srcdir)/libvirt_remote.syms
endif ! WITH_REMOTE

1300
if WITH_VMX
1301
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
1302
else ! WITH_VMX
1303
SYM_FILES += $(srcdir)/libvirt_vmx.syms
1304
endif ! WITH_VMX
1305

1306
if WITH_SASL
1307
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
1308
else ! WITH_SASL
1309
SYM_FILES += $(srcdir)/libvirt_sasl.syms
1310
endif ! WITH_SASL
E
Eric Blake 已提交
1311

1312 1313
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
1314
else ! WITH_GNUTLS
1315
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
1316
endif ! WITH_GNUTLS
1317

1318
if WITH_SSH2
1319
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
1320
else ! WITH_SSH2
1321
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
1322
endif ! WITH_SSH2
1323

1324
if WITH_ATOMIC_OPS_PTHREAD
1325
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
1326
else ! WITH_ATOMIC_OPS_PTHREAD
1327
SYM_FILES += $(srcdir)/libvirt_atomic.syms
1328
endif ! WITH_ATOMIC_OPS_PTHREAD
1329

1330 1331 1332 1333 1334 1335
if WITH_LIBSSH
USED_SYM_FILES += $(srcdir)/libvirt_libssh.syms
else ! WITH_LIBSSH
SYM_FILES += $(srcdir)/libvirt_libssh.syms
endif ! WITH_LIBSSH

1336
EXTRA_DIST += \
1337 1338 1339 1340 1341 1342
	libvirt_public.syms \
	libvirt_lxc.syms \
	libvirt_qemu.syms \
	libvirt_admin_public.syms \
	$(SYM_FILES) \
	$(ADMIN_SYM_FILES) \
1343
	$(NULL)
1344

1345
BUILT_SOURCES += $(GENERATED_SYM_FILES)
1346

1347 1348
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(ACCESS_DRIVER_SYM_FILES) \
1349
		$(top_builddir)/config.status
1350 1351 1352 1353 1354 1355
	$(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 && \
1356
	cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
1357 1358
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
1359
	mv $@-tmp libvirt.syms
1360

1361
%.def: %.syms
1362 1363
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
1364
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d' \
1365
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
1366
	chmod a-w $@-tmp && \
1367
	mv $@-tmp $@
1368

1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381
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

1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396

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) \
1397
		$(XDR_CFLAGS) \
1398 1399 1400 1401 1402 1403
		-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)

1404 1405 1406 1407
# 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 已提交
1408 1409
lib_LTLIBRARIES += libvirt-admin.la
libvirt_admin_la_SOURCES = \
1410 1411
		libvirt-admin.c \
		$(ADMIN_PROTOCOL_GENERATED) \
M
Martin Kletzander 已提交
1412 1413 1414
		$(DATATYPES_SOURCES)

libvirt_admin_la_LDFLAGS = \
1415 1416
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_ADMIN_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
1417
		$(AM_LDFLAGS)
M
Martin Kletzander 已提交
1418 1419

libvirt_admin_la_LIBADD = \
1420
		libvirt.la \
M
Martin Kletzander 已提交
1421 1422 1423
		$(CYGWIN_EXTRA_LIBADD)

libvirt_admin_la_CFLAGS = \
1424 1425 1426
		$(AM_CFLAGS) \
		-I$(srcdir)/remote \
		-I$(srcdir)/rpc \
M
Martin Kletzander 已提交
1427 1428 1429
		-I$(srcdir)/admin

libvirt_admin_la_CFLAGS += \
1430 1431 1432 1433 1434 1435
		$(XDR_CFLAGS) \
		$(CAPNG_CFLAGS) \
		$(YAJL_CFLAGS) \
		$(SSH2_CFLAGS) \
		$(SASL_CFLAGS) \
		$(GNUTLS_CFLAGS) \
1436
		$(LIBSSH_CFLAGS)
M
Martin Kletzander 已提交
1437 1438

libvirt_admin_la_LIBADD += \
1439 1440 1441 1442 1443 1444 1445
		$(CAPNG_LIBS) \
		$(YAJL_LIBS) \
		$(DEVMAPPER_LIBS) \
		$(LIBXML_LIBS) \
		$(SSH2_LIBS) \
		$(SASL_LIBS) \
		$(GNUTLS_LIBS) \
1446
		$(LIBSSH_LIBS)
M
Martin Kletzander 已提交
1447

1448 1449
ADMIN_SYM_FILES = $(srcdir)/libvirt_admin_private.syms

M
Martin Kletzander 已提交
1450 1451 1452 1453
if WITH_DTRACE_PROBES
libvirt_admin_la_LIBADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

1454 1455
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
1456 1457 1458 1459
libvirt_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(LIBVIRT_NODELETE) \
1460
		$(NO_UNDEFINED_LDFLAGS) \
D
Daniel P. Berrange 已提交
1461 1462
		$(AM_LDFLAGS) \
		$(NULL)
1463
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
1464
libvirt_la_LIBADD += \
1465
		    $(DRIVER_MODULES_LIBS) \
1466
		    $(CYGWIN_EXTRA_LIBADD)
1467
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
1468 1469 1470 1471 1472 1473
# 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)
1474

1475
if WITH_DTRACE_PROBES
1476
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
1477
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
1478
nodist_libvirt_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
1479
if WITH_REMOTE
E
Eric Blake 已提交
1480
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
1481
endif WITH_REMOTE
1482
DTRACE2SYSTEMTAP_FLAGS = --with-modules
1483

1484 1485
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

1486 1487

tapsetdir = $(datadir)/systemtap/tapset
1488
tapset_DATA += libvirt_probes.stp libvirt_functions.stp
1489

1490
%_probes.h: %_probes.d
1491 1492
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

E
Eric Blake 已提交
1493
.PRECIOUS: %_probes.o
1494
%_probes.o: %_probes.d
1495 1496
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

1497 1498 1499 1500 1501 1502 1503 1504 1505
%_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 已提交
1506
# Keep this list synced with PROTOCOL_STRUCTS
1507
RPC_PROBE_FILES += $(srcdir)/rpc/virnetprotocol.x \
J
Jiri Denemark 已提交
1508 1509
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
1510
		  $(srcdir)/remote/lxc_protocol.x \
1511
		  $(srcdir)/remote/qemu_protocol.x \
M
Martin Kletzander 已提交
1512 1513
		  $(srcdir)/locking/lock_protocol.x \
		  $(srcdir)/admin/admin_protocol.x
1514 1515

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

1518 1519
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl \
		$(top_builddir)/config.status
1520
	$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
1521
	  $(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
1522

1523
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
1524
              libvirt_functions.stp libvirt_probes.stp
1525
endif WITH_DTRACE_PROBES
1526

1527
EXTRA_DIST += libvirt_probes.d
1528

C
Chris Lalancette 已提交
1529
libvirt_qemu_la_SOURCES = libvirt-qemu.c
D
Daniel P. Berrange 已提交
1530 1531 1532 1533 1534
libvirt_qemu_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
1535
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
C
Chris Lalancette 已提交
1536
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
1537

1538
libvirt_lxc_la_SOURCES = libvirt-lxc.c
D
Daniel P. Berrange 已提交
1539 1540 1541 1542 1543
libvirt_lxc_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
1544 1545 1546
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)

1547 1548 1549 1550 1551 1552 1553
# 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
1554
if WITH_SETUID_RPC_CLIENT
1555 1556
noinst_LTLIBRARIES += libvirt-setuid-rpc-client.la

1557 1558
libvirt_setuid_rpc_client_la_SOURCES = \
		util/viralloc.c \
1559
		util/virarch.c \
1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624
		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 \
1625 1626
		$(NULL)

1627 1628 1629 1630
libvirt_setuid_rpc_client_la_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(LIBXML_LIBS) \
		$(SECDRIVER_LIBS) \
1631
		$(NULL)
1632 1633 1634 1635 1636 1637 1638
libvirt_setuid_rpc_client_la_CFLAGS = \
		-DLIBVIRT_SETUID_RPC_CLIENT \
		-I$(srcdir)/conf \
		-I$(srcdir)/rpc \
		$(AM_CFLAGS) \
		$(SECDRIVER_CFLAGS) \
		$(XDR_CFLAGS) \
1639
		$(NULL)
1640
endif WITH_SETUID_RPC_CLIENT
1641

1642 1643 1644
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

1645
if WITH_LIBVIRTD
1646 1647 1648 1649 1650
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
		$(LOCK_DRIVER_LOCKD_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
		$(NULL)
1651
lockd_la_CFLAGS = -I$(srcdir)/conf \
E
Eric Blake 已提交
1652 1653
		$(XDR_CFLAGS) \
		$(AM_CFLAGS)
1654
lockd_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1655
lockd_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
J
Jiri Denemark 已提交
1656
augeas_DATA += locking/libvirt_lockd.aug
1657 1658
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
1659
endif WITH_DTRACE_PROBES
1660
if WITH_QEMU
1661 1662
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
1663
nodist_conf_DATA += locking/qemu-lockd.conf
1664 1665
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
1666
endif WITH_QEMU
1667

1668 1669 1670 1671 1672 1673
if WITH_LIBXL
nodist_conf_DATA += locking/libxl-lockd.conf
BUILT_SOURCES += locking/libxl-lockd.conf
DISTCLEANFILES += locking/libxl-lockd.conf
endif WITH_LIBXL

1674 1675 1676 1677 1678
locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
	$(AM_V_GEN)$(MKDIR_P) locking ; \
	cp $< $@


1679
sbin_PROGRAMS += virtlockd virtlogd
1680

1681 1682 1683
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
1684
		$(LOCK_DAEMON_GENERATED) \
1685
		$(NULL)
1686 1687
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
1688
		$(PIE_CFLAGS) \
1689
		$(XDR_CFLAGS) \
1690 1691 1692
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
1693
		$(PIE_LDFLAGS) \
1694
		$(NO_UNDEFINED_LDFLAGS) \
1695 1696
		$(NULL)
virtlockd_LDADD = \
1697
		libvirt_driver_admin.la \
1698 1699 1700 1701 1702 1703 1704 1705
		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
1706
endif WITH_DTRACE_PROBES
1707

1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721

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) \
1722
		$(NO_UNDEFINED_LDFLAGS) \
1723 1724
		$(NULL)
virtlogd_LDADD = \
1725
		libvirt_driver_admin.la \
1726 1727 1728 1729 1730 1731 1732 1733 1734 1735
		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

1736
else ! WITH_LIBVIRTD
1737
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
1738 1739
              $(LOCK_DRIVER_LOCKD_SOURCES) \
	      $(LOG_DAEMON_SOURCES)
1740
endif ! WITH_LIBVIRTD
1741

1742
SYSCONF_FILES = \
1743
	locking/virtlockd.sysconf \
1744
	logging/virtlogd.sysconf \
1745
	remote/libvirtd.sysconf \
1746 1747 1748
	$(NULL)

EXTRA_DIST += \
J
Jiri Denemark 已提交
1749 1750
	locking/lockd.conf \
	locking/libvirt_lockd.aug \
1751
	locking/test_libvirt_lockd.aug.in \
1752 1753
	$(SYSCONF_FILES) \
	$(NULL)
1754 1755

install-sysconfig:
E
Eric Blake 已提交
1756
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
1757 1758 1759
	for f in $(SYSCONF_FILES:%.sysconf=%) ; \
	do \
	  tgt=`basename $$f`; \
1760 1761
	  $(INSTALL_SCRIPT) $(srcdir)/$$f.sysconf \
	      $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
1762
	done
1763 1764

uninstall-sysconfig:
1765 1766 1767 1768 1769
	for f in $(SYSCONF_FILES:%.sysconf=%) ; \
	do \
	  tgt=`basename $$f`; \
	  rm -f $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
	done
E
Eric Blake 已提交
1770
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
1771

1772 1773 1774
SYSVINIT_FILES_IN = \
	locking/virtlockd.init.in \
	logging/virtlogd.init.in \
1775
	remote/libvirtd.init.in \
1776 1777 1778 1779 1780
	$(NULL)

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

EXTRA_DIST += $(SYSVINIT_FILES_IN)
1781

1782 1783 1784 1785 1786 1787 1788 1789 1790 1791
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)

1792
if WITH_LIBVIRTD
1793

1794 1795 1796
LOGROTATE_FILES := $(LOGROTATE_FILES_IN:remote/%.in=%)

BUILT_SOURCES += $(LOGROTATE_FILES)
1797
CLEANFILES += $(LOGROTATE_FILES)
1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817

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

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 1856
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

1857
if LIBVIRT_INIT_SCRIPT_RED_HAT
1858
install-init:: $(SYSVINIT_FILES) install-sysconfig
E
Eric Blake 已提交
1859
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
1860 1861 1862 1863
	for f in $(SYSVINIT_FILES:%.init=%) ; \
	do \
	  $(INSTALL_SCRIPT) $$f.init $(DESTDIR)$(sysconfdir)/rc.d/init.d/$$f; \
	done
1864 1865

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

1869 1870
BUILT_SOURCES += $(SYSVINIT_FILES)
DISTCLEANFILES += $(SYSVINIT_FILES)
1871
else ! LIBVIRT_INIT_SCRIPT_RED_HAT
1872 1873
install-init::
uninstall-init::
1874 1875
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
else ! WITH_LIBVIRTD
1876 1877 1878 1879
install-polkit::
uninstall-polkit::
install-sysctl::
uninstall-sysctl::
1880 1881
install-init::
uninstall-init::
1882 1883
install-logrotate::
uninstall-logrotate::
1884
endif ! WITH_LIBVIRTD
1885

1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902
# 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


1903 1904 1905 1906 1907 1908 1909 1910 1911
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 $@

1912
virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
1913 1914 1915 1916 1917 1918
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    < $< > $@-t && \
	    chmod a+x $@-t && \
1919 1920
	    mv $@-t $@

1921
virtlogd.init: logging/virtlogd.init.in $(top_builddir)/config.status
1922 1923 1924 1925 1926 1927
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    < $< > $@-t && \
	    chmod a+x $@-t && \
1928 1929
	    mv $@-t $@

1930
virtlockd.8.in: locking/virtlockd.pod
1931 1932 1933 1934 1935 1936 1937 1938
	$(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 $@
1939

1940
virtlogd.8.in: logging/virtlogd.pod
1941 1942 1943 1944 1945 1946 1947 1948
	$(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 $@
1949

1950 1951 1952 1953 1954 1955 1956 1957 1958 1959
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 $@

1960
%.8: %.8.in $(top_srcdir)/configure.ac
1961
	$(AM_V_GEN)sed \
1962 1963 1964
		-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
		-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
		< $< > $@-t && \
1965 1966
	mv $@-t $@

1967
if WITH_LIBVIRTD
1968
man8_MANS = virtlockd.8 virtlogd.8 libvirtd.8
1969

1970
conf_DATA += locking/virtlockd.conf logging/virtlogd.conf
1971

1972 1973
augeas_DATA += locking/virtlockd.aug logging/virtlogd.aug
augeastest_DATA += test_virtlockd.aug test_virtlogd.aug
1974
endif WITH_LIBVIRTD
1975

A
Andrea Bolognani 已提交
1976 1977 1978
PODFILES = \
	locking/virtlockd.pod \
	logging/virtlogd.pod \
1979
	remote/libvirtd.pod \
A
Andrea Bolognani 已提交
1980 1981 1982 1983 1984
	$(NULL)

MANINFILES = \
	virtlockd.8.in \
	virtlogd.8.in \
1985
	libvirtd.8.in \
A
Andrea Bolognani 已提交
1986 1987 1988 1989
	$(NULL)

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

1991 1992 1993 1994 1995 1996 1997
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 \
1998 1999
	remote/libvirtd.service.in \
	remote/virt-guest-shutdown.target.in \
2000 2001
	$(NULL)

2002
EXTRA_DIST += \
2003
        $(SYSTEMD_UNIT_FILES_IN) \
2004 2005 2006
        locking/virtlockd.aug \
        locking/virtlockd.conf \
        locking/test_virtlockd.aug.in \
2007 2008 2009
        logging/virtlogd.aug \
        logging/virtlogd.conf \
        logging/test_virtlogd.aug.in \
A
Andrea Bolognani 已提交
2010 2011
        $(PODFILES) \
        $(MANINFILES) \
2012
        $(NULL)
2013

2014 2015 2016 2017

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

2018
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
2019
SYSTEMD_UNIT_FILES = $(notdir $(SYSTEMD_UNIT_FILES_IN:%.in=%))
2020

2021 2022
BUILT_SOURCES += $(SYSTEMD_UNIT_FILES)
DISTCLEANFILES += $(SYSTEMD_UNIT_FILES)
2023

2024
install-systemd: $(SYSTEMD_UNIT_FILES) install-sysconfig
E
Eric Blake 已提交
2025
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
2026 2027 2028 2029
	for f in $(SYSTEMD_UNIT_FILES); \
	do \
	  $(INSTALL_DATA) $$f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/ ; \
	done
2030 2031

uninstall-systemd: uninstall-sysconfig
2032
	rm -f $(SYSTEMD_UNIT_FILES:%=$(DESTDIR)$(SYSTEMD_UNIT_DIR)/%)
E
Eric Blake 已提交
2033
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
2034
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
2035 2036
install-systemd:
uninstall-systemd:
2037 2038
endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
else ! WITH_LIBVIRTD
2039 2040
install-systemd:
uninstall-systemd:
2041
endif ! WITH_LIBVIRTD
2042

2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054
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 $< $@

2055
virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
2056 2057 2058
	$(AM_V_GEN)sed \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    < $< > $@-t && \
2059 2060 2061
	    mv $@-t $@

virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
2062 2063 2064
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
2065 2066
	    mv $@-t $@

J
John Ferlan 已提交
2067 2068 2069 2070 2071 2072 2073
virtlockd-admin.socket: locking/virtlockd-admin.socket.in \
                        $(top_builddir)/config.status
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
	    mv $@-t $@

2074
virtlogd.service: logging/virtlogd.service.in $(top_builddir)/config.status
2075 2076 2077
	$(AM_V_GEN)sed \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    < $< > $@-t && \
2078 2079 2080
	    mv $@-t $@

virtlogd.socket: logging/virtlogd.socket.in $(top_builddir)/config.status
J
John Ferlan 已提交
2081 2082 2083 2084 2085 2086 2087
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
	    mv $@-t $@

virtlogd-admin.socket: logging/virtlogd-admin.socket.in \
                       $(top_builddir)/config.status
2088 2089 2090
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
2091 2092
	    mv $@-t $@

2093

2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107
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` ; \
2108 2109
	  $(INSTALL_SCRIPT) $(srcdir)/$$f.upstart \
	      $(DESTDIR)$(sysconfdir)/event.d/$$tgt ; \
2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127
	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

2128
if WITH_SANLOCK
2129
lockdriver_LTLIBRARIES += sanlock.la
2130
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
2131
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
2132
sanlock_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
2133
sanlock_la_LIBADD = -lsanlock_client libvirt.la ../gnulib/lib/libgnu.la
2134 2135

augeas_DATA += locking/libvirt_sanlock.aug
2136 2137
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
2138

E
Eric Blake 已提交
2139
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
2140
	$(AM_V_GEN)$(MKDIR_P) locking ; \
2141 2142 2143
	cp $< $@

if WITH_QEMU
2144
nodist_conf_DATA += locking/qemu-sanlock.conf
2145
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
2146
DISTCLEANFILES += locking/qemu-sanlock.conf
2147
endif WITH_QEMU
2148 2149 2150 2151 2152 2153

if WITH_LIBXL
nodist_conf_DATA += locking/libxl-sanlock.conf
BUILT_SOURCES += locking/libxl-sanlock.conf
DISTCLEANFILES += locking/libxl-sanlock.conf
endif WITH_LIBXL
2154
else ! WITH_SANLOCK
2155
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
2156
endif ! WITH_SANLOCK
2157 2158
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
2159
	locking/test_libvirt_sanlock.aug.in
2160

2161 2162 2163 2164
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
2165

2166 2167 2168 2169 2170
libvirt_la_BUILT_LIBADD += \
       libvirt-net-rpc.la \
       libvirt-net-rpc-server.la \
       libvirt-net-rpc-client.la

2171
EXTRA_DIST += \
E
Eric Blake 已提交
2172 2173 2174 2175
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
2176 2177
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
2178

E
Eric Blake 已提交
2179
VIR_NET_RPC_GENERATED = \
2180 2181 2182 2183
	rpc/virnetprotocol.h \
	rpc/virnetprotocol.c \
	rpc/virkeepaliveprotocol.h \
	rpc/virkeepaliveprotocol.c
2184

2185
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2186

2187
libvirt_net_rpc_la_SOURCES = \
2188
	rpc/virnetmessage.h rpc/virnetmessage.c \
2189
	rpc/virnetsocket.h rpc/virnetsocket.c \
2190 2191
	rpc/virkeepalive.h rpc/virkeepalive.c \
	$(VIR_NET_RPC_GENERATED)
2192
if WITH_SSH2
2193 2194
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2195
else ! WITH_SSH2
2196 2197
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2198
endif ! WITH_SSH2
2199
if WITH_GNUTLS
2200 2201
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2202
else ! WITH_GNUTLS
2203 2204
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2205
endif ! WITH_GNUTLS
2206
if WITH_SASL
2207 2208
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2209
else ! WITH_SASL
2210 2211
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2212
endif ! WITH_SASL
2213 2214 2215 2216 2217 2218 2219
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
2220
libvirt_net_rpc_la_CFLAGS = \
2221
			$(GNUTLS_CFLAGS) \
2222
			$(SASL_CFLAGS) \
2223
			$(SSH2_CFLAGS) \
2224
			$(LIBSSH_CFLAGS) \
2225
			$(XDR_CFLAGS) \
2226 2227
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
2228
			$(GNUTLS_LIBS) \
2229
			$(SASL_LIBS) \
2230
			$(SSH2_LIBS)\
2231
			$(LIBSSH_LIBS) \
J
Jim Fehlig 已提交
2232
			$(SECDRIVER_LIBS) \
2233
			$(AM_LDFLAGS) \
2234
			$(NULL)
2235 2236 2237
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2238 2239 2240 2241
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
2242
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
2243
	rpc/virnetdaemon.h rpc/virnetdaemon.c \
2244 2245
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
2246
			$(AVAHI_CFLAGS) \
2247
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
2248
			$(XDR_CFLAGS) \
2249
			$(AM_CFLAGS)
2250 2251
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
2252
			$(AVAHI_LIBS) \
2253
			$(DBUS_LIBS) \
2254
			$(NULL)
2255 2256 2257
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2258 2259 2260 2261 2262
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 已提交
2263 2264
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
2265
libvirt_net_rpc_client_la_LDFLAGS = $(AM_LDFLAGS)
2266 2267
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
2268

2269
if WITH_LIBVIRTD
2270 2271
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2272 2273 2274 2275
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2276 2277
libvirt_iohelper_LDADD = \
		libvirt_util.la \
2278
		../gnulib/lib/libgnu.la
2279 2280
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
2281
endif WITH_DTRACE_PROBES
2282

D
Daniel P. Berrange 已提交
2283 2284 2285 2286
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2287 2288


2289
endif WITH_LIBVIRTD
2290

2291

2292
if WITH_SANLOCK
2293 2294 2295
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2296
libvirt_sanlock_helper_CFLAGS = \
2297
		-I$(srcdir)/conf \
D
Daniel P. Berrange 已提交
2298 2299 2300 2301 2302 2303 2304
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2305
libvirt_sanlock_helper_LDADD = libvirt.la
2306
endif WITH_SANLOCK
2307

2308

J
Jamie Strandboge 已提交
2309 2310 2311 2312 2313 2314
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 已提交
2315 2316 2317 2318
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2319 2320 2321 2322 2323
virt_aa_helper_LDADD = \
		libvirt.la \
		libvirt_conf.la \
		libvirt_util.la \
		libvirt_driver_storage_impl.la \
C
Chris Lalancette 已提交
2324
		../gnulib/lib/libgnu.la
2325
if WITH_DTRACE_PROBES
2326
virt_aa_helper_LDADD += libvirt_probes.lo
2327
endif WITH_DTRACE_PROBES
2328 2329 2330 2331 2332
virt_aa_helper_CFLAGS = \
		-I$(srcdir)/conf \
		-I$(srcdir)/security \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
D
Daniel P. Berrange 已提交
2333
		$(NULL)
2334 2335
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
J
Jamie Strandboge 已提交
2336 2337
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

2338
if WITH_NSS
2339 2340
noinst_LTLIBRARIES += libvirt-nss.la

2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389
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 \
2390 2391
		$(NULL)

2392 2393 2394 2395
libvirt_nss_la_CFLAGS = \
		-DLIBVIRT_NSS \
		$(AM_CFLAGS) \
		$(YAJL_CFLAGS) \
2396
		$(NULL)
2397 2398
libvirt_nss_la_LDFLAGS = \
		$(AM_LDFLAGS) \
2399 2400
		$(NULL)

2401 2402
libvirt_nss_la_LIBADD = \
		$(YAJL_LIBS) \
2403
		$(NULL)
2404
endif WITH_NSS
2405 2406


2407
install-data-local: install-init install-systemd install-upstart \
2408
		install-sysctl install-polkit install-sasl \
2409
		install-logrotate $(INSTALL_DATA_DIRS:%=install-data-%)
2410
if WITH_LIBVIRTD
2411
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt"
2412
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
2413
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
2414
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
2415
endif WITH_LIBVIRTD
2416 2417
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
2418
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
2419
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
2420
if WITH_SANLOCK
2421
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
2422
endif WITH_SANLOCK
2423

2424
uninstall-local:: uninstall-init uninstall-systemd uninstall-upstart \
2425
		uninstall-sysctl uninstall-polkit uninstall-sasl \
2426
		uninstall-logrotate $(INSTALL_DATA_DIRS:%=uninstall-data-%)
2427
if WITH_LIBVIRTD
2428
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt" ||:
2429
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
2430 2431
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
2432
endif WITH_LIBVIRTD
2433 2434
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
2435
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
2436
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
2437
if WITH_SANLOCK
2438
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
2439
endif WITH_SANLOCK
2440
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
2441

2442 2443
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
2444 2445 2446 2447 2448
MAINTAINERCLEANFILES += \
	$(REMOTE_DRIVER_GENERATED) \
	$(LIBVIRTD_GENERATED) \
	$(VIR_NET_RPC_GENERATED) \
	$(NULL)