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

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

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

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

40
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_MODULES_LDFLAGS)			\
G
Guido Günther 已提交
46 47
		$(COVERAGE_LDFLAGS)				\
		$(RELRO_LDFLAGS)				\
48
		$(NO_INDIRECT_LDFLAGS)				\
49 50
		$(CYGWIN_EXTRA_LDFLAGS) 			\
		$(MINGW_EXTRA_LDFLAGS)				\
G
Guido Günther 已提交
51
		$(NULL)
52

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

55
BUILT_SOURCES =
56 57 58
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
59
nodist_conf_DATA =
60

E
Eric Blake 已提交
61 62
THREAD_LIBS = $(LIB_PTHREAD) $(LTLIBMULTITHREAD)

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

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

78
lib_LTLIBRARIES = libvirt.la libvirt-qemu.la libvirt-lxc.la
79

80
moddir = $(libdir)/libvirt/connection-driver
81 82
mod_LTLIBRARIES =

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

86 87 88 89 90 91
augeasdir = $(datadir)/augeas/lenses
augeas_DATA =

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

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

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

E
Eric Blake 已提交
193
BUILT_SOURCES += util/virkeymaps.h
194
MAINTAINERCLEANFILES += util/virkeymaps.h
195

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

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

238 239 240
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

241 242
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
243

244
LOCK_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
245 246
		locking/lock_protocol.h \
		locking/lock_protocol.c \
247 248
		$(NULL)

249 250 251
LOCK_PROTOCOL = $(srcdir)/locking/lock_protocol.x
EXTRA_DIST += $(LOCK_PROTOCOL) \
	$(LOCK_PROTOCOL_GENERATED)
252 253 254
BUILT_SOURCES += $(LOCK_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(LOCK_PROTOCOL_GENERATED)

255
LOCK_DAEMON_GENERATED = \
256
		locking/lock_daemon_dispatch_stubs.h
257 258 259
		$(NULL)

BUILT_SOURCES += $(LOCK_DAEMON_GENERATED)
260
EXTRA_DIST += $(LOCK_DAEMON_GENERATED)
261 262
MAINTAINERCLEANFILES += $(LOCK_DAEMON_GENERATED)

263 264
LOCK_DRIVER_LOCKD_SOURCES = \
		locking/lock_driver_lockd.c \
265
		locking/lock_driver_lockd.h \
266 267
		$(NULL)

268 269 270 271 272
LOCK_DAEMON_SOURCES = \
		locking/lock_daemon.h \
		locking/lock_daemon.c \
		locking/lock_daemon_config.h \
		locking/lock_daemon_config.c \
273 274
		locking/lock_daemon_dispatch.c \
		locking/lock_daemon_dispatch.h \
275 276
		$(NULL)

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


284 285 286 287 288
LOG_PROTOCOL_GENERATED = \
		logging/log_protocol.h \
		logging/log_protocol.c \
		$(NULL)

289 290
DRIVER_SOURCES += $(LOG_PROTOCOL_GENERATED)

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


323 324
NETDEV_CONF_SOURCES =						\
		conf/netdev_bandwidth_conf.h conf/netdev_bandwidth_conf.c \
325 326
		conf/netdev_vport_profile_conf.h conf/netdev_vport_profile_conf.c \
		conf/netdev_vlan_conf.h conf/netdev_vlan_conf.c
327

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

341 342 343 344
OBJECT_EVENT_SOURCES =						\
		conf/object_event.c conf/object_event.h \
		conf/object_event_private.h

345 346
DOMAIN_EVENT_SOURCES =						\
		conf/domain_event.c conf/domain_event.h
347

348 349 350
NETWORK_EVENT_SOURCES =						\
		conf/network_event.c conf/network_event.h

351 352 353
STORAGE_EVENT_SOURCES =						\
                conf/storage_event.c conf/storage_event.h

354 355 356
NODE_DEVICE_EVENT_SOURCES =					\
                conf/node_device_event.c conf/node_device_event.h

357 358 359
SECRET_EVENT_SOURCES =					\
                conf/secret_event.c conf/secret_event.h

360
# Network driver generic impl APIs
361
NETWORK_CONF_SOURCES =						\
362 363
		conf/network_conf.c conf/network_conf.h \
		conf/networkcommon_conf.c conf/networkcommon_conf.h
364

365 366
# Network filter driver generic impl APIs
NWFILTER_PARAM_CONF_SOURCES =					\
367
		conf/nwfilter_params.c conf/nwfilter_params.h	\
368 369
		conf/nwfilter_ipaddrmap.c			\
		conf/nwfilter_ipaddrmap.h			\
370
		conf/nwfilter_conf.h
371

372
NWFILTER_CONF_SOURCES =						\
373 374 375
		$(NWFILTER_PARAM_CONF_SOURCES)			\
		conf/nwfilter_conf.c conf/nwfilter_conf.h

376
# Storage driver generic impl APIs
377 378
STORAGE_CONF_SOURCES =                                         \
		conf/storage_conf.h conf/storage_conf.c
379

380
# Interface driver generic impl APIs
381 382
INTERFACE_CONF_SOURCES =                                       \
		conf/interface_conf.c conf/interface_conf.h
383

384
# Secret driver generic impl APIs
385
SECRET_CONF_SOURCES =                                          \
386 387
		conf/secret_conf.h conf/secret_conf.c          \
		conf/virsecretobj.h conf/virsecretobj.c
388 389 390 391 392

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

393 394
CPU_CONF_SOURCES =						\
		conf/cpu_conf.c conf/cpu_conf.h
395

396 397
# Safe character device handling helper APIs
CHRDEV_CONF_SOURCES =						\
398
		conf/virchrdev.c conf/virchrdev.h
399

400 401 402 403
# Device Helper APIs
DEVICE_CONF_SOURCES =                                           \
		conf/device_conf.c conf/device_conf.h

404
CONF_SOURCES =							\
405
		$(NETDEV_CONF_SOURCES)				\
406
		$(DOMAIN_CONF_SOURCES)				\
407
		$(OBJECT_EVENT_SOURCES)				\
408
		$(DOMAIN_EVENT_SOURCES)				\
409
		$(NETWORK_EVENT_SOURCES)			\
410
		$(STORAGE_EVENT_SOURCES)			\
411
		$(NODE_DEVICE_EVENT_SOURCES)			\
412
		$(SECRET_EVENT_SOURCES)				\
413
		$(NETWORK_CONF_SOURCES)				\
414
		$(NWFILTER_CONF_SOURCES)			\
415 416 417
		$(NODE_DEVICE_CONF_SOURCES)			\
		$(STORAGE_CONF_SOURCES)				\
		$(INTERFACE_CONF_SOURCES)			\
418
		$(SECRET_CONF_SOURCES)				\
419
		$(CPU_CONF_SOURCES)				\
420
		$(CHRDEV_CONF_SOURCES)				\
421
		$(DEVICE_CONF_SOURCES)
422

423
# The remote RPC driver, covering domains, storage, networks, etc
424
REMOTE_DRIVER_GENERATED = \
E
Eric Blake 已提交
425 426 427 428 429 430 431 432 433 434
		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 已提交
435 436

REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x
437
LXC_PROTOCOL = $(srcdir)/remote/lxc_protocol.x
E
Eric Blake 已提交
438
QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x
439
REMOTE_DRIVER_PROTOCOL = $(REMOTE_PROTOCOL) $(QEMU_PROTOCOL) $(LXC_PROTOCOL)
440

E
Eric Blake 已提交
441
remote/remote_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
442
		$(REMOTE_PROTOCOL) Makefile.am
443
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
444 445
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/remote/remote_client_bodies.h
446

E
Eric Blake 已提交
447
remote/lxc_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
448
		$(LXC_PROTOCOL) Makefile.am
449
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
450 451
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/remote/lxc_client_bodies.h
452

E
Eric Blake 已提交
453
remote/qemu_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
454
		$(QEMU_PROTOCOL) Makefile.am
455
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
456 457
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/remote/qemu_client_bodies.h
458 459 460 461

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

463
EXTRA_DIST +=  $(REMOTE_DRIVER_PROTOCOL) \
464
		$(REMOTE_DRIVER_GENERATED)
465

M
Martin Kletzander 已提交
466 467 468 469
ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x

ADMIN_PROTOCOL_GENERATED = \
		admin/admin_protocol.c	\
470 471 472 473 474 475 476 477
		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 已提交
478 479 480 481 482

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

483 484 485 486 487 488 489 490 491 492
# 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
493 494 495 496

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

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

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

E
Eric Blake 已提交
575
# Keep this list synced with RPC_PROBE_FILES
576 577
PROTOCOL_STRUCTS = \
	$(srcdir)/remote_protocol-structs \
578
	$(srcdir)/lxc_protocol-structs \
579
	$(srcdir)/qemu_protocol-structs \
J
Jiri Denemark 已提交
580
	$(srcdir)/virnetprotocol-structs \
E
Eric Blake 已提交
581 582 583
	$(srcdir)/virkeepaliveprotocol-structs \
	$(srcdir)/lxc_monitor_protocol-structs \
	$(srcdir)/lock_protocol-structs \
M
Martin Kletzander 已提交
584
	$(srcdir)/admin_protocol-structs \
E
Eric Blake 已提交
585 586
	$(NULL)

587
if WITH_REMOTE
588 589
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)

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

610
else !WITH_REMOTE
611 612 613
# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be
# re-generated when configured --without-remote.
check-protocol:
614
endif !WITH_REMOTE
J
Jiri Denemark 已提交
615
EXTRA_DIST += $(PROTOCOL_STRUCTS)
616 617 618 619 620

check-drivername:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-drivername.pl \
		$(srcdir)/driver.h \
		$(srcdir)/libvirt_public.syms \
621
		$(srcdir)/libvirt_admin_public.syms \
622 623 624 625 626
		$(srcdir)/libvirt_qemu.syms \
		$(srcdir)/libvirt_lxc.syms

EXTRA_DIST += check-drivername.pl

627
DRIVER_SOURCE_FILES = \
628 629 630 631 632 633 634 635 636 637 638
	$(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) \
639
	$(VZ_DRIVER_SOURCES) \
640 641 642 643 644 645 646 647
	$(PHYP_DRIVER_SOURCES) \
	$(QEMU_DRIVER_SOURCES) \
	$(REMOTE_DRIVER_SOURCES) \
	$(SECRET_DRIVER_SOURCES) \
	$(STORAGE_DRIVER_SOURCES) \
	$(TEST_DRIVER_SOURCES) \
	$(UML_DRIVER_SOURCES) \
	$(VBOX_DRIVER_SOURCES) \
648
	vbox/vbox_tmpl.c \
649 650 651
	$(VMWARE_DRIVER_SOURCES) \
	$(XEN_DRIVER_SOURCES) \
	$(XENAPI_DRIVER_SOURCES) \
652 653
	$(NULL)

654
STATEFUL_DRIVER_SOURCE_FILES = \
R
Roman Bogorodskiy 已提交
655
	$(BHYVE_DRIVER_SOURCES) \
656 657 658 659 660 661 662 663 664 665 666
	$(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) \
667
	$(VZ_DRIVER_SOURCES) \
668 669
	$(NULL)

670 671 672

check-driverimpls:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-driverimpls.pl \
673
		$(filter /%,$(DRIVER_SOURCE_FILES)) \
E
Eric Blake 已提交
674 675 676
		$(filter $(srcdir)/%,$(DRIVER_SOURCE_FILES)) \
		$(addprefix $(srcdir)/,$(filter-out $(srcdir)/%, \
			$(filter-out /%,$(DRIVER_SOURCE_FILES))))
677

678 679
check-aclrules:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclrules.pl \
E
Eric Blake 已提交
680
		$(REMOTE_PROTOCOL) \
681
		$(addprefix $(srcdir)/,$(filter-out /%,$(STATEFUL_DRIVER_SOURCE_FILES)))
682

683 684 685 686 687
check-aclperms:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclperms.pl \
		$(srcdir)/access/viraccessperm.h \
		$(srcdir)/access/viraccessperm.c

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

690
check-local: check-protocol check-symfile check-symsorting \
691
	check-drivername check-driverimpls check-aclrules \
692
	check-aclperms check-admin-symfile check-admin-symsorting
693
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
694

695 696
# Mock driver, covering domains, storage, networks, etc
TEST_DRIVER_SOURCES =						\
697
		test/test_driver.c test/test_driver.h
D
Daniel P. Berrange 已提交
698
TEST_DRIVER_ASSETS = test/test-screenshot.png
699 700 701

# Now the Hypervisor specific drivers
XEN_DRIVER_SOURCES =						\
702 703 704 705 706 707
		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
708
if WITH_XEN_INOTIFY
709
XEN_DRIVER_SOURCES += xen/xen_inotify.c xen/xen_inotify.h
710
endif WITH_XEN_INOTIFY
711

712
LXC_MONITOR_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
713 714
	lxc/lxc_monitor_protocol.h \
	lxc/lxc_monitor_protocol.c \
715 716 717
	$(NULL)

LXC_MONITOR_GENERATED = \
E
Eric Blake 已提交
718
	lxc/lxc_monitor_dispatch.h \
719 720 721
	$(NULL)

LXC_CONTROLLER_GENERATED = \
E
Eric Blake 已提交
722
	lxc/lxc_controller_dispatch.h \
723 724 725
	$(NULL)

LXC_GENERATED = \
726
	$(LXC_MONITOR_PROTOCOL_GENERATED) \
727 728 729 730
	$(LXC_MONITOR_GENERATED) \
	$(LXC_CONTROLLER_GENERATED) \
	$(NULL)

731
LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x
732

E
Eric Blake 已提交
733
lxc/lxc_monitor_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
734
		$(LXC_MONITOR_PROTOCOL) Makefile.am
735
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
736 737
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_monitor_dispatch.h
738

E
Eric Blake 已提交
739
lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
740
		$(REMOTE_PROTOCOL) Makefile.am
741
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \
E
Eric Blake 已提交
742 743
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_controller_dispatch.h
744 745

EXTRA_DIST += \
746
	$(LXC_MONITOR_PROTOCOL) \
747 748 749 750 751
	$(LXC_GENERATED) \
	$(NULL)

BUILT_SOURCES += $(LXC_GENERATED)

752 753
CLEANFILES += $(LXC_GENERATED)

754
LXC_DRIVER_SOURCES =						\
755
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
756
		$(LXC_MONITOR_GENERATED)			\
757 758
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
759
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
760
		lxc/lxc_domain.c lxc/lxc_domain.h		\
761
		lxc/lxc_hostdev.c lxc/lxc_hostdev.h		\
762
		lxc/lxc_monitor.c lxc/lxc_monitor.h		\
763
		lxc/lxc_process.c lxc/lxc_process.h		\
G
Gao feng 已提交
764
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
765
		lxc/lxc_native.c lxc/lxc_native.h		\
766
		lxc/lxc_driver.c lxc/lxc_driver.h
767

768
LXC_CONTROLLER_SOURCES =					\
769
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
770
		$(LXC_CONTROLLER_GENERATED)			\
771 772
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
773
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
774
		lxc/lxc_domain.c lxc/lxc_domain.h		\
G
Gao feng 已提交
775
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
776
		lxc/lxc_controller.c
777

J
Jamie Strandboge 已提交
778
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES =			\
E
Eric Blake 已提交
779
		$(DATATYPES_SOURCES)				\
J
Jamie Strandboge 已提交
780 781
		security/virt-aa-helper.c

782 783 784
PHYP_DRIVER_SOURCES =						\
		phyp/phyp_driver.c phyp/phyp_driver.h

785
OPENVZ_DRIVER_SOURCES =						\
786
		openvz/openvz_conf.c openvz/openvz_conf.h	\
787 788
		openvz/openvz_driver.c openvz/openvz_driver.h   \
		openvz/openvz_util.c openvz/openvz_util.h
789

E
Eric Blake 已提交
790
VMWARE_DRIVER_SOURCES =						\
791
		vmware/vmware_driver.c vmware/vmware_driver.h	\
792 793
		vmware/vmware_conf.c vmware/vmware_conf.h

794
VBOX_DRIVER_SOURCES =						\
E
Eric Blake 已提交
795 796
	vbox/vbox_glue.c vbox/vbox_glue.h			\
	vbox/vbox_driver.c vbox/vbox_driver.h			\
T
Taowei 已提交
797
	vbox/vbox_snapshot_conf.c vbox/vbox_snapshot_conf.h     \
798
	vbox/vbox_V4_0.c vbox/vbox_CAPI_v4_0.h			\
799
	vbox/vbox_V4_1.c vbox/vbox_CAPI_v4_1.h			\
R
Ryota Ozaki 已提交
800
	vbox/vbox_V4_2.c vbox/vbox_CAPI_v4_2.h			\
T
Taowei 已提交
801
	vbox/vbox_V4_2_20.c vbox/vbox_CAPI_v4_2_20.h		\
802
	vbox/vbox_V4_3.c vbox/vbox_CAPI_v4_3.h			\
T
Taowei 已提交
803
	vbox/vbox_V4_3_4.c vbox/vbox_CAPI_v4_3_4.h              \
M
Martin Pietsch 已提交
804
	vbox/vbox_V5_0.c vbox/vbox_CAPI_v5_0.h			\
805
	vbox/vbox_V5_1.c vbox/vbox_CAPI_v5_1.h			\
T
Taowei 已提交
806 807
	vbox/vbox_common.c vbox/vbox_common.h                   \
	vbox/vbox_uniformed_api.h                               \
808 809 810
	vbox/vbox_get_driver.h					\
	vbox/vbox_network.c					\
	vbox/vbox_storage.c
T
Taowei Luo 已提交
811

E
Eric Blake 已提交
812
VBOX_DRIVER_EXTRA_DIST =					\
813 814 815
		vbox/vbox_tmpl.c vbox/README			\
		vbox/vbox_MSCOMGlue.c vbox/vbox_MSCOMGlue.h	\
		vbox/vbox_XPCOMCGlue.c vbox/vbox_XPCOMCGlue.h
816

O
Osier Yang 已提交
817 818
QEMU_DRIVER_SOURCES =							\
		qemu/qemu_agent.c qemu/qemu_agent.h			\
819
		qemu/qemu_alias.c qemu/qemu_alias.h			\
820
		qemu/qemu_blockjob.c qemu/qemu_blockjob.h		\
O
Osier Yang 已提交
821 822
		qemu/qemu_capabilities.c qemu/qemu_capabilities.h	\
		qemu/qemu_command.c qemu/qemu_command.h			\
823
		qemu/qemu_parse_command.c qemu/qemu_parse_command.h	\
O
Osier Yang 已提交
824
		qemu/qemu_domain.c qemu/qemu_domain.h			\
825
		qemu/qemu_domain_address.c qemu/qemu_domain_address.h	\
O
Osier Yang 已提交
826 827 828
		qemu/qemu_cgroup.c qemu/qemu_cgroup.h			\
		qemu/qemu_hostdev.c qemu/qemu_hostdev.h			\
		qemu/qemu_hotplug.c qemu/qemu_hotplug.h			\
829
		qemu/qemu_hotplugpriv.h					\
O
Osier Yang 已提交
830 831
		qemu/qemu_conf.c qemu/qemu_conf.h			\
		qemu/qemu_process.c qemu/qemu_process.h			\
832
		qemu/qemu_processpriv.h					\
O
Osier Yang 已提交
833 834 835 836 837 838
		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				\
839
		qemu/qemu_driver.c qemu/qemu_driver.h	\
840
		qemu/qemu_interface.c qemu/qemu_interface.h		\
841 842
		qemu/qemu_capspriv.h					\
		qemu/qemu_security.c qemu/qemu_security.h
R
Richard W.M. Jones 已提交
843

O
Osier Yang 已提交
844
XENAPI_DRIVER_SOURCES =						\
845
		xenapi/xenapi_driver.c xenapi/xenapi_driver.h	\
O
Osier Yang 已提交
846
		xenapi/xenapi_driver_private.h			\
847 848
		xenapi/xenapi_utils.c xenapi/xenapi_utils.h

849 850 851 852 853
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       	\
854
		libxl/libxl_logger.c libxl/libxl_logger.h           \
J
Jim Fehlig 已提交
855
		libxl/libxl_migration.c libxl/libxl_migration.h
J
Jim Fehlig 已提交
856

857
UML_DRIVER_SOURCES =						\
D
Daniel P. Berrange 已提交
858 859
		uml/uml_conf.c uml/uml_conf.h			\
		uml/uml_driver.c uml/uml_driver.h
860

O
Osier Yang 已提交
861 862 863 864 865 866
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	\
867
		esx/esx_storage_backend_vmfs.c esx/esx_storage_backend_vmfs.h	\
868
		esx/esx_storage_backend_iscsi.c esx/esx_storage_backend_iscsi.h	\
869
		esx/esx_stream.c esx/esx_stream.h			\
O
Osier Yang 已提交
870 871 872
		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		\
873
		esx/esx_vi_types.c esx/esx_vi_types.h
874

875
ESX_DRIVER_GENERATED =							\
876 877
		esx/esx_vi_methods.generated.c				\
		esx/esx_vi_methods.generated.h				\
878
		esx/esx_vi_methods.generated.macro			\
879 880 881 882 883
		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			\
884 885 886
		esx/esx_vi_types.generated.typefromstring		\
		esx/esx_vi.generated.c					\
		esx/esx_vi.generated.h
887

O
Osier Yang 已提交
888
ESX_DRIVER_EXTRA_DIST =							\
889 890 891 892 893
		esx/README						\
		esx/esx_vi_generator.input				\
		esx/esx_vi_generator.py					\
		$(ESX_DRIVER_GENERATED)

O
Osier Yang 已提交
894
HYPERV_DRIVER_SOURCES =									\
M
Matthias Bolte 已提交
895 896
		hyperv/hyperv_private.h							\
		hyperv/hyperv_driver.c hyperv/hyperv_driver.h				\
897
		hyperv/hyperv_util.c hyperv/hyperv_util.h				\
898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913
		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)

914
VZ_DRIVER_SOURCES =				\
915 916 917 918 919 920
		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 已提交
921

R
Roman Bogorodskiy 已提交
922
BHYVE_DRIVER_SOURCES =						\
923 924
		bhyve/bhyve_capabilities.c			\
		bhyve/bhyve_capabilities.h			\
R
Roman Bogorodskiy 已提交
925 926
		bhyve/bhyve_command.c				\
		bhyve/bhyve_command.h				\
927 928
		bhyve/bhyve_parse_command.c			\
		bhyve/bhyve_parse_command.h			\
929 930 931 932
		bhyve/bhyve_device.c				\
		bhyve/bhyve_device.h				\
		bhyve/bhyve_domain.c				\
		bhyve/bhyve_domain.h				\
R
Roman Bogorodskiy 已提交
933 934
		bhyve/bhyve_driver.h				\
		bhyve/bhyve_driver.c				\
935 936
		bhyve/bhyve_monitor.c				\
		bhyve/bhyve_monitor.h				\
R
Roman Bogorodskiy 已提交
937 938 939 940 941
		bhyve/bhyve_process.c				\
		bhyve/bhyve_process.h				\
		bhyve/bhyve_utils.h				\
		$(NULL)

942
NETWORK_DRIVER_SOURCES =					\
943 944 945 946 947
		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
948

949 950 951 952
INTERFACE_DRIVER_SOURCES =

if WITH_INTERFACE
INTERFACE_DRIVER_SOURCES +=					\
953 954
		interface/interface_driver.h        \
		interface/interface_driver.c
955 956 957 958

if WITH_NETCF
INTERFACE_DRIVER_SOURCES +=					\
		interface/interface_backend_netcf.c
959
endif WITH_NETCF
960
if WITH_UDEV
961 962
INTERFACE_DRIVER_SOURCES +=					\
		interface/interface_backend_udev.c
963 964
endif WITH_UDEV
endif WITH_INTERFACE
965

966 967 968
SECRET_UTIL_SOURCES =						\
		secret/secret_util.h secret/secret_util.c

969
SECRET_DRIVER_SOURCES =						\
970
		secret/secret_driver.h secret/secret_driver.c
971

972
# Storage backend specific impls
O
Osier Yang 已提交
973 974
STORAGE_DRIVER_SOURCES =						\
		storage/storage_driver.h storage/storage_driver.c	\
975 976
		storage/storage_backend.h storage/storage_backend.c \
		storage/storage_util.h storage/storage_util.c
977 978

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

981
STORAGE_DRIVER_LVM_SOURCES =					\
O
Osier Yang 已提交
982
		storage/storage_backend_logical.h		\
983
		storage/storage_backend_logical.c
984 985

STORAGE_DRIVER_ISCSI_SOURCES =					\
986
		storage/storage_backend_iscsi.h storage/storage_backend_iscsi.c
987

988
STORAGE_DRIVER_SCSI_SOURCES =					\
989
		storage/storage_backend_scsi.h storage/storage_backend_scsi.c
990

D
Dave Allan 已提交
991
STORAGE_DRIVER_MPATH_SOURCES =					\
992
		storage/storage_backend_mpath.h storage/storage_backend_mpath.c
D
Dave Allan 已提交
993

994
STORAGE_DRIVER_DISK_SOURCES =					\
995
		storage/storage_backend_disk.h storage/storage_backend_disk.c
996

997 998 999
STORAGE_DRIVER_RBD_SOURCES =					\
		storage/storage_backend_rbd.h storage/storage_backend_rbd.c

1000
STORAGE_DRIVER_SHEEPDOG_SOURCES =				\
1001 1002
		storage/storage_backend_sheepdog.h storage/storage_backend_sheepdog.c \
		storage/storage_backend_sheepdog_priv.h
1003

1004 1005 1006
STORAGE_DRIVER_GLUSTER_SOURCES =				\
		storage/storage_backend_gluster.h storage/storage_backend_gluster.c

R
Roman Bogorodskiy 已提交
1007 1008 1009
STORAGE_DRIVER_ZFS_SOURCES =					\
                storage/storage_backend_zfs.h storage/storage_backend_zfs.c

1010
STORAGE_HELPER_DISK_SOURCES =					\
1011
		storage/parthelper.c
1012

1013 1014 1015
UTIL_IO_HELPER_SOURCES =					\
		util/iohelper.c

1016 1017 1018
NETWORK_LEASES_HELPER_SOURCES =                                 \
               network/leaseshelper.c

1019
# Network filters
O
Osier Yang 已提交
1020
NWFILTER_DRIVER_SOURCES =						\
1021
		nwfilter/nwfilter_driver.h nwfilter/nwfilter_driver.c	\
1022
		nwfilter/nwfilter_tech_driver.h				\
1023 1024
		nwfilter/nwfilter_gentech_driver.c			\
		nwfilter/nwfilter_gentech_driver.h			\
S
Stefan Berger 已提交
1025 1026
		nwfilter/nwfilter_dhcpsnoop.c				\
		nwfilter/nwfilter_dhcpsnoop.h				\
1027
		nwfilter/nwfilter_ebiptables_driver.c			\
1028 1029 1030
		nwfilter/nwfilter_ebiptables_driver.h			\
		nwfilter/nwfilter_learnipaddr.c				\
		nwfilter/nwfilter_learnipaddr.h
1031

1032

1033
# Security framework and drivers for various models
O
Osier Yang 已提交
1034 1035 1036 1037 1038
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		\
1039
		security/security_manager.h security/security_manager.c
1040

1041
SECURITY_DRIVER_SELINUX_SOURCES =				\
1042
		security/security_selinux.h security/security_selinux.c
1043

J
Jamie Strandboge 已提交
1044 1045 1046
SECURITY_DRIVER_APPARMOR_SOURCES =				\
		security/security_apparmor.h security/security_apparmor.c

1047
ACCESS_DRIVER_GENERATED = \
E
Eric Blake 已提交
1048 1049 1050 1051 1052 1053 1054
		access/viraccessapicheck.h \
		access/viraccessapicheck.c \
		access/viraccessapicheckqemu.h \
		access/viraccessapicheckqemu.c \
		access/viraccessapichecklxc.h \
		access/viraccessapichecklxc.c \
		$(NULL)
1055

1056
ACCESS_DRIVER_SYM_FILES = \
1057 1058 1059
		libvirt_access.syms \
		libvirt_access_qemu.syms \
		libvirt_access_lxc.syms
1060

1061 1062 1063 1064 1065
ACCESS_DRIVER_API_FILES = \
		libvirt_access.xml \
		libvirt_access_qemu.xml \
		libvirt_access_lxc.xml

1066 1067 1068 1069 1070 1071 1072
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

1073 1074 1075 1076
ACCESS_DRIVER_POLKIT_SOURCES = \
		access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c

ACCESS_DRIVER_POLKIT_POLICY = \
1077
		$(srcdir)/access/org.libvirt.api.policy
1078 1079


1080
NODE_DEVICE_DRIVER_SOURCES =					\
O
Osier Yang 已提交
1081 1082
		node_device/node_device_driver.c		\
		node_device/node_device_driver.h		\
1083 1084
		node_device/node_device_linux_sysfs.c           \
		node_device/node_device_linux_sysfs.h
1085 1086

NODE_DEVICE_DRIVER_HAL_SOURCES =				\
1087
		node_device/node_device_hal.c			\
1088
		node_device/node_device_hal.h
1089

1090
NODE_DEVICE_DRIVER_UDEV_SOURCES =				\
D
Daniel Veillard 已提交
1091 1092
		node_device/node_device_udev.c			\
		node_device/node_device_udev.h
1093

J
Jiri Denemark 已提交
1094 1095 1096
CPU_SOURCES =							\
		cpu/cpu.h cpu/cpu.c				\
		cpu/cpu_x86.h cpu/cpu_x86.c cpu/cpu_x86_data.h	\
T
Thang Pham 已提交
1097
		cpu/cpu_s390.h cpu/cpu_s390.c			\
C
Chuck Short 已提交
1098
		cpu/cpu_arm.h cpu/cpu_arm.c			\
1099 1100 1101
		cpu/cpu_ppc64.h cpu/cpu_ppc64.c			\
		cpu/cpu_ppc64_data.h				\
		cpu/cpu_map.h cpu/cpu_map.c
1102

1103 1104 1105
VMX_SOURCES =							\
		vmx/vmx.c vmx/vmx.h

1106 1107
XENCONFIG_SOURCES =						\
		xenconfig/xenxs_private.h			\
1108
		xenconfig/xen_common.c xenconfig/xen_common.h   \
1109
		xenconfig/xen_sxpr.c xenconfig/xen_sxpr.h	\
1110
		xenconfig/xen_xm.c xenconfig/xen_xm.h
1111 1112 1113 1114
if WITH_LIBXL
XENCONFIG_SOURCES +=						\
		xenconfig/xen_xl.c xenconfig/xen_xl.h
endif WITH_LIBXL
1115

J
Jiri Denemark 已提交
1116 1117
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
1118
EXTRA_DIST +=	$(pkgdata_DATA)
1119

1120 1121 1122 1123 1124 1125
#########################
#
# Build up list of libvirt.la source files based on configure conditions
#
# First deal with sources usable in non-daemon context

1126
noinst_LTLIBRARIES = libvirt_util.la
1127 1128
libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
libvirt_la_BUILT_LIBADD = libvirt_util.la
1129 1130
libvirt_util_la_SOURCES =					\
		$(UTIL_SOURCES)
1131
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
1132
		$(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
1133
		$(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS)	\
M
Michal Privoznik 已提交
1134
		$(POLKIT_CFLAGS) $(GNUTLS_CFLAGS) $(ACL_CFLAGS) \
1135
		-I$(srcdir)/conf
1136
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
1137
		$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
1138
		$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(WIN32_EXTRA_LIBS) $(LIBXML_LIBS) \
M
Michal Privoznik 已提交
1139
		$(SECDRIVER_LIBS) $(NUMACTL_LIBS) $(ACL_LIBS) \
1140
		$(POLKIT_LIBS)
1141

1142 1143

noinst_LTLIBRARIES += libvirt_conf.la
1144
libvirt_la_BUILT_LIBADD += libvirt_conf.la
1145
libvirt_conf_la_SOURCES = $(CONF_SOURCES)
1146 1147
libvirt_conf_la_CFLAGS = \
		-I$(srcdir)/conf $(AM_CFLAGS)
1148
libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS)
1149
libvirt_conf_la_LIBADD = $(LIBXML_LIBS)
1150

J
Jiri Denemark 已提交
1151
noinst_LTLIBRARIES += libvirt_cpu.la
1152
libvirt_la_BUILT_LIBADD += libvirt_cpu.la
J
Jiri Denemark 已提交
1153
libvirt_cpu_la_CFLAGS = \
1154
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jiri Denemark 已提交
1155 1156
libvirt_cpu_la_SOURCES = $(CPU_SOURCES)

1157 1158 1159 1160 1161 1162
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)

1163 1164 1165 1166
if WITH_VMX
noinst_LTLIBRARIES += libvirt_vmx.la
libvirt_la_BUILT_LIBADD += libvirt_vmx.la
libvirt_vmx_la_CFLAGS = \
1167
		-I$(srcdir)/conf $(AM_CFLAGS)
1168
libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
1169
endif WITH_VMX
1170

J
Jim Fehlig 已提交
1171 1172 1173
if WITH_XENCONFIG
noinst_LTLIBRARIES += libvirt_xenconfig.la
libvirt_la_BUILT_LIBADD += libvirt_xenconfig.la
1174
libvirt_xenconfig_la_LIBADD = $(LIBXL_LIBS)
J
Jim Fehlig 已提交
1175
libvirt_xenconfig_la_CFLAGS = \
J
Jim Fehlig 已提交
1176
		-I$(srcdir)/conf -I$(srcdir)/libxl $(AM_CFLAGS)
J
Jim Fehlig 已提交
1177 1178
libvirt_xenconfig_la_SOURCES = $(XENCONFIG_SOURCES)
endif WITH_XENCONFIG
1179

1180

1181
noinst_LTLIBRARIES += libvirt_driver.la
1182
libvirt_la_BUILT_LIBADD += libvirt_driver.la
1183
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
1184

1185
libvirt_driver_la_CFLAGS = \
1186
		$(GNUTLS_CFLAGS) $(CURL_CFLAGS) $(XDR_CFLAGS) \
1187
		-I$(srcdir)/conf $(AM_CFLAGS)
1188
libvirt_driver_la_LIBADD = \
1189
		$(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS)
1190

1191 1192
# 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.
1193
SYM_FILES = $(USED_SYM_FILES)
1194
USED_SYM_FILES = $(srcdir)/libvirt_private.syms
1195 1196 1197
GENERATED_SYM_FILES = \
	$(ACCESS_DRIVER_SYM_FILES) \
	libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \
1198
	libvirt_admin.syms libvirt_admin.def \
1199
	$(NULL)
1200

1201
if WITH_TEST
D
Daniel P. Berrange 已提交
1202 1203 1204 1205

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

1206
noinst_LTLIBRARIES += libvirt_driver_test.la
1207
libvirt_la_BUILT_LIBADD += libvirt_driver_test.la
1208
libvirt_driver_test_la_CFLAGS = \
1209
		-I$(srcdir)/conf $(AM_CFLAGS)
1210
libvirt_driver_test_la_SOURCES = $(TEST_DRIVER_SOURCES)
1211
endif WITH_TEST
1212 1213

if WITH_REMOTE
1214
noinst_LTLIBRARIES += libvirt_driver_remote.la
1215
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
1216 1217
libvirt_driver_remote_la_CFLAGS =				\
		$(GNUTLS_CFLAGS)				\
E
Eric Blake 已提交
1218
		$(XDR_CFLAGS)					\
1219 1220
		-I$(srcdir)/conf				\
		-I$(srcdir)/rpc					\
1221 1222
		$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
1223 1224 1225 1226
libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) \
                libvirt-net-rpc-client.la \
                libvirt-net-rpc-server.la \
                libvirt-net-rpc.la
1227
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
1228

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

1231 1232
endif WITH_REMOTE

1233
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
1234
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
1235
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1236

1237
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
1238
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
1239
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1240

1241
if WITH_XEN
E
Eric Blake 已提交
1242 1243 1244
noinst_LTLIBRARIES += libvirt_driver_xen_impl.la
libvirt_driver_xen_la_SOURCES =
libvirt_driver_xen_la_LIBADD = libvirt_driver_xen_impl.la
1245 1246
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_xen.la
E
Eric Blake 已提交
1247
libvirt_driver_xen_la_LIBADD += ../gnulib/lib/libgnu.la
1248
libvirt_driver_xen_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1249
else ! WITH_DRIVER_MODULES
1250
noinst_LTLIBRARIES += libvirt_driver_xen.la
1251 1252
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_xen.la
1253
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1254

1255
libvirt_driver_xen_impl_la_CFLAGS =				\
1256
		$(XEN_CFLAGS)					\
1257 1258 1259
		-I$(srcdir)/access				\
		-I$(srcdir)/conf				\
		-I$(srcdir)/xenconfig				\
1260
		$(AM_CFLAGS)
E
Eric Blake 已提交
1261
libvirt_driver_xen_impl_la_LDFLAGS = $(AM_LDFLAGS)
P
Pavel Hrdina 已提交
1262
libvirt_driver_xen_impl_la_LIBADD = $(XEN_LIBS) libvirt_xenconfig.la
E
Eric Blake 已提交
1263
libvirt_driver_xen_impl_la_SOURCES = $(XEN_DRIVER_SOURCES)
1264
endif WITH_XEN
1265

1266 1267
if WITH_PHYP
noinst_LTLIBRARIES += libvirt_driver_phyp.la
1268
libvirt_la_BUILT_LIBADD += libvirt_driver_phyp.la
1269 1270
libvirt_driver_phyp_la_LIBADD = $(SSH2_LIBS)
libvirt_driver_phyp_la_CFLAGS = $(SSH2_CFLAGS) \
1271
		-I$(srcdir)/conf $(AM_CFLAGS)
1272
libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES)
1273
endif WITH_PHYP
1274

1275
if WITH_OPENVZ
1276
noinst_LTLIBRARIES += libvirt_driver_openvz.la
1277
libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la
1278
libvirt_driver_openvz_la_CFLAGS = \
1279
		-I$(srcdir)/conf $(AM_CFLAGS)
1280
libvirt_driver_openvz_la_SOURCES = $(OPENVZ_DRIVER_SOURCES)
1281
endif WITH_OPENVZ
1282

1283 1284 1285 1286
if WITH_VMWARE
noinst_LTLIBRARIES += libvirt_driver_vmware.la
libvirt_la_BUILT_LIBADD += libvirt_driver_vmware.la
libvirt_driver_vmware_la_CFLAGS = \
1287
		-I$(srcdir)/conf -I$(srcdir)/vmx $(AM_CFLAGS)
1288
libvirt_driver_vmware_la_SOURCES = $(VMWARE_DRIVER_SOURCES)
1289
endif WITH_VMWARE
1290

1291
if WITH_VBOX
M
Michal Privoznik 已提交
1292
noinst_LTLIBRARIES += \
1293
		libvirt_driver_vbox_impl.la
1294 1295 1296
libvirt_driver_vbox_la_SOURCES =
libvirt_driver_vbox_la_LIBADD = libvirt_driver_vbox_impl.la
if WITH_DRIVER_MODULES
M
Michal Privoznik 已提交
1297
mod_LTLIBRARIES += \
1298
		libvirt_driver_vbox.la
1299
libvirt_driver_vbox_la_LIBADD += ../gnulib/lib/libgnu.la
1300
libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1301
else ! WITH_DRIVER_MODULES
1302
noinst_LTLIBRARIES += libvirt_driver_vbox.la
1303 1304 1305
# GPLv2-only license requries that it be linked into
# libvirtd and *not* libvirt.so
#libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la
1306
endif ! WITH_DRIVER_MODULES
1307 1308

libvirt_driver_vbox_impl_la_CFLAGS =				\
1309 1310
		-I$(srcdir)/conf				\
		$(AM_CFLAGS)					\
M
Michal Privoznik 已提交
1311
		-DVBOX_DRIVER
1312
libvirt_driver_vbox_impl_la_LDFLAGS = $(AM_LDFLAGS)
1313
libvirt_driver_vbox_impl_la_LIBADD =  $(DLOPEN_LIBS)		\
1314
		$(WIN32_EXTRA_LIBS)				\
1315
		$(LIBXML_LIBS)
1316
libvirt_driver_vbox_impl_la_SOURCES = $(VBOX_DRIVER_SOURCES)
1317
endif WITH_VBOX
1318

1319 1320
if WITH_XENAPI
noinst_LTLIBRARIES += libvirt_driver_xenapi.la
1321
libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la
1322
libvirt_driver_xenapi_la_CFLAGS = $(XENAPI_CFLAGS) $(CURL_CFLAGS) \
P
Pavel Hrdina 已提交
1323
		-I$(srcdir)/conf -I$(srcdir)/xenconfig $(AM_CFLAGS)
1324
libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS)
1325
libvirt_driver_xenapi_la_LIBADD = $(XENAPI_LIBS) $(CURL_LIBS)
1326
libvirt_driver_xenapi_la_SOURCES = $(XENAPI_DRIVER_SOURCES)
1327
endif WITH_XENAPI
1328

J
Jim Fehlig 已提交
1329
if WITH_LIBXL
E
Eric Blake 已提交
1330 1331 1332
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 已提交
1333 1334
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_libxl.la
E
Eric Blake 已提交
1335
libvirt_driver_libxl_la_LIBADD += ../gnulib/lib/libgnu.la
1336
libvirt_driver_libxl_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1337
else ! WITH_DRIVER_MODULES
J
Jim Fehlig 已提交
1338 1339 1340
noinst_LTLIBRARIES += libvirt_driver_libxl.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_libxl.la
1341
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1342

1343 1344
libvirt_driver_libxl_impl_la_CFLAGS = 		\
		$(LIBXL_CFLAGS)			\
1345 1346
		-I$(srcdir)/access	\
		-I$(srcdir)/conf	\
1347
		-I$(srcdir)/secret      \
1348
		-I$(srcdir)/xenconfig	\
1349
		$(AM_CFLAGS)
E
Eric Blake 已提交
1350
libvirt_driver_libxl_impl_la_LDFLAGS = $(AM_LDFLAGS)
1351 1352 1353
libvirt_driver_libxl_impl_la_LIBADD = $(LIBXL_LIBS) \
				      libvirt_xenconfig.la \
				      libvirt_secret.la
E
Eric Blake 已提交
1354
libvirt_driver_libxl_impl_la_SOURCES = $(LIBXL_DRIVER_SOURCES)
1355 1356 1357 1358 1359 1360

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

1361
endif WITH_LIBXL
1362 1363
EXTRA_DIST += libxl/libxl.conf libxl/libvirtd_libxl.aug \
		libxl/test_libvirtd_libxl.aug.in
J
Jim Fehlig 已提交
1364

1365
if WITH_QEMU
E
Eric Blake 已提交
1366 1367 1368
noinst_LTLIBRARIES += libvirt_driver_qemu_impl.la
libvirt_driver_qemu_la_SOURCES =
libvirt_driver_qemu_la_LIBADD = libvirt_driver_qemu_impl.la
1369 1370
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_qemu.la
E
Eric Blake 已提交
1371
libvirt_driver_qemu_la_LIBADD += ../gnulib/lib/libgnu.la
1372
libvirt_driver_qemu_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1373
else ! WITH_DRIVER_MODULES
1374
noinst_LTLIBRARIES += libvirt_driver_qemu.la
1375
# Stateful, so linked to daemon instead
1376
#libvirt_la_BUILT_LIBADD += libvirt_driver_qemu.la
1377
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1378

1379 1380 1381
libvirt_driver_qemu_impl_la_CFLAGS = \
		$(GNUTLS_CFLAGS) \
		$(LIBNL_CFLAGS) \
1382
		$(XDR_CFLAGS) \
1383 1384
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1385
		-I$(srcdir)/secret \
1386
		$(AM_CFLAGS)
E
Eric Blake 已提交
1387
libvirt_driver_qemu_impl_la_LDFLAGS = $(AM_LDFLAGS)
1388
libvirt_driver_qemu_impl_la_LIBADD = $(CAPNG_LIBS) \
1389
                                $(GNUTLS_LIBS) \
1390 1391
				$(LIBNL_LIBS) \
				$(LIBXML_LIBS) \
1392
				libvirt_secret.la \
1393
				$(NULL)
E
Eric Blake 已提交
1394
libvirt_driver_qemu_impl_la_SOURCES = $(QEMU_DRIVER_SOURCES)
1395

A
Amy Griffis 已提交
1396
conf_DATA += qemu/qemu.conf
1397

1398
augeas_DATA += qemu/libvirtd_qemu.aug
1399 1400
augeastest_DATA += test_libvirtd_qemu.aug
CLEANFILES += test_libvirtd_qemu.aug
1401

1402
endif WITH_QEMU
1403
EXTRA_DIST += qemu/qemu.conf qemu/libvirtd_qemu.aug \
1404
		qemu/test_libvirtd_qemu.aug.in qemu/THREADS.txt
1405

1406 1407

if WITH_LXC
E
Eric Blake 已提交
1408 1409 1410
noinst_LTLIBRARIES += libvirt_driver_lxc_impl.la
libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = libvirt_driver_lxc_impl.la
1411 1412
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_lxc.la
E
Eric Blake 已提交
1413 1414
libvirt_driver_lxc_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_lxc_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1415
else ! WITH_DRIVER_MODULES
1416
noinst_LTLIBRARIES += libvirt_driver_lxc.la
1417
# Stateful, so linked to daemon instead
1418
#libvirt_la_BUILT_LIBADD += libvirt_driver_lxc.la
1419
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1420 1421

libvirt_driver_lxc_impl_la_CFLAGS = \
S
Serge Hallyn 已提交
1422
		$(LIBNL_CFLAGS) \
G
Gao feng 已提交
1423
		$(FUSE_CFLAGS) \
P
Pavel Fedin 已提交
1424
		$(XDR_CFLAGS) \
1425 1426
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1427
		$(AM_CFLAGS)
I
ik.nitk 已提交
1428 1429 1430 1431 1432 1433
libvirt_driver_lxc_impl_la_LIBADD = \
               $(CAPNG_LIBS) \
               $(LIBNL_LIBS) \
               $(LIBXML_LIBS) \
               $(FUSE_LIBS)

1434
if WITH_BLKID
E
Eric Blake 已提交
1435 1436
libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS)
1437
endif WITH_BLKID
1438
libvirt_driver_lxc_impl_la_LIBADD += $(SECDRIVER_LIBS)
E
Eric Blake 已提交
1439
libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES)
A
Amy Griffis 已提交
1440 1441 1442

conf_DATA += lxc/lxc.conf

1443
augeas_DATA += lxc/libvirtd_lxc.aug
1444 1445
augeastest_DATA += test_libvirtd_lxc.aug
CLEANFILES += test_libvirtd_lxc.aug
1446

1447
endif WITH_LXC
1448
EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in
1449

1450
if WITH_UML
E
Eric Blake 已提交
1451 1452 1453
noinst_LTLIBRARIES += libvirt_driver_uml_impl.la
libvirt_driver_uml_la_SOURCES =
libvirt_driver_uml_la_LIBADD = libvirt_driver_uml_impl.la
1454 1455
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_uml.la
E
Eric Blake 已提交
1456
libvirt_driver_uml_la_LIBADD += ../gnulib/lib/libgnu.la
1457
libvirt_driver_uml_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1458
else ! WITH_DRIVER_MODULES
1459 1460
noinst_LTLIBRARIES += libvirt_driver_uml.la
# Stateful, so linked to daemon instead
1461
#libvirt_la_BUILT_LIBADD += libvirt_driver_uml.la
1462
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1463

1464
libvirt_driver_uml_impl_la_CFLAGS = \
1465 1466
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1467
		$(AM_CFLAGS)
E
Eric Blake 已提交
1468
libvirt_driver_uml_impl_la_LDFLAGS = $(AM_LDFLAGS)
1469
# libvirt_driver_uml_impl_la_LIBADD =
E
Eric Blake 已提交
1470
libvirt_driver_uml_impl_la_SOURCES = $(UML_DRIVER_SOURCES)
1471
endif WITH_UML
1472

D
Daniel Veillard 已提交
1473

1474
BUILT_SOURCES += $(ESX_DRIVER_GENERATED)
D
Daniel Veillard 已提交
1475

1476 1477
ESX_GENERATED_STAMP = .esx_vi_generator.stamp

E
Eric Blake 已提交
1478 1479
EXTRA_DIST += $(ESX_GENERATED_STAMP)

1480 1481 1482
$(ESX_DRIVER_GENERATED): $(ESX_GENERATED_STAMP)

$(ESX_GENERATED_STAMP): $(srcdir)/esx/esx_vi_generator.input \
1483
                         $(srcdir)/esx/esx_vi_generator.py
1484 1485 1486 1487 1488
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/esx/esx_vi_generator.py \
	  && touch $@

MAINTAINERCLEANFILES += $(ESX_DRIVER_GENERATED) $(ESX_GENERATED_STAMP)

D
Daniel Veillard 已提交
1489

1490 1491
if WITH_ESX
noinst_LTLIBRARIES += libvirt_driver_esx.la
1492
libvirt_la_BUILT_LIBADD += libvirt_driver_esx.la
1493
libvirt_driver_esx_la_CFLAGS = $(CURL_CFLAGS) \
1494
		-I$(srcdir)/conf -I$(srcdir)/vmx $(AM_CFLAGS)
1495
libvirt_driver_esx_la_LDFLAGS = $(AM_LDFLAGS)
1496
libvirt_driver_esx_la_LIBADD = $(CURL_LIBS)
1497
libvirt_driver_esx_la_SOURCES = $(ESX_DRIVER_SOURCES)
1498
libvirt_driver_esx_la_DEPENDENCIES = $(ESX_DRIVER_GENERATED)
1499
endif WITH_ESX
1500

M
Matthias Bolte 已提交
1501

1502 1503
BUILT_SOURCES += $(HYPERV_DRIVER_GENERATED)

1504 1505
HYPERV_GENERATED_STAMP = .hyperv_wmi_generator.stamp

E
Eric Blake 已提交
1506 1507
EXTRA_DIST += $(HYPERV_GENERATED_STAMP)

1508 1509 1510
$(HYPERV_DRIVER_GENERATED): $(HYPERV_GENERATED_STAMP)

$(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \
1511
                            $(srcdir)/hyperv/hyperv_wmi_generator.py
1512 1513
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) \
	  $(srcdir)/hyperv/hyperv_wmi_generator.py \
1514 1515 1516
	  && touch $@

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

M
Matthias Bolte 已提交
1518 1519 1520 1521
if WITH_HYPERV
noinst_LTLIBRARIES += libvirt_driver_hyperv.la
libvirt_la_BUILT_LIBADD += libvirt_driver_hyperv.la
libvirt_driver_hyperv_la_CFLAGS = $(OPENWSMAN_CFLAGS) \
1522
		-I$(srcdir)/conf $(AM_CFLAGS)
M
Matthias Bolte 已提交
1523 1524 1525
libvirt_driver_hyperv_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_hyperv_la_LIBADD = $(OPENWSMAN_LIBS)
libvirt_driver_hyperv_la_SOURCES = $(HYPERV_DRIVER_SOURCES)
1526
endif WITH_HYPERV
M
Matthias Bolte 已提交
1527

1528
if WITH_VZ
1529 1530 1531 1532 1533 1534 1535 1536
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
1537
noinst_LTLIBRARIES += libvirt_driver_vz.la
1538 1539
endif ! WITH_DRIVER_MODULES
libvirt_driver_vz_impl_la_CFLAGS = \
1540 1541 1542
		-I$(srcdir)/conf \
		-I$(srcdir)/access \
		$(AM_CFLAGS) \
1543
		$(PARALLELS_SDK_CFLAGS) $(LIBNL_CFLAGS)
1544 1545
libvirt_driver_vz_impl_la_SOURCES = $(VZ_DRIVER_SOURCES)
libvirt_driver_vz_impl_la_LIBADD =  $(PARALLELS_SDK_LIBS) $(LIBNL_LIBS)
1546
endif WITH_VZ
D
Dmitry Guryanov 已提交
1547

R
Roman Bogorodskiy 已提交
1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560
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 = \
1561 1562
	-I$(srcdir)/access \
	-I$(srcdir)/conf \
R
Roman Bogorodskiy 已提交
1563 1564 1565 1566 1567
	$(AM_CFLAGS)
libvirt_driver_bhyve_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_bhyve_impl_la_SOURCES = $(BHYVE_DRIVER_SOURCES)
endif WITH_BHYVE

1568
if WITH_NETWORK
E
Eric Blake 已提交
1569 1570 1571
noinst_LTLIBRARIES += libvirt_driver_network_impl.la
libvirt_driver_network_la_SOURCES =
libvirt_driver_network_la_LIBADD = libvirt_driver_network_impl.la
1572 1573
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_network.la
1574 1575 1576 1577
libvirt_driver_network_la_LIBADD += ../gnulib/lib/libgnu.la \
	$(LIBNL_LIBS) \
	$(DBUS_LIBS) \
	$(NULL)
E
Eric Blake 已提交
1578
libvirt_driver_network_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1579
else ! WITH_DRIVER_MODULES
1580
noinst_LTLIBRARIES += libvirt_driver_network.la
1581
# Stateful, so linked to daemon instead
1582
#libvirt_la_BUILT_LIBADD += libvirt_driver_network.la
1583
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1584 1585

libvirt_driver_network_impl_la_CFLAGS = \
1586 1587
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1588 1589
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1590
		$(AM_CFLAGS)
E
Eric Blake 已提交
1591
libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
1592
libvirt_driver_network_impl_la_LIBADD  = $(DBUS_LIBS)
1593
endif WITH_NETWORK
1594 1595 1596
EXTRA_DIST += network/default.xml


1597
if WITH_INTERFACE
1598 1599
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_interface.la
1600
else ! WITH_DRIVER_MODULES
1601
noinst_LTLIBRARIES += libvirt_driver_interface.la
1602 1603
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_interface.la
1604
endif ! WITH_DRIVER_MODULES
1605
libvirt_driver_interface_la_CFLAGS = \
1606 1607
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1608
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1609
libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS)
1610 1611 1612 1613
libvirt_driver_interface_la_LIBADD =
if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
1614
endif WITH_NETCF
1615
if WITH_UDEV
1616 1617
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
1618
endif WITH_UDEV
1619
if WITH_DRIVER_MODULES
1620
libvirt_driver_interface_la_LIBADD += ../gnulib/lib/libgnu.la
1621
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
1622
endif WITH_DRIVER_MODULES
1623
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
1624
endif WITH_INTERFACE
D
Daniel Veillard 已提交
1625

D
Daniel P. Berrange 已提交
1626
if WITH_SECRETS
1627 1628
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_secret.la
1629
else ! WITH_DRIVER_MODULES
1630
noinst_LTLIBRARIES += libvirt_driver_secret.la
1631
# Stateful, so linked to daemon instead
1632
#libvirt_la_BUILT_LIBADD += libvirt_driver_secret.la
1633
endif ! WITH_DRIVER_MODULES
1634
libvirt_driver_secret_la_CFLAGS = \
1635 1636
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1637
		$(AM_CFLAGS)
1638
if WITH_DRIVER_MODULES
1639
libvirt_driver_secret_la_LIBADD = ../gnulib/lib/libgnu.la
1640
libvirt_driver_secret_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1641
endif WITH_DRIVER_MODULES
1642
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
1643
endif WITH_SECRETS
1644

1645
# Needed to keep automake quiet about conditionals
1646 1647
libvirt_driver_storage_impl_la_SOURCES =
libvirt_driver_storage_impl_la_CFLAGS = \
1648 1649
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1650
		-I$(srcdir)/secret \
1651
		$(AM_CFLAGS)
1652 1653
libvirt_driver_storage_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_storage_impl_la_LIBADD =
1654
libvirt_driver_storage_impl_la_LIBADD += $(SECDRIVER_LIBS) $(LIBXML_LIBS)
1655
if WITH_BLKID
1656 1657
libvirt_driver_storage_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(BLKID_LIBS)
1658
endif WITH_BLKID
1659
if WITH_STORAGE
1660 1661 1662
noinst_LTLIBRARIES += libvirt_driver_storage_impl.la
libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_LIBADD = libvirt_driver_storage_impl.la
1663 1664
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_storage.la
1665
libvirt_driver_storage_la_LIBADD += ../gnulib/lib/libgnu.la
1666
libvirt_driver_storage_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1667
else ! WITH_DRIVER_MODULES
1668
noinst_LTLIBRARIES += libvirt_driver_storage.la
1669
# Stateful, so linked to daemon instead
1670
#libvirt_la_BUILT_LIBADD += libvirt_driver_storage.la
1671
endif ! WITH_DRIVER_MODULES
1672 1673
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_FS_SOURCES)
1674
endif WITH_STORAGE
1675

1676
if WITH_STORAGE_LVM
1677
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_LVM_SOURCES)
1678
endif WITH_STORAGE_LVM
1679

1680
if WITH_STORAGE_ISCSI
1681
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_ISCSI_SOURCES)
1682
endif WITH_STORAGE_ISCSI
1683

1684
if WITH_STORAGE_SCSI
1685
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SCSI_SOURCES)
1686
endif WITH_STORAGE_SCSI
1687

D
Dave Allan 已提交
1688
if WITH_STORAGE_MPATH
1689 1690 1691
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)
1692
endif WITH_STORAGE_MPATH
D
Dave Allan 已提交
1693

1694
if WITH_STORAGE_DISK
1695
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_DISK_SOURCES)
1696
endif WITH_STORAGE_DISK
1697

1698
if WITH_STORAGE_RBD
1699 1700
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_RBD_SOURCES)
libvirt_driver_storage_impl_la_LIBADD += $(LIBRBD_LIBS)
1701
endif WITH_STORAGE_RBD
1702

1703
if WITH_STORAGE_SHEEPDOG
1704
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SHEEPDOG_SOURCES)
1705
endif WITH_STORAGE_SHEEPDOG
1706

1707 1708 1709 1710 1711 1712
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 已提交
1713 1714 1715 1716
if WITH_STORAGE_ZFS
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_ZFS_SOURCES)
endif WITH_STORAGE_ZFS

1717 1718 1719 1720
if WITH_NODE_DEVICES
# Needed to keep automake quiet about conditionals
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nodedev.la
1721
else ! WITH_DRIVER_MODULES
1722 1723
noinst_LTLIBRARIES += libvirt_driver_nodedev.la
# Stateful, so linked to daemon instead
1724
#libvirt_la_BUILT_LIBADD += libvirt_driver_nodedev.la
1725
endif ! WITH_DRIVER_MODULES
1726 1727
libvirt_driver_nodedev_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES)

1728
libvirt_driver_nodedev_la_CFLAGS = \
1729 1730
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1731
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1732
libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS)
1733
libvirt_driver_nodedev_la_LIBADD =
1734

D
Doug Goldstein 已提交
1735
if WITH_LIBVIRTD
1736
if WITH_HAL
1737 1738
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS)
1739
libvirt_driver_nodedev_la_LIBADD += $(HAL_LIBS)
1740
endif WITH_HAL
1741
if WITH_UDEV
1742
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES)
1743
libvirt_driver_nodedev_la_CFLAGS += $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS)
1744
libvirt_driver_nodedev_la_LIBADD += $(UDEV_LIBS) $(PCIACCESS_LIBS)
1745 1746
endif WITH_UDEV
endif WITH_LIBVIRTD
1747 1748

if WITH_DRIVER_MODULES
1749
libvirt_driver_nodedev_la_LIBADD += ../gnulib/lib/libgnu.la
1750
libvirt_driver_nodedev_la_LDFLAGS += -module -avoid-version
1751 1752
endif WITH_DRIVER_MODULES
endif WITH_NODE_DEVICES
1753 1754


1755
if WITH_NWFILTER
1756 1757 1758
noinst_LTLIBRARIES += libvirt_driver_nwfilter_impl.la
libvirt_driver_nwfilter_la_SOURCES =
libvirt_driver_nwfilter_la_LIBADD = libvirt_driver_nwfilter_impl.la
1759 1760
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nwfilter.la
1761
libvirt_driver_nwfilter_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1762
else ! WITH_DRIVER_MODULES
1763
noinst_LTLIBRARIES += libvirt_driver_nwfilter.la
1764 1765
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_nwfilter.la
1766
endif ! WITH_DRIVER_MODULES
1767
libvirt_driver_nwfilter_impl_la_CFLAGS = \
1768 1769 1770
		$(LIBPCAP_CFLAGS) \
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1771 1772
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1773
		$(AM_CFLAGS)
1774 1775 1776 1777 1778
libvirt_driver_nwfilter_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_nwfilter_impl_la_LIBADD = \
		$(LIBPCAP_LIBS) \
		$(LIBNL_LIBS) \
		$(DBUS_LIBS)
1779
if WITH_DRIVER_MODULES
1780 1781
libvirt_driver_nwfilter_impl_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_nwfilter_impl_la_LDFLAGS += -module -avoid-version
1782
endif WITH_DRIVER_MODULES
1783
libvirt_driver_nwfilter_impl_la_SOURCES = $(NWFILTER_DRIVER_SOURCES)
1784
endif WITH_NWFILTER
1785 1786


1787 1788 1789 1790
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 = \
1791
		-I$(srcdir)/conf $(AM_CFLAGS)
1792
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
1793
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
1794
if WITH_SECDRIVER_SELINUX
1795 1796
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
1797
endif WITH_SECDRIVER_SELINUX
J
Jamie Strandboge 已提交
1798
if WITH_SECDRIVER_APPARMOR
1799 1800
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
1801
endif WITH_SECDRIVER_APPARMOR
1802

1803 1804
libvirt_driver_access_la_SOURCES = \
	$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
1805 1806 1807
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
1808
		-I$(srcdir)/conf $(AM_CFLAGS)
1809 1810 1811
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD =

1812 1813
EXTRA_DIST += access/genpolkit.pl

1814 1815 1816 1817
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
    $(srcdir)/access/genpolkit.pl Makefile.am
	$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@

1818 1819 1820 1821
if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)

polkitactiondir = $(datadir)/polkit-1/actions
1822
if WITH_LIBVIRTD
1823
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
1824
endif WITH_LIBVIRTD
1825 1826 1827

CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
1828
else ! WITH_POLKIT1
1829
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
1830
endif ! WITH_POLKIT1
1831

1832

1833 1834
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848

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

1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861
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 已提交
1862
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
1863 1864
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1865 1866 1867
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
1868 1869
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1870 1871
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
	  > $(srcdir)/access/viraccessapicheck.c
1872

E
Eric Blake 已提交
1873
access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
1874 1875
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1876 1877 1878
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheckqemu.h
access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
1879 1880
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1881 1882
	  qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h \
	  > $(srcdir)/access/viraccessapicheckqemu.c
1883

E
Eric Blake 已提交
1884
access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
1885 1886
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1887 1888 1889
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/access/viraccessapichecklxc.h
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
1890 1891
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1892 1893
	  lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \
	  > $(srcdir)/access/viraccessapichecklxc.c
1894

1895 1896 1897
# Add all conditional sources just in case...
EXTRA_DIST +=							\
		$(TEST_DRIVER_SOURCES)				\
D
Daniel P. Berrange 已提交
1898
		$(TEST_DRIVER_ASSETS)				\
1899 1900 1901 1902
		$(REMOTE_DRIVER_SOURCES)			\
		$(XEN_DRIVER_SOURCES)				\
		$(QEMU_DRIVER_SOURCES)				\
		$(LXC_DRIVER_SOURCES)				\
1903
		$(UML_DRIVER_SOURCES)				\
1904
		$(OPENVZ_DRIVER_SOURCES)			\
1905
		$(PHYP_DRIVER_SOURCES)				\
1906
		$(VBOX_DRIVER_SOURCES)				\
1907
		$(XENAPI_DRIVER_SOURCES)			\
O
Osier Yang 已提交
1908
		$(LIBXL_DRIVER_SOURCES)				\
1909
		$(ESX_DRIVER_SOURCES)				\
1910
		$(ESX_DRIVER_EXTRA_DIST)			\
M
Matthias Bolte 已提交
1911
		$(HYPERV_DRIVER_SOURCES)			\
1912
		$(HYPERV_DRIVER_EXTRA_DIST)			\
1913
		$(VZ_DRIVER_SOURCES)				\
R
Roman Bogorodskiy 已提交
1914
		$(BHYVE_DRIVER_SOURCES)				\
1915
		$(NETWORK_DRIVER_SOURCES)			\
1916
		$(INTERFACE_DRIVER_SOURCES)			\
1917 1918 1919 1920
		$(STORAGE_DRIVER_SOURCES)			\
		$(STORAGE_DRIVER_FS_SOURCES)			\
		$(STORAGE_DRIVER_LVM_SOURCES)			\
		$(STORAGE_DRIVER_ISCSI_SOURCES)			\
1921
		$(STORAGE_DRIVER_SCSI_SOURCES)			\
D
Dave Allan 已提交
1922
		$(STORAGE_DRIVER_MPATH_SOURCES)			\
1923
		$(STORAGE_DRIVER_DISK_SOURCES)			\
1924
		$(STORAGE_DRIVER_RBD_SOURCES)			\
1925
		$(STORAGE_DRIVER_SHEEPDOG_SOURCES)		\
1926
		$(STORAGE_DRIVER_GLUSTER_SOURCES)		\
R
Roman Bogorodskiy 已提交
1927
		$(STORAGE_DRIVER_ZFS_SOURCES)			\
1928 1929
		$(NODE_DEVICE_DRIVER_SOURCES)			\
		$(NODE_DEVICE_DRIVER_HAL_SOURCES)		\
1930
		$(NODE_DEVICE_DRIVER_UDEV_SOURCES)		\
1931
		$(NWFILTER_DRIVER_SOURCES)			\
1932
		$(SECURITY_DRIVER_SELINUX_SOURCES)		\
J
Jamie Strandboge 已提交
1933
		$(SECURITY_DRIVER_APPARMOR_SOURCES)		\
D
Daniel P. Berrange 已提交
1934
		$(SECRET_DRIVER_SOURCES)			\
1935
		$(SECRET_UTIL_SOURCES)				\
1936
		$(VBOX_DRIVER_EXTRA_DIST)			\
1937
		$(VMWARE_DRIVER_SOURCES)			\
J
Jim Fehlig 已提交
1938
		$(XENCONFIG_SOURCES)				\
1939
		$(ACCESS_DRIVER_POLKIT_POLICY)
1940

1941 1942
check-local: check-augeas

1943 1944 1945 1946 1947
.PHONY: check-augeas \
	check-augeas-qemu \
	check-augeas-lxc \
	check-augeas-sanlock \
	check-augeas-lockd \
1948
	check-augeas-libxl \
1949
	$(NULL)
1950

1951
check-augeas: check-augeas-qemu check-augeas-lxc check-augeas-sanlock \
1952 1953
	check-augeas-lockd check-augeas-virtlockd check-augeas-libxl \
	check-augeas-virtlogd
1954

1955
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
1956
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
1957

1958
if WITH_QEMU
1959 1960
test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
		$(srcdir)/qemu/qemu.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1961
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
1962

1963
check-augeas-qemu: test_libvirtd_qemu.aug
1964
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1965
	    '$(AUGPARSE)' -I $(srcdir)/qemu test_libvirtd_qemu.aug; \
1966
	fi
1967
else ! WITH_QEMU
1968
check-augeas-qemu:
1969
endif ! WITH_QEMU
1970

1971
if WITH_LXC
1972 1973
test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
		$(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1974
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
1975

1976
check-augeas-lxc: test_libvirtd_lxc.aug
1977
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1978
	    '$(AUGPARSE)' -I $(srcdir)/lxc test_libvirtd_lxc.aug; \
1979
	fi
1980
else ! WITH_LXC
1981
check-augeas-lxc:
1982
endif ! WITH_LXC
1983

1984
if WITH_SANLOCK
1985 1986
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1987
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
1988

1989
check-augeas-sanlock: test_libvirt_sanlock.aug
1990
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1991
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
1992
	fi
1993
else ! WITH_SANLOCK
1994
check-augeas-sanlock:
1995
endif ! WITH_SANLOCK
1996

1997
if WITH_QEMU
1998 1999 2000
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 $< $@
2001 2002 2003
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
2004

2005 2006
test_virtlockd.aug: locking/test_virtlockd.aug.in \
		locking/virtlockd.conf $(AUG_GENTEST)
2007
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
2008

2009
if WITH_QEMU
2010 2011 2012 2013
check-augeas-lockd: test_libvirt_lockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_lockd.aug; \
	fi
2014 2015 2016
else ! WITH_QEMU
check-augeas-lockd:
endif ! WITH_QEMU
2017

2018 2019 2020 2021 2022
check-augeas-virtlockd: test_virtlockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
	fi

2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035
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

2036 2037 2038 2039 2040 2041 2042 2043 2044
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

2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063
#
# 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.
#

2064
if WITH_DRIVER_MODULES
2065
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
2066
else ! WITH_DRIVER_MODULES
2067
SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
2068
endif ! WITH_DRIVER_MODULES
2069

2070
if WITH_LINUX
2071
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
2072
else ! WITH_LINUX
2073
SYM_FILES += $(srcdir)/libvirt_linux.syms
2074
endif ! WITH_LINUX
2075

2076
if WITH_ESX
2077
USED_SYM_FILES += $(srcdir)/libvirt_esx.syms
2078
else ! WITH_ESX
2079
SYM_FILES += $(srcdir)/libvirt_esx.syms
2080
endif ! WITH_ESX
2081

E
Eric Blake 已提交
2082 2083 2084 2085 2086 2087
if WITH_REMOTE
USED_SYM_FILES += $(srcdir)/libvirt_remote.syms
else ! WITH_REMOTE
SYM_FILES += $(srcdir)/libvirt_remote.syms
endif ! WITH_REMOTE

2088
if WITH_OPENVZ
2089
USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms
2090
else ! WITH_OPENVZ
2091
SYM_FILES += $(srcdir)/libvirt_openvz.syms
2092
endif ! WITH_OPENVZ
2093

2094
if WITH_VMX
2095
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
2096
else ! WITH_VMX
2097
SYM_FILES += $(srcdir)/libvirt_vmx.syms
2098
endif ! WITH_VMX
2099

2100 2101 2102 2103 2104 2105
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 已提交
2106 2107 2108 2109 2110
if WITH_XENCONFIG
USED_SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
else ! WITH_XENCONFIG
SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
endif ! WITH_XENCONFIG
2111

2112 2113 2114 2115 2116 2117
if WITH_LIBXL
USED_SYM_FILES += $(srcdir)/libvirt_xenxlconfig.syms
else ! WITH_LIBXL
SYM_FILES += $(srcdir)/libvirt_xenxlconfig.syms
endif ! WITH_LIBXL

2118
if WITH_SASL
2119
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
2120
else ! WITH_SASL
2121
SYM_FILES += $(srcdir)/libvirt_sasl.syms
2122
endif ! WITH_SASL
E
Eric Blake 已提交
2123

2124 2125
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2126
else ! WITH_GNUTLS
2127
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2128
endif ! WITH_GNUTLS
2129

2130
if WITH_SSH2
2131
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2132
else ! WITH_SSH2
2133
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2134
endif ! WITH_SSH2
2135

2136
if WITH_ATOMIC_OPS_PTHREAD
2137
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
2138
else ! WITH_ATOMIC_OPS_PTHREAD
2139
SYM_FILES += $(srcdir)/libvirt_atomic.syms
2140
endif ! WITH_ATOMIC_OPS_PTHREAD
2141

2142 2143 2144 2145 2146 2147
if WITH_LIBSSH
USED_SYM_FILES += $(srcdir)/libvirt_libssh.syms
else ! WITH_LIBSSH
SYM_FILES += $(srcdir)/libvirt_libssh.syms
endif ! WITH_LIBSSH

2148
EXTRA_DIST += \
2149 2150 2151
	libvirt_public.syms		\
	libvirt_lxc.syms		\
	libvirt_qemu.syms		\
2152
	libvirt_admin_public.syms	\
2153
	$(SYM_FILES)			\
2154
	$(ADMIN_SYM_FILES)		\
2155
	$(NULL)
2156

2157
BUILT_SOURCES += $(GENERATED_SYM_FILES)
2158

2159 2160
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(ACCESS_DRIVER_SYM_FILES) \
2161
		$(top_builddir)/config.status
2162 2163 2164 2165 2166 2167
	$(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 && \
2168
	cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
2169 2170
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
2171
	mv $@-tmp libvirt.syms
2172

2173
%.def: %.syms
2174 2175
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
2176 2177
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d'	\
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
2178
	chmod a-w $@-tmp && \
2179
	mv $@-tmp $@
2180

2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193
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

2194 2195 2196 2197
# 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 已提交
2198 2199 2200 2201 2202 2203 2204 2205 2206
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)			\
2207
		$(AM_LDFLAGS)
M
Martin Kletzander 已提交
2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219

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 += \
2220
		$(XDR_CFLAGS)			\
M
Martin Kletzander 已提交
2221 2222 2223 2224
		$(CAPNG_CFLAGS)			\
		$(YAJL_CFLAGS)			\
		$(SSH2_CFLAGS)			\
		$(SASL_CFLAGS)			\
2225 2226
		$(GNUTLS_CFLAGS)		\
		$(LIBSSH_CFLAGS)
M
Martin Kletzander 已提交
2227 2228 2229 2230 2231 2232 2233 2234

libvirt_admin_la_LIBADD += \
		$(CAPNG_LIBS)			\
		$(YAJL_LIBS)			\
		$(DEVMAPPER_LIBS)		\
		$(LIBXML_LIBS)			\
		$(SSH2_LIBS)			\
		$(SASL_LIBS)			\
2235 2236
		$(GNUTLS_LIBS)			\
		$(LIBSSH_LIBS)
M
Martin Kletzander 已提交
2237

2238 2239
ADMIN_SYM_FILES = $(srcdir)/libvirt_admin_private.syms

M
Martin Kletzander 已提交
2240 2241 2242 2243
if WITH_DTRACE_PROBES
libvirt_admin_la_LIBADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

2244 2245
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
2246 2247 2248 2249 2250 2251
libvirt_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(LIBVIRT_NODELETE) \
		$(AM_LDFLAGS) \
		$(NULL)
2252
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
2253
libvirt_la_LIBADD += \
2254
		    $(DRIVER_MODULES_LIBS) \
2255
		    $(CYGWIN_EXTRA_LIBADD)
2256
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
2257 2258 2259 2260 2261 2262
# 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)
2263

2264
if WITH_DTRACE_PROBES
2265
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
2266
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
2267
nodist_libvirt_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2268
if WITH_REMOTE
E
Eric Blake 已提交
2269
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2270
endif WITH_REMOTE
2271 2272
if WITH_DRIVER_MODULES
DTRACE2SYSTEMTAP_FLAGS = --with-modules
2273
endif WITH_DRIVER_MODULES
2274

2275 2276 2277
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

if WITH_QEMU
2278
libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.lo
2279
nodist_libvirt_driver_qemu_la_SOURCES = libvirt_qemu_probes.h
2280
BUILT_SOURCES += libvirt_qemu_probes.h
2281
endif WITH_QEMU
2282 2283

tapsetdir = $(datadir)/systemtap/tapset
2284
tapset_DATA = libvirt_probes.stp libvirt_qemu_probes.stp libvirt_functions.stp
2285

2286
%_probes.h: %_probes.d
2287 2288
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

E
Eric Blake 已提交
2289
.PRECIOUS: %_probes.o
2290
%_probes.o: %_probes.d
2291 2292
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

2293 2294 2295 2296 2297 2298 2299 2300 2301
%_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 已提交
2302
# Keep this list synced with PROTOCOL_STRUCTS
J
Jiri Denemark 已提交
2303 2304 2305
RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
2306
		  $(srcdir)/remote/lxc_protocol.x \
2307 2308
		  $(srcdir)/remote/qemu_protocol.x \
		  $(srcdir)/lxc/lxc_monitor_protocol.x \
M
Martin Kletzander 已提交
2309 2310
		  $(srcdir)/locking/lock_protocol.x \
		  $(srcdir)/admin/admin_protocol.x
2311 2312

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

2315 2316
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl \
		$(top_builddir)/config.status
2317
	$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
2318
	  $(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
2319

2320
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
2321
              libvirt_qemu_probes.h libvirt_qemu_probes.o \
2322
              libvirt_qemu_probes.lo\
2323 2324
              libvirt_functions.stp libvirt_probes.stp \
              libvirt_qemu_probes.stp
2325
endif WITH_DTRACE_PROBES
2326

2327
EXTRA_DIST += libvirt_probes.d libvirt_qemu_probes.d
2328

C
Chris Lalancette 已提交
2329
libvirt_qemu_la_SOURCES = libvirt-qemu.c
D
Daniel P. Berrange 已提交
2330 2331 2332 2333 2334
libvirt_qemu_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
2335
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
C
Chris Lalancette 已提交
2336
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
2337

2338
libvirt_lxc_la_SOURCES = libvirt-lxc.c
D
Daniel P. Berrange 已提交
2339 2340 2341 2342 2343
libvirt_lxc_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
2344 2345 2346
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)

2347 2348 2349 2350 2351 2352 2353
# 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
2354
if WITH_SETUID_RPC_CLIENT
2355 2356 2357 2358
noinst_LTLIBRARIES += libvirt-setuid-rpc-client.la

libvirt_setuid_rpc_client_la_SOURCES = 		\
		util/viralloc.c			\
2359 2360
		util/viratomic.c		\
		util/viratomic.h		\
2361 2362
		util/virbitmap.c		\
		util/virbuffer.c		\
2363
		util/vircgroup.c		\
2364 2365
		util/vircommand.c		\
		util/virconf.c			\
2366
		util/virdbus.c			\
2367 2368 2369 2370
		util/virerror.c			\
		util/virevent.c			\
		util/vireventpoll.c		\
		util/virfile.c			\
2371
		util/virgettext.c		\
2372 2373
		util/virhash.c			\
		util/virhashcode.c		\
2374
		util/virhostcpu.c		\
2375 2376 2377 2378 2379 2380 2381 2382
		util/virjson.c			\
		util/virlog.c			\
		util/virobject.c		\
		util/virpidfile.c		\
		util/virprocess.c		\
		util/virrandom.c		\
		util/virsocketaddr.c		\
		util/virstring.c		\
2383
		util/virsystemd.c		\
2384 2385
		util/virtime.c			\
		util/virthread.c		\
2386
		util/virthreadjob.c		\
2387 2388 2389 2390 2391
		util/virtypedparam.c		\
		util/viruri.c			\
		util/virutil.c			\
		util/viruuid.c			\
		conf/domain_event.c		\
2392
		conf/network_event.c		\
2393
		conf/object_event.c		\
2394
		conf/storage_event.c            \
2395
		conf/node_device_event.c	\
2396
		conf/secret_event.c		\
2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412
		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			\
2413
		libvirt-domain.c		\
2414
		libvirt-domain-snapshot.c	\
2415
		libvirt-host.c			\
2416
		libvirt-interface.c		\
2417
		libvirt-network.c		\
2418
		libvirt-nodedev.c		\
2419
		libvirt-nwfilter.c		\
2420
		libvirt-secret.c		\
2421
		libvirt-storage.c		\
2422
		libvirt-stream.c		\
2423 2424 2425 2426 2427 2428
		libvirt-lxc.c			\
		$(NULL)

libvirt_setuid_rpc_client_la_LDFLAGS =		\
		$(AM_LDFLAGS)			\
		$(LIBXML_LIBS)			\
J
Jim Fehlig 已提交
2429
		$(SECDRIVER_LIBS)		\
2430 2431 2432
		$(NULL)
libvirt_setuid_rpc_client_la_CFLAGS =		\
		-DLIBVIRT_SETUID_RPC_CLIENT	\
2433 2434
		-I$(srcdir)/conf		\
		-I$(srcdir)/rpc			\
2435
		$(AM_CFLAGS)			\
J
Jim Fehlig 已提交
2436
		$(SECDRIVER_CFLAGS)		\
P
Pavel Fedin 已提交
2437
		$(XDR_CFLAGS)			\
2438
		$(NULL)
2439
endif WITH_SETUID_RPC_CLIENT
2440

2441 2442 2443
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

2444
if WITH_LIBVIRTD
2445 2446 2447 2448 2449
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
		$(LOCK_DRIVER_LOCKD_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
		$(NULL)
2450
lockd_la_CFLAGS = -I$(srcdir)/conf \
E
Eric Blake 已提交
2451 2452
		$(XDR_CFLAGS) \
		$(AM_CFLAGS)
2453
lockd_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
2454 2455 2456 2457
lockd_la_LIBADD = ../gnulib/lib/libgnu.la \
	libvirt-net-rpc.la \
	libvirt-net-rpc-client.la \
	$(NULL)
J
Jiri Denemark 已提交
2458
augeas_DATA += locking/libvirt_lockd.aug
2459 2460
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
2461
endif WITH_DTRACE_PROBES
2462
if WITH_QEMU
2463 2464
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
2465
nodist_conf_DATA += locking/qemu-lockd.conf
2466 2467
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
2468
endif WITH_QEMU
2469

2470 2471 2472 2473 2474 2475
if WITH_LIBXL
nodist_conf_DATA += locking/libxl-lockd.conf
BUILT_SOURCES += locking/libxl-lockd.conf
DISTCLEANFILES += locking/libxl-lockd.conf
endif WITH_LIBXL

2476 2477 2478 2479 2480
locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
	$(AM_V_GEN)$(MKDIR_P) locking ; \
	cp $< $@


2481
sbin_PROGRAMS = virtlockd virtlogd
2482

2483 2484 2485
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
2486
		$(LOCK_DAEMON_GENERATED) \
2487
		$(NULL)
2488 2489
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
2490
		$(PIE_CFLAGS) \
2491
		$(XDR_CFLAGS) \
2492 2493 2494
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
2495
		$(PIE_LDFLAGS) \
2496 2497 2498 2499 2500 2501 2502 2503 2504 2505
		$(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
2506
endif WITH_DTRACE_PROBES
2507

2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533

virtlogd_SOURCES = \
		$(LOG_DAEMON_SOURCES) \
		$(LOG_PROTOCOL_GENERATED) \
		$(LOG_DAEMON_GENERATED) \
		$(NULL)
virtlogd_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(XDR_CFLAGS) \
		$(NULL)
virtlogd_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
virtlogd_LDADD = \
		libvirt-net-rpc-server.la \
		libvirt-net-rpc.la \
		libvirt_util.la \
		../gnulib/lib/libgnu.la \
		$(CYGWIN_EXTRA_LIBADD) \
		$(NULL)
if WITH_DTRACE_PROBES
virtlogd_LDADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

2534
else ! WITH_LIBVIRTD
2535
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
2536 2537
              $(LOCK_DRIVER_LOCKD_SOURCES) \
	      $(LOG_DAEMON_SOURCES)
2538
endif ! WITH_LIBVIRTD
2539

2540 2541
EXTRA_DIST += \
	locking/virtlockd.sysconf \
J
Jiri Denemark 已提交
2542 2543
	locking/lockd.conf \
	locking/libvirt_lockd.aug \
2544
	locking/test_libvirt_lockd.aug.in \
2545
	logging/virtlogd.sysconf
2546 2547

install-sysconfig:
E
Eric Blake 已提交
2548
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
2549 2550
	$(INSTALL_DATA) $(srcdir)/locking/virtlockd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
2551 2552
	$(INSTALL_DATA) $(srcdir)/logging/virtlogd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlogd
2553 2554

uninstall-sysconfig:
2555
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlogd
2556
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
E
Eric Blake 已提交
2557
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
2558

2559
EXTRA_DIST += locking/virtlockd.init.in logging/virtlogd.init.in
2560 2561 2562

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_RED_HAT
2563
install-init:: virtlockd.init virtlogd.init install-sysconfig
E
Eric Blake 已提交
2564
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
2565 2566
	$(INSTALL_SCRIPT) virtlockd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
2567 2568
	$(INSTALL_SCRIPT) virtlogd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlogd
2569 2570

uninstall-init:: uninstall-sysconfig
E
Eric Blake 已提交
2571
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
2572
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlogd
E
Eric Blake 已提交
2573
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
2574

2575 2576
BUILT_SOURCES += virtlockd.init virtlogd.init
DISTCLEANFILES += virtlockd.init virtlogd.init
2577
else ! LIBVIRT_INIT_SCRIPT_RED_HAT
2578 2579
install-init::
uninstall-init::
2580 2581
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
else ! WITH_LIBVIRTD
2582 2583
install-init::
uninstall-init::
2584
endif ! WITH_LIBVIRTD
2585 2586

virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
2587 2588 2589 2590 2591 2592
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g'		\
	    < $< > $@-t &&					\
	    chmod a+x $@-t &&					\
2593 2594
	    mv $@-t $@

2595 2596 2597 2598 2599 2600 2601 2602 2603
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 $@

2604
POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)"
2605

2606
virtlockd.8.in: locking/virtlockd.pod
2607 2608 2609 2610 2611 2612 2613 2614
	$(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 $@
2615

2616
virtlogd.8.in: logging/virtlogd.pod
2617 2618 2619 2620 2621 2622 2623 2624
	$(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 $@
2625

2626
%.8: %.8.in $(top_srcdir)/configure.ac
2627
	$(AM_V_GEN)sed \
2628 2629 2630
		-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
		-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
		< $< > $@-t && \
2631 2632
	mv $@-t $@

2633
if WITH_LIBVIRTD
2634
man8_MANS = virtlockd.8 virtlogd.8
2635

2636
conf_DATA += locking/virtlockd.conf logging/virtlogd.conf
2637

2638 2639
augeas_DATA += locking/virtlockd.aug logging/virtlogd.aug
augeastest_DATA += test_virtlockd.aug test_virtlogd.aug
2640
endif WITH_LIBVIRTD
2641

A
Andrea Bolognani 已提交
2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653
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)
2654 2655 2656 2657

EXTRA_DIST += \
        locking/virtlockd.service.in \
        locking/virtlockd.socket.in \
2658 2659 2660
        locking/virtlockd.aug \
        locking/virtlockd.conf \
        locking/test_virtlockd.aug.in \
2661 2662 2663 2664 2665
        logging/virtlogd.service.in \
        logging/virtlogd.socket.in \
        logging/virtlogd.aug \
        logging/virtlogd.conf \
        logging/test_virtlogd.aug.in \
A
Andrea Bolognani 已提交
2666 2667
        $(PODFILES) \
        $(MANINFILES) \
2668
        $(NULL)
2669

2670 2671 2672 2673

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

2674
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
2675

2676 2677 2678 2679
BUILT_SOURCES += virtlockd.service virtlockd.socket \
		 virtlogd.service virtlogd.socket
DISTCLEANFILES += virtlockd.service virtlockd.socket \
		  virtlogd.service virtlogd.socket
2680

2681 2682
install-systemd: virtlockd.service virtlockd.socket \
                 virtlogd.service virtlogd.socket install-sysconfig
E
Eric Blake 已提交
2683
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
2684
	$(INSTALL_DATA) virtlockd.service \
2685
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2686
	$(INSTALL_DATA) virtlockd.socket \
2687
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2688 2689 2690 2691
	$(INSTALL_DATA) virtlogd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
	$(INSTALL_DATA) virtlogd.socket \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2692 2693

uninstall-systemd: uninstall-sysconfig
E
Eric Blake 已提交
2694 2695
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.socket
2696 2697
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlogd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlogd.socket
E
Eric Blake 已提交
2698
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
2699
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
2700 2701
install-systemd:
uninstall-systemd:
2702 2703
endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
else ! WITH_LIBVIRTD
2704 2705
install-systemd:
uninstall-systemd:
2706
endif ! WITH_LIBVIRTD
2707 2708

virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
2709 2710 2711
	$(AM_V_GEN)sed						\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    < $< > $@-t &&					\
2712 2713 2714
	    mv $@-t $@

virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
2715 2716 2717
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    < $< > $@-t &&					\
2718 2719
	    mv $@-t $@

2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731
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 $@

2732

2733
if WITH_SANLOCK
2734
lockdriver_LTLIBRARIES += sanlock.la
2735
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
2736
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
2737
sanlock_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
2738
sanlock_la_LIBADD = -lsanlock_client \
2739 2740 2741
		../gnulib/lib/libgnu.la

augeas_DATA += locking/libvirt_sanlock.aug
2742 2743
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
2744

E
Eric Blake 已提交
2745
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
2746
	$(AM_V_GEN)$(MKDIR_P) locking ; \
2747 2748 2749
	cp $< $@

if WITH_QEMU
2750
nodist_conf_DATA += locking/qemu-sanlock.conf
2751
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
2752
DISTCLEANFILES += locking/qemu-sanlock.conf
2753
endif WITH_QEMU
2754 2755 2756 2757 2758 2759

if WITH_LIBXL
nodist_conf_DATA += locking/libxl-sanlock.conf
BUILT_SOURCES += locking/libxl-sanlock.conf
DISTCLEANFILES += locking/libxl-sanlock.conf
endif WITH_LIBXL
2760
else ! WITH_SANLOCK
2761
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
2762
endif ! WITH_SANLOCK
2763 2764
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
2765
	locking/test_libvirt_sanlock.aug.in
2766

2767 2768 2769 2770
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
2771

2772
EXTRA_DIST += \
E
Eric Blake 已提交
2773 2774 2775 2776
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
2777 2778
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
2779

E
Eric Blake 已提交
2780
VIR_NET_RPC_GENERATED = \
2781 2782 2783 2784
	rpc/virnetprotocol.h \
	rpc/virnetprotocol.c \
	rpc/virkeepaliveprotocol.h \
	rpc/virkeepaliveprotocol.c
2785

2786
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2787

2788
libvirt_net_rpc_la_SOURCES = \
2789
	rpc/virnetmessage.h rpc/virnetmessage.c \
2790
	rpc/virnetsocket.h rpc/virnetsocket.c \
2791 2792
	rpc/virkeepalive.h rpc/virkeepalive.c \
	$(VIR_NET_RPC_GENERATED)
2793
if WITH_SSH2
2794 2795
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2796
else ! WITH_SSH2
2797 2798
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2799
endif ! WITH_SSH2
2800
if WITH_GNUTLS
2801 2802
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2803
else ! WITH_GNUTLS
2804 2805
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2806
endif ! WITH_GNUTLS
2807
if WITH_SASL
2808 2809
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2810
else ! WITH_SASL
2811 2812
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2813
endif ! WITH_SASL
2814 2815 2816 2817 2818 2819 2820
if WITH_LIBSSH
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetlibsshsession.h rpc/virnetlibsshsession.c
else ! WITH_LIBSSH
EXTRA_DIST += \
	rpc/virnetlibsshsession.h rpc/virnetlibsshsession.c
endif ! WITH_LIBSSH
2821
libvirt_net_rpc_la_CFLAGS = \
2822
			$(GNUTLS_CFLAGS) \
2823
			$(SASL_CFLAGS) \
2824
			$(SSH2_CFLAGS) \
2825
			$(LIBSSH_CFLAGS) \
2826
			$(XDR_CFLAGS) \
2827 2828
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
2829
			$(GNUTLS_LIBS) \
2830
			$(SASL_LIBS) \
2831
			$(SSH2_LIBS)\
2832
			$(LIBSSH_LIBS) \
J
Jim Fehlig 已提交
2833
			$(SECDRIVER_LIBS) \
2834
			$(AM_LDFLAGS) \
2835
			$(NULL)
2836 2837 2838
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2839 2840 2841 2842
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
2843
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
2844
	rpc/virnetdaemon.h rpc/virnetdaemon.c \
2845 2846
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
2847
			$(AVAHI_CFLAGS) \
2848
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
2849
			$(XDR_CFLAGS) \
2850
			$(AM_CFLAGS)
2851 2852
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
2853
			$(AVAHI_LIBS) \
2854
			$(DBUS_LIBS) \
2855
			$(NULL)
2856 2857 2858
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2859 2860 2861 2862 2863
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 已提交
2864 2865
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
2866
libvirt_net_rpc_client_la_LDFLAGS = $(AM_LDFLAGS)
2867 2868
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
2869

2870 2871
libexec_PROGRAMS =

2872
if WITH_LIBVIRTD
2873 2874
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2875 2876 2877 2878
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2879 2880 2881
libvirt_iohelper_LDADD =		\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
2882 2883
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
2884
endif WITH_DTRACE_PROBES
2885

D
Daniel P. Berrange 已提交
2886 2887 2888 2889
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2890 2891 2892 2893

if WITH_NETWORK
libexec_PROGRAMS += libvirt_leaseshelper
libvirt_leaseshelper_SOURCES = $(NETWORK_LEASES_HELPER_SOURCES)
2894 2895 2896 2897
libvirt_leaseshelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912
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

2913
endif WITH_LIBVIRTD
2914

2915
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
2916
if WITH_LIBVIRTD
2917
libexec_PROGRAMS += libvirt_parthelper
2918

2919
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
D
Daniel P. Berrange 已提交
2920 2921 2922 2923
libvirt_parthelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2924 2925 2926 2927
libvirt_parthelper_LDADD =		\
		$(LIBPARTED_LIBS)	\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
2928 2929
if WITH_DTRACE_PROBES
libvirt_parthelper_LDADD += libvirt_probes.lo
2930
endif WITH_DTRACE_PROBES
2931

D
Daniel P. Berrange 已提交
2932 2933 2934 2935 2936
libvirt_parthelper_CFLAGS = \
		$(LIBPARTED_CFLAGS) \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2937 2938
endif WITH_LIBVIRTD
endif WITH_STORAGE_DISK
2939 2940
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)

2941

2942
if WITH_SANLOCK
2943 2944 2945
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2946
libvirt_sanlock_helper_CFLAGS = \
2947
		-I$(srcdir)/conf \
D
Daniel P. Berrange 已提交
2948 2949 2950 2951 2952 2953 2954
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2955
libvirt_sanlock_helper_LDADD = libvirt.la
2956
endif WITH_SANLOCK
2957

2958 2959 2960 2961 2962 2963
if WITH_LXC
if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_lxc

libvirt_lxc_SOURCES =						\
		$(LXC_CONTROLLER_SOURCES)			\
O
Osier Yang 已提交
2964 2965
		$(NODE_INFO_SOURCES)				\
		$(DATATYPES_SOURCES)
D
Daniel P. Berrange 已提交
2966 2967 2968 2969
libvirt_lxc_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2970
libvirt_lxc_LDADD =			\
G
Gao feng 已提交
2971
		$(FUSE_LIBS) \
2972 2973
		libvirt-net-rpc-server.la \
		libvirt-net-rpc.la \
2974
		libvirt_security_manager.la \
2975 2976
		libvirt_conf.la \
		libvirt_util.la \
2977
		../gnulib/lib/libgnu.la
2978
if WITH_DTRACE_PROBES
2979
libvirt_lxc_LDADD += libvirt_probes.lo
2980
endif WITH_DTRACE_PROBES
2981
libvirt_lxc_LDADD += $(SECDRIVER_LIBS)
2982
libvirt_lxc_CFLAGS =				\
2983
		-I$(srcdir)/conf	\
2984
		$(AM_CFLAGS)                    \
D
Daniel P. Berrange 已提交
2985
		$(PIE_CFLAGS)			\
G
Gao feng 已提交
2986
		$(LIBNL_CFLAGS)			\
D
Daniel P. Berrange 已提交
2987
		$(FUSE_CFLAGS)			\
2988
		$(DBUS_CFLAGS)			\
P
Pavel Fedin 已提交
2989
		$(XDR_CFLAGS)			\
D
Daniel P. Berrange 已提交
2990
		$(NULL)
2991
if WITH_BLKID
2992 2993
libvirt_lxc_CFLAGS += $(BLKID_CFLAGS)
libvirt_lxc_LDADD += $(BLKID_LIBS)
2994
endif WITH_BLKID
J
Jim Fehlig 已提交
2995
libvirt_lxc_CFLAGS += $(SECDRIVER_CFLAGS)
2996 2997
endif WITH_LIBVIRTD
endif WITH_LXC
2998 2999
EXTRA_DIST += $(LXC_CONTROLLER_SOURCES)

J
Jamie Strandboge 已提交
3000 3001 3002 3003 3004 3005
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 已提交
3006 3007 3008 3009
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
J
Jamie Strandboge 已提交
3010
virt_aa_helper_LDADD =						\
3011
		libvirt.la					\
C
Chris Lalancette 已提交
3012 3013
		libvirt_conf.la					\
		libvirt_util.la					\
3014
		libvirt_driver_storage_impl.la			\
C
Chris Lalancette 已提交
3015
		../gnulib/lib/libgnu.la
3016
if WITH_DTRACE_PROBES
3017
virt_aa_helper_LDADD += libvirt_probes.lo
3018
endif WITH_DTRACE_PROBES
J
Jamie Strandboge 已提交
3019
virt_aa_helper_CFLAGS =						\
3020 3021 3022 3023
		-I$(srcdir)/conf				\
		-I$(srcdir)/security				\
		$(AM_CFLAGS) 					\
		$(PIE_CFLAGS) 					\
D
Daniel P. Berrange 已提交
3024
		$(NULL)
3025 3026
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
J
Jamie Strandboge 已提交
3027 3028
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

3029
if WITH_NSS
3030 3031 3032 3033 3034
noinst_LTLIBRARIES += libvirt-nss.la

libvirt_nss_la_SOURCES =		\
		util/viralloc.c			\
		util/viralloc.h			\
K
Kai Kang 已提交
3035 3036
		util/viratomic.c		\
		util/viratomic.h		\
3037 3038 3039 3040 3041 3042 3043 3044 3045 3046
		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			\
3047 3048 3049 3050
		util/virhash.c			\
		util/virhash.h			\
		util/virhashcode.c		\
		util/virhashcode.h		\
3051 3052 3053 3054 3055 3056 3057 3058
		util/virjson.c			\
		util/virjson.h			\
		util/virkmod.c			\
		util/virkmod.h			\
		util/virlease.c			\
		util/virlease.h			\
		util/virlog.c			\
		util/virlog.h			\
3059 3060
		util/virmacmap.c		\
		util/virmacmap.h		\
3061 3062 3063 3064 3065 3066
		util/virobject.c		\
		util/virobject.h		\
		util/virpidfile.c		\
		util/virpidfile.h		\
		util/virprocess.c		\
		util/virprocess.h		\
3067 3068
		util/virrandom.c		\
		util/virrandom.h		\
3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094
		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)
3095
endif WITH_NSS
3096 3097


3098
install-data-local: install-init install-systemd
3099 3100
if WITH_LIBVIRTD
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
3101
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
3102
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
3103
endif WITH_LIBVIRTD
3104 3105
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
3106
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
3107
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
3108
if WITH_SANLOCK
3109
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
3110
endif WITH_SANLOCK
3111
if WITH_QEMU
3112
	$(MKDIR_P) -m 0751 "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu"
3113
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu"
3114
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu"
3115
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu"
3116
endif WITH_QEMU
3117 3118 3119
if WITH_LXC
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lxc"
3120
endif WITH_LXC
J
Jim Fehlig 已提交
3121 3122 3123
if WITH_LIBXL
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/libxl"
J
Jim Fehlig 已提交
3124
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl"
3125
endif WITH_LIBXL
3126 3127 3128
if WITH_UML
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/uml"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/uml"
3129
endif WITH_UML
3130 3131
if WITH_XEN
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/xen"
3132
endif WITH_XEN
3133 3134
if WITH_NETWORK
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network"
3135
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq"
3136
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/network"
3137
	$(MKDIR_P) "$(DESTDIR)$(confdir)/qemu/networks/autostart"
3138
	$(INSTALL_DATA) $(srcdir)/network/default.xml \
3139
	  $(DESTDIR)$(confdir)/qemu/networks/default.xml
3140
	test -z "$(UUID)" || \
3141 3142 3143
	  { sed -e "s,</name>,</name>;  <uuid>$(UUID)</uuid>," \
	      $(DESTDIR)$(confdir)/qemu/networks/default.xml | \
	      tr ";" "\n" > \
3144 3145 3146 3147
	      $(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 已提交
3148
	( cd $(DESTDIR)$(confdir)/qemu/networks/autostart && \
3149 3150
	  rm -f default.xml && \
	  $(LN_S) ../default.xml default.xml )
3151
endif WITH_NETWORK
3152

3153
uninstall-local:: uninstall-init uninstall-systemd
3154
if WITH_LIBVIRTD
3155
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
3156 3157
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
3158
endif WITH_LIBVIRTD
3159 3160
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
3161
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
3162
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
3163
if WITH_SANLOCK
3164
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
3165
endif WITH_SANLOCK
3166 3167 3168 3169 3170
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" ||:
3171
endif WITH_QEMU
3172 3173 3174
if WITH_LXC
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||:
3175
endif WITH_LXC
J
Jim Fehlig 已提交
3176 3177 3178
if WITH_LIBXL
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||:
J
Jim Fehlig 已提交
3179
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||:
3180
endif WITH_LIBXL
3181 3182 3183
if WITH_UML
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/uml" ||:
3184
endif WITH_UML
3185 3186
if WITH_XEN
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/xen" ||:
3187
endif WITH_XEN
3188
if WITH_NETWORK
3189 3190 3191 3192
	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" || :
3193 3194
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||:
3195
endif WITH_NETWORK
3196
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
3197

3198 3199
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
3200
MAINTAINERCLEANFILES += $(REMOTE_DRIVER_GENERATED) $(VIR_NET_RPC_GENERATED)