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

3
## Copyright (C) 2005-2015 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
AM_CFLAGS =	$(LIBXML_CFLAGS)				\
41
		$(WARN_CFLAGS)					\
E
Eric Blake 已提交
42 43 44
		$(LOCK_CHECKING_CFLAGS)				\
		$(WIN32_EXTRA_CFLAGS)				\
		$(COVERAGE_CFLAGS)
45
AM_LDFLAGS =	$(DRIVER_MODULE_LDFLAGS)			\
G
Guido Günther 已提交
46 47
		$(COVERAGE_LDFLAGS)				\
		$(RELRO_LDFLAGS)				\
48
		$(NO_INDIRECT_LDFLAGS)				\
G
Guido Günther 已提交
49
		$(NULL)
50

L
Lai Jiangshan 已提交
51
EXTRA_DIST = $(conf_DATA) util/keymaps.csv
52

53
BUILT_SOURCES =
54 55 56
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
57
nodist_conf_DATA =
58

E
Eric Blake 已提交
59 60
THREAD_LIBS = $(LIB_PTHREAD) $(LTLIBMULTITHREAD)

J
Jim Fehlig 已提交
61
SECDRIVER_CFLAGS =
62 63
SECDRIVER_LIBS =
if WITH_SECDRIVER_SELINUX
J
Jim Fehlig 已提交
64
SECDRIVER_CFLAGS += $(SELINUX_CFLAGS)
65
SECDRIVER_LIBS += $(SELINUX_LIBS)
66
endif WITH_SECDRIVER_SELINUX
67
if WITH_SECDRIVER_APPARMOR
J
Jim Fehlig 已提交
68
SECDRIVER_CFLAGS += $(APPARMOR_CFLAGS)
69
SECDRIVER_LIBS += $(APPARMOR_LIBS)
70
endif WITH_SECDRIVER_APPARMOR
71

72 73
if WITH_NETWORK
UUID=$(shell uuidgen 2>/dev/null)
74
endif WITH_NETWORK
75

76
lib_LTLIBRARIES = libvirt.la libvirt-qemu.la libvirt-lxc.la
77

78
moddir = $(libdir)/libvirt/connection-driver
79 80
mod_LTLIBRARIES =

A
Amy Griffis 已提交
81
confdir = $(sysconfdir)/libvirt
82
conf_DATA = libvirt.conf libvirt-admin.conf
83

84 85 86 87 88 89
augeasdir = $(datadir)/augeas/lenses
augeas_DATA =

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

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

188
EXTRA_DIST += $(srcdir)/util/keymaps.csv $(srcdir)/util/virkeycode-mapgen.py
L
Lai Jiangshan 已提交
189

E
Eric Blake 已提交
190
BUILT_SOURCES += util/virkeymaps.h
191
MAINTAINERCLEANFILES += util/virkeymaps.h
192

E
Eric Blake 已提交
193
util/virkeymaps.h: $(srcdir)/util/keymaps.csv	\
L
Lai Jiangshan 已提交
194
		$(srcdir)/util/virkeycode-mapgen.py
195
	$(MKDIR_P) util/
196
	$(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py \
197
	  <$(srcdir)/util/keymaps.csv >util/virkeymaps.h
L
Lai Jiangshan 已提交
198

199
# Internal generic driver infrastructure
200
NODE_INFO_SOURCES = nodeinfo.h nodeinfo.c
O
Osier Yang 已提交
201 202 203
DATATYPES_SOURCES = datatypes.h datatypes.c
DRIVER_SOURCES =							\
		driver.c driver.h					\
204 205 206 207 208 209 210 211 212
		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 已提交
213 214 215 216 217
		internal.h						\
		$(DATATYPES_SOURCES)					\
		fdstream.c fdstream.h					\
		$(NODE_INFO_SOURCES)					\
		libvirt.c libvirt_internal.h				\
218
		libvirt-domain.c 					\
219
		libvirt-domain-snapshot.c 				\
220
		libvirt-host.c 						\
221
		libvirt-interface.c	 				\
222
		libvirt-network.c	 				\
223
		libvirt-nodedev.c	 				\
224
		libvirt-nwfilter.c	 				\
225
		libvirt-secret.c	 				\
226
		libvirt-storage.c	 				\
227
		libvirt-stream.c	 				\
O
Osier Yang 已提交
228 229 230
		locking/lock_manager.c locking/lock_manager.h		\
		locking/lock_driver.h					\
		locking/lock_driver_nop.h locking/lock_driver_nop.c	\
231 232 233
		locking/domain_lock.h locking/domain_lock.c		\
		logging/log_manager.c logging/log_manager.h		\
		$(NULL)
234

235 236 237
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

238 239
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
240

241
LOCK_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
242 243
		locking/lock_protocol.h \
		locking/lock_protocol.c \
244 245
		$(NULL)

246 247 248
LOCK_PROTOCOL = $(srcdir)/locking/lock_protocol.x
EXTRA_DIST += $(LOCK_PROTOCOL) \
	$(LOCK_PROTOCOL_GENERATED)
249 250 251
BUILT_SOURCES += $(LOCK_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(LOCK_PROTOCOL_GENERATED)

252
LOCK_DAEMON_GENERATED = \
253
		locking/lock_daemon_dispatch_stubs.h
254 255 256
		$(NULL)

BUILT_SOURCES += $(LOCK_DAEMON_GENERATED)
257
EXTRA_DIST += $(LOCK_DAEMON_GENERATED)
258 259
MAINTAINERCLEANFILES += $(LOCK_DAEMON_GENERATED)

260 261
LOCK_DRIVER_LOCKD_SOURCES = \
		locking/lock_driver_lockd.c \
262
		locking/lock_driver_lockd.h \
263 264
		$(NULL)

265 266 267 268 269
LOCK_DAEMON_SOURCES = \
		locking/lock_daemon.h \
		locking/lock_daemon.c \
		locking/lock_daemon_config.h \
		locking/lock_daemon_config.c \
270 271
		locking/lock_daemon_dispatch.c \
		locking/lock_daemon_dispatch.h \
272 273
		$(NULL)

E
Eric Blake 已提交
274
locking/lock_daemon_dispatch_stubs.h: $(LOCK_PROTOCOL) \
275
		$(srcdir)/rpc/gendispatch.pl Makefile.am
276 277
	$(AM_V_GEN)perl -w $(srcdir)/rpc/gendispatch.pl --mode=server \
	    virLockSpaceProtocol VIR_LOCK_SPACE_PROTOCOL \
E
Eric Blake 已提交
278
	    $(LOCK_PROTOCOL) > $(srcdir)/locking/lock_daemon_dispatch_stubs.h
279 280


281 282 283 284 285
LOG_PROTOCOL_GENERATED = \
		logging/log_protocol.h \
		logging/log_protocol.c \
		$(NULL)

286 287
DRIVER_SOURCES += $(LOG_PROTOCOL_GENERATED)

288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308
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 \
309 310
		logging/log_handler.c \
		logging/log_handler.h \
311 312 313 314 315 316 317 318 319
		$(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


320 321
NETDEV_CONF_SOURCES =						\
		conf/netdev_bandwidth_conf.h conf/netdev_bandwidth_conf.c \
322 323
		conf/netdev_vport_profile_conf.h conf/netdev_vport_profile_conf.c \
		conf/netdev_vlan_conf.h conf/netdev_vlan_conf.c
324

325
# XML configuration format handling sources
326 327
# Domain driver generic impl APIs
DOMAIN_CONF_SOURCES =						\
328
		conf/capabilities.c conf/capabilities.h		\
329
		conf/domain_addr.c conf/domain_addr.h		\
M
Michal Privoznik 已提交
330
		conf/domain_capabilities.c conf/domain_capabilities.h	\
331
		conf/domain_conf.c conf/domain_conf.h		\
332
		conf/domain_audit.c conf/domain_audit.h		\
333
		conf/domain_nwfilter.c conf/domain_nwfilter.h	\
334
		conf/snapshot_conf.c conf/snapshot_conf.h	\
335 336
		conf/numa_conf.c conf/numa_conf.h	\
		conf/virdomainobjlist.c conf/virdomainobjlist.h
337

338 339 340 341
OBJECT_EVENT_SOURCES =						\
		conf/object_event.c conf/object_event.h \
		conf/object_event_private.h

342 343
DOMAIN_EVENT_SOURCES =						\
		conf/domain_event.c conf/domain_event.h
344

345 346 347
NETWORK_EVENT_SOURCES =						\
		conf/network_event.c conf/network_event.h

348 349 350
STORAGE_EVENT_SOURCES =						\
                conf/storage_event.c conf/storage_event.h

351
# Network driver generic impl APIs
352
NETWORK_CONF_SOURCES =						\
353 354
		conf/network_conf.c conf/network_conf.h \
		conf/networkcommon_conf.c conf/networkcommon_conf.h
355

356 357
# Network filter driver generic impl APIs
NWFILTER_PARAM_CONF_SOURCES =					\
358
		conf/nwfilter_params.c conf/nwfilter_params.h	\
359 360
		conf/nwfilter_ipaddrmap.c			\
		conf/nwfilter_ipaddrmap.h			\
361
		conf/nwfilter_conf.h
362

363
NWFILTER_CONF_SOURCES =						\
364 365 366
		$(NWFILTER_PARAM_CONF_SOURCES)			\
		conf/nwfilter_conf.c conf/nwfilter_conf.h

367
# Storage driver generic impl APIs
368 369
STORAGE_CONF_SOURCES =                                         \
		conf/storage_conf.h conf/storage_conf.c
370

371
# Interface driver generic impl APIs
372 373
INTERFACE_CONF_SOURCES =                                       \
		conf/interface_conf.c conf/interface_conf.h
374

375
# Secret driver generic impl APIs
376
SECRET_CONF_SOURCES =                                          \
377 378
		conf/secret_conf.h conf/secret_conf.c          \
		conf/virsecretobj.h conf/virsecretobj.c
379 380 381 382 383

# Network driver generic impl APIs
NODE_DEVICE_CONF_SOURCES =                                     \
		conf/node_device_conf.c conf/node_device_conf.h

384 385
CPU_CONF_SOURCES =						\
		conf/cpu_conf.c conf/cpu_conf.h
386

387 388
# Safe character device handling helper APIs
CHRDEV_CONF_SOURCES =						\
389
		conf/virchrdev.c conf/virchrdev.h
390

391 392 393 394
# Device Helper APIs
DEVICE_CONF_SOURCES =                                           \
		conf/device_conf.c conf/device_conf.h

395
CONF_SOURCES =							\
396
		$(NETDEV_CONF_SOURCES)				\
397
		$(DOMAIN_CONF_SOURCES)				\
398
		$(OBJECT_EVENT_SOURCES)				\
399
		$(DOMAIN_EVENT_SOURCES)				\
400
		$(NETWORK_EVENT_SOURCES)			\
401
		$(STORAGE_EVENT_SOURCES)			\
402
		$(NETWORK_CONF_SOURCES)				\
403
		$(NWFILTER_CONF_SOURCES)			\
404 405 406
		$(NODE_DEVICE_CONF_SOURCES)			\
		$(STORAGE_CONF_SOURCES)				\
		$(INTERFACE_CONF_SOURCES)			\
407
		$(SECRET_CONF_SOURCES)				\
408
		$(CPU_CONF_SOURCES)				\
409
		$(CHRDEV_CONF_SOURCES)				\
410
		$(DEVICE_CONF_SOURCES)
411

412
# The remote RPC driver, covering domains, storage, networks, etc
413
REMOTE_DRIVER_GENERATED = \
E
Eric Blake 已提交
414 415 416 417 418 419 420 421 422 423
		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 已提交
424 425

REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x
426
LXC_PROTOCOL = $(srcdir)/remote/lxc_protocol.x
E
Eric Blake 已提交
427
QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x
428
REMOTE_DRIVER_PROTOCOL = $(REMOTE_PROTOCOL) $(QEMU_PROTOCOL) $(LXC_PROTOCOL)
429

E
Eric Blake 已提交
430
remote/remote_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
431
		$(REMOTE_PROTOCOL) Makefile.am
432
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
433 434
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/remote/remote_client_bodies.h
435

E
Eric Blake 已提交
436
remote/lxc_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
437
		$(LXC_PROTOCOL) Makefile.am
438
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
439 440
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/remote/lxc_client_bodies.h
441

E
Eric Blake 已提交
442
remote/qemu_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
443
		$(QEMU_PROTOCOL) Makefile.am
444
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
445 446
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/remote/qemu_client_bodies.h
447 448 449 450

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

452
EXTRA_DIST +=  $(REMOTE_DRIVER_PROTOCOL) \
453
		$(REMOTE_DRIVER_GENERATED)
454

M
Martin Kletzander 已提交
455 456 457 458
ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x

ADMIN_PROTOCOL_GENERATED = \
		admin/admin_protocol.c	\
459 460 461 462 463 464 465 466
		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 已提交
467 468 469 470 471

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

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

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

496
# Depending on configure options, libtool creates one or both of
E
Eric Blake 已提交
497 498
# remote/{,.libs/}libvirt_driver_remote_la-remote_protocol.o.  We want
# the newest of the two, in case configure options changed and a stale
499
# file is left around from an earlier build.
500
PDWTAGS = \
501
	$(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then		\
E
Eric Blake 已提交
502 503
	  o=`ls -t $(<:.lo=.$(OBJEXT))					\
	     $(subst /,/.libs/,$(<:.lo=.$(OBJEXT)))			\
504 505 506
	    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 已提交
507
	  if test ! -s $(@F)-t1 && test -s $(@F)-t2; then		\
508 509 510
	    rm -rf $(@F)-t?;						\
	    echo 'WARNING: pdwtags appears broken; skipping the $@ test' >&2;\
	  else								\
511
	    $(PERL) -0777 -n						\
512
		-e 'foreach my $$p (split m!\n*(?:$(r1)|$(r2))\n!) {'	\
513
		-e '  if ($$p =~ /^(struct|enum) $(struct_prefix)/ ||'	\
514
		-e '      $$p =~ /^enum \{/) {'				\
515 516 517
		-e '    $$p =~ s!\t*/\*.*?\*/!!sg;'			\
		-e '    $$p =~ s!\s+\n!\n!sg;'				\
		-e '    $$p =~ s!\s+$$!!;'				\
518
		-e '    $$p =~ s!\t!        !g;'			\
519 520 521 522
		-e '    print "$$p\n";'					\
		-e '    $$n++;'						\
		-e '  }'						\
		-e '}'							\
523 524 525
		-e 'BEGIN {'						\
		-e '  print "/* -*- c -*- */\n";'			\
		-e '}'							\
526
		-e 'END {'						\
527
		-e '  if ($$n < 1) {'					\
528 529 530 531 532 533
		-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 '}'							\
534 535
		< $(@F)-t1 > $(@F)-t3;					\
	    case $$? in 8) rm -f $(@F)-t?; exit 0;; 0) ;; *) exit 1;; esac;\
536
	    diff -u $(@)s $(@F)-t3; st=$$?; rm -f $(@F)-t?; exit $$st;	\
537
	  fi;								\
538
	else								\
539 540
	  echo 'WARNING: you lack pdwtags; skipping the $@ test' >&2;	\
	  echo 'WARNING: install the dwarves package to get pdwtags' >&2; \
541
	fi
542

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

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

576
if WITH_REMOTE
577 578
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)

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

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

check-drivername:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-drivername.pl \
		$(srcdir)/driver.h \
		$(srcdir)/libvirt_public.syms \
610
		$(srcdir)/libvirt_admin_public.syms \
611 612 613 614 615
		$(srcdir)/libvirt_qemu.syms \
		$(srcdir)/libvirt_lxc.syms

EXTRA_DIST += check-drivername.pl

616
DRIVER_SOURCE_FILES = \
617 618 619 620 621 622 623 624 625 626 627
	$(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) \
628
	$(VZ_DRIVER_SOURCES) \
629 630 631 632 633 634 635 636
	$(PHYP_DRIVER_SOURCES) \
	$(QEMU_DRIVER_SOURCES) \
	$(REMOTE_DRIVER_SOURCES) \
	$(SECRET_DRIVER_SOURCES) \
	$(STORAGE_DRIVER_SOURCES) \
	$(TEST_DRIVER_SOURCES) \
	$(UML_DRIVER_SOURCES) \
	$(VBOX_DRIVER_SOURCES) \
637
	vbox/vbox_tmpl.c \
638 639 640
	$(VMWARE_DRIVER_SOURCES) \
	$(XEN_DRIVER_SOURCES) \
	$(XENAPI_DRIVER_SOURCES) \
641 642
	$(NULL)

643
STATEFUL_DRIVER_SOURCE_FILES = \
R
Roman Bogorodskiy 已提交
644
	$(BHYVE_DRIVER_SOURCES) \
645 646 647 648 649 650 651 652 653 654 655 656 657
	$(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) \
	$(NULL)

658 659 660

check-driverimpls:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-driverimpls.pl \
661
		$(filter /%,$(DRIVER_SOURCE_FILES)) \
E
Eric Blake 已提交
662 663 664
		$(filter $(srcdir)/%,$(DRIVER_SOURCE_FILES)) \
		$(addprefix $(srcdir)/,$(filter-out $(srcdir)/%, \
			$(filter-out /%,$(DRIVER_SOURCE_FILES))))
665

666 667
check-aclrules:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclrules.pl \
E
Eric Blake 已提交
668
		$(REMOTE_PROTOCOL) \
669
		$(addprefix $(srcdir)/,$(filter-out /%,$(STATEFUL_DRIVER_SOURCE_FILES)))
670

671 672 673 674 675
check-aclperms:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclperms.pl \
		$(srcdir)/access/viraccessperm.h \
		$(srcdir)/access/viraccessperm.c

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

678
check-local: check-protocol check-symfile check-symsorting \
679
	check-drivername check-driverimpls check-aclrules \
680
	check-aclperms check-admin-symfile check-admin-symsorting
681
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
682

683 684
# Mock driver, covering domains, storage, networks, etc
TEST_DRIVER_SOURCES =						\
685
		test/test_driver.c test/test_driver.h
686 687 688

# Now the Hypervisor specific drivers
XEN_DRIVER_SOURCES =						\
689 690 691 692 693 694
		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
695
if WITH_XEN_INOTIFY
696
XEN_DRIVER_SOURCES += xen/xen_inotify.c xen/xen_inotify.h
697
endif WITH_XEN_INOTIFY
698

699
LXC_MONITOR_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
700 701
	lxc/lxc_monitor_protocol.h \
	lxc/lxc_monitor_protocol.c \
702 703 704
	$(NULL)

LXC_MONITOR_GENERATED = \
E
Eric Blake 已提交
705
	lxc/lxc_monitor_dispatch.h \
706 707 708
	$(NULL)

LXC_CONTROLLER_GENERATED = \
E
Eric Blake 已提交
709
	lxc/lxc_controller_dispatch.h \
710 711 712
	$(NULL)

LXC_GENERATED = \
713
	$(LXC_MONITOR_PROTOCOL_GENERATED) \
714 715 716 717
	$(LXC_MONITOR_GENERATED) \
	$(LXC_CONTROLLER_GENERATED) \
	$(NULL)

718
LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x
719

E
Eric Blake 已提交
720
lxc/lxc_monitor_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
721
		$(LXC_MONITOR_PROTOCOL) Makefile.am
722
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
723 724
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_monitor_dispatch.h
725

E
Eric Blake 已提交
726
lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
727
		$(REMOTE_PROTOCOL) Makefile.am
728
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \
E
Eric Blake 已提交
729 730
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_controller_dispatch.h
731 732

EXTRA_DIST += \
733
	$(LXC_MONITOR_PROTOCOL) \
734 735 736 737 738
	$(LXC_GENERATED) \
	$(NULL)

BUILT_SOURCES += $(LXC_GENERATED)

739 740
CLEANFILES += $(LXC_GENERATED)

741
LXC_DRIVER_SOURCES =						\
742
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
743
		$(LXC_MONITOR_GENERATED)			\
744 745
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
746
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
747
		lxc/lxc_domain.c lxc/lxc_domain.h		\
748
		lxc/lxc_hostdev.c lxc/lxc_hostdev.h		\
749
		lxc/lxc_monitor.c lxc/lxc_monitor.h		\
750
		lxc/lxc_process.c lxc/lxc_process.h		\
G
Gao feng 已提交
751
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
752
		lxc/lxc_native.c lxc/lxc_native.h		\
753
		lxc/lxc_driver.c lxc/lxc_driver.h
754

755
LXC_CONTROLLER_SOURCES =					\
756
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
757
		$(LXC_CONTROLLER_GENERATED)			\
758 759
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
760
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
761
		lxc/lxc_domain.c lxc/lxc_domain.h		\
G
Gao feng 已提交
762
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
763
		lxc/lxc_controller.c
764

J
Jamie Strandboge 已提交
765
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES =			\
E
Eric Blake 已提交
766
		$(DATATYPES_SOURCES)				\
J
Jamie Strandboge 已提交
767 768
		security/virt-aa-helper.c

769 770 771
PHYP_DRIVER_SOURCES =						\
		phyp/phyp_driver.c phyp/phyp_driver.h

772
OPENVZ_DRIVER_SOURCES =						\
773
		openvz/openvz_conf.c openvz/openvz_conf.h	\
774 775
		openvz/openvz_driver.c openvz/openvz_driver.h   \
		openvz/openvz_util.c openvz/openvz_util.h
776

E
Eric Blake 已提交
777
VMWARE_DRIVER_SOURCES =						\
778
		vmware/vmware_driver.c vmware/vmware_driver.h	\
779 780
		vmware/vmware_conf.c vmware/vmware_conf.h

781
VBOX_DRIVER_SOURCES =						\
E
Eric Blake 已提交
782 783
	vbox/vbox_glue.c vbox/vbox_glue.h			\
	vbox/vbox_driver.c vbox/vbox_driver.h			\
T
Taowei 已提交
784
	vbox/vbox_snapshot_conf.c vbox/vbox_snapshot_conf.h     \
E
Eric Blake 已提交
785 786 787 788
	vbox/vbox_V2_2.c vbox/vbox_CAPI_v2_2.h			\
	vbox/vbox_V3_0.c vbox/vbox_CAPI_v3_0.h			\
	vbox/vbox_V3_1.c vbox/vbox_CAPI_v3_1.h			\
	vbox/vbox_V3_2.c vbox/vbox_CAPI_v3_2.h			\
789
	vbox/vbox_V4_0.c vbox/vbox_CAPI_v4_0.h			\
790
	vbox/vbox_V4_1.c vbox/vbox_CAPI_v4_1.h			\
R
Ryota Ozaki 已提交
791
	vbox/vbox_V4_2.c vbox/vbox_CAPI_v4_2.h			\
T
Taowei 已提交
792
	vbox/vbox_V4_2_20.c vbox/vbox_CAPI_v4_2_20.h		\
793
	vbox/vbox_V4_3.c vbox/vbox_CAPI_v4_3.h			\
T
Taowei 已提交
794
	vbox/vbox_V4_3_4.c vbox/vbox_CAPI_v4_3_4.h              \
M
Martin Pietsch 已提交
795
	vbox/vbox_V5_0.c vbox/vbox_CAPI_v5_0.h			\
T
Taowei 已提交
796 797
	vbox/vbox_common.c vbox/vbox_common.h                   \
	vbox/vbox_uniformed_api.h                               \
798 799 800
	vbox/vbox_get_driver.h					\
	vbox/vbox_network.c					\
	vbox/vbox_storage.c
T
Taowei Luo 已提交
801

E
Eric Blake 已提交
802
VBOX_DRIVER_EXTRA_DIST =					\
803 804 805
		vbox/vbox_tmpl.c vbox/README			\
		vbox/vbox_MSCOMGlue.c vbox/vbox_MSCOMGlue.h	\
		vbox/vbox_XPCOMCGlue.c vbox/vbox_XPCOMCGlue.h
806

O
Osier Yang 已提交
807 808
QEMU_DRIVER_SOURCES =							\
		qemu/qemu_agent.c qemu/qemu_agent.h			\
809
		qemu/qemu_alias.c qemu/qemu_alias.h			\
810
		qemu/qemu_blockjob.c qemu/qemu_blockjob.h		\
O
Osier Yang 已提交
811 812
		qemu/qemu_capabilities.c qemu/qemu_capabilities.h	\
		qemu/qemu_command.c qemu/qemu_command.h			\
813
		qemu/qemu_parse_command.c qemu/qemu_parse_command.h	\
O
Osier Yang 已提交
814
		qemu/qemu_domain.c qemu/qemu_domain.h			\
815
		qemu/qemu_domain_address.c qemu/qemu_domain_address.h	\
O
Osier Yang 已提交
816 817 818
		qemu/qemu_cgroup.c qemu/qemu_cgroup.h			\
		qemu/qemu_hostdev.c qemu/qemu_hostdev.h			\
		qemu/qemu_hotplug.c qemu/qemu_hotplug.h			\
819
		qemu/qemu_hotplugpriv.h					\
O
Osier Yang 已提交
820 821
		qemu/qemu_conf.c qemu/qemu_conf.h			\
		qemu/qemu_process.c qemu/qemu_process.h			\
822
		qemu/qemu_processpriv.h					\
O
Osier Yang 已提交
823 824 825 826 827 828
		qemu/qemu_migration.c qemu/qemu_migration.h		\
		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				\
829
		qemu/qemu_driver.c qemu/qemu_driver.h	\
830 831
		qemu/qemu_interface.c qemu/qemu_interface.h		\
		qemu/qemu_capspriv.h
R
Richard W.M. Jones 已提交
832

O
Osier Yang 已提交
833
XENAPI_DRIVER_SOURCES =						\
834
		xenapi/xenapi_driver.c xenapi/xenapi_driver.h	\
O
Osier Yang 已提交
835
		xenapi/xenapi_driver_private.h			\
836 837
		xenapi/xenapi_utils.c xenapi/xenapi_utils.h

838 839 840 841 842
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       	\
J
Jim Fehlig 已提交
843
		libxl/libxl_migration.c libxl/libxl_migration.h
J
Jim Fehlig 已提交
844

845
UML_DRIVER_SOURCES =						\
D
Daniel P. Berrange 已提交
846 847
		uml/uml_conf.c uml/uml_conf.h			\
		uml/uml_driver.c uml/uml_driver.h
848

O
Osier Yang 已提交
849 850 851 852 853 854
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	\
855
		esx/esx_storage_backend_vmfs.c esx/esx_storage_backend_vmfs.h	\
856
		esx/esx_storage_backend_iscsi.c esx/esx_storage_backend_iscsi.h	\
857
		esx/esx_stream.c esx/esx_stream.h			\
O
Osier Yang 已提交
858 859 860
		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		\
861
		esx/esx_vi_types.c esx/esx_vi_types.h
862

863
ESX_DRIVER_GENERATED =							\
864 865
		esx/esx_vi_methods.generated.c				\
		esx/esx_vi_methods.generated.h				\
866
		esx/esx_vi_methods.generated.macro			\
867 868 869 870 871
		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			\
872 873 874
		esx/esx_vi_types.generated.typefromstring		\
		esx/esx_vi.generated.c					\
		esx/esx_vi.generated.h
875

O
Osier Yang 已提交
876
ESX_DRIVER_EXTRA_DIST =							\
877 878 879 880 881
		esx/README						\
		esx/esx_vi_generator.input				\
		esx/esx_vi_generator.py					\
		$(ESX_DRIVER_GENERATED)

O
Osier Yang 已提交
882
HYPERV_DRIVER_SOURCES =									\
M
Matthias Bolte 已提交
883 884
		hyperv/hyperv_private.h							\
		hyperv/hyperv_driver.c hyperv/hyperv_driver.h				\
885
		hyperv/hyperv_util.c hyperv/hyperv_util.h				\
886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901
		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.generated.c					\
		hyperv/hyperv_wmi.generated.h					\
		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)

902
VZ_DRIVER_SOURCES =				\
903 904 905 906 907 908
		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 已提交
909

R
Roman Bogorodskiy 已提交
910
BHYVE_DRIVER_SOURCES =						\
911 912
		bhyve/bhyve_capabilities.c			\
		bhyve/bhyve_capabilities.h			\
R
Roman Bogorodskiy 已提交
913 914
		bhyve/bhyve_command.c				\
		bhyve/bhyve_command.h				\
915 916 917 918
		bhyve/bhyve_device.c				\
		bhyve/bhyve_device.h				\
		bhyve/bhyve_domain.c				\
		bhyve/bhyve_domain.h				\
R
Roman Bogorodskiy 已提交
919 920
		bhyve/bhyve_driver.h				\
		bhyve/bhyve_driver.c				\
921 922
		bhyve/bhyve_monitor.c				\
		bhyve/bhyve_monitor.h				\
R
Roman Bogorodskiy 已提交
923 924 925 926 927
		bhyve/bhyve_process.c				\
		bhyve/bhyve_process.h				\
		bhyve/bhyve_utils.h				\
		$(NULL)

928
NETWORK_DRIVER_SOURCES =					\
929 930 931 932 933
		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
934

935 936 937 938
INTERFACE_DRIVER_SOURCES =

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

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

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

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

958
# Storage backend specific impls
O
Osier Yang 已提交
959 960
STORAGE_DRIVER_SOURCES =						\
		storage/storage_driver.h storage/storage_driver.c	\
961
		storage/storage_backend.h storage/storage_backend.c
962 963

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

966
STORAGE_DRIVER_LVM_SOURCES =					\
O
Osier Yang 已提交
967
		storage/storage_backend_logical.h		\
968
		storage/storage_backend_logical.c
969 970

STORAGE_DRIVER_ISCSI_SOURCES =					\
971
		storage/storage_backend_iscsi.h storage/storage_backend_iscsi.c
972

973
STORAGE_DRIVER_SCSI_SOURCES =					\
974
		storage/storage_backend_scsi.h storage/storage_backend_scsi.c
975

D
Dave Allan 已提交
976
STORAGE_DRIVER_MPATH_SOURCES =					\
977
		storage/storage_backend_mpath.h storage/storage_backend_mpath.c
D
Dave Allan 已提交
978

979
STORAGE_DRIVER_DISK_SOURCES =					\
980
		storage/storage_backend_disk.h storage/storage_backend_disk.c
981

982 983 984
STORAGE_DRIVER_RBD_SOURCES =					\
		storage/storage_backend_rbd.h storage/storage_backend_rbd.c

985 986 987
STORAGE_DRIVER_SHEEPDOG_SOURCES =				\
		storage/storage_backend_sheepdog.h storage/storage_backend_sheepdog.c

988 989 990
STORAGE_DRIVER_GLUSTER_SOURCES =				\
		storage/storage_backend_gluster.h storage/storage_backend_gluster.c

R
Roman Bogorodskiy 已提交
991 992 993
STORAGE_DRIVER_ZFS_SOURCES =					\
                storage/storage_backend_zfs.h storage/storage_backend_zfs.c

994
STORAGE_HELPER_DISK_SOURCES =					\
995
		storage/parthelper.c
996

997 998 999
UTIL_IO_HELPER_SOURCES =					\
		util/iohelper.c

1000 1001 1002
NETWORK_LEASES_HELPER_SOURCES =                                 \
               network/leaseshelper.c

1003
# Network filters
O
Osier Yang 已提交
1004
NWFILTER_DRIVER_SOURCES =						\
1005
		nwfilter/nwfilter_driver.h nwfilter/nwfilter_driver.c	\
1006
		nwfilter/nwfilter_tech_driver.h				\
1007 1008
		nwfilter/nwfilter_gentech_driver.c			\
		nwfilter/nwfilter_gentech_driver.h			\
S
Stefan Berger 已提交
1009 1010
		nwfilter/nwfilter_dhcpsnoop.c				\
		nwfilter/nwfilter_dhcpsnoop.h				\
1011
		nwfilter/nwfilter_ebiptables_driver.c			\
1012 1013 1014
		nwfilter/nwfilter_ebiptables_driver.h			\
		nwfilter/nwfilter_learnipaddr.c				\
		nwfilter/nwfilter_learnipaddr.h
1015

1016

1017
# Security framework and drivers for various models
O
Osier Yang 已提交
1018 1019 1020 1021 1022
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		\
1023
		security/security_manager.h security/security_manager.c
1024

1025
SECURITY_DRIVER_SELINUX_SOURCES =				\
1026
		security/security_selinux.h security/security_selinux.c
1027

J
Jamie Strandboge 已提交
1028 1029 1030
SECURITY_DRIVER_APPARMOR_SOURCES =				\
		security/security_apparmor.h security/security_apparmor.c

1031
ACCESS_DRIVER_GENERATED = \
E
Eric Blake 已提交
1032 1033 1034 1035 1036 1037 1038
		access/viraccessapicheck.h \
		access/viraccessapicheck.c \
		access/viraccessapicheckqemu.h \
		access/viraccessapicheckqemu.c \
		access/viraccessapichecklxc.h \
		access/viraccessapichecklxc.c \
		$(NULL)
1039

1040
ACCESS_DRIVER_SYM_FILES = \
1041 1042 1043
		libvirt_access.syms \
		libvirt_access_qemu.syms \
		libvirt_access_lxc.syms
1044

1045 1046 1047 1048 1049
ACCESS_DRIVER_API_FILES = \
		libvirt_access.xml \
		libvirt_access_qemu.xml \
		libvirt_access_lxc.xml

1050 1051 1052 1053 1054 1055 1056
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

1057 1058 1059 1060
ACCESS_DRIVER_POLKIT_SOURCES = \
		access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c

ACCESS_DRIVER_POLKIT_POLICY = \
1061
		$(srcdir)/access/org.libvirt.api.policy
1062 1063


1064
NODE_DEVICE_DRIVER_SOURCES =					\
O
Osier Yang 已提交
1065 1066
		node_device/node_device_driver.c		\
		node_device/node_device_driver.h		\
1067 1068
		node_device/node_device_linux_sysfs.c           \
		node_device/node_device_linux_sysfs.h
1069 1070

NODE_DEVICE_DRIVER_HAL_SOURCES =				\
1071
		node_device/node_device_hal.c			\
1072
		node_device/node_device_hal.h
1073

1074
NODE_DEVICE_DRIVER_UDEV_SOURCES =				\
D
Daniel Veillard 已提交
1075 1076
		node_device/node_device_udev.c			\
		node_device/node_device_udev.h
1077

J
Jiri Denemark 已提交
1078 1079 1080
CPU_SOURCES =							\
		cpu/cpu.h cpu/cpu.c				\
		cpu/cpu_x86.h cpu/cpu_x86.c cpu/cpu_x86_data.h	\
T
Thang Pham 已提交
1081
		cpu/cpu_s390.h cpu/cpu_s390.c			\
C
Chuck Short 已提交
1082
		cpu/cpu_arm.h cpu/cpu_arm.c			\
1083 1084 1085
		cpu/cpu_ppc64.h cpu/cpu_ppc64.c			\
		cpu/cpu_ppc64_data.h				\
		cpu/cpu_map.h cpu/cpu_map.c
1086

1087 1088 1089
VMX_SOURCES =							\
		vmx/vmx.c vmx/vmx.h

1090 1091
XENCONFIG_SOURCES =						\
		xenconfig/xenxs_private.h			\
1092
		xenconfig/xen_common.c xenconfig/xen_common.h   \
1093
		xenconfig/xen_sxpr.c xenconfig/xen_sxpr.h	\
1094
		xenconfig/xen_xm.c xenconfig/xen_xm.h
1095 1096 1097 1098
if WITH_LIBXL
XENCONFIG_SOURCES +=						\
		xenconfig/xen_xl.c xenconfig/xen_xl.h
endif WITH_LIBXL
1099

J
Jiri Denemark 已提交
1100 1101
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
1102
EXTRA_DIST +=	$(pkgdata_DATA)
1103

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

1110
noinst_LTLIBRARIES = libvirt_util.la
1111 1112
libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
libvirt_la_BUILT_LIBADD = libvirt_util.la
1113 1114
libvirt_util_la_SOURCES =					\
		$(UTIL_SOURCES)
1115
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
1116
		$(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
1117
		$(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS)	\
1118
		$(POLKIT_CFLAGS) $(GNUTLS_CFLAGS) \
1119
		-I$(srcdir)/conf
1120
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
1121
		$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
1122
		$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(MSCOM_LIBS) $(LIBXML_LIBS) \
1123
		$(SECDRIVER_LIBS) $(NUMACTL_LIBS) \
1124
		$(POLKIT_LIBS)
1125

1126 1127

noinst_LTLIBRARIES += libvirt_conf.la
1128
libvirt_la_BUILT_LIBADD += libvirt_conf.la
1129
libvirt_conf_la_SOURCES = $(CONF_SOURCES)
1130 1131
libvirt_conf_la_CFLAGS = $(AM_CFLAGS)
libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS)
1132
libvirt_conf_la_LIBADD = $(LIBXML_LIBS)
1133

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

1140 1141 1142 1143 1144 1145
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)

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

J
Jim Fehlig 已提交
1154 1155 1156
if WITH_XENCONFIG
noinst_LTLIBRARIES += libvirt_xenconfig.la
libvirt_la_BUILT_LIBADD += libvirt_xenconfig.la
1157
libvirt_xenconfig_la_LIBADD = $(LIBXL_LIBS)
J
Jim Fehlig 已提交
1158
libvirt_xenconfig_la_CFLAGS = \
J
Jim Fehlig 已提交
1159
		-I$(srcdir)/conf -I$(srcdir)/libxl $(AM_CFLAGS)
J
Jim Fehlig 已提交
1160 1161
libvirt_xenconfig_la_SOURCES = $(XENCONFIG_SOURCES)
endif WITH_XENCONFIG
1162

1163

1164
noinst_LTLIBRARIES += libvirt_driver.la
1165
libvirt_la_BUILT_LIBADD += libvirt_driver.la
1166
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
1167

1168
libvirt_driver_la_CFLAGS = \
1169
		$(GNUTLS_CFLAGS) $(CURL_CFLAGS) \
1170
		-I$(srcdir)/conf $(AM_CFLAGS)
1171
libvirt_driver_la_LIBADD = \
1172
		$(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS)
1173

1174 1175
# 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.
1176
SYM_FILES = $(USED_SYM_FILES)
1177
USED_SYM_FILES = $(srcdir)/libvirt_private.syms
1178 1179 1180
GENERATED_SYM_FILES = \
	$(ACCESS_DRIVER_SYM_FILES) \
	libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \
1181
	libvirt_admin.syms libvirt_admin.def \
1182
	$(NULL)
1183

1184
if WITH_TEST
1185
noinst_LTLIBRARIES += libvirt_driver_test.la
1186
libvirt_la_BUILT_LIBADD += libvirt_driver_test.la
1187
libvirt_driver_test_la_CFLAGS = \
1188
		-I$(srcdir)/conf $(AM_CFLAGS)
1189
libvirt_driver_test_la_SOURCES = $(TEST_DRIVER_SOURCES)
1190
endif WITH_TEST
1191 1192

if WITH_REMOTE
1193
noinst_LTLIBRARIES += libvirt_driver_remote.la
1194
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
1195 1196
libvirt_driver_remote_la_CFLAGS =				\
		$(GNUTLS_CFLAGS)				\
E
Eric Blake 已提交
1197
		$(XDR_CFLAGS)					\
1198 1199
		-I$(srcdir)/conf				\
		-I$(srcdir)/rpc					\
1200 1201
		$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
1202 1203 1204 1205
libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) \
                libvirt-net-rpc-client.la \
                libvirt-net-rpc-server.la \
                libvirt-net-rpc.la
1206
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
1207

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

1210 1211
endif WITH_REMOTE

1212
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
1213
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
1214
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1215

1216
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
1217
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
1218
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1219

1220
if WITH_XEN
E
Eric Blake 已提交
1221 1222 1223
noinst_LTLIBRARIES += libvirt_driver_xen_impl.la
libvirt_driver_xen_la_SOURCES =
libvirt_driver_xen_la_LIBADD = libvirt_driver_xen_impl.la
1224 1225
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_xen.la
E
Eric Blake 已提交
1226
libvirt_driver_xen_la_LIBADD += ../gnulib/lib/libgnu.la
1227
libvirt_driver_xen_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1228
else ! WITH_DRIVER_MODULES
1229
noinst_LTLIBRARIES += libvirt_driver_xen.la
1230 1231
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_xen.la
1232
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1233

1234
libvirt_driver_xen_impl_la_CFLAGS =				\
1235
		$(XEN_CFLAGS)					\
1236 1237 1238
		-I$(srcdir)/access				\
		-I$(srcdir)/conf				\
		-I$(srcdir)/xenconfig				\
1239
		$(AM_CFLAGS)
E
Eric Blake 已提交
1240
libvirt_driver_xen_impl_la_LDFLAGS = $(AM_LDFLAGS)
P
Pavel Hrdina 已提交
1241
libvirt_driver_xen_impl_la_LIBADD = $(XEN_LIBS) libvirt_xenconfig.la
E
Eric Blake 已提交
1242
libvirt_driver_xen_impl_la_SOURCES = $(XEN_DRIVER_SOURCES)
1243
endif WITH_XEN
1244

1245 1246
if WITH_PHYP
noinst_LTLIBRARIES += libvirt_driver_phyp.la
1247
libvirt_la_BUILT_LIBADD += libvirt_driver_phyp.la
1248 1249
libvirt_driver_phyp_la_LIBADD = $(SSH2_LIBS)
libvirt_driver_phyp_la_CFLAGS = $(SSH2_CFLAGS) \
1250
		-I$(srcdir)/conf $(AM_CFLAGS)
1251
libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES)
1252
endif WITH_PHYP
1253

1254
if WITH_OPENVZ
1255
noinst_LTLIBRARIES += libvirt_driver_openvz.la
1256
libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la
1257
libvirt_driver_openvz_la_CFLAGS = \
1258
		-I$(srcdir)/conf $(AM_CFLAGS)
1259
libvirt_driver_openvz_la_SOURCES = $(OPENVZ_DRIVER_SOURCES)
1260
endif WITH_OPENVZ
1261

1262 1263 1264 1265
if WITH_VMWARE
noinst_LTLIBRARIES += libvirt_driver_vmware.la
libvirt_la_BUILT_LIBADD += libvirt_driver_vmware.la
libvirt_driver_vmware_la_CFLAGS = \
1266
		-I$(srcdir)/conf -I$(srcdir)/vmx $(AM_CFLAGS)
1267
libvirt_driver_vmware_la_SOURCES = $(VMWARE_DRIVER_SOURCES)
1268
endif WITH_VMWARE
1269

1270
if WITH_VBOX
M
Michal Privoznik 已提交
1271
noinst_LTLIBRARIES += \
1272
		libvirt_driver_vbox_impl.la
1273 1274 1275
libvirt_driver_vbox_la_SOURCES =
libvirt_driver_vbox_la_LIBADD = libvirt_driver_vbox_impl.la
if WITH_DRIVER_MODULES
M
Michal Privoznik 已提交
1276
mod_LTLIBRARIES += \
1277
		libvirt_driver_vbox.la
1278
libvirt_driver_vbox_la_LIBADD += ../gnulib/lib/libgnu.la
1279
libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1280
else ! WITH_DRIVER_MODULES
1281
noinst_LTLIBRARIES += libvirt_driver_vbox.la
1282 1283 1284
# GPLv2-only license requries that it be linked into
# libvirtd and *not* libvirt.so
#libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la
1285
endif ! WITH_DRIVER_MODULES
1286 1287

libvirt_driver_vbox_impl_la_CFLAGS =				\
1288 1289
		-I$(srcdir)/conf				\
		$(AM_CFLAGS)					\
M
Michal Privoznik 已提交
1290
		-DVBOX_DRIVER
1291
libvirt_driver_vbox_impl_la_LDFLAGS = $(AM_LDFLAGS)
1292 1293 1294
libvirt_driver_vbox_impl_la_LIBADD =  $(DLOPEN_LIBS)		\
		$(MSCOM_LIBS)					\
		$(LIBXML_LIBS)
1295
libvirt_driver_vbox_impl_la_SOURCES = $(VBOX_DRIVER_SOURCES)
1296
endif WITH_VBOX
1297

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

J
Jim Fehlig 已提交
1308
if WITH_LIBXL
E
Eric Blake 已提交
1309 1310 1311
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 已提交
1312 1313
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_libxl.la
E
Eric Blake 已提交
1314
libvirt_driver_libxl_la_LIBADD += ../gnulib/lib/libgnu.la
1315
libvirt_driver_libxl_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1316
else ! WITH_DRIVER_MODULES
J
Jim Fehlig 已提交
1317 1318 1319
noinst_LTLIBRARIES += libvirt_driver_libxl.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_libxl.la
1320
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1321

1322 1323
libvirt_driver_libxl_impl_la_CFLAGS = 		\
		$(LIBXL_CFLAGS)			\
1324 1325
		-I$(srcdir)/access	\
		-I$(srcdir)/conf	\
1326
		-I$(srcdir)/secret      \
1327
		-I$(srcdir)/xenconfig	\
1328
		$(AM_CFLAGS)
E
Eric Blake 已提交
1329
libvirt_driver_libxl_impl_la_LDFLAGS = $(AM_LDFLAGS)
1330 1331 1332
libvirt_driver_libxl_impl_la_LIBADD = $(LIBXL_LIBS) \
				      libvirt_xenconfig.la \
				      libvirt_secret.la
E
Eric Blake 已提交
1333
libvirt_driver_libxl_impl_la_SOURCES = $(LIBXL_DRIVER_SOURCES)
1334 1335 1336 1337 1338 1339

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

1340
endif WITH_LIBXL
1341 1342
EXTRA_DIST += libxl/libxl.conf libxl/libvirtd_libxl.aug \
		libxl/test_libvirtd_libxl.aug.in
J
Jim Fehlig 已提交
1343

1344
if WITH_QEMU
E
Eric Blake 已提交
1345 1346 1347
noinst_LTLIBRARIES += libvirt_driver_qemu_impl.la
libvirt_driver_qemu_la_SOURCES =
libvirt_driver_qemu_la_LIBADD = libvirt_driver_qemu_impl.la
1348 1349
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_qemu.la
E
Eric Blake 已提交
1350
libvirt_driver_qemu_la_LIBADD += ../gnulib/lib/libgnu.la
1351
libvirt_driver_qemu_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1352
else ! WITH_DRIVER_MODULES
1353
noinst_LTLIBRARIES += libvirt_driver_qemu.la
1354
# Stateful, so linked to daemon instead
1355
#libvirt_la_BUILT_LIBADD += libvirt_driver_qemu.la
1356
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1357

1358 1359 1360
libvirt_driver_qemu_impl_la_CFLAGS = \
		$(GNUTLS_CFLAGS) \
		$(LIBNL_CFLAGS) \
1361 1362
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1363
		-I$(srcdir)/secret \
1364
		$(AM_CFLAGS)
E
Eric Blake 已提交
1365
libvirt_driver_qemu_impl_la_LDFLAGS = $(AM_LDFLAGS)
1366
libvirt_driver_qemu_impl_la_LIBADD = $(CAPNG_LIBS) \
1367
                                $(GNUTLS_LIBS) \
1368 1369
				$(LIBNL_LIBS) \
				$(LIBXML_LIBS) \
1370
				libvirt_secret.la \
1371
				$(NULL)
E
Eric Blake 已提交
1372
libvirt_driver_qemu_impl_la_SOURCES = $(QEMU_DRIVER_SOURCES)
1373

A
Amy Griffis 已提交
1374
conf_DATA += qemu/qemu.conf
1375

1376
augeas_DATA += qemu/libvirtd_qemu.aug
1377 1378
augeastest_DATA += test_libvirtd_qemu.aug
CLEANFILES += test_libvirtd_qemu.aug
1379

1380
endif WITH_QEMU
1381
EXTRA_DIST += qemu/qemu.conf qemu/libvirtd_qemu.aug \
1382
		qemu/test_libvirtd_qemu.aug.in qemu/THREADS.txt
1383

1384 1385

if WITH_LXC
E
Eric Blake 已提交
1386 1387 1388
noinst_LTLIBRARIES += libvirt_driver_lxc_impl.la
libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = libvirt_driver_lxc_impl.la
1389 1390
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_lxc.la
E
Eric Blake 已提交
1391 1392
libvirt_driver_lxc_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_lxc_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1393
else ! WITH_DRIVER_MODULES
1394
noinst_LTLIBRARIES += libvirt_driver_lxc.la
1395
# Stateful, so linked to daemon instead
1396
#libvirt_la_BUILT_LIBADD += libvirt_driver_lxc.la
1397
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1398 1399

libvirt_driver_lxc_impl_la_CFLAGS = \
S
Serge Hallyn 已提交
1400
		$(LIBNL_CFLAGS) \
G
Gao feng 已提交
1401
		$(FUSE_CFLAGS) \
P
Pavel Fedin 已提交
1402
		$(XDR_CFLAGS) \
1403 1404
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1405
		$(AM_CFLAGS)
I
ik.nitk 已提交
1406 1407 1408 1409 1410 1411
libvirt_driver_lxc_impl_la_LIBADD = \
               $(CAPNG_LIBS) \
               $(LIBNL_LIBS) \
               $(LIBXML_LIBS) \
               $(FUSE_LIBS)

1412
if WITH_BLKID
E
Eric Blake 已提交
1413 1414
libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS)
1415
endif WITH_BLKID
1416
libvirt_driver_lxc_impl_la_LIBADD += $(SECDRIVER_LIBS)
E
Eric Blake 已提交
1417
libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES)
A
Amy Griffis 已提交
1418 1419 1420

conf_DATA += lxc/lxc.conf

1421
augeas_DATA += lxc/libvirtd_lxc.aug
1422 1423
augeastest_DATA += test_libvirtd_lxc.aug
CLEANFILES += test_libvirtd_lxc.aug
1424

1425
endif WITH_LXC
1426
EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in
1427

1428
if WITH_UML
E
Eric Blake 已提交
1429 1430 1431
noinst_LTLIBRARIES += libvirt_driver_uml_impl.la
libvirt_driver_uml_la_SOURCES =
libvirt_driver_uml_la_LIBADD = libvirt_driver_uml_impl.la
1432 1433
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_uml.la
E
Eric Blake 已提交
1434
libvirt_driver_uml_la_LIBADD += ../gnulib/lib/libgnu.la
1435
libvirt_driver_uml_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1436
else ! WITH_DRIVER_MODULES
1437 1438
noinst_LTLIBRARIES += libvirt_driver_uml.la
# Stateful, so linked to daemon instead
1439
#libvirt_la_BUILT_LIBADD += libvirt_driver_uml.la
1440
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1441

1442
libvirt_driver_uml_impl_la_CFLAGS = \
1443 1444
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1445
		$(AM_CFLAGS)
E
Eric Blake 已提交
1446
libvirt_driver_uml_impl_la_LDFLAGS = $(AM_LDFLAGS)
1447
# libvirt_driver_uml_impl_la_LIBADD =
E
Eric Blake 已提交
1448
libvirt_driver_uml_impl_la_SOURCES = $(UML_DRIVER_SOURCES)
1449
endif WITH_UML
1450

D
Daniel Veillard 已提交
1451

1452
BUILT_SOURCES += $(ESX_DRIVER_GENERATED)
D
Daniel Veillard 已提交
1453

1454 1455
ESX_GENERATED_STAMP = .esx_vi_generator.stamp

E
Eric Blake 已提交
1456 1457
EXTRA_DIST += $(ESX_GENERATED_STAMP)

1458 1459 1460
$(ESX_DRIVER_GENERATED): $(ESX_GENERATED_STAMP)

$(ESX_GENERATED_STAMP): $(srcdir)/esx/esx_vi_generator.input \
1461
                         $(srcdir)/esx/esx_vi_generator.py
1462 1463 1464 1465 1466
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/esx/esx_vi_generator.py \
	  && touch $@

MAINTAINERCLEANFILES += $(ESX_DRIVER_GENERATED) $(ESX_GENERATED_STAMP)

D
Daniel Veillard 已提交
1467

1468 1469
if WITH_ESX
noinst_LTLIBRARIES += libvirt_driver_esx.la
1470
libvirt_la_BUILT_LIBADD += libvirt_driver_esx.la
1471
libvirt_driver_esx_la_CFLAGS = $(CURL_CFLAGS) \
1472
		-I$(srcdir)/conf -I$(srcdir)/vmx $(AM_CFLAGS)
1473
libvirt_driver_esx_la_LDFLAGS = $(AM_LDFLAGS)
1474
libvirt_driver_esx_la_LIBADD = $(CURL_LIBS)
1475
libvirt_driver_esx_la_SOURCES = $(ESX_DRIVER_SOURCES)
1476
libvirt_driver_esx_la_DEPENDENCIES = $(ESX_DRIVER_GENERATED)
1477
endif WITH_ESX
1478

M
Matthias Bolte 已提交
1479

1480 1481
BUILT_SOURCES += $(HYPERV_DRIVER_GENERATED)

1482 1483
HYPERV_GENERATED_STAMP = .hyperv_wmi_generator.stamp

E
Eric Blake 已提交
1484 1485
EXTRA_DIST += $(HYPERV_GENERATED_STAMP)

1486 1487 1488
$(HYPERV_DRIVER_GENERATED): $(HYPERV_GENERATED_STAMP)

$(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \
1489
                            $(srcdir)/hyperv/hyperv_wmi_generator.py
1490 1491
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) \
	  $(srcdir)/hyperv/hyperv_wmi_generator.py \
1492 1493 1494
	  && touch $@

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

M
Matthias Bolte 已提交
1496 1497 1498 1499
if WITH_HYPERV
noinst_LTLIBRARIES += libvirt_driver_hyperv.la
libvirt_la_BUILT_LIBADD += libvirt_driver_hyperv.la
libvirt_driver_hyperv_la_CFLAGS = $(OPENWSMAN_CFLAGS) \
1500
		-I$(srcdir)/conf $(AM_CFLAGS)
M
Matthias Bolte 已提交
1501 1502 1503
libvirt_driver_hyperv_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_hyperv_la_LIBADD = $(OPENWSMAN_LIBS)
libvirt_driver_hyperv_la_SOURCES = $(HYPERV_DRIVER_SOURCES)
1504
endif WITH_HYPERV
M
Matthias Bolte 已提交
1505

1506
if WITH_VZ
1507 1508 1509 1510 1511 1512 1513 1514
noinst_LTLIBRARIES += libvirt_driver_vz_impl.la
libvirt_driver_vz_la_SOURCES =
libvirt_driver_vz_la_LIBADD = libvirt_driver_vz_impl.la
if WITH_DRIVER_MODULES
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)
else ! WITH_DRIVER_MODULES
1515
noinst_LTLIBRARIES += libvirt_driver_vz.la
1516 1517
endif ! WITH_DRIVER_MODULES
libvirt_driver_vz_impl_la_CFLAGS = \
1518
		-I$(srcdir)/conf $(AM_CFLAGS) \
1519
		$(PARALLELS_SDK_CFLAGS) $(LIBNL_CFLAGS)
1520 1521
libvirt_driver_vz_impl_la_SOURCES = $(VZ_DRIVER_SOURCES)
libvirt_driver_vz_impl_la_LIBADD =  $(PARALLELS_SDK_LIBS) $(LIBNL_LIBS)
1522
endif WITH_VZ
D
Dmitry Guryanov 已提交
1523

R
Roman Bogorodskiy 已提交
1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536
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
if WITH_DRIVER_MODULES
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)
else ! WITH_DRIVER_MODULES
noinst_LTLIBRARIES += libvirt_driver_bhyve.la
endif ! WITH_DRIVER_MODULES

libvirt_driver_bhyve_impl_la_CFLAGS = \
1537 1538
	-I$(srcdir)/access \
	-I$(srcdir)/conf \
R
Roman Bogorodskiy 已提交
1539 1540 1541 1542 1543
	$(AM_CFLAGS)
libvirt_driver_bhyve_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_bhyve_impl_la_SOURCES = $(BHYVE_DRIVER_SOURCES)
endif WITH_BHYVE

1544
if WITH_NETWORK
E
Eric Blake 已提交
1545 1546 1547
noinst_LTLIBRARIES += libvirt_driver_network_impl.la
libvirt_driver_network_la_SOURCES =
libvirt_driver_network_la_LIBADD = libvirt_driver_network_impl.la
1548 1549
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_network.la
1550 1551 1552 1553
libvirt_driver_network_la_LIBADD += ../gnulib/lib/libgnu.la \
	$(LIBNL_LIBS) \
	$(DBUS_LIBS) \
	$(NULL)
E
Eric Blake 已提交
1554
libvirt_driver_network_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1555
else ! WITH_DRIVER_MODULES
1556
noinst_LTLIBRARIES += libvirt_driver_network.la
1557
# Stateful, so linked to daemon instead
1558
#libvirt_la_BUILT_LIBADD += libvirt_driver_network.la
1559
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1560 1561

libvirt_driver_network_impl_la_CFLAGS = \
1562 1563
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1564 1565
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1566
		$(AM_CFLAGS)
E
Eric Blake 已提交
1567
libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
1568
libvirt_driver_network_impl_la_LIBADD  = $(DBUS_LIBS)
1569
endif WITH_NETWORK
1570 1571 1572
EXTRA_DIST += network/default.xml


1573
if WITH_INTERFACE
1574 1575
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_interface.la
1576
else ! WITH_DRIVER_MODULES
1577
noinst_LTLIBRARIES += libvirt_driver_interface.la
1578 1579
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_interface.la
1580
endif ! WITH_DRIVER_MODULES
1581
libvirt_driver_interface_la_CFLAGS = \
1582 1583
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1584
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1585
libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS)
1586 1587 1588 1589
libvirt_driver_interface_la_LIBADD =
if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
1590
endif WITH_NETCF
1591
if WITH_UDEV
1592 1593
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
1594
endif WITH_UDEV
1595
if WITH_DRIVER_MODULES
1596
libvirt_driver_interface_la_LIBADD += ../gnulib/lib/libgnu.la
1597
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
1598
endif WITH_DRIVER_MODULES
1599
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
1600
endif WITH_INTERFACE
D
Daniel Veillard 已提交
1601

D
Daniel P. Berrange 已提交
1602
if WITH_SECRETS
1603 1604
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_secret.la
1605
else ! WITH_DRIVER_MODULES
1606
noinst_LTLIBRARIES += libvirt_driver_secret.la
1607
# Stateful, so linked to daemon instead
1608
#libvirt_la_BUILT_LIBADD += libvirt_driver_secret.la
1609
endif ! WITH_DRIVER_MODULES
1610
libvirt_driver_secret_la_CFLAGS = \
1611 1612
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1613
		$(AM_CFLAGS)
1614
if WITH_DRIVER_MODULES
1615
libvirt_driver_secret_la_LIBADD = ../gnulib/lib/libgnu.la
1616
libvirt_driver_secret_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1617
endif WITH_DRIVER_MODULES
1618
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
1619
endif WITH_SECRETS
1620

1621
# Needed to keep automake quiet about conditionals
1622 1623
libvirt_driver_storage_impl_la_SOURCES =
libvirt_driver_storage_impl_la_CFLAGS = \
1624 1625
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1626
		-I$(srcdir)/secret \
1627
		$(AM_CFLAGS)
1628 1629
libvirt_driver_storage_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_storage_impl_la_LIBADD =
1630
libvirt_driver_storage_impl_la_LIBADD += $(SECDRIVER_LIBS) $(LIBXML_LIBS)
1631
if WITH_BLKID
1632 1633
libvirt_driver_storage_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(BLKID_LIBS)
1634
endif WITH_BLKID
1635
if WITH_STORAGE
1636 1637 1638
noinst_LTLIBRARIES += libvirt_driver_storage_impl.la
libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_LIBADD = libvirt_driver_storage_impl.la
1639 1640
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_storage.la
1641
libvirt_driver_storage_la_LIBADD += ../gnulib/lib/libgnu.la
1642
libvirt_driver_storage_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1643
else ! WITH_DRIVER_MODULES
1644
noinst_LTLIBRARIES += libvirt_driver_storage.la
1645
# Stateful, so linked to daemon instead
1646
#libvirt_la_BUILT_LIBADD += libvirt_driver_storage.la
1647
endif ! WITH_DRIVER_MODULES
1648 1649
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_FS_SOURCES)
1650
endif WITH_STORAGE
1651

1652
if WITH_STORAGE_LVM
1653
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_LVM_SOURCES)
1654
endif WITH_STORAGE_LVM
1655

1656
if WITH_STORAGE_ISCSI
1657
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_ISCSI_SOURCES)
1658
endif WITH_STORAGE_ISCSI
1659

1660
if WITH_STORAGE_SCSI
1661
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SCSI_SOURCES)
1662
endif WITH_STORAGE_SCSI
1663

D
Dave Allan 已提交
1664
if WITH_STORAGE_MPATH
1665 1666 1667
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_MPATH_SOURCES)
libvirt_driver_storage_impl_la_CFLAGS += $(DEVMAPPER_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(DEVMAPPER_LIBS)
1668
endif WITH_STORAGE_MPATH
D
Dave Allan 已提交
1669

1670
if WITH_STORAGE_DISK
1671
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_DISK_SOURCES)
1672
endif WITH_STORAGE_DISK
1673

1674
if WITH_STORAGE_RBD
1675 1676
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_RBD_SOURCES)
libvirt_driver_storage_impl_la_LIBADD += $(LIBRBD_LIBS)
1677
endif WITH_STORAGE_RBD
1678

1679
if WITH_STORAGE_SHEEPDOG
1680
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SHEEPDOG_SOURCES)
1681
endif WITH_STORAGE_SHEEPDOG
1682

1683 1684 1685 1686 1687 1688
if WITH_STORAGE_GLUSTER
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_GLUSTER_SOURCES)
libvirt_driver_storage_impl_la_CFLAGS += $(GLUSTERFS_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(GLUSTERFS_LIBS)
endif WITH_STORAGE_GLUSTER

R
Roman Bogorodskiy 已提交
1689 1690 1691 1692
if WITH_STORAGE_ZFS
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_ZFS_SOURCES)
endif WITH_STORAGE_ZFS

1693 1694 1695 1696
if WITH_NODE_DEVICES
# Needed to keep automake quiet about conditionals
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nodedev.la
1697
else ! WITH_DRIVER_MODULES
1698 1699
noinst_LTLIBRARIES += libvirt_driver_nodedev.la
# Stateful, so linked to daemon instead
1700
#libvirt_la_BUILT_LIBADD += libvirt_driver_nodedev.la
1701
endif ! WITH_DRIVER_MODULES
1702 1703
libvirt_driver_nodedev_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES)

1704
libvirt_driver_nodedev_la_CFLAGS = \
1705 1706
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1707
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1708
libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS)
1709
libvirt_driver_nodedev_la_LIBADD =
1710

D
Doug Goldstein 已提交
1711
if WITH_LIBVIRTD
1712
if WITH_HAL
1713 1714
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS)
1715
libvirt_driver_nodedev_la_LIBADD += $(HAL_LIBS)
1716
endif WITH_HAL
1717
if WITH_UDEV
1718
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES)
1719
libvirt_driver_nodedev_la_CFLAGS += $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS)
1720
libvirt_driver_nodedev_la_LIBADD += $(UDEV_LIBS) $(PCIACCESS_LIBS)
1721 1722
endif WITH_UDEV
endif WITH_LIBVIRTD
1723 1724

if WITH_DRIVER_MODULES
1725
libvirt_driver_nodedev_la_LIBADD += ../gnulib/lib/libgnu.la
1726
libvirt_driver_nodedev_la_LDFLAGS += -module -avoid-version
1727 1728
endif WITH_DRIVER_MODULES
endif WITH_NODE_DEVICES
1729 1730


1731
if WITH_NWFILTER
1732 1733 1734
noinst_LTLIBRARIES += libvirt_driver_nwfilter_impl.la
libvirt_driver_nwfilter_la_SOURCES =
libvirt_driver_nwfilter_la_LIBADD = libvirt_driver_nwfilter_impl.la
1735 1736
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nwfilter.la
1737
libvirt_driver_nwfilter_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1738
else ! WITH_DRIVER_MODULES
1739
noinst_LTLIBRARIES += libvirt_driver_nwfilter.la
1740 1741
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_nwfilter.la
1742
endif ! WITH_DRIVER_MODULES
1743
libvirt_driver_nwfilter_impl_la_CFLAGS = \
1744 1745 1746
		$(LIBPCAP_CFLAGS) \
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1747 1748
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1749
		$(AM_CFLAGS)
1750 1751 1752 1753 1754
libvirt_driver_nwfilter_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_nwfilter_impl_la_LIBADD = \
		$(LIBPCAP_LIBS) \
		$(LIBNL_LIBS) \
		$(DBUS_LIBS)
1755
if WITH_DRIVER_MODULES
1756 1757
libvirt_driver_nwfilter_impl_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_nwfilter_impl_la_LDFLAGS += -module -avoid-version
1758
endif WITH_DRIVER_MODULES
1759
libvirt_driver_nwfilter_impl_la_SOURCES = $(NWFILTER_DRIVER_SOURCES)
1760
endif WITH_NWFILTER
1761 1762


1763 1764 1765 1766
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 = \
1767
		-I$(srcdir)/conf $(AM_CFLAGS)
1768
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
1769
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
1770
if WITH_SECDRIVER_SELINUX
1771 1772
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
1773
endif WITH_SECDRIVER_SELINUX
J
Jamie Strandboge 已提交
1774
if WITH_SECDRIVER_APPARMOR
1775 1776
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
1777
endif WITH_SECDRIVER_APPARMOR
1778

1779 1780
libvirt_driver_access_la_SOURCES = \
	$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
1781 1782 1783
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
1784
		-I$(srcdir)/conf $(AM_CFLAGS)
1785 1786 1787
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD =

1788 1789
EXTRA_DIST += access/genpolkit.pl

1790 1791 1792 1793
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
    $(srcdir)/access/genpolkit.pl Makefile.am
	$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@

1794 1795 1796 1797
if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)

polkitactiondir = $(datadir)/polkit-1/actions
1798
if WITH_LIBVIRTD
1799
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
1800
endif WITH_LIBVIRTD
1801 1802 1803

CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
1804
else ! WITH_POLKIT1
1805
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
1806
endif ! WITH_POLKIT1
1807

1808

1809 1810
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824

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

1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837
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 已提交
1838
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
1839 1840
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1841 1842 1843
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
1844 1845
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1846 1847
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
	  > $(srcdir)/access/viraccessapicheck.c
1848

E
Eric Blake 已提交
1849
access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
1850 1851
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1852 1853 1854
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheckqemu.h
access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
1855 1856
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1857 1858
	  qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h \
	  > $(srcdir)/access/viraccessapicheckqemu.c
1859

E
Eric Blake 已提交
1860
access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
1861 1862
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1863 1864 1865
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/access/viraccessapichecklxc.h
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
1866 1867
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1868 1869
	  lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \
	  > $(srcdir)/access/viraccessapichecklxc.c
1870

1871 1872 1873 1874 1875 1876 1877
# Add all conditional sources just in case...
EXTRA_DIST +=							\
		$(TEST_DRIVER_SOURCES)				\
		$(REMOTE_DRIVER_SOURCES)			\
		$(XEN_DRIVER_SOURCES)				\
		$(QEMU_DRIVER_SOURCES)				\
		$(LXC_DRIVER_SOURCES)				\
1878
		$(UML_DRIVER_SOURCES)				\
1879
		$(OPENVZ_DRIVER_SOURCES)			\
1880
		$(PHYP_DRIVER_SOURCES)				\
1881
		$(VBOX_DRIVER_SOURCES)				\
1882
		$(XENAPI_DRIVER_SOURCES)			\
O
Osier Yang 已提交
1883
		$(LIBXL_DRIVER_SOURCES)				\
1884
		$(ESX_DRIVER_SOURCES)				\
1885
		$(ESX_DRIVER_EXTRA_DIST)			\
M
Matthias Bolte 已提交
1886
		$(HYPERV_DRIVER_SOURCES)			\
1887
		$(HYPERV_DRIVER_EXTRA_DIST)			\
1888
		$(VZ_DRIVER_SOURCES)				\
R
Roman Bogorodskiy 已提交
1889
		$(BHYVE_DRIVER_SOURCES)				\
1890
		$(NETWORK_DRIVER_SOURCES)			\
1891
		$(INTERFACE_DRIVER_SOURCES)			\
1892 1893 1894 1895
		$(STORAGE_DRIVER_SOURCES)			\
		$(STORAGE_DRIVER_FS_SOURCES)			\
		$(STORAGE_DRIVER_LVM_SOURCES)			\
		$(STORAGE_DRIVER_ISCSI_SOURCES)			\
1896
		$(STORAGE_DRIVER_SCSI_SOURCES)			\
D
Dave Allan 已提交
1897
		$(STORAGE_DRIVER_MPATH_SOURCES)			\
1898
		$(STORAGE_DRIVER_DISK_SOURCES)			\
1899
		$(STORAGE_DRIVER_RBD_SOURCES)			\
1900
		$(STORAGE_DRIVER_SHEEPDOG_SOURCES)		\
1901
		$(STORAGE_DRIVER_GLUSTER_SOURCES)		\
R
Roman Bogorodskiy 已提交
1902
		$(STORAGE_DRIVER_ZFS_SOURCES)			\
1903 1904
		$(NODE_DEVICE_DRIVER_SOURCES)			\
		$(NODE_DEVICE_DRIVER_HAL_SOURCES)		\
1905
		$(NODE_DEVICE_DRIVER_UDEV_SOURCES)		\
1906
		$(NWFILTER_DRIVER_SOURCES)			\
1907
		$(SECURITY_DRIVER_SELINUX_SOURCES)		\
J
Jamie Strandboge 已提交
1908
		$(SECURITY_DRIVER_APPARMOR_SOURCES)		\
D
Daniel P. Berrange 已提交
1909
		$(SECRET_DRIVER_SOURCES)			\
1910
		$(SECRET_UTIL_SOURCES)				\
1911
		$(VBOX_DRIVER_EXTRA_DIST)			\
1912
		$(VMWARE_DRIVER_SOURCES)			\
J
Jim Fehlig 已提交
1913
		$(XENCONFIG_SOURCES)				\
1914
		$(ACCESS_DRIVER_POLKIT_POLICY)
1915

1916 1917
check-local: check-augeas

1918 1919 1920 1921 1922
.PHONY: check-augeas \
	check-augeas-qemu \
	check-augeas-lxc \
	check-augeas-sanlock \
	check-augeas-lockd \
1923
	check-augeas-libxl \
1924
	$(NULL)
1925

1926
check-augeas: check-augeas-qemu check-augeas-lxc check-augeas-sanlock \
1927 1928
	check-augeas-lockd check-augeas-virtlockd check-augeas-libxl \
	check-augeas-virtlogd
1929

1930
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
1931
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
1932

1933
if WITH_QEMU
1934 1935
test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
		$(srcdir)/qemu/qemu.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1936
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
1937

1938
check-augeas-qemu: test_libvirtd_qemu.aug
1939
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1940
	    '$(AUGPARSE)' -I $(srcdir)/qemu test_libvirtd_qemu.aug; \
1941
	fi
1942
else ! WITH_QEMU
1943
check-augeas-qemu:
1944
endif ! WITH_QEMU
1945

1946
if WITH_LXC
1947 1948
test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
		$(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1949
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
1950

1951
check-augeas-lxc: test_libvirtd_lxc.aug
1952
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1953
	    '$(AUGPARSE)' -I $(srcdir)/lxc test_libvirtd_lxc.aug; \
1954
	fi
1955
else ! WITH_LXC
1956
check-augeas-lxc:
1957
endif ! WITH_LXC
1958

1959
if WITH_SANLOCK
1960 1961
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1962
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
1963

1964
check-augeas-sanlock: test_libvirt_sanlock.aug
1965
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1966
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
1967
	fi
1968
else ! WITH_SANLOCK
1969
check-augeas-sanlock:
1970
endif ! WITH_SANLOCK
1971

1972
if WITH_QEMU
1973 1974 1975
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 $< $@
1976 1977 1978
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
1979

1980 1981
test_virtlockd.aug: locking/test_virtlockd.aug.in \
		locking/virtlockd.conf $(AUG_GENTEST)
1982
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
1983

1984
if WITH_QEMU
1985 1986 1987 1988
check-augeas-lockd: test_libvirt_lockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_lockd.aug; \
	fi
1989 1990 1991
else ! WITH_QEMU
check-augeas-lockd:
endif ! WITH_QEMU
1992

1993 1994 1995 1996 1997
check-augeas-virtlockd: test_virtlockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
	fi

1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010
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

2011 2012 2013 2014 2015 2016 2017 2018 2019
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

2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038
#
# 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.
#

2039
if WITH_DRIVER_MODULES
2040
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
2041
else ! WITH_DRIVER_MODULES
2042
SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
2043
endif ! WITH_DRIVER_MODULES
2044

2045
if WITH_LINUX
2046
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
2047
else ! WITH_LINUX
2048
SYM_FILES += $(srcdir)/libvirt_linux.syms
2049
endif ! WITH_LINUX
2050

2051
if WITH_ESX
2052
USED_SYM_FILES += $(srcdir)/libvirt_esx.syms
2053
else ! WITH_ESX
2054
SYM_FILES += $(srcdir)/libvirt_esx.syms
2055
endif ! WITH_ESX
2056

E
Eric Blake 已提交
2057 2058 2059 2060 2061 2062
if WITH_REMOTE
USED_SYM_FILES += $(srcdir)/libvirt_remote.syms
else ! WITH_REMOTE
SYM_FILES += $(srcdir)/libvirt_remote.syms
endif ! WITH_REMOTE

2063
if WITH_OPENVZ
2064
USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms
2065
else ! WITH_OPENVZ
2066
SYM_FILES += $(srcdir)/libvirt_openvz.syms
2067
endif ! WITH_OPENVZ
2068

2069
if WITH_VMX
2070
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
2071
else ! WITH_VMX
2072
SYM_FILES += $(srcdir)/libvirt_vmx.syms
2073
endif ! WITH_VMX
2074

2075 2076 2077 2078 2079 2080
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 已提交
2081 2082 2083 2084 2085
if WITH_XENCONFIG
USED_SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
else ! WITH_XENCONFIG
SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
endif ! WITH_XENCONFIG
2086

2087 2088 2089 2090 2091 2092
if WITH_LIBXL
USED_SYM_FILES += $(srcdir)/libvirt_xenxlconfig.syms
else ! WITH_LIBXL
SYM_FILES += $(srcdir)/libvirt_xenxlconfig.syms
endif ! WITH_LIBXL

2093
if WITH_SASL
2094
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
2095
else ! WITH_SASL
2096
SYM_FILES += $(srcdir)/libvirt_sasl.syms
2097
endif ! WITH_SASL
E
Eric Blake 已提交
2098

2099 2100
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2101
else ! WITH_GNUTLS
2102
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2103
endif ! WITH_GNUTLS
2104

2105
if WITH_SSH2
2106
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2107
else ! WITH_SSH2
2108
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2109
endif ! WITH_SSH2
2110

2111
if WITH_ATOMIC_OPS_PTHREAD
2112
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
2113
else ! WITH_ATOMIC_OPS_PTHREAD
2114
SYM_FILES += $(srcdir)/libvirt_atomic.syms
2115
endif ! WITH_ATOMIC_OPS_PTHREAD
2116

2117
EXTRA_DIST += \
2118 2119 2120
	libvirt_public.syms		\
	libvirt_lxc.syms		\
	libvirt_qemu.syms		\
2121
	libvirt_admin_public.syms	\
2122
	$(SYM_FILES)			\
2123
	$(ADMIN_SYM_FILES)		\
2124
	$(NULL)
2125

2126
BUILT_SOURCES += $(GENERATED_SYM_FILES)
2127

2128 2129
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(ACCESS_DRIVER_SYM_FILES) \
2130
		$(top_builddir)/config.status
2131 2132 2133 2134 2135 2136
	$(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 && \
2137
	cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
2138 2139
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
2140
	mv $@-tmp libvirt.syms
2141

2142
%.def: %.syms
2143 2144
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
2145 2146
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d'	\
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
2147
	chmod a-w $@-tmp && \
2148
	mv $@-tmp $@
2149

2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162
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

2163 2164 2165 2166
# 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 已提交
2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190
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)			\
		$(AM_LDFLAGS) 						\
		$(CYGWIN_EXTRA_LDFLAGS) 				\
		$(MINGW_EXTRA_LDFLAGS)

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 += \
2191
		$(XDR_CFLAGS)			\
M
Martin Kletzander 已提交
2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206
		$(CAPNG_CFLAGS)			\
		$(YAJL_CFLAGS)			\
		$(SSH2_CFLAGS)			\
		$(SASL_CFLAGS)			\
		$(GNUTLS_CFLAGS)

libvirt_admin_la_LIBADD += \
		$(CAPNG_LIBS)			\
		$(YAJL_LIBS)			\
		$(DEVMAPPER_LIBS)		\
		$(LIBXML_LIBS)			\
		$(SSH2_LIBS)			\
		$(SASL_LIBS)			\
		$(GNUTLS_LIBS)

2207 2208
ADMIN_SYM_FILES = $(srcdir)/libvirt_admin_private.syms

M
Martin Kletzander 已提交
2209 2210 2211 2212
if WITH_DTRACE_PROBES
libvirt_admin_la_LIBADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

2213 2214
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
2215 2216 2217 2218 2219 2220 2221 2222
libvirt_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(LIBVIRT_NODELETE) \
		$(AM_LDFLAGS) \
		$(CYGWIN_EXTRA_LDFLAGS) \
		$(MINGW_EXTRA_LDFLAGS) \
		$(NULL)
2223
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
2224
libvirt_la_LIBADD += \
2225
		    $(DRIVER_MODULE_LIBS) \
2226
		    $(CYGWIN_EXTRA_LIBADD)
2227
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
2228 2229 2230 2231 2232 2233
# 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)
2234

2235
if WITH_DTRACE_PROBES
2236
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
2237
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
2238
nodist_libvirt_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2239
if WITH_REMOTE
E
Eric Blake 已提交
2240
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2241
endif WITH_REMOTE
2242 2243
if WITH_DRIVER_MODULES
DTRACE2SYSTEMTAP_FLAGS = --with-modules
2244
endif WITH_DRIVER_MODULES
2245

2246 2247 2248
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

if WITH_QEMU
2249
libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.lo
2250
nodist_libvirt_driver_qemu_la_SOURCES = libvirt_qemu_probes.h
2251
BUILT_SOURCES += libvirt_qemu_probes.h
2252
endif WITH_QEMU
2253 2254

tapsetdir = $(datadir)/systemtap/tapset
2255
tapset_DATA = libvirt_probes.stp libvirt_qemu_probes.stp libvirt_functions.stp
2256

2257
%_probes.h: %_probes.d
2258 2259
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

E
Eric Blake 已提交
2260
.PRECIOUS: %_probes.o
2261
%_probes.o: %_probes.d
2262 2263
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

2264 2265 2266 2267 2268 2269 2270 2271 2272
%_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 已提交
2273
# Keep this list synced with PROTOCOL_STRUCTS
J
Jiri Denemark 已提交
2274 2275 2276
RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
2277
		  $(srcdir)/remote/lxc_protocol.x \
2278 2279
		  $(srcdir)/remote/qemu_protocol.x \
		  $(srcdir)/lxc/lxc_monitor_protocol.x \
M
Martin Kletzander 已提交
2280 2281
		  $(srcdir)/locking/lock_protocol.x \
		  $(srcdir)/admin/admin_protocol.x
2282 2283

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

2286 2287
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl \
		$(top_builddir)/config.status
2288
	$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
2289
	  $(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
2290

2291
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
2292
              libvirt_qemu_probes.h libvirt_qemu_probes.o \
2293
              libvirt_qemu_probes.lo\
2294 2295
              libvirt_functions.stp libvirt_probes.stp \
              libvirt_qemu_probes.stp
2296
endif WITH_DTRACE_PROBES
2297

2298
EXTRA_DIST += libvirt_probes.d libvirt_qemu_probes.d
2299

C
Chris Lalancette 已提交
2300
libvirt_qemu_la_SOURCES = libvirt-qemu.c
D
Daniel P. Berrange 已提交
2301 2302 2303 2304 2305 2306 2307
libvirt_qemu_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(CYGWIN_EXTRA_LDFLAGS) \
		$(MINGW_EXTRA_LDFLAGS) \
		$(NULL)
2308
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
C
Chris Lalancette 已提交
2309
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
2310

2311
libvirt_lxc_la_SOURCES = libvirt-lxc.c
D
Daniel P. Berrange 已提交
2312 2313 2314 2315 2316 2317 2318
libvirt_lxc_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(CYGWIN_EXTRA_LDFLAGS) \
		$(MINGW_EXTRA_LDFLAGS) \
		$(NULL)
2319 2320 2321
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)

2322 2323 2324 2325 2326 2327 2328
# 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
2329
if WITH_SETUID_RPC_CLIENT
2330 2331 2332 2333
noinst_LTLIBRARIES += libvirt-setuid-rpc-client.la

libvirt_setuid_rpc_client_la_SOURCES = 		\
		util/viralloc.c			\
2334 2335
		util/viratomic.c		\
		util/viratomic.h		\
2336 2337
		util/virbitmap.c		\
		util/virbuffer.c		\
2338
		util/vircgroup.c		\
2339 2340
		util/vircommand.c		\
		util/virconf.c			\
2341
		util/virdbus.c			\
2342 2343 2344 2345
		util/virerror.c			\
		util/virevent.c			\
		util/vireventpoll.c		\
		util/virfile.c			\
2346
		util/virgettext.c		\
2347 2348
		util/virhash.c			\
		util/virhashcode.c		\
2349
		util/virhostcpu.c		\
2350 2351 2352 2353 2354 2355 2356 2357
		util/virjson.c			\
		util/virlog.c			\
		util/virobject.c		\
		util/virpidfile.c		\
		util/virprocess.c		\
		util/virrandom.c		\
		util/virsocketaddr.c		\
		util/virstring.c		\
2358
		util/virsystemd.c		\
2359 2360
		util/virtime.c			\
		util/virthread.c		\
2361
		util/virthreadjob.c		\
2362 2363 2364 2365 2366
		util/virtypedparam.c		\
		util/viruri.c			\
		util/virutil.c			\
		util/viruuid.c			\
		conf/domain_event.c		\
2367
		conf/network_event.c		\
2368
		conf/object_event.c		\
2369
		conf/storage_event.c            \
2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385
		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			\
2386
		libvirt-domain.c		\
2387
		libvirt-domain-snapshot.c	\
2388
		libvirt-host.c			\
2389
		libvirt-interface.c		\
2390
		libvirt-network.c		\
2391
		libvirt-nodedev.c		\
2392
		libvirt-nwfilter.c		\
2393
		libvirt-secret.c		\
2394
		libvirt-storage.c		\
2395
		libvirt-stream.c		\
2396 2397 2398 2399 2400 2401
		libvirt-lxc.c			\
		$(NULL)

libvirt_setuid_rpc_client_la_LDFLAGS =		\
		$(AM_LDFLAGS)			\
		$(LIBXML_LIBS)			\
J
Jim Fehlig 已提交
2402
		$(SECDRIVER_LIBS)		\
2403 2404 2405
		$(NULL)
libvirt_setuid_rpc_client_la_CFLAGS =		\
		-DLIBVIRT_SETUID_RPC_CLIENT	\
2406 2407
		-I$(srcdir)/conf		\
		-I$(srcdir)/rpc			\
2408
		$(AM_CFLAGS)			\
J
Jim Fehlig 已提交
2409
		$(SECDRIVER_CFLAGS)		\
P
Pavel Fedin 已提交
2410
		$(XDR_CFLAGS)			\
2411
		$(NULL)
2412
endif WITH_SETUID_RPC_CLIENT
2413

2414 2415 2416
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

2417
if WITH_LIBVIRTD
2418 2419 2420 2421 2422
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
		$(LOCK_DRIVER_LOCKD_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
		$(NULL)
2423
lockd_la_CFLAGS = -I$(srcdir)/conf \
E
Eric Blake 已提交
2424 2425
		$(XDR_CFLAGS) \
		$(AM_CFLAGS)
2426
lockd_la_LDFLAGS = -module -avoid-version
2427 2428 2429 2430
lockd_la_LIBADD = ../gnulib/lib/libgnu.la \
	libvirt-net-rpc.la \
	libvirt-net-rpc-client.la \
	$(NULL)
J
Jiri Denemark 已提交
2431
augeas_DATA += locking/libvirt_lockd.aug
2432 2433
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
2434
endif WITH_DTRACE_PROBES
2435
if WITH_QEMU
2436 2437
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
2438
nodist_conf_DATA += locking/qemu-lockd.conf
2439 2440
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
2441
endif WITH_QEMU
2442

2443 2444 2445 2446 2447 2448
if WITH_LIBXL
nodist_conf_DATA += locking/libxl-lockd.conf
BUILT_SOURCES += locking/libxl-lockd.conf
DISTCLEANFILES += locking/libxl-lockd.conf
endif WITH_LIBXL

2449 2450 2451 2452 2453
locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
	$(AM_V_GEN)$(MKDIR_P) locking ; \
	cp $< $@


2454
sbin_PROGRAMS = virtlockd virtlogd
2455

2456 2457 2458
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
2459
		$(LOCK_DAEMON_GENERATED) \
2460
		$(NULL)
2461 2462
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
2463
		$(PIE_CFLAGS) \
2464
		$(XDR_CFLAGS) \
2465 2466 2467
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
2468
		$(PIE_LDFLAGS) \
2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480
		$(CYGWIN_EXTRA_LDFLAGS) \
		$(MINGW_EXTRA_LDFLAGS) \
		$(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
2481
endif WITH_DTRACE_PROBES
2482

2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510

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) \
		$(CYGWIN_EXTRA_LDFLAGS) \
		$(MINGW_EXTRA_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

2511
else ! WITH_LIBVIRTD
2512
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
2513 2514
              $(LOCK_DRIVER_LOCKD_SOURCES) \
	      $(LOG_DAEMON_SOURCES)
2515
endif ! WITH_LIBVIRTD
2516

2517 2518
EXTRA_DIST += \
	locking/virtlockd.sysconf \
J
Jiri Denemark 已提交
2519 2520
	locking/lockd.conf \
	locking/libvirt_lockd.aug \
2521
	locking/test_libvirt_lockd.aug.in \
2522
	logging/virtlogd.sysconf
2523 2524

install-sysconfig:
E
Eric Blake 已提交
2525
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
2526 2527
	$(INSTALL_DATA) $(srcdir)/locking/virtlockd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
2528 2529
	$(INSTALL_DATA) $(srcdir)/logging/virtlogd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlogd
2530 2531

uninstall-sysconfig:
2532
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlogd
2533
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
E
Eric Blake 已提交
2534
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
2535

2536
EXTRA_DIST += locking/virtlockd.init.in logging/virtlogd.init.in
2537 2538 2539

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_RED_HAT
2540
install-init:: virtlockd.init virtlogd.init install-sysconfig
E
Eric Blake 已提交
2541
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
2542 2543
	$(INSTALL_SCRIPT) virtlockd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
2544 2545
	$(INSTALL_SCRIPT) virtlogd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlogd
2546 2547

uninstall-init:: uninstall-sysconfig
E
Eric Blake 已提交
2548
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
2549
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlogd
E
Eric Blake 已提交
2550
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
2551

2552 2553
BUILT_SOURCES += virtlockd.init virtlogd.init
DISTCLEANFILES += virtlockd.init virtlogd.init
2554
else ! LIBVIRT_INIT_SCRIPT_RED_HAT
2555 2556
install-init::
uninstall-init::
2557 2558
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
else ! WITH_LIBVIRTD
2559 2560
install-init::
uninstall-init::
2561
endif ! WITH_LIBVIRTD
2562 2563

virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
2564 2565 2566 2567 2568 2569
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g'		\
	    < $< > $@-t &&					\
	    chmod a+x $@-t &&					\
2570 2571
	    mv $@-t $@

2572 2573 2574 2575 2576 2577 2578 2579 2580
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 $@

2581
POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)"
2582

2583
virtlockd.8.in: locking/virtlockd.pod
2584 2585 2586 2587 2588 2589 2590 2591
	$(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 $@
2592

2593
virtlogd.8.in: logging/virtlogd.pod
2594 2595 2596 2597 2598 2599 2600 2601
	$(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 $@
2602

2603
%.8: %.8.in $(top_srcdir)/configure.ac
2604
	$(AM_V_GEN)sed \
2605 2606 2607
		-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
		-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
		< $< > $@-t && \
2608 2609
	mv $@-t $@

2610
if WITH_LIBVIRTD
2611
man8_MANS = virtlockd.8 virtlogd.8
2612

2613
conf_DATA += locking/virtlockd.conf logging/virtlogd.conf
2614

2615 2616
augeas_DATA += locking/virtlockd.aug logging/virtlogd.aug
augeastest_DATA += test_virtlockd.aug test_virtlogd.aug
2617
endif WITH_LIBVIRTD
2618

A
Andrea Bolognani 已提交
2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630
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)
2631 2632 2633 2634

EXTRA_DIST += \
        locking/virtlockd.service.in \
        locking/virtlockd.socket.in \
2635 2636 2637
        locking/virtlockd.aug \
        locking/virtlockd.conf \
        locking/test_virtlockd.aug.in \
2638 2639 2640 2641 2642
        logging/virtlogd.service.in \
        logging/virtlogd.socket.in \
        logging/virtlogd.aug \
        logging/virtlogd.conf \
        logging/test_virtlogd.aug.in \
A
Andrea Bolognani 已提交
2643 2644
        $(PODFILES) \
        $(MANINFILES) \
2645
        $(NULL)
2646

2647 2648 2649 2650

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

2651
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
2652

2653 2654 2655 2656
BUILT_SOURCES += virtlockd.service virtlockd.socket \
		 virtlogd.service virtlogd.socket
DISTCLEANFILES += virtlockd.service virtlockd.socket \
		  virtlogd.service virtlogd.socket
2657

2658 2659
install-systemd: virtlockd.service virtlockd.socket \
                 virtlogd.service virtlogd.socket install-sysconfig
E
Eric Blake 已提交
2660
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
2661
	$(INSTALL_DATA) virtlockd.service \
2662
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2663
	$(INSTALL_DATA) virtlockd.socket \
2664
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2665 2666 2667 2668
	$(INSTALL_DATA) virtlogd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
	$(INSTALL_DATA) virtlogd.socket \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2669 2670

uninstall-systemd: uninstall-sysconfig
E
Eric Blake 已提交
2671 2672
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.socket
2673 2674
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlogd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlogd.socket
E
Eric Blake 已提交
2675
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
2676
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
2677 2678
install-systemd:
uninstall-systemd:
2679 2680
endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
else ! WITH_LIBVIRTD
2681 2682
install-systemd:
uninstall-systemd:
2683
endif ! WITH_LIBVIRTD
2684 2685

virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
2686 2687 2688
	$(AM_V_GEN)sed						\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    < $< > $@-t &&					\
2689 2690 2691
	    mv $@-t $@

virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
2692 2693 2694
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    < $< > $@-t &&					\
2695 2696
	    mv $@-t $@

2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708
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 $@

2709

2710
if WITH_SANLOCK
2711
lockdriver_LTLIBRARIES += sanlock.la
2712
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
2713
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
2714
sanlock_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
2715
sanlock_la_LIBADD = -lsanlock_client \
2716 2717 2718
		../gnulib/lib/libgnu.la

augeas_DATA += locking/libvirt_sanlock.aug
2719 2720
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
2721

E
Eric Blake 已提交
2722
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
2723
	$(AM_V_GEN)$(MKDIR_P) locking ; \
2724 2725 2726
	cp $< $@

if WITH_QEMU
2727
nodist_conf_DATA += locking/qemu-sanlock.conf
2728
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
2729
DISTCLEANFILES += locking/qemu-sanlock.conf
2730
endif WITH_QEMU
2731 2732 2733 2734 2735 2736

if WITH_LIBXL
nodist_conf_DATA += locking/libxl-sanlock.conf
BUILT_SOURCES += locking/libxl-sanlock.conf
DISTCLEANFILES += locking/libxl-sanlock.conf
endif WITH_LIBXL
2737
else ! WITH_SANLOCK
2738
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
2739
endif ! WITH_SANLOCK
2740 2741
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
2742
	locking/test_libvirt_sanlock.aug.in
2743

2744 2745 2746 2747
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
2748

2749
EXTRA_DIST += \
E
Eric Blake 已提交
2750 2751 2752 2753
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
2754 2755
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
2756

E
Eric Blake 已提交
2757
VIR_NET_RPC_GENERATED = \
2758 2759 2760 2761
	rpc/virnetprotocol.h \
	rpc/virnetprotocol.c \
	rpc/virkeepaliveprotocol.h \
	rpc/virkeepaliveprotocol.c
2762

2763
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2764

2765
libvirt_net_rpc_la_SOURCES = \
2766
	rpc/virnetmessage.h rpc/virnetmessage.c \
2767
	rpc/virnetsocket.h rpc/virnetsocket.c \
2768 2769
	rpc/virkeepalive.h rpc/virkeepalive.c \
	$(VIR_NET_RPC_GENERATED)
2770
if WITH_SSH2
2771 2772
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2773
else ! WITH_SSH2
2774 2775
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2776
endif ! WITH_SSH2
2777
if WITH_GNUTLS
2778 2779
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2780
else ! WITH_GNUTLS
2781 2782
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2783
endif ! WITH_GNUTLS
2784
if WITH_SASL
2785 2786
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2787
else ! WITH_SASL
2788 2789
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2790
endif ! WITH_SASL
2791
libvirt_net_rpc_la_CFLAGS = \
2792
			$(GNUTLS_CFLAGS) \
2793
			$(SASL_CFLAGS) \
2794
			$(SSH2_CFLAGS) \
2795
			$(XDR_CFLAGS) \
2796 2797
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
2798
			$(GNUTLS_LIBS) \
2799
			$(SASL_LIBS) \
2800
			$(SSH2_LIBS)\
J
Jim Fehlig 已提交
2801
			$(SECDRIVER_LIBS) \
2802 2803 2804 2805 2806 2807
			$(AM_LDFLAGS) \
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2808 2809 2810 2811
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
2812
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
2813
	rpc/virnetdaemon.h rpc/virnetdaemon.c \
2814 2815
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
2816
			$(AVAHI_CFLAGS) \
2817
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
2818
			$(XDR_CFLAGS) \
2819
			$(AM_CFLAGS)
2820 2821
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
2822
			$(AVAHI_LIBS) \
2823
			$(DBUS_LIBS) \
2824 2825 2826 2827 2828
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2829 2830 2831 2832 2833
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 已提交
2834 2835
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
2836 2837 2838 2839 2840 2841
libvirt_net_rpc_client_la_LDFLAGS = \
			$(AM_LDFLAGS) \
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
2842

2843 2844
libexec_PROGRAMS =

2845
if WITH_LIBVIRTD
2846 2847
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2848 2849 2850 2851
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2852 2853 2854
libvirt_iohelper_LDADD =		\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
2855 2856
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
2857
endif WITH_DTRACE_PROBES
2858

D
Daniel P. Berrange 已提交
2859 2860 2861 2862
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2863 2864 2865 2866

if WITH_NETWORK
libexec_PROGRAMS += libvirt_leaseshelper
libvirt_leaseshelper_SOURCES = $(NETWORK_LEASES_HELPER_SOURCES)
2867 2868 2869 2870
libvirt_leaseshelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885
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

2886
endif WITH_LIBVIRTD
2887

2888
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
2889
if WITH_LIBVIRTD
2890
libexec_PROGRAMS += libvirt_parthelper
2891

2892
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
D
Daniel P. Berrange 已提交
2893 2894 2895 2896
libvirt_parthelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2897 2898 2899 2900
libvirt_parthelper_LDADD =		\
		$(LIBPARTED_LIBS)	\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
2901 2902
if WITH_DTRACE_PROBES
libvirt_parthelper_LDADD += libvirt_probes.lo
2903
endif WITH_DTRACE_PROBES
2904

D
Daniel P. Berrange 已提交
2905 2906 2907 2908 2909
libvirt_parthelper_CFLAGS = \
		$(LIBPARTED_CFLAGS) \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2910 2911
endif WITH_LIBVIRTD
endif WITH_STORAGE_DISK
2912 2913
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)

2914

2915
if WITH_SANLOCK
2916 2917 2918
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2919
libvirt_sanlock_helper_CFLAGS = \
2920
		-I$(srcdir)/conf \
D
Daniel P. Berrange 已提交
2921 2922 2923 2924 2925 2926 2927
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2928
libvirt_sanlock_helper_LDADD = libvirt.la
2929
endif WITH_SANLOCK
2930

2931 2932 2933 2934 2935 2936
if WITH_LXC
if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_lxc

libvirt_lxc_SOURCES =						\
		$(LXC_CONTROLLER_SOURCES)			\
O
Osier Yang 已提交
2937 2938
		$(NODE_INFO_SOURCES)				\
		$(DATATYPES_SOURCES)
D
Daniel P. Berrange 已提交
2939 2940 2941 2942
libvirt_lxc_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2943
libvirt_lxc_LDADD =			\
G
Gao feng 已提交
2944
		$(FUSE_LIBS) \
2945 2946
		libvirt-net-rpc-server.la \
		libvirt-net-rpc.la \
2947
		libvirt_security_manager.la \
2948 2949
		libvirt_conf.la \
		libvirt_util.la \
2950
		../gnulib/lib/libgnu.la
2951
if WITH_DTRACE_PROBES
2952
libvirt_lxc_LDADD += libvirt_probes.lo
2953
endif WITH_DTRACE_PROBES
2954
libvirt_lxc_LDADD += $(SECDRIVER_LIBS)
2955
libvirt_lxc_CFLAGS =				\
2956
		-I$(srcdir)/conf	\
2957
		$(AM_CFLAGS)                    \
D
Daniel P. Berrange 已提交
2958
		$(PIE_CFLAGS)			\
G
Gao feng 已提交
2959
		$(LIBNL_CFLAGS)			\
D
Daniel P. Berrange 已提交
2960
		$(FUSE_CFLAGS)			\
2961
		$(DBUS_CFLAGS)			\
P
Pavel Fedin 已提交
2962
		$(XDR_CFLAGS)			\
D
Daniel P. Berrange 已提交
2963
		$(NULL)
2964
if WITH_BLKID
2965 2966
libvirt_lxc_CFLAGS += $(BLKID_CFLAGS)
libvirt_lxc_LDADD += $(BLKID_LIBS)
2967
endif WITH_BLKID
J
Jim Fehlig 已提交
2968
libvirt_lxc_CFLAGS += $(SECDRIVER_CFLAGS)
2969 2970
endif WITH_LIBVIRTD
endif WITH_LXC
2971 2972
EXTRA_DIST += $(LXC_CONTROLLER_SOURCES)

J
Jamie Strandboge 已提交
2973 2974 2975 2976 2977 2978
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 已提交
2979 2980 2981 2982
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
J
Jamie Strandboge 已提交
2983
virt_aa_helper_LDADD =						\
2984
		libvirt.la					\
C
Chris Lalancette 已提交
2985 2986
		libvirt_conf.la					\
		libvirt_util.la					\
2987
		libvirt_driver_storage_impl.la			\
C
Chris Lalancette 已提交
2988
		../gnulib/lib/libgnu.la
2989
if WITH_DTRACE_PROBES
2990
virt_aa_helper_LDADD += libvirt_probes.lo
2991
endif WITH_DTRACE_PROBES
J
Jamie Strandboge 已提交
2992
virt_aa_helper_CFLAGS =						\
2993 2994 2995 2996
		-I$(srcdir)/conf				\
		-I$(srcdir)/security				\
		$(AM_CFLAGS) 					\
		$(PIE_CFLAGS) 					\
D
Daniel P. Berrange 已提交
2997
		$(NULL)
2998 2999
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
J
Jamie Strandboge 已提交
3000 3001
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058
noinst_LTLIBRARIES += libvirt-nss.la

libvirt_nss_la_SOURCES =		\
		util/viralloc.c			\
		util/viralloc.h			\
		util/virbitmap.c		\
		util/virbitmap.h		\
		util/virbuffer.c		\
		util/virbuffer.h		\
		util/vircommand.c		\
		util/vircommand.h		\
		util/virerror.c			\
		util/virerror.h			\
		util/virfile.c			\
		util/virfile.h			\
		util/virjson.c			\
		util/virjson.h			\
		util/virkmod.c			\
		util/virkmod.h			\
		util/virlease.c			\
		util/virlease.h			\
		util/virlog.c			\
		util/virlog.h			\
		util/virobject.c		\
		util/virobject.h		\
		util/virpidfile.c		\
		util/virpidfile.h		\
		util/virprocess.c		\
		util/virprocess.h		\
		util/virsocketaddr.c	\
		util/virsocketaddr.h	\
		util/virstring.c		\
		util/virstring.h		\
		util/virthread.c		\
		util/virthread.h		\
		util/virthreadjob.c		\
		util/virthreadjob.h		\
		util/virtime.c			\
		util/virtime.h			\
		util/virutil.c			\
		util/virutil.h			\
		$(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)


3059
install-data-local: install-init install-systemd
3060 3061
if WITH_LIBVIRTD
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
3062
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
3063
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
3064
endif WITH_LIBVIRTD
3065 3066
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
3067
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
3068
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
3069
if WITH_SANLOCK
3070
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
3071
endif WITH_SANLOCK
3072
if WITH_QEMU
3073
	$(MKDIR_P) -m 0751 "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu"
3074
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu"
3075
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu"
3076
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu"
3077
endif WITH_QEMU
3078 3079 3080
if WITH_LXC
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lxc"
3081
endif WITH_LXC
J
Jim Fehlig 已提交
3082 3083 3084
if WITH_LIBXL
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/libxl"
J
Jim Fehlig 已提交
3085
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl"
3086
endif WITH_LIBXL
3087 3088 3089
if WITH_UML
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/uml"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/uml"
3090
endif WITH_UML
3091 3092
if WITH_XEN
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/xen"
3093
endif WITH_XEN
3094 3095
if WITH_NETWORK
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network"
3096
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq"
3097
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/network"
3098
	$(MKDIR_P) "$(DESTDIR)$(confdir)/qemu/networks/autostart"
3099
	$(INSTALL_DATA) $(srcdir)/network/default.xml \
3100
	  $(DESTDIR)$(confdir)/qemu/networks/default.xml
3101
	test -z "$(UUID)" || \
3102 3103 3104
	  { sed -e "s,</name>,</name>;  <uuid>$(UUID)</uuid>," \
	      $(DESTDIR)$(confdir)/qemu/networks/default.xml | \
	      tr ";" "\n" > \
3105 3106 3107 3108
	      $(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 已提交
3109
	( cd $(DESTDIR)$(confdir)/qemu/networks/autostart && \
3110 3111
	  rm -f default.xml && \
	  $(LN_S) ../default.xml default.xml )
3112
endif WITH_NETWORK
3113

3114
uninstall-local:: uninstall-init uninstall-systemd
3115
if WITH_LIBVIRTD
3116
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
3117 3118
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
3119
endif WITH_LIBVIRTD
3120 3121
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
3122
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
3123
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
3124
if WITH_SANLOCK
3125
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
3126
endif WITH_SANLOCK
3127 3128 3129 3130 3131
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" ||:
3132
endif WITH_QEMU
3133 3134 3135
if WITH_LXC
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||:
3136
endif WITH_LXC
J
Jim Fehlig 已提交
3137 3138 3139
if WITH_LIBXL
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||:
J
Jim Fehlig 已提交
3140
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||:
3141
endif WITH_LIBXL
3142 3143 3144
if WITH_UML
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/uml" ||:
3145
endif WITH_UML
3146 3147
if WITH_XEN
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/xen" ||:
3148
endif WITH_XEN
3149
if WITH_NETWORK
3150 3151 3152 3153
	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" || :
3154 3155
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||:
3156
endif WITH_NETWORK
3157
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
3158

3159 3160
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
3161
MAINTAINERCLEANFILES += $(REMOTE_DRIVER_GENERATED) $(VIR_NET_RPC_GENERATED)