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

3
## Copyright (C) 2005-2016 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
INCLUDES =	-I../gnulib/lib					\
		-I$(top_srcdir)/gnulib/lib			\
30
		-I$(top_srcdir)					\
31
		-I../include					\
32
		-I$(top_srcdir)/include				\
33
		-I$(srcdir)/util				\
A
Andrea Bolognani 已提交
34
		-I./util					\
35
		-DIN_LIBVIRT					\
36
		-Dabs_topbuilddir="\"$(abs_topbuilddir)\""	\
37
		-Dabs_topsrcdir="\"$(abs_topsrcdir)\""		\
38
		$(GETTEXT_CPPFLAGS)
E
Eric Blake 已提交
39

40 41
WARN_CFLAGS += $(STRICT_FRAME_LIMIT_CFLAGS)

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

55 56
POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)"

57
EXTRA_DIST = $(conf_DATA)
58

59
BUILT_SOURCES =
60 61 62
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
63
nodist_conf_DATA =
64

E
Eric Blake 已提交
65 66
THREAD_LIBS = $(LIB_PTHREAD) $(LTLIBMULTITHREAD)

J
Jim Fehlig 已提交
67
SECDRIVER_CFLAGS =
68 69
SECDRIVER_LIBS =
if WITH_SECDRIVER_SELINUX
J
Jim Fehlig 已提交
70
SECDRIVER_CFLAGS += $(SELINUX_CFLAGS)
71
SECDRIVER_LIBS += $(SELINUX_LIBS)
72
endif WITH_SECDRIVER_SELINUX
73
if WITH_SECDRIVER_APPARMOR
J
Jim Fehlig 已提交
74
SECDRIVER_CFLAGS += $(APPARMOR_CFLAGS)
75
SECDRIVER_LIBS += $(APPARMOR_LIBS)
76
endif WITH_SECDRIVER_APPARMOR
77

78 79
if WITH_NETWORK
UUID=$(shell uuidgen 2>/dev/null)
80
endif WITH_NETWORK
81

82
lib_LTLIBRARIES = libvirt.la libvirt-qemu.la libvirt-lxc.la
83

84
moddir = $(libdir)/libvirt/connection-driver
85 86
mod_LTLIBRARIES =

A
Amy Griffis 已提交
87
confdir = $(sysconfdir)/libvirt
88
conf_DATA = libvirt.conf libvirt-admin.conf
89

90 91 92 93 94 95
augeasdir = $(datadir)/augeas/lenses
augeas_DATA =

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

96 97
# These files are not related to driver APIs. Simply generic
# helper APIs for various purposes
98
UTIL_SOURCES =							\
99
		util/viralloc.c util/viralloc.h			\
100
		util/virarch.h util/virarch.c			\
101
		util/viratomic.h util/viratomic.c		\
102
		util/viraudit.c util/viraudit.h			\
103
		util/virauth.c util/virauth.h			\
104
		util/virauthconfig.c util/virauthconfig.h	\
105
		util/virbitmap.c util/virbitmap.h		\
106
		util/virbuffer.c util/virbuffer.h		\
107
		util/virperf.c util/virperf.h			\
108
		util/vircgroup.c util/vircgroup.h util/vircgrouppriv.h	\
109
		util/virclosecallbacks.c util/virclosecallbacks.h		\
110
		util/vircommand.c util/vircommand.h util/vircommandpriv.h \
111
		util/virconf.c util/virconf.h			\
112
		util/vircrypto.c util/vircrypto.h		\
L
Laine Stump 已提交
113
		util/virdbus.c util/virdbus.h util/virdbuspriv.h	\
114
		util/virdnsmasq.c util/virdnsmasq.h		\
115
		util/virebtables.c util/virebtables.h		\
E
Eric Blake 已提交
116
		util/virendian.h				\
117
		util/virerror.c util/virerror.h			\
118
		util/virevent.c util/virevent.h			\
119
		util/vireventpoll.c util/vireventpoll.h		\
120
		util/virfcp.c util/virfcp.h			\
121
		util/virfdstream.c util/virfdstream.h		\
E
Eric Blake 已提交
122
		util/virfile.c util/virfile.h			\
123 124
		util/virfirewall.c util/virfirewall.h		\
		util/virfirewallpriv.h				\
125
		util/virfirmware.c util/virfirmware.h		\
126
		util/virgettext.c util/virgettext.h		\
127
		util/virgic.c util/virgic.h			\
128 129
		util/virhash.c util/virhash.h			\
		util/virhashcode.c util/virhashcode.h		\
130
		util/virhook.c util/virhook.h			\
131
		util/virhostcpu.c util/virhostcpu.h util/virhostcpupriv.h \
132
		util/virhostdev.c util/virhostdev.h		\
133
		util/virhostmem.c util/virhostmem.h		\
134
		util/viridentity.c util/viridentity.h		\
135
		util/virinitctl.c util/virinitctl.h		\
136
		util/viriptables.c util/viriptables.h		\
137
		util/viriscsi.c util/viriscsi.h			\
138
		util/virjson.c util/virjson.h			\
L
Lai Jiangshan 已提交
139
		util/virkeycode.c util/virkeycode.h		\
140
		util/virkeyfile.c util/virkeyfile.h		\
141
		util/virlease.c util/virlease.h			\
142
		util/virlockspace.c util/virlockspace.h		\
143
		util/virlog.c util/virlog.h			\
144
		util/virmacaddr.h util/virmacaddr.c		\
145
		util/virmacmap.h util/virmacmap.c		\
146
		util/virnetdev.h util/virnetdev.c		\
147
		util/virnetdevbandwidth.h util/virnetdevbandwidth.c \
148
		util/virnetdevbridge.h util/virnetdevbridge.c	\
149
		util/virnetdevip.h util/virnetdevip.c		\
150
		util/virnetdevmacvlan.c util/virnetdevmacvlan.h	\
151
		util/virnetdevmidonet.h util/virnetdevmidonet.c \
A
Ansis Atteka 已提交
152
		util/virnetdevopenvswitch.h util/virnetdevopenvswitch.c \
153
		util/virnetdevtap.h util/virnetdevtap.c		\
154 155
		util/virnetdevveth.h util/virnetdevveth.c	\
		util/virnetdevvlan.h util/virnetdevvlan.c	\
156
		util/virnetdevvportprofile.h util/virnetdevvportprofile.c \
157
		util/virnetlink.c util/virnetlink.h		\
158
		util/virnodesuspend.c util/virnodesuspend.h	\
159
		util/virkmod.c util/virkmod.h                   \
160
		util/virnuma.c util/virnuma.h			\
161 162 163
		util/virobject.c util/virobject.h		\
		util/virpci.c util/virpci.h			\
		util/virpidfile.c util/virpidfile.h		\
164
		util/virpolkit.c util/virpolkit.h               \
D
Daniel P. Berrange 已提交
165
		util/virportallocator.c util/virportallocator.h \
166
		util/virprobe.h					\
167
		util/virprocess.c util/virprocess.h		\
168
		util/virqemu.c util/virqemu.h			\
169
		util/virrandom.h util/virrandom.c		\
170
		util/virresctrl.h util/virresctrl.c		\
171
		util/virrotatingfile.h util/virrotatingfile.c   \
172
		util/virscsi.c util/virscsi.h			\
173
		util/virscsihost.c util/virscsihost.h		\
174
		util/virscsivhost.c util/virscsivhost.h		\
175
		util/virseclabel.c util/virseclabel.h		\
176
		util/virsecret.c util/virsecret.h		\
177 178
		util/virsexpr.c util/virsexpr.h			\
		util/virsocketaddr.h util/virsocketaddr.c	\
179
		util/virstorageencryption.c util/virstorageencryption.h \
180 181
		util/virstoragefile.c util/virstoragefile.h	\
		util/virstring.h util/virstring.c		\
182
		util/virsysinfo.c util/virsysinfo.h util/virsysinfopriv.h		\
183
		util/virsystemd.c util/virsystemd.h util/virsystemdpriv.h \
184
		util/virthread.c util/virthread.h		\
P
Pavel Hrdina 已提交
185
		util/virthreadjob.c util/virthreadjob.h		\
186 187
		util/virthreadpool.c util/virthreadpool.h	\
		util/virtime.h util/virtime.c			\
188
		util/virtpm.h util/virtpm.c			\
189
		util/virtypedparam.c util/virtypedparam.h	\
190
		util/virusb.c util/virusb.h			\
191 192
		util/viruri.h util/viruri.c			\
		util/virutil.c util/virutil.h			\
193
		util/viruuid.c util/viruuid.h			\
194
		util/virvhba.c util/virvhba.h			\
195
		util/virxdrdefs.h                               \
196
		util/virxml.c util/virxml.h			\
197
		util/virmdev.c util/virmdev.h			\
P
Pavel Hrdina 已提交
198
		util/virfilecache.c util/virfilecache.h		\
199
		$(NULL)
L
Lai Jiangshan 已提交
200

201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
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

226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
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 $@

256 257 258 259 260 261 262 263
KEYCODES = linux osx atset1 atset2 atset3 xt xtkbd usb win32 rfb
KEYNAMES = linux osx win32

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

264 265 266 267 268 269
KEYPODS = $(KEYCODES:%=util/virkeycode-%.pod) \
	  $(KEYNAMES:%=util/virkeyname-%.pod)
KEYMANS = $(KEYPODS:%.pod=%.7)

man7_MANS = $(KEYMANS)

270 271 272
UTIL_SOURCES += $(KEYTABLES)
BUILT_SOURCES += $(KEYTABLES)
MAINTAINERCLEANFILES += $(KEYTABLES)
273
CLEANFILES += $(KEYMANS) $(KEYPODS)
L
Lai Jiangshan 已提交
274

275
# Internal generic driver infrastructure
O
Osier Yang 已提交
276 277 278
DATATYPES_SOURCES = datatypes.h datatypes.c
DRIVER_SOURCES =							\
		driver.c driver.h					\
279 280 281 282 283 284 285 286 287
		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						\
O
Osier Yang 已提交
288 289 290
		internal.h						\
		$(DATATYPES_SOURCES)					\
		libvirt.c libvirt_internal.h				\
291
		libvirt-domain.c 					\
292
		libvirt-domain-snapshot.c 				\
293
		libvirt-host.c 						\
294
		libvirt-interface.c	 				\
295
		libvirt-network.c	 				\
296
		libvirt-nodedev.c	 				\
297
		libvirt-nwfilter.c	 				\
298
		libvirt-secret.c	 				\
299
		libvirt-storage.c	 				\
300
		libvirt-stream.c	 				\
O
Osier Yang 已提交
301 302 303
		locking/lock_manager.c locking/lock_manager.h		\
		locking/lock_driver.h					\
		locking/lock_driver_nop.h locking/lock_driver_nop.c	\
304 305 306
		locking/domain_lock.h locking/domain_lock.c		\
		logging/log_manager.c logging/log_manager.h		\
		$(NULL)
307

308 309 310
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

311 312
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
313

314
LOCK_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
315 316
		locking/lock_protocol.h \
		locking/lock_protocol.c \
317 318
		$(NULL)

319 320 321
LOCK_PROTOCOL = $(srcdir)/locking/lock_protocol.x
EXTRA_DIST += $(LOCK_PROTOCOL) \
	$(LOCK_PROTOCOL_GENERATED)
322 323 324
BUILT_SOURCES += $(LOCK_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(LOCK_PROTOCOL_GENERATED)

325
LOCK_DAEMON_GENERATED = \
326
		locking/lock_daemon_dispatch_stubs.h
327 328 329
		$(NULL)

BUILT_SOURCES += $(LOCK_DAEMON_GENERATED)
330
EXTRA_DIST += $(LOCK_DAEMON_GENERATED)
331 332
MAINTAINERCLEANFILES += $(LOCK_DAEMON_GENERATED)

333 334
LOCK_DRIVER_LOCKD_SOURCES = \
		locking/lock_driver_lockd.c \
335
		locking/lock_driver_lockd.h \
336 337
		$(NULL)

338 339 340 341 342
LOCK_DAEMON_SOURCES = \
		locking/lock_daemon.h \
		locking/lock_daemon.c \
		locking/lock_daemon_config.h \
		locking/lock_daemon_config.c \
343 344
		locking/lock_daemon_dispatch.c \
		locking/lock_daemon_dispatch.h \
345 346
		$(NULL)

E
Eric Blake 已提交
347
locking/lock_daemon_dispatch_stubs.h: $(LOCK_PROTOCOL) \
348
		$(srcdir)/rpc/gendispatch.pl Makefile.am
349 350
	$(AM_V_GEN)perl -w $(srcdir)/rpc/gendispatch.pl --mode=server \
	    virLockSpaceProtocol VIR_LOCK_SPACE_PROTOCOL \
E
Eric Blake 已提交
351
	    $(LOCK_PROTOCOL) > $(srcdir)/locking/lock_daemon_dispatch_stubs.h
352 353


354 355 356 357 358
LOG_PROTOCOL_GENERATED = \
		logging/log_protocol.h \
		logging/log_protocol.c \
		$(NULL)

359 360
DRIVER_SOURCES += $(LOG_PROTOCOL_GENERATED)

361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381
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 \
382 383
		logging/log_handler.c \
		logging/log_handler.h \
384 385 386 387 388 389 390 391 392
		$(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


393 394
NETDEV_CONF_SOURCES =						\
		conf/netdev_bandwidth_conf.h conf/netdev_bandwidth_conf.c \
395 396
		conf/netdev_vport_profile_conf.h conf/netdev_vport_profile_conf.c \
		conf/netdev_vlan_conf.h conf/netdev_vlan_conf.c
397

398
# XML configuration format handling sources
399 400
# Domain driver generic impl APIs
DOMAIN_CONF_SOURCES =						\
401
		conf/capabilities.c conf/capabilities.h		\
402
		conf/domain_addr.c conf/domain_addr.h		\
M
Michal Privoznik 已提交
403
		conf/domain_capabilities.c conf/domain_capabilities.h	\
404
		conf/domain_conf.c conf/domain_conf.h		\
405
		conf/domain_audit.c conf/domain_audit.h		\
406
		conf/domain_nwfilter.c conf/domain_nwfilter.h	\
J
Jiri Denemark 已提交
407
		conf/virsavecookie.c conf/virsavecookie.h	\
408
		conf/snapshot_conf.c conf/snapshot_conf.h	\
409 410
		conf/numa_conf.c conf/numa_conf.h	\
		conf/virdomainobjlist.c conf/virdomainobjlist.h
411

412 413 414 415
OBJECT_EVENT_SOURCES =						\
		conf/object_event.c conf/object_event.h \
		conf/object_event_private.h

416 417
DOMAIN_EVENT_SOURCES =						\
		conf/domain_event.c conf/domain_event.h
418

419 420 421
NETWORK_EVENT_SOURCES =						\
		conf/network_event.c conf/network_event.h

422 423 424
STORAGE_EVENT_SOURCES =						\
                conf/storage_event.c conf/storage_event.h

425 426 427
NODE_DEVICE_EVENT_SOURCES =					\
                conf/node_device_event.c conf/node_device_event.h

428 429 430
SECRET_EVENT_SOURCES =					\
                conf/secret_event.c conf/secret_event.h

431
# Network driver generic impl APIs
432
NETWORK_CONF_SOURCES =						\
J
John Ferlan 已提交
433 434
		conf/network_conf.c conf/network_conf.h		\
		conf/virnetworkobj.c conf/virnetworkobj.h	\
435
		conf/networkcommon_conf.c conf/networkcommon_conf.h
436

437 438
# Network filter driver generic impl APIs
NWFILTER_PARAM_CONF_SOURCES =					\
439
		conf/nwfilter_params.c conf/nwfilter_params.h	\
440 441
		conf/nwfilter_ipaddrmap.c			\
		conf/nwfilter_ipaddrmap.h			\
J
John Ferlan 已提交
442 443
		conf/nwfilter_conf.h                            \
		conf/virnwfilterobj.h
444

445
NWFILTER_CONF_SOURCES =						\
446
		$(NWFILTER_PARAM_CONF_SOURCES)			\
J
John Ferlan 已提交
447 448
		conf/nwfilter_conf.c conf/nwfilter_conf.h	\
		conf/virnwfilterobj.c conf/virnwfilterobj.h
449

450
# Storage driver generic impl APIs
451
STORAGE_CONF_SOURCES =                                         \
452
		conf/storage_adapter_conf.h conf/storage_adapter_conf.c \
J
John Ferlan 已提交
453 454
		conf/storage_conf.h conf/storage_conf.c        \
		conf/virstorageobj.h conf/virstorageobj.c
455

456
# Interface driver generic impl APIs
457
INTERFACE_CONF_SOURCES =                                       \
J
John Ferlan 已提交
458 459
		conf/interface_conf.c conf/interface_conf.h    \
		conf/virinterfaceobj.c conf/virinterfaceobj.h
460

461
# Secret driver generic impl APIs
462
SECRET_CONF_SOURCES =                                          \
463 464
		conf/secret_conf.h conf/secret_conf.c          \
		conf/virsecretobj.h conf/virsecretobj.c
465 466 467

# Network driver generic impl APIs
NODE_DEVICE_CONF_SOURCES =                                     \
J
John Ferlan 已提交
468 469
		conf/node_device_conf.c conf/node_device_conf.h \
		conf/virnodedeviceobj.c conf/virnodedeviceobj.h
470

471 472
CPU_CONF_SOURCES =						\
		conf/cpu_conf.c conf/cpu_conf.h
473

474 475
# Safe character device handling helper APIs
CHRDEV_CONF_SOURCES =						\
476
		conf/virchrdev.c conf/virchrdev.h
477

478 479 480 481
# Device Helper APIs
DEVICE_CONF_SOURCES =                                           \
		conf/device_conf.c conf/device_conf.h

482
CONF_SOURCES =							\
483
		$(NETDEV_CONF_SOURCES)				\
484
		$(DOMAIN_CONF_SOURCES)				\
485
		$(OBJECT_EVENT_SOURCES)				\
486
		$(DOMAIN_EVENT_SOURCES)				\
487
		$(NETWORK_EVENT_SOURCES)			\
488
		$(STORAGE_EVENT_SOURCES)			\
489
		$(NODE_DEVICE_EVENT_SOURCES)			\
490
		$(SECRET_EVENT_SOURCES)				\
491
		$(NETWORK_CONF_SOURCES)				\
492
		$(NWFILTER_CONF_SOURCES)			\
493 494 495
		$(NODE_DEVICE_CONF_SOURCES)			\
		$(STORAGE_CONF_SOURCES)				\
		$(INTERFACE_CONF_SOURCES)			\
496
		$(SECRET_CONF_SOURCES)				\
497
		$(CPU_CONF_SOURCES)				\
498
		$(CHRDEV_CONF_SOURCES)				\
499
		$(DEVICE_CONF_SOURCES)
500

501
# The remote RPC driver, covering domains, storage, networks, etc
502
REMOTE_DRIVER_GENERATED = \
E
Eric Blake 已提交
503 504 505 506 507 508 509 510 511 512
		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		\
		$(NULL)
E
Eric Blake 已提交
513 514

REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x
515
LXC_PROTOCOL = $(srcdir)/remote/lxc_protocol.x
E
Eric Blake 已提交
516
QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x
517
REMOTE_DRIVER_PROTOCOL = $(REMOTE_PROTOCOL) $(QEMU_PROTOCOL) $(LXC_PROTOCOL)
518

E
Eric Blake 已提交
519
remote/remote_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
520
		$(REMOTE_PROTOCOL) Makefile.am
521
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
522 523
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/remote/remote_client_bodies.h
524

E
Eric Blake 已提交
525
remote/lxc_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
526
		$(LXC_PROTOCOL) Makefile.am
527
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
528 529
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/remote/lxc_client_bodies.h
530

E
Eric Blake 已提交
531
remote/qemu_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
532
		$(QEMU_PROTOCOL) Makefile.am
533
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
534 535
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/remote/qemu_client_bodies.h
536 537 538 539

REMOTE_DRIVER_SOURCES =						\
		remote/remote_driver.c remote/remote_driver.h	\
		$(REMOTE_DRIVER_GENERATED)
540

541
EXTRA_DIST +=  $(REMOTE_DRIVER_PROTOCOL) \
542
		$(REMOTE_DRIVER_GENERATED)
543

M
Martin Kletzander 已提交
544 545 546 547
ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x

ADMIN_PROTOCOL_GENERATED = \
		admin/admin_protocol.c	\
548 549 550 551 552 553 554 555
		admin/admin_protocol.h	\
		admin/admin_client.h

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 已提交
556 557 558 559 560

EXTRA_DIST += $(ADMIN_PROTOCOL) $(ADMIN_PROTOCOL_GENERATED)
BUILT_SOURCES += $(ADMIN_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(ADMIN_PROTOCOL_GENERATED)

561 562 563 564 565 566 567 568 569 570
# 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
571 572 573 574

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

585
# Depending on configure options, libtool creates one or both of
E
Eric Blake 已提交
586 587
# remote/{,.libs/}libvirt_driver_remote_la-remote_protocol.o.  We want
# the newest of the two, in case configure options changed and a stale
588
# file is left around from an earlier build.
589
PDWTAGS = \
590
	$(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then		\
E
Eric Blake 已提交
591 592
	  o=`ls -t $(<:.lo=.$(OBJEXT))					\
	     $(subst /,/.libs/,$(<:.lo=.$(OBJEXT)))			\
593 594 595
	    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;			\
E
Eric Blake 已提交
596
	  if test ! -s $(@F)-t1 && test -s $(@F)-t2; then		\
597 598 599
	    rm -rf $(@F)-t?;						\
	    echo 'WARNING: pdwtags appears broken; skipping the $@ test' >&2;\
	  else								\
600
	    $(PERL) -0777 -n						\
601
		-e 'foreach my $$p (split m!\n*(?:$(r1)|$(r2))\n!) {'	\
602
		-e '  if ($$p =~ /^(struct|enum) $(struct_prefix)/ ||'	\
603
		-e '      $$p =~ /^enum \{/) {'				\
604 605 606
		-e '    $$p =~ s!\t*/\*.*?\*/!!sg;'			\
		-e '    $$p =~ s!\s+\n!\n!sg;'				\
		-e '    $$p =~ s!\s+$$!!;'				\
607
		-e '    $$p =~ s!\t!        !g;'			\
608 609 610 611
		-e '    print "$$p\n";'					\
		-e '    $$n++;'						\
		-e '  }'						\
		-e '}'							\
612 613 614
		-e 'BEGIN {'						\
		-e '  print "/* -*- c -*- */\n";'			\
		-e '}'							\
615
		-e 'END {'						\
616
		-e '  if ($$n < 1) {'					\
617 618 619 620 621 622
		-e '    warn "WARNING: your pdwtags program is too old\n";' \
		-e '    warn "WARNING: skipping the $@ test\n";'	\
		-e '    warn "WARNING: install dwarves-1.3 or newer\n";' \
		-e '    exit 8;'					\
		-e '  }'						\
		-e '}'							\
623 624
		< $(@F)-t1 > $(@F)-t3;					\
	    case $$? in 8) rm -f $(@F)-t?; exit 0;; 0) ;; *) exit 1;; esac;\
625
	    diff -u $(@)s $(@F)-t3; st=$$?; rm -f $(@F)-t?; exit $$st;	\
626
	  fi;								\
627
	else								\
628 629
	  echo 'WARNING: you lack pdwtags; skipping the $@ test' >&2;	\
	  echo 'WARNING: install the dwarves package to get pdwtags' >&2; \
630
	fi
631

632
# .libs/libvirt.so is built by libtool as a side-effect of the Makefile
633 634
# rule for libvirt.la.  However, checking symbols relies on Linux ELF layout
if WITH_LINUX
635 636 637
check-symfile: libvirt.syms libvirt.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt.syms \
	  .libs/libvirt.so
638 639 640
check-admin-symfile: libvirt_admin.syms libvirt-admin.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt_admin.syms \
	  .libs/libvirt-admin.so
641
else ! WITH_LINUX
642
check-symfile:
643
check-admin-symfile:
644
endif ! WITH_LINUX
645
check-symsorting:
646
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
647
		$(srcdir) $(SYM_FILES)
648 649 650
check-admin-symsorting:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
		$(srcdir) $(ADMIN_SYM_FILES)
J
Jiri Denemark 已提交
651
EXTRA_DIST += check-symfile.pl check-symsorting.pl
652

E
Eric Blake 已提交
653
# Keep this list synced with RPC_PROBE_FILES
654 655
PROTOCOL_STRUCTS = \
	$(srcdir)/remote_protocol-structs \
656
	$(srcdir)/lxc_protocol-structs \
657
	$(srcdir)/qemu_protocol-structs \
J
Jiri Denemark 已提交
658
	$(srcdir)/virnetprotocol-structs \
E
Eric Blake 已提交
659 660 661
	$(srcdir)/virkeepaliveprotocol-structs \
	$(srcdir)/lxc_monitor_protocol-structs \
	$(srcdir)/lock_protocol-structs \
M
Martin Kletzander 已提交
662
	$(srcdir)/admin_protocol-structs \
E
Eric Blake 已提交
663 664
	$(NULL)

665
if WITH_REMOTE
666 667
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)

668 669
# 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.
670 671 672
$(srcdir)/remote_protocol-struct \
	$(srcdir)/qemu_protocol-struct \
	$(srcdir)/lxc_protocol-struct: \
E
Eric Blake 已提交
673
		$(srcdir)/%-struct: remote/libvirt_driver_remote_la-%.lo
674
	$(PDWTAGS)
675
$(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \
E
Eric Blake 已提交
676
		$(srcdir)/%-struct: rpc/libvirt_net_rpc_la-%.lo
677
	$(PDWTAGS)
E
Eric Blake 已提交
678
$(srcdir)/lxc_monitor_protocol-struct: \
E
Eric Blake 已提交
679
		$(srcdir)/%-struct: lxc/libvirt_driver_lxc_impl_la-%.lo
E
Eric Blake 已提交
680 681
	$(PDWTAGS)
$(srcdir)/lock_protocol-struct: \
E
Eric Blake 已提交
682
		$(srcdir)/%-struct: locking/lockd_la-%.lo
E
Eric Blake 已提交
683
	$(PDWTAGS)
M
Martin Kletzander 已提交
684 685 686
$(srcdir)/admin_protocol-struct: \
		$(srcdir)/%-struct: admin/libvirt_admin_la-%.lo
	$(PDWTAGS)
E
Eric Blake 已提交
687

688
else !WITH_REMOTE
689 690 691
# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be
# re-generated when configured --without-remote.
check-protocol:
692
endif !WITH_REMOTE
J
Jiri Denemark 已提交
693
EXTRA_DIST += $(PROTOCOL_STRUCTS)
694 695 696 697 698

check-drivername:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-drivername.pl \
		$(srcdir)/driver.h \
		$(srcdir)/libvirt_public.syms \
699
		$(srcdir)/libvirt_admin_public.syms \
700 701 702 703 704
		$(srcdir)/libvirt_qemu.syms \
		$(srcdir)/libvirt_lxc.syms

EXTRA_DIST += check-drivername.pl

705
DRIVER_SOURCE_FILES = \
706 707 708 709 710 711 712 713 714 715 716
	$(ESX_DRIVER_SOURCES) \
	$(HYPERV_DRIVER_SORUCES) \
	$(INTERFACE_DRIVER_SOURCES) \
	$(LIBXL_DRIVER_SOURCES) \
	$(LXC_DRIVER_SOURCES) \
	$(NETWORK_DRIVER_SOURCES) \
	$(NODE_DEVICE_DRIVER_SOURCES) \
	$(NODE_DEVICE_DRIVER_HAL_SOURCES) \
	$(NODE_DEVICE_DRIVER_UDEV_SOURCES) \
	$(NWFILTER_DRIVER_SOURCES) \
	$(OPENVZ_DRIVER_SOURCES) \
717
	$(VZ_DRIVER_SOURCES) \
718 719 720 721 722 723 724 725
	$(PHYP_DRIVER_SOURCES) \
	$(QEMU_DRIVER_SOURCES) \
	$(REMOTE_DRIVER_SOURCES) \
	$(SECRET_DRIVER_SOURCES) \
	$(STORAGE_DRIVER_SOURCES) \
	$(TEST_DRIVER_SOURCES) \
	$(UML_DRIVER_SOURCES) \
	$(VBOX_DRIVER_SOURCES) \
726
	vbox/vbox_tmpl.c \
727 728 729
	$(VMWARE_DRIVER_SOURCES) \
	$(XEN_DRIVER_SOURCES) \
	$(XENAPI_DRIVER_SOURCES) \
730 731
	$(NULL)

732
STATEFUL_DRIVER_SOURCE_FILES = \
R
Roman Bogorodskiy 已提交
733
	$(BHYVE_DRIVER_SOURCES) \
734 735 736 737 738 739 740 741 742 743 744
	$(INTERFACE_DRIVER_SOURCES) \
	$(LIBXL_DRIVER_SOURCES) \
	$(LXC_DRIVER_SOURCES) \
	$(NETWORK_DRIVER_SOURCES) \
	$(NODE_DEVICE_DRIVER_SOURCES) \
	$(NWFILTER_DRIVER_SOURCES) \
	$(QEMU_DRIVER_SOURCES) \
	$(SECRET_DRIVER_SOURCES) \
	$(STORAGE_DRIVER_SOURCES) \
	$(UML_DRIVER_SOURCES) \
	$(XEN_DRIVER_SOURCES) \
745
	$(VZ_DRIVER_SOURCES) \
746 747
	$(NULL)

748 749 750

check-driverimpls:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-driverimpls.pl \
751
		$(filter /%,$(DRIVER_SOURCE_FILES)) \
E
Eric Blake 已提交
752 753 754
		$(filter $(srcdir)/%,$(DRIVER_SOURCE_FILES)) \
		$(addprefix $(srcdir)/,$(filter-out $(srcdir)/%, \
			$(filter-out /%,$(DRIVER_SOURCE_FILES))))
755

756 757
check-aclrules:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclrules.pl \
E
Eric Blake 已提交
758
		$(REMOTE_PROTOCOL) \
759
		$(addprefix $(srcdir)/,$(filter-out /%,$(STATEFUL_DRIVER_SOURCE_FILES)))
760

761 762 763 764 765
check-aclperms:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclperms.pl \
		$(srcdir)/access/viraccessperm.h \
		$(srcdir)/access/viraccessperm.c

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

768
check-local: check-protocol check-symfile check-symsorting \
769
	check-drivername check-driverimpls check-aclrules \
770
	check-aclperms check-admin-symfile check-admin-symsorting
771
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
772

773 774
# Mock driver, covering domains, storage, networks, etc
TEST_DRIVER_SOURCES =						\
775
		test/test_driver.c test/test_driver.h
D
Daniel P. Berrange 已提交
776
TEST_DRIVER_ASSETS = test/test-screenshot.png
777 778 779

# Now the Hypervisor specific drivers
XEN_DRIVER_SOURCES =						\
780 781 782 783 784 785
		xen/block_stats.c xen/block_stats.h		\
		xen/xen_hypervisor.c xen/xen_hypervisor.h	\
		xen/xen_driver.c xen/xen_driver.h		\
		xen/xend_internal.c xen/xend_internal.h		\
		xen/xm_internal.c xen/xm_internal.h		\
		xen/xs_internal.c xen/xs_internal.h
786
if WITH_XEN_INOTIFY
787
XEN_DRIVER_SOURCES += xen/xen_inotify.c xen/xen_inotify.h
788
endif WITH_XEN_INOTIFY
789

790
LXC_MONITOR_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
791 792
	lxc/lxc_monitor_protocol.h \
	lxc/lxc_monitor_protocol.c \
793 794 795
	$(NULL)

LXC_MONITOR_GENERATED = \
E
Eric Blake 已提交
796
	lxc/lxc_monitor_dispatch.h \
797 798 799
	$(NULL)

LXC_CONTROLLER_GENERATED = \
E
Eric Blake 已提交
800
	lxc/lxc_controller_dispatch.h \
801 802 803
	$(NULL)

LXC_GENERATED = \
804
	$(LXC_MONITOR_PROTOCOL_GENERATED) \
805 806 807 808
	$(LXC_MONITOR_GENERATED) \
	$(LXC_CONTROLLER_GENERATED) \
	$(NULL)

809
LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x
810

E
Eric Blake 已提交
811
lxc/lxc_monitor_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
812
		$(LXC_MONITOR_PROTOCOL) Makefile.am
813
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
814 815
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_monitor_dispatch.h
816

E
Eric Blake 已提交
817
lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
818
		$(REMOTE_PROTOCOL) Makefile.am
819
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \
E
Eric Blake 已提交
820 821
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_controller_dispatch.h
822 823

EXTRA_DIST += \
824
	$(LXC_MONITOR_PROTOCOL) \
825 826 827 828 829
	$(LXC_GENERATED) \
	$(NULL)

BUILT_SOURCES += $(LXC_GENERATED)

830 831
CLEANFILES += $(LXC_GENERATED)

832
LXC_DRIVER_SOURCES =						\
833
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
834
		$(LXC_MONITOR_GENERATED)			\
835 836
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
837
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
838
		lxc/lxc_domain.c lxc/lxc_domain.h		\
839
		lxc/lxc_hostdev.c lxc/lxc_hostdev.h		\
840
		lxc/lxc_monitor.c lxc/lxc_monitor.h		\
841
		lxc/lxc_process.c lxc/lxc_process.h		\
G
Gao feng 已提交
842
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
843
		lxc/lxc_native.c lxc/lxc_native.h		\
844
		lxc/lxc_driver.c lxc/lxc_driver.h
845

846
LXC_CONTROLLER_SOURCES =					\
847
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
848
		$(LXC_CONTROLLER_GENERATED)			\
849 850
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
851
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
852
		lxc/lxc_domain.c lxc/lxc_domain.h		\
G
Gao feng 已提交
853
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
854
		lxc/lxc_controller.c
855

J
Jamie Strandboge 已提交
856
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES =			\
E
Eric Blake 已提交
857
		$(DATATYPES_SOURCES)				\
J
Jamie Strandboge 已提交
858 859
		security/virt-aa-helper.c

860 861 862
PHYP_DRIVER_SOURCES =						\
		phyp/phyp_driver.c phyp/phyp_driver.h

863
OPENVZ_DRIVER_SOURCES =						\
864
		openvz/openvz_conf.c openvz/openvz_conf.h	\
865 866
		openvz/openvz_driver.c openvz/openvz_driver.h   \
		openvz/openvz_util.c openvz/openvz_util.h
867

E
Eric Blake 已提交
868
VMWARE_DRIVER_SOURCES =						\
869
		vmware/vmware_driver.c vmware/vmware_driver.h	\
870 871
		vmware/vmware_conf.c vmware/vmware_conf.h

872
VBOX_DRIVER_SOURCES =						\
E
Eric Blake 已提交
873 874
	vbox/vbox_glue.c vbox/vbox_glue.h			\
	vbox/vbox_driver.c vbox/vbox_driver.h			\
T
Taowei 已提交
875
	vbox/vbox_snapshot_conf.c vbox/vbox_snapshot_conf.h     \
876
	vbox/vbox_V4_0.c vbox/vbox_CAPI_v4_0.h			\
877
	vbox/vbox_V4_1.c vbox/vbox_CAPI_v4_1.h			\
R
Ryota Ozaki 已提交
878
	vbox/vbox_V4_2.c vbox/vbox_CAPI_v4_2.h			\
T
Taowei 已提交
879
	vbox/vbox_V4_2_20.c vbox/vbox_CAPI_v4_2_20.h		\
880
	vbox/vbox_V4_3.c vbox/vbox_CAPI_v4_3.h			\
T
Taowei 已提交
881
	vbox/vbox_V4_3_4.c vbox/vbox_CAPI_v4_3_4.h              \
M
Martin Pietsch 已提交
882
	vbox/vbox_V5_0.c vbox/vbox_CAPI_v5_0.h			\
883
	vbox/vbox_V5_1.c vbox/vbox_CAPI_v5_1.h			\
T
Taowei 已提交
884 885
	vbox/vbox_common.c vbox/vbox_common.h                   \
	vbox/vbox_uniformed_api.h                               \
886 887 888
	vbox/vbox_get_driver.h					\
	vbox/vbox_network.c					\
	vbox/vbox_storage.c
T
Taowei Luo 已提交
889

E
Eric Blake 已提交
890
VBOX_DRIVER_EXTRA_DIST =					\
891 892 893
		vbox/vbox_tmpl.c vbox/README			\
		vbox/vbox_MSCOMGlue.c vbox/vbox_MSCOMGlue.h	\
		vbox/vbox_XPCOMCGlue.c vbox/vbox_XPCOMCGlue.h
894

O
Osier Yang 已提交
895 896
QEMU_DRIVER_SOURCES =							\
		qemu/qemu_agent.c qemu/qemu_agent.h			\
897
		qemu/qemu_alias.c qemu/qemu_alias.h			\
898
		qemu/qemu_block.c qemu/qemu_block.h			\
899
		qemu/qemu_blockjob.c qemu/qemu_blockjob.h		\
O
Osier Yang 已提交
900 901
		qemu/qemu_capabilities.c qemu/qemu_capabilities.h	\
		qemu/qemu_command.c qemu/qemu_command.h			\
902
		qemu/qemu_parse_command.c qemu/qemu_parse_command.h	\
O
Osier Yang 已提交
903
		qemu/qemu_domain.c qemu/qemu_domain.h			\
904
		qemu/qemu_domain_address.c qemu/qemu_domain_address.h	\
O
Osier Yang 已提交
905 906 907
		qemu/qemu_cgroup.c qemu/qemu_cgroup.h			\
		qemu/qemu_hostdev.c qemu/qemu_hostdev.h			\
		qemu/qemu_hotplug.c qemu/qemu_hotplug.h			\
908
		qemu/qemu_hotplugpriv.h					\
O
Osier Yang 已提交
909 910
		qemu/qemu_conf.c qemu/qemu_conf.h			\
		qemu/qemu_process.c qemu/qemu_process.h			\
911
		qemu/qemu_processpriv.h					\
O
Osier Yang 已提交
912
		qemu/qemu_migration.c qemu/qemu_migration.h		\
913
		qemu/qemu_migration_cookie.c qemu/qemu_migration_cookie.h \
O
Osier Yang 已提交
914 915 916 917 918
		qemu/qemu_monitor.c qemu/qemu_monitor.h			\
		qemu/qemu_monitor_text.c				\
		qemu/qemu_monitor_text.h				\
		qemu/qemu_monitor_json.c				\
		qemu/qemu_monitor_json.h				\
919
		qemu/qemu_driver.c qemu/qemu_driver.h	\
920
		qemu/qemu_interface.c qemu/qemu_interface.h		\
921 922
		qemu/qemu_capspriv.h					\
		qemu/qemu_security.c qemu/qemu_security.h
R
Richard W.M. Jones 已提交
923

O
Osier Yang 已提交
924
XENAPI_DRIVER_SOURCES =						\
925
		xenapi/xenapi_driver.c xenapi/xenapi_driver.h	\
O
Osier Yang 已提交
926
		xenapi/xenapi_driver_private.h			\
927 928
		xenapi/xenapi_utils.c xenapi/xenapi_utils.h

929 930 931 932 933
LIBXL_DRIVER_SOURCES =							\
		libxl/libxl_conf.c libxl/libxl_conf.h			\
		libxl/libxl_capabilities.c libxl/libxl_capabilities.h	\
		libxl/libxl_domain.c libxl/libxl_domain.h       	\
		libxl/libxl_driver.c libxl/libxl_driver.h       	\
934
		libxl/libxl_logger.c libxl/libxl_logger.h           \
J
Jim Fehlig 已提交
935
		libxl/libxl_migration.c libxl/libxl_migration.h
J
Jim Fehlig 已提交
936

937
UML_DRIVER_SOURCES =						\
D
Daniel P. Berrange 已提交
938 939
		uml/uml_conf.c uml/uml_conf.h			\
		uml/uml_driver.c uml/uml_driver.h
940

O
Osier Yang 已提交
941 942 943 944 945 946
ESX_DRIVER_SOURCES =							\
		esx/esx_private.h					\
		esx/esx_driver.c esx/esx_driver.h			\
		esx/esx_interface_driver.c esx/esx_interface_driver.h	\
		esx/esx_network_driver.c esx/esx_network_driver.h	\
		esx/esx_storage_driver.c esx/esx_storage_driver.h	\
947
		esx/esx_storage_backend_vmfs.c esx/esx_storage_backend_vmfs.h	\
948
		esx/esx_storage_backend_iscsi.c esx/esx_storage_backend_iscsi.h	\
949
		esx/esx_stream.c esx/esx_stream.h			\
O
Osier Yang 已提交
950 951 952
		esx/esx_util.c esx/esx_util.h				\
		esx/esx_vi.c esx/esx_vi.h				\
		esx/esx_vi_methods.c esx/esx_vi_methods.h		\
953
		esx/esx_vi_types.c esx/esx_vi_types.h
954

955
ESX_DRIVER_GENERATED =							\
956 957
		esx/esx_vi_methods.generated.c				\
		esx/esx_vi_methods.generated.h				\
958
		esx/esx_vi_methods.generated.macro			\
959 960 961 962 963
		esx/esx_vi_types.generated.c				\
		esx/esx_vi_types.generated.h				\
		esx/esx_vi_types.generated.typedef			\
		esx/esx_vi_types.generated.typeenum			\
		esx/esx_vi_types.generated.typetostring			\
964 965 966
		esx/esx_vi_types.generated.typefromstring		\
		esx/esx_vi.generated.c					\
		esx/esx_vi.generated.h
967

O
Osier Yang 已提交
968
ESX_DRIVER_EXTRA_DIST =							\
969 970 971 972 973
		esx/README						\
		esx/esx_vi_generator.input				\
		esx/esx_vi_generator.py					\
		$(ESX_DRIVER_GENERATED)

O
Osier Yang 已提交
974
HYPERV_DRIVER_SOURCES =									\
M
Matthias Bolte 已提交
975 976
		hyperv/hyperv_private.h							\
		hyperv/hyperv_driver.c hyperv/hyperv_driver.h				\
977
		hyperv/hyperv_util.c hyperv/hyperv_util.h				\
978 979 980 981 982 983 984 985 986 987 988 989 990 991
		hyperv/hyperv_wmi.c hyperv/hyperv_wmi.h					\
		hyperv/hyperv_wmi_classes.c hyperv/hyperv_wmi_classes.h			\
		hyperv/openwsman.h

HYPERV_DRIVER_GENERATED =							\
		hyperv/hyperv_wmi_classes.generated.c				\
		hyperv/hyperv_wmi_classes.generated.h				\
		hyperv/hyperv_wmi_classes.generated.typedef

HYPERV_DRIVER_EXTRA_DIST =							\
		hyperv/hyperv_wmi_generator.input				\
		hyperv/hyperv_wmi_generator.py					\
		$(HYPERV_DRIVER_GENERATED)

992
VZ_DRIVER_SOURCES =				\
993 994 995 996 997 998
		vz/vz_driver.h			\
		vz/vz_driver.c			\
		vz/vz_utils.c			\
		vz/vz_utils.h			\
		vz/vz_sdk.h			\
		vz/vz_sdk.c
D
Dmitry Guryanov 已提交
999

R
Roman Bogorodskiy 已提交
1000
BHYVE_DRIVER_SOURCES =						\
1001 1002
		bhyve/bhyve_capabilities.c			\
		bhyve/bhyve_capabilities.h			\
R
Roman Bogorodskiy 已提交
1003 1004
		bhyve/bhyve_command.c				\
		bhyve/bhyve_command.h				\
1005 1006
		bhyve/bhyve_conf.c				\
		bhyve/bhyve_conf.h				\
1007 1008
		bhyve/bhyve_parse_command.c			\
		bhyve/bhyve_parse_command.h			\
1009 1010 1011 1012
		bhyve/bhyve_device.c				\
		bhyve/bhyve_device.h				\
		bhyve/bhyve_domain.c				\
		bhyve/bhyve_domain.h				\
R
Roman Bogorodskiy 已提交
1013 1014
		bhyve/bhyve_driver.h				\
		bhyve/bhyve_driver.c				\
1015 1016
		bhyve/bhyve_monitor.c				\
		bhyve/bhyve_monitor.h				\
R
Roman Bogorodskiy 已提交
1017 1018 1019 1020 1021
		bhyve/bhyve_process.c				\
		bhyve/bhyve_process.h				\
		bhyve/bhyve_utils.h				\
		$(NULL)

1022
NETWORK_DRIVER_SOURCES =					\
1023 1024 1025 1026 1027
		network/bridge_driver.h network/bridge_driver.c \
		network/bridge_driver_platform.h 		\
		network/bridge_driver_platform.c		\
		$(NULL)
EXTRA_DIST += network/bridge_driver_linux.c network/bridge_driver_nop.c
1028

1029 1030 1031 1032
INTERFACE_DRIVER_SOURCES =

if WITH_INTERFACE
INTERFACE_DRIVER_SOURCES +=					\
1033 1034
		interface/interface_driver.h        \
		interface/interface_driver.c
1035 1036 1037 1038

if WITH_NETCF
INTERFACE_DRIVER_SOURCES +=					\
		interface/interface_backend_netcf.c
1039
endif WITH_NETCF
1040
if WITH_UDEV
1041 1042
INTERFACE_DRIVER_SOURCES +=					\
		interface/interface_backend_udev.c
1043 1044
endif WITH_UDEV
endif WITH_INTERFACE
1045

1046 1047 1048
SECRET_UTIL_SOURCES =						\
		secret/secret_util.h secret/secret_util.c

1049
SECRET_DRIVER_SOURCES =						\
1050
		secret/secret_driver.h secret/secret_driver.c
1051

1052
# Storage backend specific impls
1053 1054 1055
STORAGE_DRIVER_BACKEND_SOURCES = \
		storage/storage_backend.h storage/storage_backend.c

O
Osier Yang 已提交
1056 1057
STORAGE_DRIVER_SOURCES =						\
		storage/storage_driver.h storage/storage_driver.c	\
1058
		storage/storage_source.h storage/storage_source.c	\
1059
		$(STORAGE_DRIVER_BACKEND_SOURCES) \
1060
		storage/storage_util.h storage/storage_util.c
1061 1062

STORAGE_DRIVER_FS_SOURCES =					\
1063
		storage/storage_backend_fs.h storage/storage_backend_fs.c
R
Richard W.M. Jones 已提交
1064

1065
STORAGE_DRIVER_LVM_SOURCES =					\
O
Osier Yang 已提交
1066
		storage/storage_backend_logical.h		\
1067
		storage/storage_backend_logical.c
1068 1069

STORAGE_DRIVER_ISCSI_SOURCES =					\
1070
		storage/storage_backend_iscsi.h storage/storage_backend_iscsi.c
1071

1072
STORAGE_DRIVER_SCSI_SOURCES =					\
1073
		storage/storage_backend_scsi.h storage/storage_backend_scsi.c
1074

D
Dave Allan 已提交
1075
STORAGE_DRIVER_MPATH_SOURCES =					\
1076
		storage/storage_backend_mpath.h storage/storage_backend_mpath.c
D
Dave Allan 已提交
1077

1078
STORAGE_DRIVER_DISK_SOURCES =					\
1079
		storage/storage_backend_disk.h storage/storage_backend_disk.c
1080

1081 1082 1083
STORAGE_DRIVER_RBD_SOURCES =					\
		storage/storage_backend_rbd.h storage/storage_backend_rbd.c

1084
STORAGE_DRIVER_SHEEPDOG_SOURCES =				\
1085 1086
		storage/storage_backend_sheepdog.h storage/storage_backend_sheepdog.c \
		storage/storage_backend_sheepdog_priv.h
1087

1088 1089 1090
STORAGE_DRIVER_GLUSTER_SOURCES =				\
		storage/storage_backend_gluster.h storage/storage_backend_gluster.c

R
Roman Bogorodskiy 已提交
1091 1092 1093
STORAGE_DRIVER_ZFS_SOURCES =					\
                storage/storage_backend_zfs.h storage/storage_backend_zfs.c

1094 1095 1096 1097
STORAGE_DRIVER_VSTORAGE_SOURCES =				\
                storage/storage_backend_vstorage.h		\
                storage/storage_backend_vstorage.c

1098
STORAGE_HELPER_DISK_SOURCES =					\
1099
		storage/parthelper.c
1100

1101 1102 1103
UTIL_IO_HELPER_SOURCES =					\
		util/iohelper.c

1104 1105 1106
NETWORK_LEASES_HELPER_SOURCES =                                 \
               network/leaseshelper.c

1107
# Network filters
O
Osier Yang 已提交
1108
NWFILTER_DRIVER_SOURCES =						\
1109
		nwfilter/nwfilter_driver.h nwfilter/nwfilter_driver.c	\
1110
		nwfilter/nwfilter_tech_driver.h				\
1111 1112
		nwfilter/nwfilter_gentech_driver.c			\
		nwfilter/nwfilter_gentech_driver.h			\
S
Stefan Berger 已提交
1113 1114
		nwfilter/nwfilter_dhcpsnoop.c				\
		nwfilter/nwfilter_dhcpsnoop.h				\
1115
		nwfilter/nwfilter_ebiptables_driver.c			\
1116 1117 1118
		nwfilter/nwfilter_ebiptables_driver.h			\
		nwfilter/nwfilter_learnipaddr.c				\
		nwfilter/nwfilter_learnipaddr.h
1119

1120

1121
# Security framework and drivers for various models
O
Osier Yang 已提交
1122 1123 1124 1125 1126
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		\
1127
		security/security_manager.h security/security_manager.c
1128

1129
SECURITY_DRIVER_SELINUX_SOURCES =				\
1130
		security/security_selinux.h security/security_selinux.c
1131

J
Jamie Strandboge 已提交
1132 1133 1134
SECURITY_DRIVER_APPARMOR_SOURCES =				\
		security/security_apparmor.h security/security_apparmor.c

1135
ACCESS_DRIVER_GENERATED = \
E
Eric Blake 已提交
1136 1137 1138 1139 1140 1141 1142
		access/viraccessapicheck.h \
		access/viraccessapicheck.c \
		access/viraccessapicheckqemu.h \
		access/viraccessapicheckqemu.c \
		access/viraccessapichecklxc.h \
		access/viraccessapichecklxc.c \
		$(NULL)
1143

1144
ACCESS_DRIVER_SYM_FILES = \
1145 1146 1147
		libvirt_access.syms \
		libvirt_access_qemu.syms \
		libvirt_access_lxc.syms
1148

1149 1150 1151 1152 1153
ACCESS_DRIVER_API_FILES = \
		libvirt_access.xml \
		libvirt_access_qemu.xml \
		libvirt_access_lxc.xml

1154 1155 1156 1157 1158 1159 1160
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

1161 1162 1163 1164
ACCESS_DRIVER_POLKIT_SOURCES = \
		access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c

ACCESS_DRIVER_POLKIT_POLICY = \
1165
		$(srcdir)/access/org.libvirt.api.policy
1166 1167


1168
NODE_DEVICE_DRIVER_SOURCES =					\
O
Osier Yang 已提交
1169 1170
		node_device/node_device_driver.c		\
		node_device/node_device_driver.h		\
1171 1172
		node_device/node_device_linux_sysfs.c           \
		node_device/node_device_linux_sysfs.h
1173 1174

NODE_DEVICE_DRIVER_HAL_SOURCES =				\
1175
		node_device/node_device_hal.c			\
1176
		node_device/node_device_hal.h
1177

1178
NODE_DEVICE_DRIVER_UDEV_SOURCES =				\
D
Daniel Veillard 已提交
1179 1180
		node_device/node_device_udev.c			\
		node_device/node_device_udev.h
1181

J
Jiri Denemark 已提交
1182 1183 1184
CPU_SOURCES =							\
		cpu/cpu.h cpu/cpu.c				\
		cpu/cpu_x86.h cpu/cpu_x86.c cpu/cpu_x86_data.h	\
T
Thang Pham 已提交
1185
		cpu/cpu_s390.h cpu/cpu_s390.c			\
C
Chuck Short 已提交
1186
		cpu/cpu_arm.h cpu/cpu_arm.c			\
1187 1188 1189
		cpu/cpu_ppc64.h cpu/cpu_ppc64.c			\
		cpu/cpu_ppc64_data.h				\
		cpu/cpu_map.h cpu/cpu_map.c
1190

1191 1192 1193
VMX_SOURCES =							\
		vmx/vmx.c vmx/vmx.h

1194 1195
XENCONFIG_SOURCES =						\
		xenconfig/xenxs_private.h			\
1196
		xenconfig/xen_common.c xenconfig/xen_common.h   \
1197
		xenconfig/xen_sxpr.c xenconfig/xen_sxpr.h	\
1198
		xenconfig/xen_xm.c xenconfig/xen_xm.h
1199
if WITH_LIBXL
1200 1201
XENCONFIG_LIBXL_SOURCES =					\
		$(XENCONFIG_SOURCES)				\
1202 1203
		xenconfig/xen_xl.c xenconfig/xen_xl.h
endif WITH_LIBXL
1204

J
Jiri Denemark 已提交
1205 1206
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
1207
EXTRA_DIST +=	$(pkgdata_DATA)
1208

1209 1210 1211 1212 1213 1214
#########################
#
# Build up list of libvirt.la source files based on configure conditions
#
# First deal with sources usable in non-daemon context

1215
noinst_LTLIBRARIES = libvirt_util.la
1216 1217
libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
libvirt_la_BUILT_LIBADD = libvirt_util.la
1218 1219
libvirt_util_la_SOURCES =					\
		$(UTIL_SOURCES)
1220
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
1221
		$(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
1222
		$(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS)	\
1223
		$(POLKIT_CFLAGS) $(GNUTLS_CFLAGS) $(ACL_CFLAGS)
1224
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
1225
		$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
1226
		$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(WIN32_EXTRA_LIBS) $(LIBXML_LIBS) \
M
Michal Privoznik 已提交
1227
		$(SECDRIVER_LIBS) $(NUMACTL_LIBS) $(ACL_LIBS) \
1228
		$(POLKIT_LIBS) $(GNUTLS_LIBS)
1229

1230 1231

noinst_LTLIBRARIES += libvirt_conf.la
1232
libvirt_la_BUILT_LIBADD += libvirt_conf.la
1233
libvirt_conf_la_SOURCES = $(CONF_SOURCES)
1234 1235
libvirt_conf_la_CFLAGS = \
		-I$(srcdir)/conf $(AM_CFLAGS)
1236
libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS)
1237
libvirt_conf_la_LIBADD = $(LIBXML_LIBS)
1238

J
Jiri Denemark 已提交
1239
noinst_LTLIBRARIES += libvirt_cpu.la
1240
libvirt_la_BUILT_LIBADD += libvirt_cpu.la
J
Jiri Denemark 已提交
1241
libvirt_cpu_la_CFLAGS = \
1242
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jiri Denemark 已提交
1243 1244
libvirt_cpu_la_SOURCES = $(CPU_SOURCES)

1245 1246 1247 1248 1249 1250
noinst_LTLIBRARIES += libvirt_secret.la
libvirt_la_BUILT_LIBADD += libvirt_secret.la
libvirt_secret_la_CFLAGS = $(AM_CFLAGS)
libvirt_secret_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_secret_la_SOURCES = $(SECRET_UTIL_SOURCES)

1251 1252 1253 1254
if WITH_VMX
noinst_LTLIBRARIES += libvirt_vmx.la
libvirt_la_BUILT_LIBADD += libvirt_vmx.la
libvirt_vmx_la_CFLAGS = \
1255
		-I$(srcdir)/conf $(AM_CFLAGS)
1256
libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
1257
endif WITH_VMX
1258

J
Jim Fehlig 已提交
1259 1260 1261 1262
if WITH_XENCONFIG
noinst_LTLIBRARIES += libvirt_xenconfig.la
libvirt_la_BUILT_LIBADD += libvirt_xenconfig.la
libvirt_xenconfig_la_CFLAGS = \
1263
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jim Fehlig 已提交
1264
libvirt_xenconfig_la_SOURCES = $(XENCONFIG_SOURCES)
1265 1266 1267 1268 1269 1270 1271 1272

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

1275

1276
noinst_LTLIBRARIES += libvirt_driver.la
1277
libvirt_la_BUILT_LIBADD += libvirt_driver.la
1278
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
1279

1280
libvirt_driver_la_CFLAGS = \
1281
		$(GNUTLS_CFLAGS) $(CURL_CFLAGS) $(XDR_CFLAGS) \
1282
		-I$(srcdir)/conf $(AM_CFLAGS)
1283
libvirt_driver_la_LIBADD = \
1284
		$(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS)
1285

1286 1287
# 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.
1288
SYM_FILES = $(USED_SYM_FILES)
1289
USED_SYM_FILES = $(srcdir)/libvirt_private.syms
1290 1291 1292
GENERATED_SYM_FILES = \
	$(ACCESS_DRIVER_SYM_FILES) \
	libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \
1293
	libvirt_admin.syms libvirt_admin.def \
1294
	$(NULL)
1295

1296
if WITH_TEST
D
Daniel P. Berrange 已提交
1297 1298 1299 1300

driver_test_asset_DATA = $(TEST_DRIVER_ASSETS)
driver_test_assetdir = $(pkgdatadir)

1301
noinst_LTLIBRARIES += libvirt_driver_test.la
1302
libvirt_la_BUILT_LIBADD += libvirt_driver_test.la
1303
libvirt_driver_test_la_CFLAGS = \
1304
		-I$(srcdir)/conf $(AM_CFLAGS)
1305
libvirt_driver_test_la_SOURCES = $(TEST_DRIVER_SOURCES)
1306
endif WITH_TEST
1307 1308

if WITH_REMOTE
1309
noinst_LTLIBRARIES += libvirt_driver_remote.la
1310
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
1311 1312
libvirt_driver_remote_la_CFLAGS =				\
		$(GNUTLS_CFLAGS)				\
E
Eric Blake 已提交
1313
		$(XDR_CFLAGS)					\
1314 1315
		-I$(srcdir)/conf				\
		-I$(srcdir)/rpc					\
1316 1317
		$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
1318 1319 1320 1321
libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) \
                libvirt-net-rpc-client.la \
                libvirt-net-rpc-server.la \
                libvirt-net-rpc.la
1322
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
1323

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

1326 1327
endif WITH_REMOTE

1328
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
1329
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
1330
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1331

1332
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
1333
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
1334
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1335

1336
if WITH_XEN
E
Eric Blake 已提交
1337 1338 1339
noinst_LTLIBRARIES += libvirt_driver_xen_impl.la
libvirt_driver_xen_la_SOURCES =
libvirt_driver_xen_la_LIBADD = libvirt_driver_xen_impl.la
1340
mod_LTLIBRARIES += libvirt_driver_xen.la
E
Eric Blake 已提交
1341
libvirt_driver_xen_la_LIBADD += ../gnulib/lib/libgnu.la
1342
libvirt_driver_xen_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
E
Eric Blake 已提交
1343

1344
libvirt_driver_xen_impl_la_CFLAGS =				\
1345
		$(XEN_CFLAGS)					\
1346 1347 1348
		-I$(srcdir)/access				\
		-I$(srcdir)/conf				\
		-I$(srcdir)/xenconfig				\
1349
		$(AM_CFLAGS)
E
Eric Blake 已提交
1350
libvirt_driver_xen_impl_la_LDFLAGS = $(AM_LDFLAGS)
P
Pavel Hrdina 已提交
1351
libvirt_driver_xen_impl_la_LIBADD = $(XEN_LIBS) libvirt_xenconfig.la
E
Eric Blake 已提交
1352
libvirt_driver_xen_impl_la_SOURCES = $(XEN_DRIVER_SOURCES)
1353
endif WITH_XEN
1354

1355 1356
if WITH_PHYP
noinst_LTLIBRARIES += libvirt_driver_phyp.la
1357
libvirt_la_BUILT_LIBADD += libvirt_driver_phyp.la
1358 1359
libvirt_driver_phyp_la_LIBADD = $(SSH2_LIBS)
libvirt_driver_phyp_la_CFLAGS = $(SSH2_CFLAGS) \
1360
		-I$(srcdir)/conf $(AM_CFLAGS)
1361
libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES)
1362
endif WITH_PHYP
1363

1364
if WITH_OPENVZ
1365
noinst_LTLIBRARIES += libvirt_driver_openvz.la
1366
libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la
1367
libvirt_driver_openvz_la_CFLAGS = \
1368
		-I$(srcdir)/conf $(AM_CFLAGS)
1369
libvirt_driver_openvz_la_SOURCES = $(OPENVZ_DRIVER_SOURCES)
1370
endif WITH_OPENVZ
1371

1372 1373 1374 1375
if WITH_VMWARE
noinst_LTLIBRARIES += libvirt_driver_vmware.la
libvirt_la_BUILT_LIBADD += libvirt_driver_vmware.la
libvirt_driver_vmware_la_CFLAGS = \
1376
		-I$(srcdir)/conf -I$(srcdir)/vmx $(AM_CFLAGS)
1377
libvirt_driver_vmware_la_SOURCES = $(VMWARE_DRIVER_SOURCES)
1378
endif WITH_VMWARE
1379

1380
if WITH_VBOX
M
Michal Privoznik 已提交
1381
noinst_LTLIBRARIES += \
1382
		libvirt_driver_vbox_impl.la
1383 1384
libvirt_driver_vbox_la_SOURCES =
libvirt_driver_vbox_la_LIBADD = libvirt_driver_vbox_impl.la
M
Michal Privoznik 已提交
1385
mod_LTLIBRARIES += \
1386
		libvirt_driver_vbox.la
1387
libvirt_driver_vbox_la_LIBADD += ../gnulib/lib/libgnu.la
1388
libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1389 1390

libvirt_driver_vbox_impl_la_CFLAGS =				\
1391 1392
		-I$(srcdir)/conf				\
		$(AM_CFLAGS)					\
M
Michal Privoznik 已提交
1393
		-DVBOX_DRIVER
1394
libvirt_driver_vbox_impl_la_LDFLAGS = $(AM_LDFLAGS)
1395
libvirt_driver_vbox_impl_la_LIBADD =  $(DLOPEN_LIBS)		\
1396
		$(WIN32_EXTRA_LIBS)				\
1397
		$(LIBXML_LIBS)
1398
libvirt_driver_vbox_impl_la_SOURCES = $(VBOX_DRIVER_SOURCES)
1399
endif WITH_VBOX
1400

1401 1402
if WITH_XENAPI
noinst_LTLIBRARIES += libvirt_driver_xenapi.la
1403
libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la
1404
libvirt_driver_xenapi_la_CFLAGS = $(XENAPI_CFLAGS) $(CURL_CFLAGS) \
P
Pavel Hrdina 已提交
1405
		-I$(srcdir)/conf -I$(srcdir)/xenconfig $(AM_CFLAGS)
1406
libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS)
1407
libvirt_driver_xenapi_la_LIBADD = $(XENAPI_LIBS) $(CURL_LIBS)
1408
libvirt_driver_xenapi_la_SOURCES = $(XENAPI_DRIVER_SOURCES)
1409
endif WITH_XENAPI
1410

J
Jim Fehlig 已提交
1411
if WITH_LIBXL
E
Eric Blake 已提交
1412 1413 1414
noinst_LTLIBRARIES += libvirt_driver_libxl_impl.la
libvirt_driver_libxl_la_SOURCES =
libvirt_driver_libxl_la_LIBADD = libvirt_driver_libxl_impl.la
J
Jim Fehlig 已提交
1415
mod_LTLIBRARIES += libvirt_driver_libxl.la
E
Eric Blake 已提交
1416
libvirt_driver_libxl_la_LIBADD += ../gnulib/lib/libgnu.la
1417
libvirt_driver_libxl_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
E
Eric Blake 已提交
1418

1419 1420
libvirt_driver_libxl_impl_la_CFLAGS = 		\
		$(LIBXL_CFLAGS)			\
1421 1422
		-I$(srcdir)/access	\
		-I$(srcdir)/conf	\
1423
		-I$(srcdir)/secret      \
1424
		-I$(srcdir)/xenconfig	\
1425
		$(AM_CFLAGS)
E
Eric Blake 已提交
1426
libvirt_driver_libxl_impl_la_LDFLAGS = $(AM_LDFLAGS)
1427
libvirt_driver_libxl_impl_la_LIBADD = $(LIBXL_LIBS) \
1428
				      libvirt_xenconfig_libxl.la \
1429
				      libvirt_secret.la
E
Eric Blake 已提交
1430
libvirt_driver_libxl_impl_la_SOURCES = $(LIBXL_DRIVER_SOURCES)
1431 1432 1433 1434 1435 1436

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

1437
endif WITH_LIBXL
1438 1439
EXTRA_DIST += libxl/libxl.conf libxl/libvirtd_libxl.aug \
		libxl/test_libvirtd_libxl.aug.in
J
Jim Fehlig 已提交
1440

1441
if WITH_QEMU
E
Eric Blake 已提交
1442 1443 1444
noinst_LTLIBRARIES += libvirt_driver_qemu_impl.la
libvirt_driver_qemu_la_SOURCES =
libvirt_driver_qemu_la_LIBADD = libvirt_driver_qemu_impl.la
1445
mod_LTLIBRARIES += libvirt_driver_qemu.la
E
Eric Blake 已提交
1446
libvirt_driver_qemu_la_LIBADD += ../gnulib/lib/libgnu.la
1447
libvirt_driver_qemu_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
E
Eric Blake 已提交
1448

1449 1450 1451
libvirt_driver_qemu_impl_la_CFLAGS = \
		$(GNUTLS_CFLAGS) \
		$(LIBNL_CFLAGS) \
1452
		$(XDR_CFLAGS) \
1453 1454
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1455
		-I$(srcdir)/secret \
1456
		$(AM_CFLAGS)
E
Eric Blake 已提交
1457
libvirt_driver_qemu_impl_la_LDFLAGS = $(AM_LDFLAGS)
1458
libvirt_driver_qemu_impl_la_LIBADD = $(CAPNG_LIBS) \
1459
                                $(GNUTLS_LIBS) \
1460 1461
				$(LIBNL_LIBS) \
				$(LIBXML_LIBS) \
1462
				libvirt_secret.la \
1463
				$(NULL)
E
Eric Blake 已提交
1464
libvirt_driver_qemu_impl_la_SOURCES = $(QEMU_DRIVER_SOURCES)
1465

A
Amy Griffis 已提交
1466
conf_DATA += qemu/qemu.conf
1467

1468
augeas_DATA += qemu/libvirtd_qemu.aug
1469 1470
augeastest_DATA += test_libvirtd_qemu.aug
CLEANFILES += test_libvirtd_qemu.aug
1471

1472
endif WITH_QEMU
1473
EXTRA_DIST += qemu/qemu.conf qemu/libvirtd_qemu.aug \
1474
		qemu/test_libvirtd_qemu.aug.in qemu/THREADS.txt
1475

1476 1477

if WITH_LXC
E
Eric Blake 已提交
1478 1479 1480
noinst_LTLIBRARIES += libvirt_driver_lxc_impl.la
libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = libvirt_driver_lxc_impl.la
1481
mod_LTLIBRARIES += libvirt_driver_lxc.la
E
Eric Blake 已提交
1482 1483 1484 1485
libvirt_driver_lxc_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_lxc_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)

libvirt_driver_lxc_impl_la_CFLAGS = \
S
Serge Hallyn 已提交
1486
		$(LIBNL_CFLAGS) \
G
Gao feng 已提交
1487
		$(FUSE_CFLAGS) \
P
Pavel Fedin 已提交
1488
		$(XDR_CFLAGS) \
1489 1490
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1491
		$(AM_CFLAGS)
I
ik.nitk 已提交
1492 1493 1494 1495 1496 1497
libvirt_driver_lxc_impl_la_LIBADD = \
               $(CAPNG_LIBS) \
               $(LIBNL_LIBS) \
               $(LIBXML_LIBS) \
               $(FUSE_LIBS)

1498
if WITH_BLKID
E
Eric Blake 已提交
1499 1500
libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS)
1501
endif WITH_BLKID
1502
libvirt_driver_lxc_impl_la_LIBADD += $(SECDRIVER_LIBS)
E
Eric Blake 已提交
1503
libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES)
A
Amy Griffis 已提交
1504 1505 1506

conf_DATA += lxc/lxc.conf

1507
augeas_DATA += lxc/libvirtd_lxc.aug
1508 1509
augeastest_DATA += test_libvirtd_lxc.aug
CLEANFILES += test_libvirtd_lxc.aug
1510

1511
endif WITH_LXC
1512
EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in
1513

1514
if WITH_UML
E
Eric Blake 已提交
1515 1516 1517
noinst_LTLIBRARIES += libvirt_driver_uml_impl.la
libvirt_driver_uml_la_SOURCES =
libvirt_driver_uml_la_LIBADD = libvirt_driver_uml_impl.la
1518
mod_LTLIBRARIES += libvirt_driver_uml.la
E
Eric Blake 已提交
1519
libvirt_driver_uml_la_LIBADD += ../gnulib/lib/libgnu.la
1520
libvirt_driver_uml_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
E
Eric Blake 已提交
1521

1522
libvirt_driver_uml_impl_la_CFLAGS = \
1523 1524
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1525
		$(AM_CFLAGS)
E
Eric Blake 已提交
1526
libvirt_driver_uml_impl_la_LDFLAGS = $(AM_LDFLAGS)
1527
# libvirt_driver_uml_impl_la_LIBADD =
E
Eric Blake 已提交
1528
libvirt_driver_uml_impl_la_SOURCES = $(UML_DRIVER_SOURCES)
1529
endif WITH_UML
1530

D
Daniel Veillard 已提交
1531

1532
BUILT_SOURCES += $(ESX_DRIVER_GENERATED)
D
Daniel Veillard 已提交
1533

1534 1535
ESX_GENERATED_STAMP = .esx_vi_generator.stamp

E
Eric Blake 已提交
1536 1537
EXTRA_DIST += $(ESX_GENERATED_STAMP)

1538 1539 1540
$(ESX_DRIVER_GENERATED): $(ESX_GENERATED_STAMP)

$(ESX_GENERATED_STAMP): $(srcdir)/esx/esx_vi_generator.input \
1541
                         $(srcdir)/esx/esx_vi_generator.py
1542 1543 1544 1545 1546
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/esx/esx_vi_generator.py \
	  && touch $@

MAINTAINERCLEANFILES += $(ESX_DRIVER_GENERATED) $(ESX_GENERATED_STAMP)

D
Daniel Veillard 已提交
1547

1548 1549
if WITH_ESX
noinst_LTLIBRARIES += libvirt_driver_esx.la
1550
libvirt_la_BUILT_LIBADD += libvirt_driver_esx.la
1551
libvirt_driver_esx_la_CFLAGS = $(CURL_CFLAGS) \
1552
		-I$(srcdir)/conf -I$(srcdir)/vmx $(AM_CFLAGS)
1553
libvirt_driver_esx_la_LDFLAGS = $(AM_LDFLAGS)
1554
libvirt_driver_esx_la_LIBADD = $(CURL_LIBS)
1555
libvirt_driver_esx_la_SOURCES = $(ESX_DRIVER_SOURCES)
1556
libvirt_driver_esx_la_DEPENDENCIES = $(ESX_DRIVER_GENERATED)
1557
endif WITH_ESX
1558

M
Matthias Bolte 已提交
1559

1560 1561
BUILT_SOURCES += $(HYPERV_DRIVER_GENERATED)

1562 1563
HYPERV_GENERATED_STAMP = .hyperv_wmi_generator.stamp

E
Eric Blake 已提交
1564 1565
EXTRA_DIST += $(HYPERV_GENERATED_STAMP)

1566 1567 1568
$(HYPERV_DRIVER_GENERATED): $(HYPERV_GENERATED_STAMP)

$(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \
1569
                            $(srcdir)/hyperv/hyperv_wmi_generator.py
1570 1571
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) \
	  $(srcdir)/hyperv/hyperv_wmi_generator.py \
1572 1573 1574
	  && touch $@

MAINTAINERCLEANFILES += $(HYPERV_DRIVER_GENERATED) $(HYPERV_GENERATED_STAMP)
1575

M
Matthias Bolte 已提交
1576 1577 1578 1579
if WITH_HYPERV
noinst_LTLIBRARIES += libvirt_driver_hyperv.la
libvirt_la_BUILT_LIBADD += libvirt_driver_hyperv.la
libvirt_driver_hyperv_la_CFLAGS = $(OPENWSMAN_CFLAGS) \
1580
		-I$(srcdir)/conf $(AM_CFLAGS)
M
Matthias Bolte 已提交
1581 1582 1583
libvirt_driver_hyperv_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_hyperv_la_LIBADD = $(OPENWSMAN_LIBS)
libvirt_driver_hyperv_la_SOURCES = $(HYPERV_DRIVER_SOURCES)
1584
endif WITH_HYPERV
M
Matthias Bolte 已提交
1585

1586
if WITH_VZ
1587 1588 1589 1590 1591 1592 1593
noinst_LTLIBRARIES += libvirt_driver_vz_impl.la
libvirt_driver_vz_la_SOURCES =
libvirt_driver_vz_la_LIBADD = libvirt_driver_vz_impl.la
mod_LTLIBRARIES += libvirt_driver_vz.la
libvirt_driver_vz_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_vz_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
libvirt_driver_vz_impl_la_CFLAGS = \
1594 1595 1596
		-I$(srcdir)/conf \
		-I$(srcdir)/access \
		$(AM_CFLAGS) \
1597
		$(PARALLELS_SDK_CFLAGS) $(LIBNL_CFLAGS)
1598 1599
libvirt_driver_vz_impl_la_SOURCES = $(VZ_DRIVER_SOURCES)
libvirt_driver_vz_impl_la_LIBADD =  $(PARALLELS_SDK_LIBS) $(LIBNL_LIBS)
1600
endif WITH_VZ
D
Dmitry Guryanov 已提交
1601

R
Roman Bogorodskiy 已提交
1602 1603 1604 1605 1606 1607 1608 1609 1610
if WITH_BHYVE
noinst_LTLIBRARIES += libvirt_driver_bhyve_impl.la
libvirt_driver_bhyve_la_SOURCES =
libvirt_driver_bhyve_la_LIBADD = libvirt_driver_bhyve_impl.la
mod_LTLIBRARIES += libvirt_driver_bhyve.la
libvirt_driver_bhyve_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_bhyve_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)

libvirt_driver_bhyve_impl_la_CFLAGS = \
1611 1612
	-I$(srcdir)/access \
	-I$(srcdir)/conf \
R
Roman Bogorodskiy 已提交
1613 1614 1615
	$(AM_CFLAGS)
libvirt_driver_bhyve_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_bhyve_impl_la_SOURCES = $(BHYVE_DRIVER_SOURCES)
1616 1617 1618 1619

conf_DATA += bhyve/bhyve.conf
augeas_DATA += bhyve/libvirtd_bhyve.aug
augeastest_DATA += test_libvirtd_bhyve.aug
R
Roman Bogorodskiy 已提交
1620
endif WITH_BHYVE
1621 1622 1623
EXTRA_DIST += bhyve/bhyve.conf \
	bhyve/libvirtd_bhyve.aug \
	bhyve/test_libvirtd_bhyve.aug.in
R
Roman Bogorodskiy 已提交
1624

1625
if WITH_NETWORK
E
Eric Blake 已提交
1626 1627 1628
noinst_LTLIBRARIES += libvirt_driver_network_impl.la
libvirt_driver_network_la_SOURCES =
libvirt_driver_network_la_LIBADD = libvirt_driver_network_impl.la
1629
mod_LTLIBRARIES += libvirt_driver_network.la
1630 1631 1632 1633
libvirt_driver_network_la_LIBADD += ../gnulib/lib/libgnu.la \
	$(LIBNL_LIBS) \
	$(DBUS_LIBS) \
	$(NULL)
E
Eric Blake 已提交
1634 1635 1636
libvirt_driver_network_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)

libvirt_driver_network_impl_la_CFLAGS = \
1637 1638
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1639 1640
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1641
		$(AM_CFLAGS)
E
Eric Blake 已提交
1642
libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
1643
libvirt_driver_network_impl_la_LIBADD  = $(DBUS_LIBS)
1644
endif WITH_NETWORK
1645 1646 1647
EXTRA_DIST += network/default.xml


1648
if WITH_INTERFACE
1649
mod_LTLIBRARIES += libvirt_driver_interface.la
1650
libvirt_driver_interface_la_CFLAGS = \
1651 1652
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1653
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1654
libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS)
1655 1656 1657 1658
libvirt_driver_interface_la_LIBADD =
if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
1659
endif WITH_NETCF
1660
if WITH_UDEV
1661 1662
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
1663
endif WITH_UDEV
1664
libvirt_driver_interface_la_LIBADD += ../gnulib/lib/libgnu.la
1665 1666
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
1667
endif WITH_INTERFACE
D
Daniel Veillard 已提交
1668

D
Daniel P. Berrange 已提交
1669
if WITH_SECRETS
1670
mod_LTLIBRARIES += libvirt_driver_secret.la
1671
libvirt_driver_secret_la_CFLAGS = \
1672 1673
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1674
		$(AM_CFLAGS)
1675
libvirt_driver_secret_la_LIBADD = ../gnulib/lib/libgnu.la
1676
libvirt_driver_secret_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1677
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
1678
endif WITH_SECRETS
1679

1680
# Needed to keep automake quiet about conditionals
1681 1682
libvirt_driver_storage_impl_la_SOURCES =
libvirt_driver_storage_impl_la_CFLAGS = \
1683 1684
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1685
		-I$(srcdir)/secret \
1686
		$(AM_CFLAGS)
1687 1688
libvirt_driver_storage_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_storage_impl_la_LIBADD =
1689
libvirt_driver_storage_impl_la_LIBADD += $(SECDRIVER_LIBS) $(LIBXML_LIBS)
1690
if WITH_BLKID
1691 1692
libvirt_driver_storage_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(BLKID_LIBS)
1693
endif WITH_BLKID
1694 1695 1696 1697

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

1698
if WITH_STORAGE
1699 1700 1701
noinst_LTLIBRARIES += libvirt_driver_storage_impl.la
libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_LIBADD = libvirt_driver_storage_impl.la
1702
mod_LTLIBRARIES += libvirt_driver_storage.la
1703
libvirt_driver_storage_la_LIBADD += ../gnulib/lib/libgnu.la
1704
libvirt_driver_storage_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1705
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
1706 1707 1708 1709 1710 1711 1712


libvirt_storage_backend_fs_la_SOURCES = $(STORAGE_DRIVER_FS_SOURCES)
libvirt_storage_backend_fs_la_CFLAGS =	\
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1713 1714 1715
storagebackend_LTLIBRARIES += libvirt_storage_backend_fs.la
libvirt_storage_backend_fs_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
1716
endif WITH_STORAGE
1717

1718
if WITH_STORAGE_LVM
1719 1720 1721 1722 1723 1724
libvirt_storage_backend_logical_la_SOURCES = \
	$(STORAGE_DRIVER_LVM_SOURCES)
libvirt_storage_backend_logical_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1725 1726 1727
storagebackend_LTLIBRARIES += libvirt_storage_backend_logical.la
libvirt_storage_backend_logical_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
1728
endif WITH_STORAGE_LVM
1729

1730
if WITH_STORAGE_ISCSI
1731 1732 1733 1734 1735 1736 1737
libvirt_storage_backend_iscsi_la_SOURCES = \
	$(STORAGE_DRIVER_ISCSI_SOURCES)
libvirt_storage_backend_iscsi_la_CFLAGS = \
	-I$(srcdir)/conf \
	-I$(srcdir)/secret \
	$(AM_CFLAGS)

1738 1739 1740
storagebackend_LTLIBRARIES += libvirt_storage_backend_iscsi.la
libvirt_storage_backend_iscsi_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
1741
endif WITH_STORAGE_ISCSI
1742

1743
if WITH_STORAGE_SCSI
1744 1745 1746 1747 1748
libvirt_storage_backend_scsi_la_SOURCES = $(STORAGE_DRIVER_SCSI_SOURCES)
libvirt_storage_backend_scsi_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1749 1750 1751
storagebackend_LTLIBRARIES += libvirt_storage_backend_scsi.la
libvirt_storage_backend_scsi_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
1752
endif WITH_STORAGE_SCSI
1753

D
Dave Allan 已提交
1754
if WITH_STORAGE_MPATH
1755 1756 1757 1758 1759 1760 1761 1762
libvirt_storage_backend_mpath_la_SOURCES = \
	$(STORAGE_DRIVER_MPATH_SOURCES)
libvirt_storage_backend_mpath_la_LIBADD = $(DEVMAPPER_LIBS)
libvirt_storage_backend_mpath_la_CFLAGS =	\
	-I$(srcdir)/conf \
	$(DEVMAPPER_CFLAGS) \
	$(AM_CFLAGS)

1763 1764 1765
storagebackend_LTLIBRARIES += libvirt_storage_backend_mpath.la
libvirt_storage_backend_mpath_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
1766
endif WITH_STORAGE_MPATH
D
Dave Allan 已提交
1767

1768
if WITH_STORAGE_DISK
1769 1770 1771 1772 1773
libvirt_storage_backend_disk_la_SOURCES = $(STORAGE_DRIVER_DISK_SOURCES)
libvirt_storage_backend_disk_la_CFLAGS =	\
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1774 1775 1776
storagebackend_LTLIBRARIES += libvirt_storage_backend_disk.la
libvirt_storage_backend_disk_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
1777
endif WITH_STORAGE_DISK
1778

1779
if WITH_STORAGE_RBD
1780 1781 1782 1783 1784 1785 1786
libvirt_storage_backend_rbd_la_SOURCES = $(STORAGE_DRIVER_RBD_SOURCES)
libvirt_storage_backend_rbd_la_LIBADD = $(LIBRBD_LIBS)
libvirt_storage_backend_rbd_la_CFLAGS = \
	-I$(srcdir)/conf \
	-I$(srcdir)/secret \
	$(AM_CFLAGS)

1787 1788 1789
storagebackend_LTLIBRARIES += libvirt_storage_backend_rbd.la
libvirt_storage_backend_rbd_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
1790
endif WITH_STORAGE_RBD
1791

1792
if WITH_STORAGE_SHEEPDOG
1793 1794 1795 1796 1797 1798
libvirt_storage_backend_sheepdog_la_SOURCES = \
	$(STORAGE_DRIVER_SHEEPDOG_SOURCES)
libvirt_storage_backend_sheepdog_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809
libvirt_storage_backend_sheepdog_priv_la_SOURCES = \
	$(STORAGE_DRIVER_SHEEPDOG_SOURCES) \
	$(STORAGE_DRIVER_BACKEND_SOURCES)
libvirt_storage_backend_sheepdog_priv_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(AM_CFLAGS)
noinst_LTLIBRARIES += libvirt_storage_backend_sheepdog_priv.la

storagebackend_LTLIBRARIES += libvirt_storage_backend_sheepdog.la
libvirt_storage_backend_sheepdog_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
1810
endif WITH_STORAGE_SHEEPDOG
1811

1812
if WITH_STORAGE_GLUSTER
1813 1814 1815 1816 1817 1818 1819 1820
libvirt_storage_backend_gluster_la_SOURCES = \
	$(STORAGE_DRIVER_GLUSTER_SOURCES)
libvirt_storage_backend_gluster_la_LIBADD = $(GLUSTERFS_LIBS)
libvirt_storage_backend_gluster_la_CFLAGS = \
	-I$(srcdir)/conf \
	$(GLUSTERFS_CFLAGS) \
	$(AM_CFLAGS)

1821 1822 1823
storagebackend_LTLIBRARIES += libvirt_storage_backend_gluster.la
libvirt_storage_backend_gluster_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
1824 1825
endif WITH_STORAGE_GLUSTER

R
Roman Bogorodskiy 已提交
1826
if WITH_STORAGE_ZFS
1827 1828 1829 1830 1831
libvirt_storage_backend_zfs_la_SOURCES = $(STORAGE_DRIVER_ZFS_SOURCES)
libvirt_storage_backend_zfs_la_CFLAGS =	\
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1832 1833 1834
storagebackend_LTLIBRARIES += libvirt_storage_backend_zfs.la
libvirt_storage_backend_zfs_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
R
Roman Bogorodskiy 已提交
1835 1836
endif WITH_STORAGE_ZFS

1837
if WITH_STORAGE_VSTORAGE
1838 1839 1840 1841 1842 1843
libvirt_storage_backend_vstorage_la_SOURCES = \
	$(STORAGE_DRIVER_VSTORAGE_SOURCES)
libvirt_storage_backend_vstorage_la_CFLAGS =	\
	-I$(srcdir)/conf \
	$(AM_CFLAGS)

1844 1845 1846
storagebackend_LTLIBRARIES += libvirt_storage_backend_vstorage.la
libvirt_storage_backend_vstorage_la_LDFLAGS = \
	-module -avoid-version $(AM_LDFLAGS)
1847 1848
endif WITH_STORAGE_VSTORAGE

1849 1850 1851 1852 1853
if WITH_NODE_DEVICES
# Needed to keep automake quiet about conditionals
mod_LTLIBRARIES += libvirt_driver_nodedev.la
libvirt_driver_nodedev_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES)

1854
libvirt_driver_nodedev_la_CFLAGS = \
1855 1856
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1857
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1858
libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS)
1859
libvirt_driver_nodedev_la_LIBADD =
1860

D
Doug Goldstein 已提交
1861
if WITH_LIBVIRTD
1862
if WITH_HAL
1863 1864
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS)
1865
libvirt_driver_nodedev_la_LIBADD += $(HAL_LIBS)
1866
endif WITH_HAL
1867
if WITH_UDEV
1868
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES)
1869
libvirt_driver_nodedev_la_CFLAGS += $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS)
1870
libvirt_driver_nodedev_la_LIBADD += $(UDEV_LIBS) $(PCIACCESS_LIBS)
1871 1872
endif WITH_UDEV
endif WITH_LIBVIRTD
1873

1874
libvirt_driver_nodedev_la_LIBADD += ../gnulib/lib/libgnu.la
1875
libvirt_driver_nodedev_la_LDFLAGS += -module -avoid-version
1876
endif WITH_NODE_DEVICES
1877 1878


1879
if WITH_NWFILTER
1880 1881 1882
noinst_LTLIBRARIES += libvirt_driver_nwfilter_impl.la
libvirt_driver_nwfilter_la_SOURCES =
libvirt_driver_nwfilter_la_LIBADD = libvirt_driver_nwfilter_impl.la
1883
mod_LTLIBRARIES += libvirt_driver_nwfilter.la
1884
libvirt_driver_nwfilter_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1885
libvirt_driver_nwfilter_impl_la_CFLAGS = \
1886 1887 1888
		$(LIBPCAP_CFLAGS) \
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1889 1890
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1891
		$(AM_CFLAGS)
1892 1893 1894 1895 1896 1897 1898 1899
libvirt_driver_nwfilter_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_nwfilter_impl_la_LIBADD = \
		$(LIBPCAP_LIBS) \
		$(LIBNL_LIBS) \
		$(DBUS_LIBS)
libvirt_driver_nwfilter_impl_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_nwfilter_impl_la_LDFLAGS += -module -avoid-version
libvirt_driver_nwfilter_impl_la_SOURCES = $(NWFILTER_DRIVER_SOURCES)
1900
endif WITH_NWFILTER
1901 1902


1903 1904 1905 1906
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 = \
1907
		-I$(srcdir)/conf $(AM_CFLAGS)
1908
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
1909
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
1910
if WITH_SECDRIVER_SELINUX
1911 1912
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
1913
endif WITH_SECDRIVER_SELINUX
J
Jamie Strandboge 已提交
1914
if WITH_SECDRIVER_APPARMOR
1915 1916
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
1917
endif WITH_SECDRIVER_APPARMOR
1918

1919 1920
libvirt_driver_access_la_SOURCES = \
	$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
1921 1922 1923
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
1924
		-I$(srcdir)/conf $(AM_CFLAGS)
1925 1926 1927
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD =

1928 1929
EXTRA_DIST += access/genpolkit.pl

1930 1931 1932 1933
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
    $(srcdir)/access/genpolkit.pl Makefile.am
	$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@

1934 1935 1936 1937
if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)

polkitactiondir = $(datadir)/polkit-1/actions
1938
if WITH_LIBVIRTD
1939
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
1940
endif WITH_LIBVIRTD
1941 1942 1943

CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
1944
else ! WITH_POLKIT1
1945
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
1946
endif ! WITH_POLKIT1
1947

1948

1949 1950
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964

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

1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977
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 已提交
1978
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
1979 1980
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1981 1982 1983
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
1984 1985
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1986 1987
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
	  > $(srcdir)/access/viraccessapicheck.c
1988

E
Eric Blake 已提交
1989
access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
1990 1991
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1992 1993 1994
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheckqemu.h
access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
1995 1996
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1997 1998
	  qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h \
	  > $(srcdir)/access/viraccessapicheckqemu.c
1999

E
Eric Blake 已提交
2000
access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
2001 2002
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
2003 2004 2005
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/access/viraccessapichecklxc.h
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
2006 2007
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
2008 2009
	  lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \
	  > $(srcdir)/access/viraccessapichecklxc.c
2010

2011 2012 2013
# Add all conditional sources just in case...
EXTRA_DIST +=							\
		$(TEST_DRIVER_SOURCES)				\
D
Daniel P. Berrange 已提交
2014
		$(TEST_DRIVER_ASSETS)				\
2015 2016 2017 2018
		$(REMOTE_DRIVER_SOURCES)			\
		$(XEN_DRIVER_SOURCES)				\
		$(QEMU_DRIVER_SOURCES)				\
		$(LXC_DRIVER_SOURCES)				\
2019
		$(UML_DRIVER_SOURCES)				\
2020
		$(OPENVZ_DRIVER_SOURCES)			\
2021
		$(PHYP_DRIVER_SOURCES)				\
2022
		$(VBOX_DRIVER_SOURCES)				\
2023
		$(XENAPI_DRIVER_SOURCES)			\
O
Osier Yang 已提交
2024
		$(LIBXL_DRIVER_SOURCES)				\
2025
		$(ESX_DRIVER_SOURCES)				\
2026
		$(ESX_DRIVER_EXTRA_DIST)			\
M
Matthias Bolte 已提交
2027
		$(HYPERV_DRIVER_SOURCES)			\
2028
		$(HYPERV_DRIVER_EXTRA_DIST)			\
2029
		$(VZ_DRIVER_SOURCES)				\
R
Roman Bogorodskiy 已提交
2030
		$(BHYVE_DRIVER_SOURCES)				\
2031
		$(NETWORK_DRIVER_SOURCES)			\
2032
		$(INTERFACE_DRIVER_SOURCES)			\
2033 2034 2035 2036
		$(STORAGE_DRIVER_SOURCES)			\
		$(STORAGE_DRIVER_FS_SOURCES)			\
		$(STORAGE_DRIVER_LVM_SOURCES)			\
		$(STORAGE_DRIVER_ISCSI_SOURCES)			\
2037
		$(STORAGE_DRIVER_SCSI_SOURCES)			\
D
Dave Allan 已提交
2038
		$(STORAGE_DRIVER_MPATH_SOURCES)			\
2039
		$(STORAGE_DRIVER_DISK_SOURCES)			\
2040
		$(STORAGE_DRIVER_RBD_SOURCES)			\
2041
		$(STORAGE_DRIVER_SHEEPDOG_SOURCES)		\
2042
		$(STORAGE_DRIVER_GLUSTER_SOURCES)		\
R
Roman Bogorodskiy 已提交
2043
		$(STORAGE_DRIVER_ZFS_SOURCES)			\
2044
		$(STORAGE_DRIVER_VSTORAGE_SOURCES)		\
2045 2046
		$(NODE_DEVICE_DRIVER_SOURCES)			\
		$(NODE_DEVICE_DRIVER_HAL_SOURCES)		\
2047
		$(NODE_DEVICE_DRIVER_UDEV_SOURCES)		\
2048
		$(NWFILTER_DRIVER_SOURCES)			\
2049
		$(SECURITY_DRIVER_SELINUX_SOURCES)		\
J
Jamie Strandboge 已提交
2050
		$(SECURITY_DRIVER_APPARMOR_SOURCES)		\
D
Daniel P. Berrange 已提交
2051
		$(SECRET_DRIVER_SOURCES)			\
2052
		$(SECRET_UTIL_SOURCES)				\
2053
		$(VBOX_DRIVER_EXTRA_DIST)			\
2054
		$(VMWARE_DRIVER_SOURCES)			\
J
Jim Fehlig 已提交
2055
		$(XENCONFIG_SOURCES)				\
2056
		$(XENCONFIG_LIBXL_SOURCES)			\
2057
		$(ACCESS_DRIVER_POLKIT_POLICY)
2058

2059 2060
check-local: check-augeas

2061 2062 2063 2064 2065
.PHONY: check-augeas \
	check-augeas-qemu \
	check-augeas-lxc \
	check-augeas-sanlock \
	check-augeas-lockd \
2066
	check-augeas-libxl \
2067
	check-augeas-bhyve \
2068
	$(NULL)
2069

2070
check-augeas: check-augeas-qemu check-augeas-lxc check-augeas-sanlock \
2071
	check-augeas-lockd check-augeas-virtlockd check-augeas-libxl \
2072
	check-augeas-bhyve check-augeas-virtlogd
2073

2074
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
2075
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
2076

2077
if WITH_QEMU
2078 2079
test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
		$(srcdir)/qemu/qemu.conf $(AUG_GENTEST)
E
Eric Blake 已提交
2080
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
2081

2082
check-augeas-qemu: test_libvirtd_qemu.aug
2083
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
2084
	    '$(AUGPARSE)' -I $(srcdir)/qemu test_libvirtd_qemu.aug; \
2085
	fi
2086
else ! WITH_QEMU
2087
check-augeas-qemu:
2088
endif ! WITH_QEMU
2089

2090
if WITH_LXC
2091 2092
test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
		$(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
E
Eric Blake 已提交
2093
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
2094

2095
check-augeas-lxc: test_libvirtd_lxc.aug
2096
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
2097
	    '$(AUGPARSE)' -I $(srcdir)/lxc test_libvirtd_lxc.aug; \
2098
	fi
2099
else ! WITH_LXC
2100
check-augeas-lxc:
2101
endif ! WITH_LXC
2102

2103
if WITH_SANLOCK
2104 2105
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
2106
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
2107

2108
check-augeas-sanlock: test_libvirt_sanlock.aug
2109
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
2110
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
2111
	fi
2112
else ! WITH_SANLOCK
2113
check-augeas-sanlock:
2114
endif ! WITH_SANLOCK
2115

2116
if WITH_QEMU
2117 2118 2119
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 $< $@
2120 2121 2122
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
2123

2124 2125
test_virtlockd.aug: locking/test_virtlockd.aug.in \
		locking/virtlockd.conf $(AUG_GENTEST)
2126
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
2127

2128
if WITH_QEMU
2129 2130 2131 2132
check-augeas-lockd: test_libvirt_lockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_lockd.aug; \
	fi
2133 2134 2135
else ! WITH_QEMU
check-augeas-lockd:
endif ! WITH_QEMU
2136

2137 2138 2139 2140 2141
check-augeas-virtlockd: test_virtlockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
	fi

2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154
if WITH_LIBXL
test_libvirtd_libxl.aug: libxl/test_libvirtd_libxl.aug.in \
		$(srcdir)/libxl/libxl.conf $(AUG_GENTEST)
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/libxl/libxl.conf $< $@

check-augeas-libxl: test_libvirtd_libxl.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/libxl test_libvirtd_libxl.aug; \
	fi
else ! WITH_LIBXL
check-augeas-libxl:
endif ! WITH_LIBXL

2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167
if WITH_BHYVE
test_libvirtd_bhyve.aug: bhyve/test_libvirtd_bhyve.aug.in \
		$(srcdir)/bhyve/bhyve.conf $(AUG_GENTEST)
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/bhyve/bhyve.conf $< $@

check-augeas-bhyve: test_libvirtd_bhyve.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/bhyve test_libvirtd_bhyve.aug; \
	fi
else ! WITH_BHYVE
check-augeas-bhyve:
endif ! WITH_BHYVE

2168 2169 2170 2171 2172 2173 2174 2175 2176
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

2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195
#
# 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.
#

2196
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
2197

2198
if WITH_LINUX
2199
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
2200
else ! WITH_LINUX
2201
SYM_FILES += $(srcdir)/libvirt_linux.syms
2202
endif ! WITH_LINUX
2203

2204
if WITH_ESX
2205
USED_SYM_FILES += $(srcdir)/libvirt_esx.syms
2206
else ! WITH_ESX
2207
SYM_FILES += $(srcdir)/libvirt_esx.syms
2208
endif ! WITH_ESX
2209

E
Eric Blake 已提交
2210 2211 2212 2213 2214 2215
if WITH_REMOTE
USED_SYM_FILES += $(srcdir)/libvirt_remote.syms
else ! WITH_REMOTE
SYM_FILES += $(srcdir)/libvirt_remote.syms
endif ! WITH_REMOTE

2216
if WITH_OPENVZ
2217
USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms
2218
else ! WITH_OPENVZ
2219
SYM_FILES += $(srcdir)/libvirt_openvz.syms
2220
endif ! WITH_OPENVZ
2221

2222
if WITH_VMX
2223
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
2224
else ! WITH_VMX
2225
SYM_FILES += $(srcdir)/libvirt_vmx.syms
2226
endif ! WITH_VMX
2227

2228 2229 2230 2231 2232 2233
if WITH_VMWARE
USED_SYM_FILES += $(srcdir)/libvirt_vmware.syms
else ! WITH_VMWARE
SYM_FILES += $(srcdir)/libvirt_vmware.syms
endif ! WITH_VMWARE

J
Jim Fehlig 已提交
2234 2235 2236 2237 2238
if WITH_XENCONFIG
USED_SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
else ! WITH_XENCONFIG
SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
endif ! WITH_XENCONFIG
2239

2240
if WITH_SASL
2241
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
2242
else ! WITH_SASL
2243
SYM_FILES += $(srcdir)/libvirt_sasl.syms
2244
endif ! WITH_SASL
E
Eric Blake 已提交
2245

2246 2247
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2248
else ! WITH_GNUTLS
2249
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2250
endif ! WITH_GNUTLS
2251

2252
if WITH_SSH2
2253
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2254
else ! WITH_SSH2
2255
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2256
endif ! WITH_SSH2
2257

2258
if WITH_ATOMIC_OPS_PTHREAD
2259
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
2260
else ! WITH_ATOMIC_OPS_PTHREAD
2261
SYM_FILES += $(srcdir)/libvirt_atomic.syms
2262
endif ! WITH_ATOMIC_OPS_PTHREAD
2263

2264 2265 2266 2267 2268 2269
if WITH_LIBSSH
USED_SYM_FILES += $(srcdir)/libvirt_libssh.syms
else ! WITH_LIBSSH
SYM_FILES += $(srcdir)/libvirt_libssh.syms
endif ! WITH_LIBSSH

2270
EXTRA_DIST += \
2271 2272 2273
	libvirt_public.syms		\
	libvirt_lxc.syms		\
	libvirt_qemu.syms		\
2274
	libvirt_admin_public.syms	\
2275
	$(SYM_FILES)			\
2276
	$(ADMIN_SYM_FILES)		\
2277
	$(NULL)
2278

2279
BUILT_SOURCES += $(GENERATED_SYM_FILES)
2280

2281 2282
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(ACCESS_DRIVER_SYM_FILES) \
2283
		$(top_builddir)/config.status
2284 2285 2286 2287 2288 2289
	$(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 && \
2290
	cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
2291 2292
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
2293
	mv $@-tmp libvirt.syms
2294

2295
%.def: %.syms
2296 2297
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
2298 2299
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d'	\
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
2300
	chmod a-w $@-tmp && \
2301
	mv $@-tmp $@
2302

2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315
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

2316 2317 2318 2319
# 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 已提交
2320 2321 2322 2323 2324 2325 2326 2327 2328
lib_LTLIBRARIES += libvirt-admin.la
libvirt_admin_la_SOURCES = \
		libvirt-admin.c			\
		$(ADMIN_PROTOCOL_GENERATED)	\
		$(DATATYPES_SOURCES)

libvirt_admin_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_ADMIN_SYMBOL_FILE)	\
		-version-info $(LIBVIRT_VERSION_INFO)			\
2329
		$(AM_LDFLAGS)
M
Martin Kletzander 已提交
2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341

libvirt_admin_la_LIBADD = \
		libvirt.la		\
		$(CYGWIN_EXTRA_LIBADD)

libvirt_admin_la_CFLAGS = \
		$(AM_CFLAGS)		\
		-I$(srcdir)/remote	\
		-I$(srcdir)/rpc		\
		-I$(srcdir)/admin

libvirt_admin_la_CFLAGS += \
2342
		$(XDR_CFLAGS)			\
M
Martin Kletzander 已提交
2343 2344 2345 2346
		$(CAPNG_CFLAGS)			\
		$(YAJL_CFLAGS)			\
		$(SSH2_CFLAGS)			\
		$(SASL_CFLAGS)			\
2347 2348
		$(GNUTLS_CFLAGS)		\
		$(LIBSSH_CFLAGS)
M
Martin Kletzander 已提交
2349 2350 2351 2352 2353 2354 2355 2356

libvirt_admin_la_LIBADD += \
		$(CAPNG_LIBS)			\
		$(YAJL_LIBS)			\
		$(DEVMAPPER_LIBS)		\
		$(LIBXML_LIBS)			\
		$(SSH2_LIBS)			\
		$(SASL_LIBS)			\
2357 2358
		$(GNUTLS_LIBS)			\
		$(LIBSSH_LIBS)
M
Martin Kletzander 已提交
2359

2360 2361
ADMIN_SYM_FILES = $(srcdir)/libvirt_admin_private.syms

M
Martin Kletzander 已提交
2362 2363 2364 2365
if WITH_DTRACE_PROBES
libvirt_admin_la_LIBADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

2366 2367
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
2368 2369 2370 2371 2372 2373
libvirt_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(LIBVIRT_NODELETE) \
		$(AM_LDFLAGS) \
		$(NULL)
2374
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
2375
libvirt_la_LIBADD += \
2376
		    $(DRIVER_MODULES_LIBS) \
2377
		    $(CYGWIN_EXTRA_LIBADD)
2378
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
2379 2380 2381 2382 2383 2384
# 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)
2385

2386
if WITH_DTRACE_PROBES
2387
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
2388
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
2389
nodist_libvirt_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2390
if WITH_REMOTE
E
Eric Blake 已提交
2391
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2392
endif WITH_REMOTE
2393
DTRACE2SYSTEMTAP_FLAGS = --with-modules
2394

2395 2396 2397
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

if WITH_QEMU
2398
libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.lo
2399
nodist_libvirt_driver_qemu_la_SOURCES = libvirt_qemu_probes.h
2400
BUILT_SOURCES += libvirt_qemu_probes.h
2401
endif WITH_QEMU
2402 2403

tapsetdir = $(datadir)/systemtap/tapset
2404
tapset_DATA = libvirt_probes.stp libvirt_qemu_probes.stp libvirt_functions.stp
2405

2406
%_probes.h: %_probes.d
2407 2408
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

E
Eric Blake 已提交
2409
.PRECIOUS: %_probes.o
2410
%_probes.o: %_probes.d
2411 2412
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

2413 2414 2415 2416 2417 2418 2419 2420 2421
%_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 已提交
2422
# Keep this list synced with PROTOCOL_STRUCTS
J
Jiri Denemark 已提交
2423 2424 2425
RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
2426
		  $(srcdir)/remote/lxc_protocol.x \
2427 2428
		  $(srcdir)/remote/qemu_protocol.x \
		  $(srcdir)/lxc/lxc_monitor_protocol.x \
M
Martin Kletzander 已提交
2429 2430
		  $(srcdir)/locking/lock_protocol.x \
		  $(srcdir)/admin/admin_protocol.x
2431 2432

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

2435 2436
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl \
		$(top_builddir)/config.status
2437
	$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
2438
	  $(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
2439

2440
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
2441
              libvirt_qemu_probes.h libvirt_qemu_probes.o \
2442
              libvirt_qemu_probes.lo\
2443 2444
              libvirt_functions.stp libvirt_probes.stp \
              libvirt_qemu_probes.stp
2445
endif WITH_DTRACE_PROBES
2446

2447
EXTRA_DIST += libvirt_probes.d libvirt_qemu_probes.d
2448

C
Chris Lalancette 已提交
2449
libvirt_qemu_la_SOURCES = libvirt-qemu.c
D
Daniel P. Berrange 已提交
2450 2451 2452 2453 2454
libvirt_qemu_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
2455
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
C
Chris Lalancette 已提交
2456
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
2457

2458
libvirt_lxc_la_SOURCES = libvirt-lxc.c
D
Daniel P. Berrange 已提交
2459 2460 2461 2462 2463
libvirt_lxc_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
2464 2465 2466
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)

2467 2468 2469 2470 2471 2472 2473
# 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
2474
if WITH_SETUID_RPC_CLIENT
2475 2476 2477 2478
noinst_LTLIBRARIES += libvirt-setuid-rpc-client.la

libvirt_setuid_rpc_client_la_SOURCES = 		\
		util/viralloc.c			\
2479 2480
		util/viratomic.c		\
		util/viratomic.h		\
2481 2482
		util/virbitmap.c		\
		util/virbuffer.c		\
2483
		util/vircgroup.c		\
2484 2485
		util/vircommand.c		\
		util/virconf.c			\
2486
		util/virdbus.c			\
2487 2488 2489 2490
		util/virerror.c			\
		util/virevent.c			\
		util/vireventpoll.c		\
		util/virfile.c			\
2491
		util/virgettext.c		\
2492 2493
		util/virhash.c			\
		util/virhashcode.c		\
2494
		util/virhostcpu.c		\
2495 2496 2497 2498 2499 2500 2501 2502
		util/virjson.c			\
		util/virlog.c			\
		util/virobject.c		\
		util/virpidfile.c		\
		util/virprocess.c		\
		util/virrandom.c		\
		util/virsocketaddr.c		\
		util/virstring.c		\
2503
		util/virsystemd.c		\
2504 2505
		util/virtime.c			\
		util/virthread.c		\
2506
		util/virthreadjob.c		\
2507 2508 2509 2510 2511
		util/virtypedparam.c		\
		util/viruri.c			\
		util/virutil.c			\
		util/viruuid.c			\
		conf/domain_event.c		\
2512
		conf/network_event.c		\
2513
		conf/object_event.c		\
2514
		conf/storage_event.c            \
2515
		conf/node_device_event.c	\
2516
		conf/secret_event.c		\
2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532
		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			\
2533
		libvirt-domain.c		\
2534
		libvirt-domain-snapshot.c	\
2535
		libvirt-host.c			\
2536
		libvirt-interface.c		\
2537
		libvirt-network.c		\
2538
		libvirt-nodedev.c		\
2539
		libvirt-nwfilter.c		\
2540
		libvirt-secret.c		\
2541
		libvirt-storage.c		\
2542
		libvirt-stream.c		\
2543 2544 2545 2546 2547 2548
		libvirt-lxc.c			\
		$(NULL)

libvirt_setuid_rpc_client_la_LDFLAGS =		\
		$(AM_LDFLAGS)			\
		$(LIBXML_LIBS)			\
J
Jim Fehlig 已提交
2549
		$(SECDRIVER_LIBS)		\
2550 2551 2552
		$(NULL)
libvirt_setuid_rpc_client_la_CFLAGS =		\
		-DLIBVIRT_SETUID_RPC_CLIENT	\
2553 2554
		-I$(srcdir)/conf		\
		-I$(srcdir)/rpc			\
2555
		$(AM_CFLAGS)			\
J
Jim Fehlig 已提交
2556
		$(SECDRIVER_CFLAGS)		\
P
Pavel Fedin 已提交
2557
		$(XDR_CFLAGS)			\
2558
		$(NULL)
2559
endif WITH_SETUID_RPC_CLIENT
2560

2561 2562 2563
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

2564
if WITH_LIBVIRTD
2565 2566 2567 2568 2569
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
		$(LOCK_DRIVER_LOCKD_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
		$(NULL)
2570
lockd_la_CFLAGS = -I$(srcdir)/conf \
E
Eric Blake 已提交
2571 2572
		$(XDR_CFLAGS) \
		$(AM_CFLAGS)
2573
lockd_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
2574 2575 2576 2577
lockd_la_LIBADD = ../gnulib/lib/libgnu.la \
	libvirt-net-rpc.la \
	libvirt-net-rpc-client.la \
	$(NULL)
J
Jiri Denemark 已提交
2578
augeas_DATA += locking/libvirt_lockd.aug
2579 2580
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
2581
endif WITH_DTRACE_PROBES
2582
if WITH_QEMU
2583 2584
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
2585
nodist_conf_DATA += locking/qemu-lockd.conf
2586 2587
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
2588
endif WITH_QEMU
2589

2590 2591 2592 2593 2594 2595
if WITH_LIBXL
nodist_conf_DATA += locking/libxl-lockd.conf
BUILT_SOURCES += locking/libxl-lockd.conf
DISTCLEANFILES += locking/libxl-lockd.conf
endif WITH_LIBXL

2596 2597 2598 2599 2600
locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
	$(AM_V_GEN)$(MKDIR_P) locking ; \
	cp $< $@


2601
sbin_PROGRAMS = virtlockd virtlogd
2602

2603 2604 2605
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
2606
		$(LOCK_DAEMON_GENERATED) \
2607
		$(NULL)
2608 2609
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
2610
		$(PIE_CFLAGS) \
2611
		$(XDR_CFLAGS) \
2612 2613 2614
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
2615
		$(PIE_LDFLAGS) \
2616 2617 2618 2619 2620 2621 2622 2623 2624 2625
		$(NULL)
virtlockd_LDADD = \
		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
2626
endif WITH_DTRACE_PROBES
2627

2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653

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) \
		$(NULL)
virtlogd_LDADD = \
		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

2654
else ! WITH_LIBVIRTD
2655
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
2656 2657
              $(LOCK_DRIVER_LOCKD_SOURCES) \
	      $(LOG_DAEMON_SOURCES)
2658
endif ! WITH_LIBVIRTD
2659

2660 2661
EXTRA_DIST += \
	locking/virtlockd.sysconf \
J
Jiri Denemark 已提交
2662 2663
	locking/lockd.conf \
	locking/libvirt_lockd.aug \
2664
	locking/test_libvirt_lockd.aug.in \
2665
	logging/virtlogd.sysconf
2666 2667

install-sysconfig:
E
Eric Blake 已提交
2668
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
2669 2670
	$(INSTALL_DATA) $(srcdir)/locking/virtlockd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
2671 2672
	$(INSTALL_DATA) $(srcdir)/logging/virtlogd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlogd
2673 2674

uninstall-sysconfig:
2675
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlogd
2676
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
E
Eric Blake 已提交
2677
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
2678

2679
EXTRA_DIST += locking/virtlockd.init.in logging/virtlogd.init.in
2680 2681 2682

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_RED_HAT
2683
install-init:: virtlockd.init virtlogd.init install-sysconfig
E
Eric Blake 已提交
2684
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
2685 2686
	$(INSTALL_SCRIPT) virtlockd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
2687 2688
	$(INSTALL_SCRIPT) virtlogd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlogd
2689 2690

uninstall-init:: uninstall-sysconfig
E
Eric Blake 已提交
2691
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
2692
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlogd
E
Eric Blake 已提交
2693
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
2694

2695 2696
BUILT_SOURCES += virtlockd.init virtlogd.init
DISTCLEANFILES += virtlockd.init virtlogd.init
2697
else ! LIBVIRT_INIT_SCRIPT_RED_HAT
2698 2699
install-init::
uninstall-init::
2700 2701
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
else ! WITH_LIBVIRTD
2702 2703
install-init::
uninstall-init::
2704
endif ! WITH_LIBVIRTD
2705 2706

virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
2707 2708 2709 2710 2711 2712
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g'		\
	    < $< > $@-t &&					\
	    chmod a+x $@-t &&					\
2713 2714
	    mv $@-t $@

2715 2716 2717 2718 2719 2720 2721 2722 2723
virtlogd.init: logging/virtlogd.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 $@

2724
virtlockd.8.in: locking/virtlockd.pod
2725 2726 2727 2728 2729 2730 2731 2732
	$(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 $@
2733

2734
virtlogd.8.in: logging/virtlogd.pod
2735 2736 2737 2738 2739 2740 2741 2742
	$(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 $@
2743

2744
%.8: %.8.in $(top_srcdir)/configure.ac
2745
	$(AM_V_GEN)sed \
2746 2747 2748
		-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
		-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
		< $< > $@-t && \
2749 2750
	mv $@-t $@

2751
if WITH_LIBVIRTD
2752
man8_MANS = virtlockd.8 virtlogd.8
2753

2754
conf_DATA += locking/virtlockd.conf logging/virtlogd.conf
2755

2756 2757
augeas_DATA += locking/virtlockd.aug logging/virtlogd.aug
augeastest_DATA += test_virtlockd.aug test_virtlogd.aug
2758
endif WITH_LIBVIRTD
2759

A
Andrea Bolognani 已提交
2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771
PODFILES = \
	locking/virtlockd.pod \
	logging/virtlogd.pod \
	$(NULL)

MANINFILES = \
	virtlockd.8.in \
	virtlogd.8.in \
	$(NULL)

CLEANFILES += test_virtlockd.aug test_virtlogd.aug $(man8_MANS)
MAINTAINERCLEANFILES += $(MANINFILES)
2772 2773 2774 2775

EXTRA_DIST += \
        locking/virtlockd.service.in \
        locking/virtlockd.socket.in \
2776 2777 2778
        locking/virtlockd.aug \
        locking/virtlockd.conf \
        locking/test_virtlockd.aug.in \
2779 2780 2781 2782 2783
        logging/virtlogd.service.in \
        logging/virtlogd.socket.in \
        logging/virtlogd.aug \
        logging/virtlogd.conf \
        logging/test_virtlogd.aug.in \
A
Andrea Bolognani 已提交
2784 2785
        $(PODFILES) \
        $(MANINFILES) \
2786
        $(NULL)
2787

2788 2789 2790 2791

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

2792
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
2793

2794 2795 2796 2797
BUILT_SOURCES += virtlockd.service virtlockd.socket \
		 virtlogd.service virtlogd.socket
DISTCLEANFILES += virtlockd.service virtlockd.socket \
		  virtlogd.service virtlogd.socket
2798

2799 2800
install-systemd: virtlockd.service virtlockd.socket \
                 virtlogd.service virtlogd.socket install-sysconfig
E
Eric Blake 已提交
2801
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
2802
	$(INSTALL_DATA) virtlockd.service \
2803
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2804
	$(INSTALL_DATA) virtlockd.socket \
2805
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2806 2807 2808 2809
	$(INSTALL_DATA) virtlogd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
	$(INSTALL_DATA) virtlogd.socket \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2810 2811

uninstall-systemd: uninstall-sysconfig
E
Eric Blake 已提交
2812 2813
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.socket
2814 2815
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlogd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlogd.socket
E
Eric Blake 已提交
2816
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
2817
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
2818 2819
install-systemd:
uninstall-systemd:
2820 2821
endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
else ! WITH_LIBVIRTD
2822 2823
install-systemd:
uninstall-systemd:
2824
endif ! WITH_LIBVIRTD
2825 2826

virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
2827 2828 2829
	$(AM_V_GEN)sed						\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    < $< > $@-t &&					\
2830 2831 2832
	    mv $@-t $@

virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
2833 2834 2835
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    < $< > $@-t &&					\
2836 2837
	    mv $@-t $@

2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849
virtlogd.service: logging/virtlogd.service.in $(top_builddir)/config.status
	$(AM_V_GEN)sed						\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    < $< > $@-t &&					\
	    mv $@-t $@

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

2850

2851
if WITH_SANLOCK
2852
lockdriver_LTLIBRARIES += sanlock.la
2853
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
2854
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
2855
sanlock_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
2856
sanlock_la_LIBADD = -lsanlock_client \
2857 2858 2859
		../gnulib/lib/libgnu.la

augeas_DATA += locking/libvirt_sanlock.aug
2860 2861
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
2862

E
Eric Blake 已提交
2863
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
2864
	$(AM_V_GEN)$(MKDIR_P) locking ; \
2865 2866 2867
	cp $< $@

if WITH_QEMU
2868
nodist_conf_DATA += locking/qemu-sanlock.conf
2869
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
2870
DISTCLEANFILES += locking/qemu-sanlock.conf
2871
endif WITH_QEMU
2872 2873 2874 2875 2876 2877

if WITH_LIBXL
nodist_conf_DATA += locking/libxl-sanlock.conf
BUILT_SOURCES += locking/libxl-sanlock.conf
DISTCLEANFILES += locking/libxl-sanlock.conf
endif WITH_LIBXL
2878
else ! WITH_SANLOCK
2879
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
2880
endif ! WITH_SANLOCK
2881 2882
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
2883
	locking/test_libvirt_sanlock.aug.in
2884

2885 2886 2887 2888
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
2889

2890
EXTRA_DIST += \
E
Eric Blake 已提交
2891 2892 2893 2894
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
2895 2896
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
2897

E
Eric Blake 已提交
2898
VIR_NET_RPC_GENERATED = \
2899 2900 2901 2902
	rpc/virnetprotocol.h \
	rpc/virnetprotocol.c \
	rpc/virkeepaliveprotocol.h \
	rpc/virkeepaliveprotocol.c
2903

2904
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2905

2906
libvirt_net_rpc_la_SOURCES = \
2907
	rpc/virnetmessage.h rpc/virnetmessage.c \
2908
	rpc/virnetsocket.h rpc/virnetsocket.c \
2909 2910
	rpc/virkeepalive.h rpc/virkeepalive.c \
	$(VIR_NET_RPC_GENERATED)
2911
if WITH_SSH2
2912 2913
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2914
else ! WITH_SSH2
2915 2916
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2917
endif ! WITH_SSH2
2918
if WITH_GNUTLS
2919 2920
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2921
else ! WITH_GNUTLS
2922 2923
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2924
endif ! WITH_GNUTLS
2925
if WITH_SASL
2926 2927
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2928
else ! WITH_SASL
2929 2930
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2931
endif ! WITH_SASL
2932 2933 2934 2935 2936 2937 2938
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
2939
libvirt_net_rpc_la_CFLAGS = \
2940
			$(GNUTLS_CFLAGS) \
2941
			$(SASL_CFLAGS) \
2942
			$(SSH2_CFLAGS) \
2943
			$(LIBSSH_CFLAGS) \
2944
			$(XDR_CFLAGS) \
2945 2946
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
2947
			$(GNUTLS_LIBS) \
2948
			$(SASL_LIBS) \
2949
			$(SSH2_LIBS)\
2950
			$(LIBSSH_LIBS) \
J
Jim Fehlig 已提交
2951
			$(SECDRIVER_LIBS) \
2952
			$(AM_LDFLAGS) \
2953
			$(NULL)
2954 2955 2956
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2957 2958 2959 2960
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
2961
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
2962
	rpc/virnetdaemon.h rpc/virnetdaemon.c \
2963 2964
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
2965
			$(AVAHI_CFLAGS) \
2966
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
2967
			$(XDR_CFLAGS) \
2968
			$(AM_CFLAGS)
2969 2970
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
2971
			$(AVAHI_LIBS) \
2972
			$(DBUS_LIBS) \
2973
			$(NULL)
2974 2975 2976
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2977 2978 2979 2980 2981
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 已提交
2982 2983
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
2984
libvirt_net_rpc_client_la_LDFLAGS = $(AM_LDFLAGS)
2985 2986
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
2987

2988 2989
libexec_PROGRAMS =

2990
if WITH_LIBVIRTD
2991 2992
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2993 2994 2995 2996
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2997 2998 2999
libvirt_iohelper_LDADD =		\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
3000 3001
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
3002
endif WITH_DTRACE_PROBES
3003

D
Daniel P. Berrange 已提交
3004 3005 3006 3007
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
3008 3009 3010 3011

if WITH_NETWORK
libexec_PROGRAMS += libvirt_leaseshelper
libvirt_leaseshelper_SOURCES = $(NETWORK_LEASES_HELPER_SOURCES)
3012 3013 3014 3015
libvirt_leaseshelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030
libvirt_leaseshelper_LDADD =           \
               libvirt_util.la         \
               ../gnulib/lib/libgnu.la
if WITH_DTRACE_PROBES
libvirt_leaseshelper_LDADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

libvirt_leaseshelper_CFLAGS = \
	       $(AM_CFLAGS) \
               $(PIE_CFLAGS) \
               $(NULL)
else ! WITH_NETWORK
EXTRA_DIST += $(NETWORK_LEASES_HELPER_SOURCES)
endif ! WITH_NETWORK

3031
endif WITH_LIBVIRTD
3032

3033
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
3034
if WITH_LIBVIRTD
3035
libexec_PROGRAMS += libvirt_parthelper
3036

3037
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
D
Daniel P. Berrange 已提交
3038 3039 3040 3041
libvirt_parthelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3042 3043 3044 3045
libvirt_parthelper_LDADD =		\
		$(LIBPARTED_LIBS)	\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
3046 3047
if WITH_DTRACE_PROBES
libvirt_parthelper_LDADD += libvirt_probes.lo
3048
endif WITH_DTRACE_PROBES
3049

D
Daniel P. Berrange 已提交
3050 3051 3052 3053 3054
libvirt_parthelper_CFLAGS = \
		$(LIBPARTED_CFLAGS) \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
3055 3056
endif WITH_LIBVIRTD
endif WITH_STORAGE_DISK
3057 3058
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)

3059

3060
if WITH_SANLOCK
3061 3062 3063
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
3064
libvirt_sanlock_helper_CFLAGS = \
3065
		-I$(srcdir)/conf \
D
Daniel P. Berrange 已提交
3066 3067 3068 3069 3070 3071 3072
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3073
libvirt_sanlock_helper_LDADD = libvirt.la
3074
endif WITH_SANLOCK
3075

3076 3077 3078 3079 3080 3081
if WITH_LXC
if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_lxc

libvirt_lxc_SOURCES =						\
		$(LXC_CONTROLLER_SOURCES)			\
O
Osier Yang 已提交
3082
		$(DATATYPES_SOURCES)
D
Daniel P. Berrange 已提交
3083 3084 3085 3086
libvirt_lxc_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
3087
libvirt_lxc_LDADD =			\
G
Gao feng 已提交
3088
		$(FUSE_LIBS) \
3089 3090
		libvirt-net-rpc-server.la \
		libvirt-net-rpc.la \
3091
		libvirt_security_manager.la \
3092 3093
		libvirt_conf.la \
		libvirt_util.la \
3094
		../gnulib/lib/libgnu.la
3095
if WITH_DTRACE_PROBES
3096
libvirt_lxc_LDADD += libvirt_probes.lo
3097
endif WITH_DTRACE_PROBES
3098
libvirt_lxc_LDADD += $(SECDRIVER_LIBS)
3099
libvirt_lxc_CFLAGS =				\
3100
		-I$(srcdir)/conf	\
3101
		$(AM_CFLAGS)                    \
D
Daniel P. Berrange 已提交
3102
		$(PIE_CFLAGS)			\
G
Gao feng 已提交
3103
		$(LIBNL_CFLAGS)			\
D
Daniel P. Berrange 已提交
3104
		$(FUSE_CFLAGS)			\
3105
		$(DBUS_CFLAGS)			\
P
Pavel Fedin 已提交
3106
		$(XDR_CFLAGS)			\
D
Daniel P. Berrange 已提交
3107
		$(NULL)
3108
if WITH_BLKID
3109 3110
libvirt_lxc_CFLAGS += $(BLKID_CFLAGS)
libvirt_lxc_LDADD += $(BLKID_LIBS)
3111
endif WITH_BLKID
J
Jim Fehlig 已提交
3112
libvirt_lxc_CFLAGS += $(SECDRIVER_CFLAGS)
3113 3114
endif WITH_LIBVIRTD
endif WITH_LXC
3115 3116
EXTRA_DIST += $(LXC_CONTROLLER_SOURCES)

J
Jamie Strandboge 已提交
3117 3118 3119 3120 3121 3122
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 已提交
3123 3124 3125 3126
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
J
Jamie Strandboge 已提交
3127
virt_aa_helper_LDADD =						\
3128
		libvirt.la					\
C
Chris Lalancette 已提交
3129 3130
		libvirt_conf.la					\
		libvirt_util.la					\
3131
		libvirt_driver_storage_impl.la			\
C
Chris Lalancette 已提交
3132
		../gnulib/lib/libgnu.la
3133
if WITH_DTRACE_PROBES
3134
virt_aa_helper_LDADD += libvirt_probes.lo
3135
endif WITH_DTRACE_PROBES
J
Jamie Strandboge 已提交
3136
virt_aa_helper_CFLAGS =						\
3137 3138 3139 3140
		-I$(srcdir)/conf				\
		-I$(srcdir)/security				\
		$(AM_CFLAGS) 					\
		$(PIE_CFLAGS) 					\
D
Daniel P. Berrange 已提交
3141
		$(NULL)
3142 3143
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
J
Jamie Strandboge 已提交
3144 3145
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

3146
if WITH_NSS
3147 3148 3149 3150 3151
noinst_LTLIBRARIES += libvirt-nss.la

libvirt_nss_la_SOURCES =		\
		util/viralloc.c			\
		util/viralloc.h			\
K
Kai Kang 已提交
3152 3153
		util/viratomic.c		\
		util/viratomic.h		\
3154 3155 3156 3157 3158 3159 3160 3161 3162 3163
		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			\
3164 3165 3166 3167
		util/virhash.c			\
		util/virhash.h			\
		util/virhashcode.c		\
		util/virhashcode.h		\
3168 3169 3170 3171 3172 3173 3174 3175
		util/virjson.c			\
		util/virjson.h			\
		util/virkmod.c			\
		util/virkmod.h			\
		util/virlease.c			\
		util/virlease.h			\
		util/virlog.c			\
		util/virlog.h			\
3176 3177
		util/virmacmap.c		\
		util/virmacmap.h		\
3178 3179 3180 3181 3182 3183
		util/virobject.c		\
		util/virobject.h		\
		util/virpidfile.c		\
		util/virpidfile.h		\
		util/virprocess.c		\
		util/virprocess.h		\
3184 3185
		util/virrandom.c		\
		util/virrandom.h		\
3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211
		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			\
		$(NULL)

libvirt_nss_la_CFLAGS =			\
		-DLIBVIRT_NSS			\
		$(AM_CFLAGS)			\
		$(YAJL_CFLAGS)			\
		$(NULL)
libvirt_nss_la_LDFLAGS =		\
		$(AM_LDFLAGS)			\
		$(NULL)

libvirt_nss_la_LIBADD =			\
		$(YAJL_LIBS)			\
		$(NULL)
3212
endif WITH_NSS
3213 3214


3215
install-data-local: install-init install-systemd
3216 3217
if WITH_LIBVIRTD
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
3218
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
3219
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
3220
endif WITH_LIBVIRTD
3221 3222
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
3223
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
3224
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
3225
if WITH_SANLOCK
3226
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
3227
endif WITH_SANLOCK
3228
if WITH_QEMU
3229
	$(MKDIR_P) -m 0751 "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu"
3230
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu"
3231
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu"
3232
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu"
3233
endif WITH_QEMU
3234 3235 3236
if WITH_LXC
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lxc"
3237
endif WITH_LXC
J
Jim Fehlig 已提交
3238 3239 3240
if WITH_LIBXL
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/libxl"
J
Jim Fehlig 已提交
3241
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl"
3242
endif WITH_LIBXL
3243 3244 3245
if WITH_UML
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/uml"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/uml"
3246
endif WITH_UML
3247 3248
if WITH_XEN
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/xen"
3249
endif WITH_XEN
3250 3251
if WITH_NETWORK
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network"
3252
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq"
3253
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/network"
3254
	$(MKDIR_P) "$(DESTDIR)$(confdir)/qemu/networks/autostart"
3255
	$(INSTALL_DATA) $(srcdir)/network/default.xml \
3256
	  $(DESTDIR)$(confdir)/qemu/networks/default.xml
3257
	test -z "$(UUID)" || \
3258 3259 3260
	  { sed -e "s,</name>,</name>;  <uuid>$(UUID)</uuid>," \
	      $(DESTDIR)$(confdir)/qemu/networks/default.xml | \
	      tr ";" "\n" > \
3261 3262 3263 3264
	      $(DESTDIR)$(confdir)/qemu/networks/default.xml.t && \
	    cp $(DESTDIR)$(confdir)/qemu/networks/default.xml.t \
	      $(DESTDIR)$(confdir)/qemu/networks/default.xml && \
	    rm $(DESTDIR)$(confdir)/qemu/networks/default.xml.t; }
A
Andrea Bolognani 已提交
3265
	( cd $(DESTDIR)$(confdir)/qemu/networks/autostart && \
3266 3267
	  rm -f default.xml && \
	  $(LN_S) ../default.xml default.xml )
3268
endif WITH_NETWORK
3269

3270
uninstall-local:: uninstall-init uninstall-systemd
3271
if WITH_LIBVIRTD
3272
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
3273 3274
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
3275
endif WITH_LIBVIRTD
3276 3277
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
3278
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
3279
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
3280
if WITH_SANLOCK
3281
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
3282
endif WITH_SANLOCK
3283 3284 3285 3286 3287
if WITH_QEMU
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/qemu" ||:
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu" ||:
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/qemu" ||:
3288
endif WITH_QEMU
3289 3290 3291
if WITH_LXC
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||:
3292
endif WITH_LXC
J
Jim Fehlig 已提交
3293 3294 3295
if WITH_LIBXL
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||:
J
Jim Fehlig 已提交
3296
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||:
3297
endif WITH_LIBXL
3298 3299 3300
if WITH_UML
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/uml" ||:
3301
endif WITH_UML
3302 3303
if WITH_XEN
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/xen" ||:
3304
endif WITH_XEN
3305
if WITH_NETWORK
3306 3307 3308 3309
	rm -f $(DESTDIR)$(confdir)/qemu/networks/autostart/default.xml
	rm -f $(DESTDIR)$(confdir)/qemu/networks/default.xml
	rmdir "$(DESTDIR)$(confdir)/qemu/networks/autostart" || :
	rmdir "$(DESTDIR)$(confdir)/qemu/networks" || :
3310 3311
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||:
3312
endif WITH_NETWORK
3313
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
3314

3315 3316
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
3317
MAINTAINERCLEANFILES += $(REMOTE_DRIVER_GENERATED) $(VIR_NET_RPC_GENERATED)