Makefile.am 59.1 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 86 87 88 89 90 91 92
LOGROTATE_FILES_IN =
PODFILES =
MANINFILES =
SYSTEMD_UNIT_FILES_IN =
SYSVINIT_FILES_IN =
UPSTART_FILES =
SYSCONF_FILES =
sbin_PROGRAMS =
man8_MANS =
93

94
include conf/Makefile.inc.am
95
include cpu/Makefile.inc.am
96
include uml/Makefile.inc.am
97
include phyp/Makefile.inc.am
98
include test/Makefile.inc.am
99
include esx/Makefile.inc.am
100
include hyperv/Makefile.inc.am
101
include vmware/Makefile.inc.am
102
include vbox/Makefile.inc.am
103
include openvz/Makefile.inc.am
104
include qemu/Makefile.inc.am
105
include bhyve/Makefile.inc.am
106
include xenconfig/Makefile.inc.am
107
include libxl/Makefile.inc.am
108
include xen/Makefile.inc.am
109
include xenapi/Makefile.inc.am
110
include vz/Makefile.inc.am
111
include lxc/Makefile.inc.am
112
include interface/Makefile.inc.am
113
include network/Makefile.inc.am
114
include nwfilter/Makefile.inc.am
115
include node_device/Makefile.inc.am
116
include secret/Makefile.inc.am
117
include storage/Makefile.inc.am
118
include remote/Makefile.inc.am
119

120

E
Eric Blake 已提交
121 122
THREAD_LIBS = $(LIB_PTHREAD) $(LTLIBMULTITHREAD)

J
Jim Fehlig 已提交
123
SECDRIVER_CFLAGS =
124 125
SECDRIVER_LIBS =
if WITH_SECDRIVER_SELINUX
J
Jim Fehlig 已提交
126
SECDRIVER_CFLAGS += $(SELINUX_CFLAGS)
127
SECDRIVER_LIBS += $(SELINUX_LIBS)
128
endif WITH_SECDRIVER_SELINUX
129
if WITH_SECDRIVER_APPARMOR
J
Jim Fehlig 已提交
130
SECDRIVER_CFLAGS += $(APPARMOR_CFLAGS)
131
SECDRIVER_LIBS += $(APPARMOR_LIBS)
132
endif WITH_SECDRIVER_APPARMOR
133

134

135
lib_LTLIBRARIES = libvirt.la libvirt-qemu.la libvirt-lxc.la
136

137
moddir = $(libdir)/libvirt/connection-driver
138

A
Amy Griffis 已提交
139
confdir = $(sysconfdir)/libvirt
140
conf_DATA += libvirt.conf libvirt-admin.conf
141

142 143 144 145
augeasdir = $(datadir)/augeas/lenses

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

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

252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276
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

277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306
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 $@

307
KEYCODES = linux osx atset1 atset2 atset3 xtkbd usb win32 rfb
308 309 310 311 312 313 314
KEYNAMES = linux osx win32

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

315 316 317 318 319 320
KEYPODS = $(KEYCODES:%=util/virkeycode-%.pod) \
	  $(KEYNAMES:%=util/virkeyname-%.pod)
KEYMANS = $(KEYPODS:%.pod=%.7)

man7_MANS = $(KEYMANS)

321 322 323
UTIL_SOURCES += $(KEYTABLES)
BUILT_SOURCES += $(KEYTABLES)
MAINTAINERCLEANFILES += $(KEYTABLES)
324
CLEANFILES += $(KEYMANS) $(KEYPODS)
L
Lai Jiangshan 已提交
325

326
# Internal generic driver infrastructure
O
Osier Yang 已提交
327
DATATYPES_SOURCES = datatypes.h datatypes.c
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356
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 \
357
		$(NULL)
358

359 360 361
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

362 363
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
364

365
LOCK_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
366 367
		locking/lock_protocol.h \
		locking/lock_protocol.c \
368 369
		$(NULL)

370 371 372
LOCK_PROTOCOL = $(srcdir)/locking/lock_protocol.x
EXTRA_DIST += $(LOCK_PROTOCOL) \
	$(LOCK_PROTOCOL_GENERATED)
373 374 375
BUILT_SOURCES += $(LOCK_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(LOCK_PROTOCOL_GENERATED)

376
LOCK_DAEMON_GENERATED = \
377
		locking/lock_daemon_dispatch_stubs.h
378 379 380
		$(NULL)

BUILT_SOURCES += $(LOCK_DAEMON_GENERATED)
381
EXTRA_DIST += $(LOCK_DAEMON_GENERATED)
382 383
MAINTAINERCLEANFILES += $(LOCK_DAEMON_GENERATED)

384 385
LOCK_DRIVER_LOCKD_SOURCES = \
		locking/lock_driver_lockd.c \
386
		locking/lock_driver_lockd.h \
387 388
		$(NULL)

389 390 391 392 393
LOCK_DAEMON_SOURCES = \
		locking/lock_daemon.h \
		locking/lock_daemon.c \
		locking/lock_daemon_config.h \
		locking/lock_daemon_config.c \
394 395
		locking/lock_daemon_dispatch.c \
		locking/lock_daemon_dispatch.h \
396 397
		$(NULL)

E
Eric Blake 已提交
398
locking/lock_daemon_dispatch_stubs.h: $(LOCK_PROTOCOL) \
399
		$(srcdir)/rpc/gendispatch.pl Makefile.am
400 401
	$(AM_V_GEN)perl -w $(srcdir)/rpc/gendispatch.pl --mode=server \
	    virLockSpaceProtocol VIR_LOCK_SPACE_PROTOCOL \
E
Eric Blake 已提交
402
	    $(LOCK_PROTOCOL) > $(srcdir)/locking/lock_daemon_dispatch_stubs.h
403 404


405 406 407 408 409
LOG_PROTOCOL_GENERATED = \
		logging/log_protocol.h \
		logging/log_protocol.c \
		$(NULL)

410 411
DRIVER_SOURCES += $(LOG_PROTOCOL_GENERATED)

412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432
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 \
433 434
		logging/log_handler.c \
		logging/log_handler.h \
435 436 437 438 439 440 441 442 443
		$(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


444

M
Martin Kletzander 已提交
445 446 447
ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x

ADMIN_PROTOCOL_GENERATED = \
448 449
		admin/admin_protocol.c \
		admin/admin_protocol.h \
450 451 452
		admin/admin_client.h \
		admin/admin_server_dispatch_stubs.h \
		$(NULL)
453 454 455 456 457 458

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

460 461 462 463 464 465
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 已提交
466 467 468 469
EXTRA_DIST += $(ADMIN_PROTOCOL) $(ADMIN_PROTOCOL_GENERATED)
BUILT_SOURCES += $(ADMIN_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(ADMIN_PROTOCOL_GENERATED)

470 471 472 473 474 475 476 477 478 479
# 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
480 481 482 483

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

494
# Depending on configure options, libtool creates one or both of
E
Eric Blake 已提交
495 496
# remote/{,.libs/}libvirt_driver_remote_la-remote_protocol.o.  We want
# the newest of the two, in case configure options changed and a stale
497
# file is left around from an earlier build.
498 499 500
# 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.
501
PDWTAGS = \
A
Andrea Bolognani 已提交
502
	$(AM_V_GEN)if $(CC) -v 2>&1 | grep -q clang; then \
503 504 505 506
	   echo 'WARNING: skipping pdwtags test with Clang' >&2; \
	   exit 0; \
	fi; \
	if (pdwtags --help) > /dev/null 2>&1; then \
507 508 509 510 511 512 513
	  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?; \
514
	    echo 'WARNING: pdwtags appears broken; skipping the $@ test' >&2;\
515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532
	  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) {' \
533
		-e '    warn "WARNING: your pdwtags program is too old\n";' \
534
		-e '    warn "WARNING: skipping the $@ test\n";' \
535
		-e '    warn "WARNING: install dwarves-1.3 or newer\n";' \
536 537 538 539
		-e '    exit 8;' \
		-e '  }' \
		-e '}' \
		< $(@F)-t1 > $(@F)-t3; \
540
	    case $$? in 8) rm -f $(@F)-t?; exit 0;; 0) ;; *) exit 1;; esac;\
541 542 543 544
	    diff -u $(@)s $(@F)-t3; st=$$?; rm -f $(@F)-t?; exit $$st; \
	  fi; \
	else \
	  echo 'WARNING: you lack pdwtags; skipping the $@ test' >&2; \
545
	  echo 'WARNING: install the dwarves package to get pdwtags' >&2; \
546
	fi
547

548
# .libs/libvirt.so is built by libtool as a side-effect of the Makefile
549 550
# rule for libvirt.la.  However, checking symbols relies on Linux ELF layout
if WITH_LINUX
551 552 553
check-symfile: libvirt.syms libvirt.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt.syms \
	  .libs/libvirt.so
554 555 556
check-admin-symfile: libvirt_admin.syms libvirt-admin.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt_admin.syms \
	  .libs/libvirt-admin.so
557
else ! WITH_LINUX
558
check-symfile:
559
check-admin-symfile:
560
endif ! WITH_LINUX
561
check-symsorting:
562
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
563
		$(srcdir) $(SYM_FILES)
564 565 566
check-admin-symsorting:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
		$(srcdir) $(ADMIN_SYM_FILES)
J
Jiri Denemark 已提交
567
EXTRA_DIST += check-symfile.pl check-symsorting.pl
568

E
Eric Blake 已提交
569
# Keep this list synced with RPC_PROBE_FILES
570 571
PROTOCOL_STRUCTS = \
	$(srcdir)/remote_protocol-structs \
572
	$(srcdir)/lxc_protocol-structs \
573
	$(srcdir)/qemu_protocol-structs \
J
Jiri Denemark 已提交
574
	$(srcdir)/virnetprotocol-structs \
E
Eric Blake 已提交
575 576 577
	$(srcdir)/virkeepaliveprotocol-structs \
	$(srcdir)/lxc_monitor_protocol-structs \
	$(srcdir)/lock_protocol-structs \
M
Martin Kletzander 已提交
578
	$(srcdir)/admin_protocol-structs \
E
Eric Blake 已提交
579 580
	$(NULL)

581
if WITH_REMOTE
582 583
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)

584 585
# 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.
586 587 588
$(srcdir)/remote_protocol-struct \
	$(srcdir)/qemu_protocol-struct \
	$(srcdir)/lxc_protocol-struct: \
E
Eric Blake 已提交
589
		$(srcdir)/%-struct: remote/libvirt_driver_remote_la-%.lo
590
	$(PDWTAGS)
591
$(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \
E
Eric Blake 已提交
592
		$(srcdir)/%-struct: rpc/libvirt_net_rpc_la-%.lo
593
	$(PDWTAGS)
E
Eric Blake 已提交
594
$(srcdir)/lxc_monitor_protocol-struct: \
E
Eric Blake 已提交
595
		$(srcdir)/%-struct: lxc/libvirt_driver_lxc_impl_la-%.lo
E
Eric Blake 已提交
596 597
	$(PDWTAGS)
$(srcdir)/lock_protocol-struct: \
E
Eric Blake 已提交
598
		$(srcdir)/%-struct: locking/lockd_la-%.lo
E
Eric Blake 已提交
599
	$(PDWTAGS)
M
Martin Kletzander 已提交
600 601 602
$(srcdir)/admin_protocol-struct: \
		$(srcdir)/%-struct: admin/libvirt_admin_la-%.lo
	$(PDWTAGS)
E
Eric Blake 已提交
603

604
else !WITH_REMOTE
605 606 607
# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be
# re-generated when configured --without-remote.
check-protocol:
608
endif !WITH_REMOTE
J
Jiri Denemark 已提交
609
EXTRA_DIST += $(PROTOCOL_STRUCTS)
610 611 612 613 614

check-drivername:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-drivername.pl \
		$(srcdir)/driver.h \
		$(srcdir)/libvirt_public.syms \
615
		$(srcdir)/libvirt_admin_public.syms \
616 617 618 619 620
		$(srcdir)/libvirt_qemu.syms \
		$(srcdir)/libvirt_lxc.syms

EXTRA_DIST += check-drivername.pl

621 622
check-driverimpls:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-driverimpls.pl \
623
		$(filter /%,$(DRIVER_SOURCE_FILES)) \
E
Eric Blake 已提交
624 625 626
		$(filter $(srcdir)/%,$(DRIVER_SOURCE_FILES)) \
		$(addprefix $(srcdir)/,$(filter-out $(srcdir)/%, \
			$(filter-out /%,$(DRIVER_SOURCE_FILES))))
627

628 629
check-aclrules:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclrules.pl \
E
Eric Blake 已提交
630
		$(REMOTE_PROTOCOL) \
631
		$(addprefix $(srcdir)/,$(filter-out /%,$(STATEFUL_DRIVER_SOURCE_FILES)))
632

633 634 635 636 637
check-aclperms:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclperms.pl \
		$(srcdir)/access/viraccessperm.h \
		$(srcdir)/access/viraccessperm.c

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

640
check-local: check-protocol check-symfile check-symsorting \
641
	check-drivername check-driverimpls check-aclrules \
642
	check-aclperms check-admin-symfile check-admin-symsorting
643
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
644

645

646 647
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES = \
		$(DATATYPES_SOURCES) \
J
Jamie Strandboge 已提交
648 649
		security/virt-aa-helper.c

650 651


652
UTIL_IO_HELPER_SOURCES = \
653 654
		util/iohelper.c

655

656
# Security framework and drivers for various models
657 658 659 660 661
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 \
662
		security/security_manager.h security/security_manager.c
663

664
SECURITY_DRIVER_SELINUX_SOURCES = \
665
		security/security_selinux.h security/security_selinux.c
666

667
SECURITY_DRIVER_APPARMOR_SOURCES = \
J
Jamie Strandboge 已提交
668 669
		security/security_apparmor.h security/security_apparmor.c

670
ACCESS_DRIVER_GENERATED = \
E
Eric Blake 已提交
671 672 673 674 675 676 677
		access/viraccessapicheck.h \
		access/viraccessapicheck.c \
		access/viraccessapicheckqemu.h \
		access/viraccessapicheckqemu.c \
		access/viraccessapichecklxc.h \
		access/viraccessapichecklxc.c \
		$(NULL)
678

679
ACCESS_DRIVER_SYM_FILES = \
680 681 682
		libvirt_access.syms \
		libvirt_access_qemu.syms \
		libvirt_access_lxc.syms
683

684 685 686 687 688
ACCESS_DRIVER_API_FILES = \
		libvirt_access.xml \
		libvirt_access_qemu.xml \
		libvirt_access_lxc.xml

689 690 691 692 693 694 695
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

696 697 698 699
ACCESS_DRIVER_POLKIT_SOURCES = \
		access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c

ACCESS_DRIVER_POLKIT_POLICY = \
700
		$(srcdir)/access/org.libvirt.api.policy
701 702


703

704
VMX_SOURCES = \
705 706
		vmx/vmx.c vmx/vmx.h

707

J
Jiri Denemark 已提交
708 709
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
710
EXTRA_DIST +=	$(pkgdata_DATA)
711

712 713 714 715 716 717
#########################
#
# Build up list of libvirt.la source files based on configure conditions
#
# First deal with sources usable in non-daemon context

718
noinst_LTLIBRARIES += libvirt_util.la
719
libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
720
libvirt_la_BUILT_LIBADD += libvirt_util.la
721
libvirt_util_la_SOURCES = \
722
		$(UTIL_SOURCES)
723
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
724
		$(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
725
		$(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS) \
726
		$(POLKIT_CFLAGS) $(GNUTLS_CFLAGS) $(ACL_CFLAGS)
727
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
728
		$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
729
		$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(WIN32_EXTRA_LIBS) $(LIBXML_LIBS) \
M
Michal Privoznik 已提交
730
		$(SECDRIVER_LIBS) $(NUMACTL_LIBS) $(ACL_LIBS) \
731
		$(POLKIT_LIBS) $(GNUTLS_LIBS)
732

733

734 735 736 737
if WITH_VMX
noinst_LTLIBRARIES += libvirt_vmx.la
libvirt_la_BUILT_LIBADD += libvirt_vmx.la
libvirt_vmx_la_CFLAGS = \
738
		-I$(srcdir)/conf $(AM_CFLAGS)
739
libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
740
endif WITH_VMX
741

742

743
noinst_LTLIBRARIES += libvirt_driver.la
744
libvirt_la_BUILT_LIBADD += libvirt_driver.la
745
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
746

747
libvirt_driver_la_CFLAGS = \
748
		$(GNUTLS_CFLAGS) $(CURL_CFLAGS) $(XDR_CFLAGS) \
749
		-I$(srcdir)/conf $(AM_CFLAGS)
750
libvirt_driver_la_LIBADD = \
751
		$(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS)
752

753 754
# 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.
755 756 757
SYM_FILES += $(USED_SYM_FILES)
USED_SYM_FILES += $(srcdir)/libvirt_private.syms
GENERATED_SYM_FILES += \
758 759
	$(ACCESS_DRIVER_SYM_FILES) \
	libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \
760
	libvirt_admin.syms libvirt_admin.def \
761
	$(NULL)
762

C
Chris Lalancette 已提交
763

764

765
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
766
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
767
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
768

769
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
770
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
771
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
772

773

774

775

776

777

778 779 780 781
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 = \
782
		-I$(srcdir)/conf $(AM_CFLAGS)
783
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
784
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
785
if WITH_SECDRIVER_SELINUX
786 787
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
788
endif WITH_SECDRIVER_SELINUX
J
Jamie Strandboge 已提交
789
if WITH_SECDRIVER_APPARMOR
790 791
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
792
endif WITH_SECDRIVER_APPARMOR
793

794 795
libvirt_driver_access_la_SOURCES = \
	$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
796 797 798
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
799
		-I$(srcdir)/conf $(AM_CFLAGS)
800 801 802
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD =

803 804
EXTRA_DIST += access/genpolkit.pl

805 806 807 808
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
    $(srcdir)/access/genpolkit.pl Makefile.am
	$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@

809 810 811 812
if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)

polkitactiondir = $(datadir)/polkit-1/actions
813
if WITH_LIBVIRTD
814
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
815
endif WITH_LIBVIRTD
816 817 818

CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
819
else ! WITH_POLKIT1
820
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
821
endif ! WITH_POLKIT1
822

823

824 825
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
826 827 828 829 830 831 832 833 834 835 836 837 838 839

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

840 841 842 843 844 845 846 847 848 849 850 851 852
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 已提交
853
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
854 855
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
856 857 858
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
859 860
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
861 862
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
	  > $(srcdir)/access/viraccessapicheck.c
863

E
Eric Blake 已提交
864
access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
865 866
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
867 868 869
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheckqemu.h
access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
870 871
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
872 873
	  qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h \
	  > $(srcdir)/access/viraccessapicheckqemu.c
874

E
Eric Blake 已提交
875
access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
876 877
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
878 879 880
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/access/viraccessapichecklxc.h
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
881 882
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
883 884
	  lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \
	  > $(srcdir)/access/viraccessapichecklxc.c
885

886
# Add all conditional sources just in case...
887 888 889
EXTRA_DIST += \
		$(SECURITY_DRIVER_SELINUX_SOURCES) \
		$(SECURITY_DRIVER_APPARMOR_SOURCES) \
890
		$(ACCESS_DRIVER_POLKIT_POLICY)
891

892 893
check-local: check-augeas

894 895 896 897
.PHONY: check-augeas \
	check-augeas-sanlock \
	check-augeas-lockd \
	$(NULL)
898

899
check-augeas: $(AUGEAS_DIRS:%=check-augeas-%) \
900
	check-augeas-sanlock \
901
	check-augeas-lockd check-augeas-virtlockd \
902
	check-augeas-virtlogd
903

904
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
905
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
906

907

908
if WITH_SANLOCK
909 910
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
911
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
912

913
check-augeas-sanlock: test_libvirt_sanlock.aug
914
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
915
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
916
	fi
917
else ! WITH_SANLOCK
918
check-augeas-sanlock:
919
endif ! WITH_SANLOCK
920

921
if WITH_QEMU
922 923 924
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 $< $@
925 926 927
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
928

929 930
test_virtlockd.aug: locking/test_virtlockd.aug.in \
		locking/virtlockd.conf $(AUG_GENTEST)
931
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
932

933
if WITH_QEMU
934 935 936 937
check-augeas-lockd: test_libvirt_lockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_lockd.aug; \
	fi
938 939 940
else ! WITH_QEMU
check-augeas-lockd:
endif ! WITH_QEMU
941

942 943 944 945 946
check-augeas-virtlockd: test_virtlockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
	fi

947

948 949 950 951 952 953 954 955 956
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

957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975
#
# 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.
#

976
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
977

978
if WITH_LINUX
979
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
980
else ! WITH_LINUX
981
SYM_FILES += $(srcdir)/libvirt_linux.syms
982
endif ! WITH_LINUX
983

984
if WITH_VMX
985
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
986
else ! WITH_VMX
987
SYM_FILES += $(srcdir)/libvirt_vmx.syms
988
endif ! WITH_VMX
989

990
if WITH_SASL
991
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
992
else ! WITH_SASL
993
SYM_FILES += $(srcdir)/libvirt_sasl.syms
994
endif ! WITH_SASL
E
Eric Blake 已提交
995

996 997
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
998
else ! WITH_GNUTLS
999
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
1000
endif ! WITH_GNUTLS
1001

1002
if WITH_SSH2
1003
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
1004
else ! WITH_SSH2
1005
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
1006
endif ! WITH_SSH2
1007

1008
if WITH_ATOMIC_OPS_PTHREAD
1009
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
1010
else ! WITH_ATOMIC_OPS_PTHREAD
1011
SYM_FILES += $(srcdir)/libvirt_atomic.syms
1012
endif ! WITH_ATOMIC_OPS_PTHREAD
1013

1014 1015 1016 1017 1018 1019
if WITH_LIBSSH
USED_SYM_FILES += $(srcdir)/libvirt_libssh.syms
else ! WITH_LIBSSH
SYM_FILES += $(srcdir)/libvirt_libssh.syms
endif ! WITH_LIBSSH

1020
EXTRA_DIST += \
1021 1022 1023 1024 1025 1026
	libvirt_public.syms \
	libvirt_lxc.syms \
	libvirt_qemu.syms \
	libvirt_admin_public.syms \
	$(SYM_FILES) \
	$(ADMIN_SYM_FILES) \
1027
	$(NULL)
1028

1029
BUILT_SOURCES += $(GENERATED_SYM_FILES)
1030

1031 1032
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(ACCESS_DRIVER_SYM_FILES) \
1033
		$(top_builddir)/config.status
1034 1035 1036 1037 1038 1039
	$(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 && \
1040
	cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
1041 1042
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
1043
	mv $@-tmp libvirt.syms
1044

1045
%.def: %.syms
1046 1047
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
1048
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d' \
1049
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
1050
	chmod a-w $@-tmp && \
1051
	mv $@-tmp $@
1052

1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065
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

1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080

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) \
1081
		$(XDR_CFLAGS) \
1082 1083 1084 1085 1086 1087
		-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)

1088 1089 1090 1091
# 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 已提交
1092 1093
lib_LTLIBRARIES += libvirt-admin.la
libvirt_admin_la_SOURCES = \
1094 1095
		libvirt-admin.c \
		$(ADMIN_PROTOCOL_GENERATED) \
M
Martin Kletzander 已提交
1096 1097 1098
		$(DATATYPES_SOURCES)

libvirt_admin_la_LDFLAGS = \
1099 1100
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_ADMIN_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
1101
		$(AM_LDFLAGS)
M
Martin Kletzander 已提交
1102 1103

libvirt_admin_la_LIBADD = \
1104
		libvirt.la \
M
Martin Kletzander 已提交
1105 1106 1107
		$(CYGWIN_EXTRA_LIBADD)

libvirt_admin_la_CFLAGS = \
1108 1109 1110
		$(AM_CFLAGS) \
		-I$(srcdir)/remote \
		-I$(srcdir)/rpc \
M
Martin Kletzander 已提交
1111 1112 1113
		-I$(srcdir)/admin

libvirt_admin_la_CFLAGS += \
1114 1115 1116 1117 1118 1119
		$(XDR_CFLAGS) \
		$(CAPNG_CFLAGS) \
		$(YAJL_CFLAGS) \
		$(SSH2_CFLAGS) \
		$(SASL_CFLAGS) \
		$(GNUTLS_CFLAGS) \
1120
		$(LIBSSH_CFLAGS)
M
Martin Kletzander 已提交
1121 1122

libvirt_admin_la_LIBADD += \
1123 1124 1125 1126 1127 1128 1129
		$(CAPNG_LIBS) \
		$(YAJL_LIBS) \
		$(DEVMAPPER_LIBS) \
		$(LIBXML_LIBS) \
		$(SSH2_LIBS) \
		$(SASL_LIBS) \
		$(GNUTLS_LIBS) \
1130
		$(LIBSSH_LIBS)
M
Martin Kletzander 已提交
1131

1132 1133
ADMIN_SYM_FILES = $(srcdir)/libvirt_admin_private.syms

M
Martin Kletzander 已提交
1134 1135 1136 1137
if WITH_DTRACE_PROBES
libvirt_admin_la_LIBADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

1138 1139
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
1140 1141 1142 1143
libvirt_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(LIBVIRT_NODELETE) \
1144
		$(NO_UNDEFINED_LDFLAGS) \
D
Daniel P. Berrange 已提交
1145 1146
		$(AM_LDFLAGS) \
		$(NULL)
1147
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
1148
libvirt_la_LIBADD += \
1149
		    $(DRIVER_MODULES_LIBS) \
1150
		    $(CYGWIN_EXTRA_LIBADD)
1151
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
1152 1153 1154 1155 1156 1157
# 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)
1158

1159
if WITH_DTRACE_PROBES
1160
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
1161
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
1162
nodist_libvirt_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
1163
if WITH_REMOTE
E
Eric Blake 已提交
1164
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
1165
endif WITH_REMOTE
1166
DTRACE2SYSTEMTAP_FLAGS = --with-modules
1167

1168 1169
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

1170 1171

tapsetdir = $(datadir)/systemtap/tapset
1172
tapset_DATA += libvirt_probes.stp libvirt_functions.stp
1173

1174
%_probes.h: %_probes.d
1175 1176
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

E
Eric Blake 已提交
1177
.PRECIOUS: %_probes.o
1178
%_probes.o: %_probes.d
1179 1180
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

1181 1182 1183 1184 1185 1186 1187 1188 1189
%_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 已提交
1190
# Keep this list synced with PROTOCOL_STRUCTS
1191
RPC_PROBE_FILES += $(srcdir)/rpc/virnetprotocol.x \
J
Jiri Denemark 已提交
1192 1193
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
1194
		  $(srcdir)/remote/lxc_protocol.x \
1195
		  $(srcdir)/remote/qemu_protocol.x \
M
Martin Kletzander 已提交
1196 1197
		  $(srcdir)/locking/lock_protocol.x \
		  $(srcdir)/admin/admin_protocol.x
1198 1199

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

1202 1203
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl \
		$(top_builddir)/config.status
1204
	$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
1205
	  $(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
1206

1207
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
1208
              libvirt_functions.stp libvirt_probes.stp
1209
endif WITH_DTRACE_PROBES
1210

1211
EXTRA_DIST += libvirt_probes.d
1212

C
Chris Lalancette 已提交
1213
libvirt_qemu_la_SOURCES = libvirt-qemu.c
D
Daniel P. Berrange 已提交
1214 1215 1216 1217 1218
libvirt_qemu_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
1219
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
C
Chris Lalancette 已提交
1220
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
1221

1222
libvirt_lxc_la_SOURCES = libvirt-lxc.c
D
Daniel P. Berrange 已提交
1223 1224 1225 1226 1227
libvirt_lxc_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
1228 1229 1230
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)

1231 1232 1233 1234 1235 1236 1237
# 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
1238
if WITH_SETUID_RPC_CLIENT
1239 1240
noinst_LTLIBRARIES += libvirt-setuid-rpc-client.la

1241 1242
libvirt_setuid_rpc_client_la_SOURCES = \
		util/viralloc.c \
1243
		util/virarch.c \
1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308
		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 \
1309 1310
		$(NULL)

1311 1312 1313 1314
libvirt_setuid_rpc_client_la_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(LIBXML_LIBS) \
		$(SECDRIVER_LIBS) \
1315
		$(NULL)
1316 1317 1318 1319 1320 1321 1322
libvirt_setuid_rpc_client_la_CFLAGS = \
		-DLIBVIRT_SETUID_RPC_CLIENT \
		-I$(srcdir)/conf \
		-I$(srcdir)/rpc \
		$(AM_CFLAGS) \
		$(SECDRIVER_CFLAGS) \
		$(XDR_CFLAGS) \
1323
		$(NULL)
1324
endif WITH_SETUID_RPC_CLIENT
1325

1326 1327 1328
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

1329
if WITH_LIBVIRTD
1330 1331 1332 1333 1334
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
		$(LOCK_DRIVER_LOCKD_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
		$(NULL)
1335
lockd_la_CFLAGS = -I$(srcdir)/conf \
E
Eric Blake 已提交
1336 1337
		$(XDR_CFLAGS) \
		$(AM_CFLAGS)
1338
lockd_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1339
lockd_la_LIBADD = libvirt.la ../gnulib/lib/libgnu.la
J
Jiri Denemark 已提交
1340
augeas_DATA += locking/libvirt_lockd.aug
1341 1342
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
1343
endif WITH_DTRACE_PROBES
1344
if WITH_QEMU
1345 1346
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
1347
nodist_conf_DATA += locking/qemu-lockd.conf
1348 1349
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
1350
endif WITH_QEMU
1351

1352 1353 1354 1355 1356 1357
if WITH_LIBXL
nodist_conf_DATA += locking/libxl-lockd.conf
BUILT_SOURCES += locking/libxl-lockd.conf
DISTCLEANFILES += locking/libxl-lockd.conf
endif WITH_LIBXL

1358 1359 1360 1361 1362
locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
	$(AM_V_GEN)$(MKDIR_P) locking ; \
	cp $< $@


1363
sbin_PROGRAMS += virtlockd virtlogd
1364

1365 1366 1367
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
1368
		$(LOCK_DAEMON_GENERATED) \
1369
		$(NULL)
1370 1371
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
1372
		$(PIE_CFLAGS) \
1373
		$(XDR_CFLAGS) \
1374 1375 1376
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
1377
		$(PIE_LDFLAGS) \
1378
		$(NO_UNDEFINED_LDFLAGS) \
1379 1380
		$(NULL)
virtlockd_LDADD = \
1381
		libvirt_driver_admin.la \
1382 1383 1384 1385 1386 1387 1388 1389
		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
1390
endif WITH_DTRACE_PROBES
1391

1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405

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) \
1406
		$(NO_UNDEFINED_LDFLAGS) \
1407 1408
		$(NULL)
virtlogd_LDADD = \
1409
		libvirt_driver_admin.la \
1410 1411 1412 1413 1414 1415 1416 1417 1418 1419
		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

1420
else ! WITH_LIBVIRTD
1421
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
1422 1423
              $(LOCK_DRIVER_LOCKD_SOURCES) \
	      $(LOG_DAEMON_SOURCES)
1424
endif ! WITH_LIBVIRTD
1425

1426
SYSCONF_FILES += \
1427
	locking/virtlockd.sysconf \
1428 1429 1430 1431
	logging/virtlogd.sysconf \
	$(NULL)

EXTRA_DIST += \
J
Jiri Denemark 已提交
1432 1433
	locking/lockd.conf \
	locking/libvirt_lockd.aug \
1434
	locking/test_libvirt_lockd.aug.in \
1435 1436
	$(SYSCONF_FILES) \
	$(NULL)
1437 1438

install-sysconfig:
E
Eric Blake 已提交
1439
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
1440 1441 1442
	for f in $(SYSCONF_FILES:%.sysconf=%) ; \
	do \
	  tgt=`basename $$f`; \
1443 1444
	  $(INSTALL_SCRIPT) $(srcdir)/$$f.sysconf \
	      $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
1445
	done
1446 1447

uninstall-sysconfig:
1448 1449 1450 1451 1452
	for f in $(SYSCONF_FILES:%.sysconf=%) ; \
	do \
	  tgt=`basename $$f`; \
	  rm -f $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
	done
E
Eric Blake 已提交
1453
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
1454

1455
SYSVINIT_FILES_IN += \
1456 1457 1458 1459 1460 1461 1462
	locking/virtlockd.init.in \
	logging/virtlogd.init.in \
	$(NULL)

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

EXTRA_DIST += $(SYSVINIT_FILES_IN)
1463

1464
LOGROTATE_FILES := $(LOGROTATE_FILES_IN:remote/%.in=%)
1465 1466 1467 1468

EXTRA_DIST += $(LOGROTATE_FILES_IN)

BUILT_SOURCES += $(LOGROTATE_FILES)
1469
CLEANFILES += $(LOGROTATE_FILES)
1470 1471 1472 1473 1474 1475 1476

%.logrotate: remote/%.logrotate.in
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
	mv $@-t $@

1477
if WITH_LIBVIRTD
1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489
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 || :
1490 1491 1492 1493
else ! WITH_LIBVIRTD
install-logrotate:
uninstall-logrotate:
endif ! WITH_LIBVIRTD
1494

1495
if LIBVIRT_INIT_SCRIPT_RED_HAT
1496
install-init:: $(SYSVINIT_FILES) install-sysconfig
E
Eric Blake 已提交
1497
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
1498 1499 1500 1501
	for f in $(SYSVINIT_FILES:%.init=%) ; \
	do \
	  $(INSTALL_SCRIPT) $$f.init $(DESTDIR)$(sysconfdir)/rc.d/init.d/$$f; \
	done
1502 1503

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

1507 1508
BUILT_SOURCES += $(SYSVINIT_FILES)
DISTCLEANFILES += $(SYSVINIT_FILES)
1509
else ! LIBVIRT_INIT_SCRIPT_RED_HAT
1510 1511
install-init::
uninstall-init::
1512
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
1513

1514

1515
virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
1516 1517 1518 1519 1520 1521
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    < $< > $@-t && \
	    chmod a+x $@-t && \
1522 1523
	    mv $@-t $@

1524
virtlogd.init: logging/virtlogd.init.in $(top_builddir)/config.status
1525 1526 1527 1528 1529 1530
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    < $< > $@-t && \
	    chmod a+x $@-t && \
1531 1532
	    mv $@-t $@

1533
virtlockd.8.in: locking/virtlockd.pod
1534 1535 1536 1537 1538 1539 1540 1541
	$(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 $@
1542

1543
virtlogd.8.in: logging/virtlogd.pod
1544 1545 1546 1547 1548 1549 1550 1551
	$(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 $@
1552

1553
%.8: %.8.in $(top_srcdir)/configure.ac
1554
	$(AM_V_GEN)sed \
1555 1556 1557
		-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
		-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
		< $< > $@-t && \
1558 1559
	mv $@-t $@

1560
if WITH_LIBVIRTD
1561
man8_MANS += virtlockd.8 virtlogd.8
1562

1563
conf_DATA += locking/virtlockd.conf logging/virtlogd.conf
1564

1565 1566
augeas_DATA += locking/virtlockd.aug logging/virtlogd.aug
augeastest_DATA += test_virtlockd.aug test_virtlogd.aug
1567
endif WITH_LIBVIRTD
1568

1569
PODFILES += \
A
Andrea Bolognani 已提交
1570 1571 1572 1573
	locking/virtlockd.pod \
	logging/virtlogd.pod \
	$(NULL)

1574
MANINFILES += \
A
Andrea Bolognani 已提交
1575 1576 1577 1578 1579 1580
	virtlockd.8.in \
	virtlogd.8.in \
	$(NULL)

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

1582
SYSTEMD_UNIT_FILES_IN += \
1583 1584 1585 1586 1587 1588 1589 1590
	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 \
	$(NULL)

1591
EXTRA_DIST += \
1592
        $(SYSTEMD_UNIT_FILES_IN) \
1593 1594 1595
        locking/virtlockd.aug \
        locking/virtlockd.conf \
        locking/test_virtlockd.aug.in \
1596 1597 1598
        logging/virtlogd.aug \
        logging/virtlogd.conf \
        logging/test_virtlogd.aug.in \
A
Andrea Bolognani 已提交
1599 1600
        $(PODFILES) \
        $(MANINFILES) \
1601
        $(NULL)
1602

1603 1604 1605 1606

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

1607
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
1608
SYSTEMD_UNIT_FILES = $(notdir $(SYSTEMD_UNIT_FILES_IN:%.in=%))
1609

1610 1611
BUILT_SOURCES += $(SYSTEMD_UNIT_FILES)
DISTCLEANFILES += $(SYSTEMD_UNIT_FILES)
1612

1613
install-systemd: $(SYSTEMD_UNIT_FILES) install-sysconfig
E
Eric Blake 已提交
1614
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
1615 1616 1617 1618
	for f in $(SYSTEMD_UNIT_FILES); \
	do \
	  $(INSTALL_DATA) $$f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/ ; \
	done
1619 1620

uninstall-systemd: uninstall-sysconfig
1621
	rm -f $(SYSTEMD_UNIT_FILES:%=$(DESTDIR)$(SYSTEMD_UNIT_DIR)/%)
E
Eric Blake 已提交
1622
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
1623
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
1624 1625
install-systemd:
uninstall-systemd:
1626 1627
endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
else ! WITH_LIBVIRTD
1628 1629
install-systemd:
uninstall-systemd:
1630
endif ! WITH_LIBVIRTD
1631 1632

virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
1633 1634 1635
	$(AM_V_GEN)sed \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    < $< > $@-t && \
1636 1637 1638
	    mv $@-t $@

virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
1639 1640 1641
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
1642 1643
	    mv $@-t $@

J
John Ferlan 已提交
1644 1645 1646 1647 1648 1649 1650
virtlockd-admin.socket: locking/virtlockd-admin.socket.in \
                        $(top_builddir)/config.status
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
	    mv $@-t $@

1651
virtlogd.service: logging/virtlogd.service.in $(top_builddir)/config.status
1652 1653 1654
	$(AM_V_GEN)sed \
	    -e 's|[@]sbindir[@]|$(sbindir)|g' \
	    < $< > $@-t && \
1655 1656 1657
	    mv $@-t $@

virtlogd.socket: logging/virtlogd.socket.in $(top_builddir)/config.status
J
John Ferlan 已提交
1658 1659 1660 1661 1662 1663 1664
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
	    mv $@-t $@

virtlogd-admin.socket: logging/virtlogd-admin.socket.in \
                       $(top_builddir)/config.status
1665 1666 1667
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
1668 1669
	    mv $@-t $@

1670

1671 1672 1673 1674 1675 1676 1677 1678 1679 1680
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` ; \
1681 1682
	  $(INSTALL_SCRIPT) $(srcdir)/$$f.upstart \
	      $(DESTDIR)$(sysconfdir)/event.d/$$tgt ; \
1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700
	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

1701
if WITH_SANLOCK
1702
lockdriver_LTLIBRARIES += sanlock.la
1703
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
1704
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
1705
sanlock_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
1706
sanlock_la_LIBADD = -lsanlock_client libvirt.la ../gnulib/lib/libgnu.la
1707 1708

augeas_DATA += locking/libvirt_sanlock.aug
1709 1710
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
1711

E
Eric Blake 已提交
1712
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
1713
	$(AM_V_GEN)$(MKDIR_P) locking ; \
1714 1715 1716
	cp $< $@

if WITH_QEMU
1717
nodist_conf_DATA += locking/qemu-sanlock.conf
1718
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
1719
DISTCLEANFILES += locking/qemu-sanlock.conf
1720
endif WITH_QEMU
1721 1722 1723 1724 1725 1726

if WITH_LIBXL
nodist_conf_DATA += locking/libxl-sanlock.conf
BUILT_SOURCES += locking/libxl-sanlock.conf
DISTCLEANFILES += locking/libxl-sanlock.conf
endif WITH_LIBXL
1727
else ! WITH_SANLOCK
1728
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
1729
endif ! WITH_SANLOCK
1730 1731
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
1732
	locking/test_libvirt_sanlock.aug.in
1733

1734 1735 1736 1737
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
1738

1739 1740 1741 1742 1743
libvirt_la_BUILT_LIBADD += \
       libvirt-net-rpc.la \
       libvirt-net-rpc-server.la \
       libvirt-net-rpc-client.la

1744
EXTRA_DIST += \
E
Eric Blake 已提交
1745 1746 1747 1748
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
1749 1750
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
1751

E
Eric Blake 已提交
1752
VIR_NET_RPC_GENERATED = \
1753 1754 1755 1756
	rpc/virnetprotocol.h \
	rpc/virnetprotocol.c \
	rpc/virkeepaliveprotocol.h \
	rpc/virkeepaliveprotocol.c
1757

1758
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
1759

1760
libvirt_net_rpc_la_SOURCES = \
1761
	rpc/virnetmessage.h rpc/virnetmessage.c \
1762
	rpc/virnetsocket.h rpc/virnetsocket.c \
1763 1764
	rpc/virkeepalive.h rpc/virkeepalive.c \
	$(VIR_NET_RPC_GENERATED)
1765
if WITH_SSH2
1766 1767
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
1768
else ! WITH_SSH2
1769 1770
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
1771
endif ! WITH_SSH2
1772
if WITH_GNUTLS
1773 1774
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
1775
else ! WITH_GNUTLS
1776 1777
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
1778
endif ! WITH_GNUTLS
1779
if WITH_SASL
1780 1781
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
1782
else ! WITH_SASL
1783 1784
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
1785
endif ! WITH_SASL
1786 1787 1788 1789 1790 1791 1792
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
1793
libvirt_net_rpc_la_CFLAGS = \
1794
			$(GNUTLS_CFLAGS) \
1795
			$(SASL_CFLAGS) \
1796
			$(SSH2_CFLAGS) \
1797
			$(LIBSSH_CFLAGS) \
1798
			$(XDR_CFLAGS) \
1799 1800
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
1801
			$(GNUTLS_LIBS) \
1802
			$(SASL_LIBS) \
1803
			$(SSH2_LIBS)\
1804
			$(LIBSSH_LIBS) \
J
Jim Fehlig 已提交
1805
			$(SECDRIVER_LIBS) \
1806
			$(AM_LDFLAGS) \
1807
			$(NULL)
1808 1809 1810
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

1811 1812 1813 1814
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
1815
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
1816
	rpc/virnetdaemon.h rpc/virnetdaemon.c \
1817 1818
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
1819
			$(AVAHI_CFLAGS) \
1820
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
1821
			$(XDR_CFLAGS) \
1822
			$(AM_CFLAGS)
1823 1824
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
1825
			$(AVAHI_LIBS) \
1826
			$(DBUS_LIBS) \
1827
			$(NULL)
1828 1829 1830
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

1831 1832 1833 1834 1835
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 已提交
1836 1837
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
1838
libvirt_net_rpc_client_la_LDFLAGS = $(AM_LDFLAGS)
1839 1840
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
1841

1842
if WITH_LIBVIRTD
1843 1844
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
1845 1846 1847 1848
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
1849 1850
libvirt_iohelper_LDADD = \
		libvirt_util.la \
1851
		../gnulib/lib/libgnu.la
1852 1853
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
1854
endif WITH_DTRACE_PROBES
1855

D
Daniel P. Berrange 已提交
1856 1857 1858 1859
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
1860 1861


1862
endif WITH_LIBVIRTD
1863

1864

1865
if WITH_SANLOCK
1866 1867 1868
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
1869
libvirt_sanlock_helper_CFLAGS = \
1870
		-I$(srcdir)/conf \
D
Daniel P. Berrange 已提交
1871 1872 1873 1874 1875 1876 1877
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
1878
libvirt_sanlock_helper_LDADD = libvirt.la
1879
endif WITH_SANLOCK
1880

1881

J
Jamie Strandboge 已提交
1882 1883 1884 1885 1886 1887
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 已提交
1888 1889 1890 1891
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
1892 1893 1894 1895 1896
virt_aa_helper_LDADD = \
		libvirt.la \
		libvirt_conf.la \
		libvirt_util.la \
		libvirt_driver_storage_impl.la \
C
Chris Lalancette 已提交
1897
		../gnulib/lib/libgnu.la
1898
if WITH_DTRACE_PROBES
1899
virt_aa_helper_LDADD += libvirt_probes.lo
1900
endif WITH_DTRACE_PROBES
1901 1902 1903 1904 1905
virt_aa_helper_CFLAGS = \
		-I$(srcdir)/conf \
		-I$(srcdir)/security \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
D
Daniel P. Berrange 已提交
1906
		$(NULL)
1907 1908
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
J
Jamie Strandboge 已提交
1909 1910
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

1911
if WITH_NSS
1912 1913
noinst_LTLIBRARIES += libvirt-nss.la

1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962
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 \
1963 1964
		$(NULL)

1965 1966 1967 1968
libvirt_nss_la_CFLAGS = \
		-DLIBVIRT_NSS \
		$(AM_CFLAGS) \
		$(YAJL_CFLAGS) \
1969
		$(NULL)
1970 1971
libvirt_nss_la_LDFLAGS = \
		$(AM_LDFLAGS) \
1972 1973
		$(NULL)

1974 1975
libvirt_nss_la_LIBADD = \
		$(YAJL_LIBS) \
1976
		$(NULL)
1977
endif WITH_NSS
1978 1979


1980
install-data-local: install-init install-systemd install-upstart \
1981
		install-sysctl install-polkit install-sasl \
1982
		install-logrotate $(INSTALL_DATA_DIRS:%=install-data-%)
1983 1984
if WITH_LIBVIRTD
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
1985
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
1986
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
1987
endif WITH_LIBVIRTD
1988 1989
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
1990
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
1991
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
1992
if WITH_SANLOCK
1993
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
1994
endif WITH_SANLOCK
1995

1996
uninstall-local:: uninstall-init uninstall-systemd uninstall-upstart \
1997
		uninstall-sysctl uninstall-polkit uninstall-sasl \
1998
		uninstall-logrotate $(INSTALL_DATA_DIRS:%=uninstall-data-%)
1999
if WITH_LIBVIRTD
2000
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
2001 2002
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
2003
endif WITH_LIBVIRTD
2004 2005
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
2006
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
2007
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
2008
if WITH_SANLOCK
2009
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
2010
endif WITH_SANLOCK
2011
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
2012

2013 2014
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
2015 2016 2017
MAINTAINERCLEANFILES += \
	$(VIR_NET_RPC_GENERATED) \
	$(NULL)