Makefile.am 98.4 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_MODULE_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/virstats.c util/virstats.h	\
173
		util/virstorageencryption.c util/virstorageencryption.h \
174 175 176
		util/virstoragefile.c util/virstoragefile.h	\
		util/virstring.h util/virstring.c		\
		util/virsysinfo.c util/virsysinfo.h		\
177
		util/virsystemd.c util/virsystemd.h		\
178
		util/virthread.c util/virthread.h		\
P
Pavel Hrdina 已提交
179
		util/virthreadjob.c util/virthreadjob.h		\
180 181
		util/virthreadpool.c util/virthreadpool.h	\
		util/virtime.h util/virtime.c			\
182
		util/virtpm.h util/virtpm.c			\
183
		util/virtypedparam.c util/virtypedparam.h	\
184
		util/virusb.c util/virusb.h			\
185 186
		util/viruri.h util/viruri.c			\
		util/virutil.c util/virutil.h			\
187
		util/viruuid.c util/viruuid.h			\
188
		util/virxdrdefs.h                               \
189
		util/virxml.c util/virxml.h			\
190
		$(NULL)
L
Lai Jiangshan 已提交
191

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

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

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

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

239 240 241
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

242 243
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
244

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

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

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

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

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

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

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


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

290 291
DRIVER_SOURCES += $(LOG_PROTOCOL_GENERATED)

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


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

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

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

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

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

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

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

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

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

370
NWFILTER_CONF_SOURCES =						\
371 372 373
		$(NWFILTER_PARAM_CONF_SOURCES)			\
		conf/nwfilter_conf.c conf/nwfilter_conf.h

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

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

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

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

391 392
CPU_CONF_SOURCES =						\
		conf/cpu_conf.c conf/cpu_conf.h
393

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

398 399 400 401
# Device Helper APIs
DEVICE_CONF_SOURCES =                                           \
		conf/device_conf.c conf/device_conf.h

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

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

REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x
434
LXC_PROTOCOL = $(srcdir)/remote/lxc_protocol.x
E
Eric Blake 已提交
435
QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x
436
REMOTE_DRIVER_PROTOCOL = $(REMOTE_PROTOCOL) $(QEMU_PROTOCOL) $(LXC_PROTOCOL)
437

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

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

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

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

460
EXTRA_DIST +=  $(REMOTE_DRIVER_PROTOCOL) \
461
		$(REMOTE_DRIVER_GENERATED)
462

M
Martin Kletzander 已提交
463 464 465 466
ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x

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

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

480 481 482 483 484 485 486 487 488 489
# 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
490 491 492 493

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

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

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

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

584
if WITH_REMOTE
585 586
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)

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

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

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

EXTRA_DIST += check-drivername.pl

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

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

667 668 669

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

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

680 681 682 683 684
check-aclperms:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclperms.pl \
		$(srcdir)/access/viraccessperm.h \
		$(srcdir)/access/viraccessperm.c

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

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

692 693
# Mock driver, covering domains, storage, networks, etc
TEST_DRIVER_SOURCES =						\
694
		test/test_driver.c test/test_driver.h
695 696 697

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

708
LXC_MONITOR_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
709 710
	lxc/lxc_monitor_protocol.h \
	lxc/lxc_monitor_protocol.c \
711 712 713
	$(NULL)

LXC_MONITOR_GENERATED = \
E
Eric Blake 已提交
714
	lxc/lxc_monitor_dispatch.h \
715 716 717
	$(NULL)

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

LXC_GENERATED = \
722
	$(LXC_MONITOR_PROTOCOL_GENERATED) \
723 724 725 726
	$(LXC_MONITOR_GENERATED) \
	$(LXC_CONTROLLER_GENERATED) \
	$(NULL)

727
LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x
728

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

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

EXTRA_DIST += \
742
	$(LXC_MONITOR_PROTOCOL) \
743 744 745 746 747
	$(LXC_GENERATED) \
	$(NULL)

BUILT_SOURCES += $(LXC_GENERATED)

748 749
CLEANFILES += $(LXC_GENERATED)

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

764
LXC_CONTROLLER_SOURCES =					\
765
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
766
		$(LXC_CONTROLLER_GENERATED)			\
767 768
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
769
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
770
		lxc/lxc_domain.c lxc/lxc_domain.h		\
G
Gao feng 已提交
771
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
772
		lxc/lxc_controller.c
773

J
Jamie Strandboge 已提交
774
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES =			\
E
Eric Blake 已提交
775
		$(DATATYPES_SOURCES)				\
J
Jamie Strandboge 已提交
776 777
		security/virt-aa-helper.c

778 779 780
PHYP_DRIVER_SOURCES =						\
		phyp/phyp_driver.c phyp/phyp_driver.h

781
OPENVZ_DRIVER_SOURCES =						\
782
		openvz/openvz_conf.c openvz/openvz_conf.h	\
783 784
		openvz/openvz_driver.c openvz/openvz_driver.h   \
		openvz/openvz_util.c openvz/openvz_util.h
785

E
Eric Blake 已提交
786
VMWARE_DRIVER_SOURCES =						\
787
		vmware/vmware_driver.c vmware/vmware_driver.h	\
788 789
		vmware/vmware_conf.c vmware/vmware_conf.h

790
VBOX_DRIVER_SOURCES =						\
E
Eric Blake 已提交
791 792
	vbox/vbox_glue.c vbox/vbox_glue.h			\
	vbox/vbox_driver.c vbox/vbox_driver.h			\
T
Taowei 已提交
793
	vbox/vbox_snapshot_conf.c vbox/vbox_snapshot_conf.h     \
E
Eric Blake 已提交
794 795 796 797
	vbox/vbox_V2_2.c vbox/vbox_CAPI_v2_2.h			\
	vbox/vbox_V3_0.c vbox/vbox_CAPI_v3_0.h			\
	vbox/vbox_V3_1.c vbox/vbox_CAPI_v3_1.h			\
	vbox/vbox_V3_2.c vbox/vbox_CAPI_v3_2.h			\
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 841
		qemu/qemu_interface.c qemu/qemu_interface.h		\
		qemu/qemu_capspriv.h
R
Richard W.M. Jones 已提交
842

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

848 849 850 851 852
LIBXL_DRIVER_SOURCES =							\
		libxl/libxl_conf.c libxl/libxl_conf.h			\
		libxl/libxl_capabilities.c libxl/libxl_capabilities.h	\
		libxl/libxl_domain.c libxl/libxl_domain.h       	\
		libxl/libxl_driver.c libxl/libxl_driver.h       	\
J
Jim Fehlig 已提交
853
		libxl/libxl_migration.c libxl/libxl_migration.h
J
Jim Fehlig 已提交
854

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

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

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

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

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

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

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

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

947 948 949 950
INTERFACE_DRIVER_SOURCES =

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

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

964 965 966
SECRET_UTIL_SOURCES =						\
		secret/secret_util.h secret/secret_util.c

967
SECRET_DRIVER_SOURCES =						\
968
		secret/secret_driver.h secret/secret_driver.c
969

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

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

978
STORAGE_DRIVER_LVM_SOURCES =					\
O
Osier Yang 已提交
979
		storage/storage_backend_logical.h		\
980
		storage/storage_backend_logical.c
981 982

STORAGE_DRIVER_ISCSI_SOURCES =					\
983
		storage/storage_backend_iscsi.h storage/storage_backend_iscsi.c
984

985
STORAGE_DRIVER_SCSI_SOURCES =					\
986
		storage/storage_backend_scsi.h storage/storage_backend_scsi.c
987

D
Dave Allan 已提交
988
STORAGE_DRIVER_MPATH_SOURCES =					\
989
		storage/storage_backend_mpath.h storage/storage_backend_mpath.c
D
Dave Allan 已提交
990

991
STORAGE_DRIVER_DISK_SOURCES =					\
992
		storage/storage_backend_disk.h storage/storage_backend_disk.c
993

994 995 996
STORAGE_DRIVER_RBD_SOURCES =					\
		storage/storage_backend_rbd.h storage/storage_backend_rbd.c

997 998 999
STORAGE_DRIVER_SHEEPDOG_SOURCES =				\
		storage/storage_backend_sheepdog.h storage/storage_backend_sheepdog.c

1000 1001 1002
STORAGE_DRIVER_GLUSTER_SOURCES =				\
		storage/storage_backend_gluster.h storage/storage_backend_gluster.c

R
Roman Bogorodskiy 已提交
1003 1004 1005
STORAGE_DRIVER_ZFS_SOURCES =					\
                storage/storage_backend_zfs.h storage/storage_backend_zfs.c

1006
STORAGE_HELPER_DISK_SOURCES =					\
1007
		storage/parthelper.c
1008

1009 1010 1011
UTIL_IO_HELPER_SOURCES =					\
		util/iohelper.c

1012 1013 1014
NETWORK_LEASES_HELPER_SOURCES =                                 \
               network/leaseshelper.c

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

1028

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

1037
SECURITY_DRIVER_SELINUX_SOURCES =				\
1038
		security/security_selinux.h security/security_selinux.c
1039

J
Jamie Strandboge 已提交
1040 1041 1042
SECURITY_DRIVER_APPARMOR_SOURCES =				\
		security/security_apparmor.h security/security_apparmor.c

1043
ACCESS_DRIVER_GENERATED = \
E
Eric Blake 已提交
1044 1045 1046 1047 1048 1049 1050
		access/viraccessapicheck.h \
		access/viraccessapicheck.c \
		access/viraccessapicheckqemu.h \
		access/viraccessapicheckqemu.c \
		access/viraccessapichecklxc.h \
		access/viraccessapichecklxc.c \
		$(NULL)
1051

1052
ACCESS_DRIVER_SYM_FILES = \
1053 1054 1055
		libvirt_access.syms \
		libvirt_access_qemu.syms \
		libvirt_access_lxc.syms
1056

1057 1058 1059 1060 1061
ACCESS_DRIVER_API_FILES = \
		libvirt_access.xml \
		libvirt_access_qemu.xml \
		libvirt_access_lxc.xml

1062 1063 1064 1065 1066 1067 1068
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

1069 1070 1071 1072
ACCESS_DRIVER_POLKIT_SOURCES = \
		access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c

ACCESS_DRIVER_POLKIT_POLICY = \
1073
		$(srcdir)/access/org.libvirt.api.policy
1074 1075


1076
NODE_DEVICE_DRIVER_SOURCES =					\
O
Osier Yang 已提交
1077 1078
		node_device/node_device_driver.c		\
		node_device/node_device_driver.h		\
1079 1080
		node_device/node_device_linux_sysfs.c           \
		node_device/node_device_linux_sysfs.h
1081 1082

NODE_DEVICE_DRIVER_HAL_SOURCES =				\
1083
		node_device/node_device_hal.c			\
1084
		node_device/node_device_hal.h
1085

1086
NODE_DEVICE_DRIVER_UDEV_SOURCES =				\
D
Daniel Veillard 已提交
1087 1088
		node_device/node_device_udev.c			\
		node_device/node_device_udev.h
1089

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

1099 1100 1101
VMX_SOURCES =							\
		vmx/vmx.c vmx/vmx.h

1102 1103
XENCONFIG_SOURCES =						\
		xenconfig/xenxs_private.h			\
1104
		xenconfig/xen_common.c xenconfig/xen_common.h   \
1105
		xenconfig/xen_sxpr.c xenconfig/xen_sxpr.h	\
1106
		xenconfig/xen_xm.c xenconfig/xen_xm.h
1107 1108 1109 1110
if WITH_LIBXL
XENCONFIG_SOURCES +=						\
		xenconfig/xen_xl.c xenconfig/xen_xl.h
endif WITH_LIBXL
1111

J
Jiri Denemark 已提交
1112 1113
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
1114
EXTRA_DIST +=	$(pkgdata_DATA)
1115

1116 1117 1118 1119 1120 1121
#########################
#
# Build up list of libvirt.la source files based on configure conditions
#
# First deal with sources usable in non-daemon context

1122
noinst_LTLIBRARIES = libvirt_util.la
1123 1124
libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
libvirt_la_BUILT_LIBADD = libvirt_util.la
1125 1126
libvirt_util_la_SOURCES =					\
		$(UTIL_SOURCES)
1127
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
1128
		$(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
1129
		$(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS)	\
1130
		$(POLKIT_CFLAGS) $(GNUTLS_CFLAGS) \
1131
		-I$(srcdir)/conf
1132
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
1133
		$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
1134
		$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(MSCOM_LIBS) $(LIBXML_LIBS) \
1135
		$(SECDRIVER_LIBS) $(NUMACTL_LIBS) \
1136
		$(POLKIT_LIBS)
1137

1138 1139

noinst_LTLIBRARIES += libvirt_conf.la
1140
libvirt_la_BUILT_LIBADD += libvirt_conf.la
1141
libvirt_conf_la_SOURCES = $(CONF_SOURCES)
1142 1143
libvirt_conf_la_CFLAGS = \
		-I$(srcdir)/conf $(AM_CFLAGS)
1144
libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS)
1145
libvirt_conf_la_LIBADD = $(LIBXML_LIBS)
1146

J
Jiri Denemark 已提交
1147
noinst_LTLIBRARIES += libvirt_cpu.la
1148
libvirt_la_BUILT_LIBADD += libvirt_cpu.la
J
Jiri Denemark 已提交
1149
libvirt_cpu_la_CFLAGS = \
1150
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jiri Denemark 已提交
1151 1152
libvirt_cpu_la_SOURCES = $(CPU_SOURCES)

1153 1154 1155 1156 1157 1158
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)

1159 1160 1161 1162
if WITH_VMX
noinst_LTLIBRARIES += libvirt_vmx.la
libvirt_la_BUILT_LIBADD += libvirt_vmx.la
libvirt_vmx_la_CFLAGS = \
1163
		-I$(srcdir)/conf $(AM_CFLAGS)
1164
libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
1165
endif WITH_VMX
1166

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

1176

1177
noinst_LTLIBRARIES += libvirt_driver.la
1178
libvirt_la_BUILT_LIBADD += libvirt_driver.la
1179
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
1180

1181
libvirt_driver_la_CFLAGS = \
1182
		$(GNUTLS_CFLAGS) $(CURL_CFLAGS) $(XDR_CFLAGS) \
1183
		-I$(srcdir)/conf $(AM_CFLAGS)
1184
libvirt_driver_la_LIBADD = \
1185
		$(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS)
1186

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

1197
if WITH_TEST
1198
noinst_LTLIBRARIES += libvirt_driver_test.la
1199
libvirt_la_BUILT_LIBADD += libvirt_driver_test.la
1200
libvirt_driver_test_la_CFLAGS = \
1201
		-I$(srcdir)/conf $(AM_CFLAGS)
1202
libvirt_driver_test_la_SOURCES = $(TEST_DRIVER_SOURCES)
1203
endif WITH_TEST
1204 1205

if WITH_REMOTE
1206
noinst_LTLIBRARIES += libvirt_driver_remote.la
1207
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
1208 1209
libvirt_driver_remote_la_CFLAGS =				\
		$(GNUTLS_CFLAGS)				\
E
Eric Blake 已提交
1210
		$(XDR_CFLAGS)					\
1211 1212
		-I$(srcdir)/conf				\
		-I$(srcdir)/rpc					\
1213 1214
		$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
1215 1216 1217 1218
libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) \
                libvirt-net-rpc-client.la \
                libvirt-net-rpc-server.la \
                libvirt-net-rpc.la
1219
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
1220

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

1223 1224
endif WITH_REMOTE

1225
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
1226
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
1227
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1228

1229
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
1230
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
1231
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1232

1233
if WITH_XEN
E
Eric Blake 已提交
1234 1235 1236
noinst_LTLIBRARIES += libvirt_driver_xen_impl.la
libvirt_driver_xen_la_SOURCES =
libvirt_driver_xen_la_LIBADD = libvirt_driver_xen_impl.la
1237 1238
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_xen.la
E
Eric Blake 已提交
1239
libvirt_driver_xen_la_LIBADD += ../gnulib/lib/libgnu.la
1240
libvirt_driver_xen_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1241
else ! WITH_DRIVER_MODULES
1242
noinst_LTLIBRARIES += libvirt_driver_xen.la
1243 1244
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_xen.la
1245
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1246

1247
libvirt_driver_xen_impl_la_CFLAGS =				\
1248
		$(XEN_CFLAGS)					\
1249 1250 1251
		-I$(srcdir)/access				\
		-I$(srcdir)/conf				\
		-I$(srcdir)/xenconfig				\
1252
		$(AM_CFLAGS)
E
Eric Blake 已提交
1253
libvirt_driver_xen_impl_la_LDFLAGS = $(AM_LDFLAGS)
P
Pavel Hrdina 已提交
1254
libvirt_driver_xen_impl_la_LIBADD = $(XEN_LIBS) libvirt_xenconfig.la
E
Eric Blake 已提交
1255
libvirt_driver_xen_impl_la_SOURCES = $(XEN_DRIVER_SOURCES)
1256
endif WITH_XEN
1257

1258 1259
if WITH_PHYP
noinst_LTLIBRARIES += libvirt_driver_phyp.la
1260
libvirt_la_BUILT_LIBADD += libvirt_driver_phyp.la
1261 1262
libvirt_driver_phyp_la_LIBADD = $(SSH2_LIBS)
libvirt_driver_phyp_la_CFLAGS = $(SSH2_CFLAGS) \
1263
		-I$(srcdir)/conf $(AM_CFLAGS)
1264
libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES)
1265
endif WITH_PHYP
1266

1267
if WITH_OPENVZ
1268
noinst_LTLIBRARIES += libvirt_driver_openvz.la
1269
libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la
1270
libvirt_driver_openvz_la_CFLAGS = \
1271
		-I$(srcdir)/conf $(AM_CFLAGS)
1272
libvirt_driver_openvz_la_SOURCES = $(OPENVZ_DRIVER_SOURCES)
1273
endif WITH_OPENVZ
1274

1275 1276 1277 1278
if WITH_VMWARE
noinst_LTLIBRARIES += libvirt_driver_vmware.la
libvirt_la_BUILT_LIBADD += libvirt_driver_vmware.la
libvirt_driver_vmware_la_CFLAGS = \
1279
		-I$(srcdir)/conf -I$(srcdir)/vmx $(AM_CFLAGS)
1280
libvirt_driver_vmware_la_SOURCES = $(VMWARE_DRIVER_SOURCES)
1281
endif WITH_VMWARE
1282

1283
if WITH_VBOX
M
Michal Privoznik 已提交
1284
noinst_LTLIBRARIES += \
1285
		libvirt_driver_vbox_impl.la
1286 1287 1288
libvirt_driver_vbox_la_SOURCES =
libvirt_driver_vbox_la_LIBADD = libvirt_driver_vbox_impl.la
if WITH_DRIVER_MODULES
M
Michal Privoznik 已提交
1289
mod_LTLIBRARIES += \
1290
		libvirt_driver_vbox.la
1291
libvirt_driver_vbox_la_LIBADD += ../gnulib/lib/libgnu.la
1292
libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1293
else ! WITH_DRIVER_MODULES
1294
noinst_LTLIBRARIES += libvirt_driver_vbox.la
1295 1296 1297
# GPLv2-only license requries that it be linked into
# libvirtd and *not* libvirt.so
#libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la
1298
endif ! WITH_DRIVER_MODULES
1299 1300

libvirt_driver_vbox_impl_la_CFLAGS =				\
1301 1302
		-I$(srcdir)/conf				\
		$(AM_CFLAGS)					\
M
Michal Privoznik 已提交
1303
		-DVBOX_DRIVER
1304
libvirt_driver_vbox_impl_la_LDFLAGS = $(AM_LDFLAGS)
1305 1306 1307
libvirt_driver_vbox_impl_la_LIBADD =  $(DLOPEN_LIBS)		\
		$(MSCOM_LIBS)					\
		$(LIBXML_LIBS)
1308
libvirt_driver_vbox_impl_la_SOURCES = $(VBOX_DRIVER_SOURCES)
1309
endif WITH_VBOX
1310

1311 1312
if WITH_XENAPI
noinst_LTLIBRARIES += libvirt_driver_xenapi.la
1313
libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la
1314
libvirt_driver_xenapi_la_CFLAGS = $(LIBXENSERVER_CFLAGS) $(CURL_CFLAGS) \
P
Pavel Hrdina 已提交
1315
		-I$(srcdir)/conf -I$(srcdir)/xenconfig $(AM_CFLAGS)
1316
libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS)
1317
libvirt_driver_xenapi_la_LIBADD = $(LIBXENSERVER_LIBS) $(CURL_LIBS)
1318
libvirt_driver_xenapi_la_SOURCES = $(XENAPI_DRIVER_SOURCES)
1319
endif WITH_XENAPI
1320

J
Jim Fehlig 已提交
1321
if WITH_LIBXL
E
Eric Blake 已提交
1322 1323 1324
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 已提交
1325 1326
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_libxl.la
E
Eric Blake 已提交
1327
libvirt_driver_libxl_la_LIBADD += ../gnulib/lib/libgnu.la
1328
libvirt_driver_libxl_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1329
else ! WITH_DRIVER_MODULES
J
Jim Fehlig 已提交
1330 1331 1332
noinst_LTLIBRARIES += libvirt_driver_libxl.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_libxl.la
1333
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1334

1335 1336
libvirt_driver_libxl_impl_la_CFLAGS = 		\
		$(LIBXL_CFLAGS)			\
1337 1338
		-I$(srcdir)/access	\
		-I$(srcdir)/conf	\
1339
		-I$(srcdir)/secret      \
1340
		-I$(srcdir)/xenconfig	\
1341
		$(AM_CFLAGS)
E
Eric Blake 已提交
1342
libvirt_driver_libxl_impl_la_LDFLAGS = $(AM_LDFLAGS)
1343 1344 1345
libvirt_driver_libxl_impl_la_LIBADD = $(LIBXL_LIBS) \
				      libvirt_xenconfig.la \
				      libvirt_secret.la
E
Eric Blake 已提交
1346
libvirt_driver_libxl_impl_la_SOURCES = $(LIBXL_DRIVER_SOURCES)
1347 1348 1349 1350 1351 1352

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

1353
endif WITH_LIBXL
1354 1355
EXTRA_DIST += libxl/libxl.conf libxl/libvirtd_libxl.aug \
		libxl/test_libvirtd_libxl.aug.in
J
Jim Fehlig 已提交
1356

1357
if WITH_QEMU
E
Eric Blake 已提交
1358 1359 1360
noinst_LTLIBRARIES += libvirt_driver_qemu_impl.la
libvirt_driver_qemu_la_SOURCES =
libvirt_driver_qemu_la_LIBADD = libvirt_driver_qemu_impl.la
1361 1362
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_qemu.la
E
Eric Blake 已提交
1363
libvirt_driver_qemu_la_LIBADD += ../gnulib/lib/libgnu.la
1364
libvirt_driver_qemu_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1365
else ! WITH_DRIVER_MODULES
1366
noinst_LTLIBRARIES += libvirt_driver_qemu.la
1367
# Stateful, so linked to daemon instead
1368
#libvirt_la_BUILT_LIBADD += libvirt_driver_qemu.la
1369
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1370

1371 1372 1373
libvirt_driver_qemu_impl_la_CFLAGS = \
		$(GNUTLS_CFLAGS) \
		$(LIBNL_CFLAGS) \
1374
		$(XDR_CFLAGS) \
1375 1376
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1377
		-I$(srcdir)/secret \
1378
		$(AM_CFLAGS)
E
Eric Blake 已提交
1379
libvirt_driver_qemu_impl_la_LDFLAGS = $(AM_LDFLAGS)
1380
libvirt_driver_qemu_impl_la_LIBADD = $(CAPNG_LIBS) \
1381
                                $(GNUTLS_LIBS) \
1382 1383
				$(LIBNL_LIBS) \
				$(LIBXML_LIBS) \
1384
				libvirt_secret.la \
1385
				$(NULL)
E
Eric Blake 已提交
1386
libvirt_driver_qemu_impl_la_SOURCES = $(QEMU_DRIVER_SOURCES)
1387

A
Amy Griffis 已提交
1388
conf_DATA += qemu/qemu.conf
1389

1390
augeas_DATA += qemu/libvirtd_qemu.aug
1391 1392
augeastest_DATA += test_libvirtd_qemu.aug
CLEANFILES += test_libvirtd_qemu.aug
1393

1394
endif WITH_QEMU
1395
EXTRA_DIST += qemu/qemu.conf qemu/libvirtd_qemu.aug \
1396
		qemu/test_libvirtd_qemu.aug.in qemu/THREADS.txt
1397

1398 1399

if WITH_LXC
E
Eric Blake 已提交
1400 1401 1402
noinst_LTLIBRARIES += libvirt_driver_lxc_impl.la
libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = libvirt_driver_lxc_impl.la
1403 1404
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_lxc.la
E
Eric Blake 已提交
1405 1406
libvirt_driver_lxc_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_lxc_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1407
else ! WITH_DRIVER_MODULES
1408
noinst_LTLIBRARIES += libvirt_driver_lxc.la
1409
# Stateful, so linked to daemon instead
1410
#libvirt_la_BUILT_LIBADD += libvirt_driver_lxc.la
1411
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1412 1413

libvirt_driver_lxc_impl_la_CFLAGS = \
S
Serge Hallyn 已提交
1414
		$(LIBNL_CFLAGS) \
G
Gao feng 已提交
1415
		$(FUSE_CFLAGS) \
P
Pavel Fedin 已提交
1416
		$(XDR_CFLAGS) \
1417 1418
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1419
		$(AM_CFLAGS)
I
ik.nitk 已提交
1420 1421 1422 1423 1424 1425
libvirt_driver_lxc_impl_la_LIBADD = \
               $(CAPNG_LIBS) \
               $(LIBNL_LIBS) \
               $(LIBXML_LIBS) \
               $(FUSE_LIBS)

1426
if WITH_BLKID
E
Eric Blake 已提交
1427 1428
libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS)
1429
endif WITH_BLKID
1430
libvirt_driver_lxc_impl_la_LIBADD += $(SECDRIVER_LIBS)
E
Eric Blake 已提交
1431
libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES)
A
Amy Griffis 已提交
1432 1433 1434

conf_DATA += lxc/lxc.conf

1435
augeas_DATA += lxc/libvirtd_lxc.aug
1436 1437
augeastest_DATA += test_libvirtd_lxc.aug
CLEANFILES += test_libvirtd_lxc.aug
1438

1439
endif WITH_LXC
1440
EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in
1441

1442
if WITH_UML
E
Eric Blake 已提交
1443 1444 1445
noinst_LTLIBRARIES += libvirt_driver_uml_impl.la
libvirt_driver_uml_la_SOURCES =
libvirt_driver_uml_la_LIBADD = libvirt_driver_uml_impl.la
1446 1447
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_uml.la
E
Eric Blake 已提交
1448
libvirt_driver_uml_la_LIBADD += ../gnulib/lib/libgnu.la
1449
libvirt_driver_uml_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1450
else ! WITH_DRIVER_MODULES
1451 1452
noinst_LTLIBRARIES += libvirt_driver_uml.la
# Stateful, so linked to daemon instead
1453
#libvirt_la_BUILT_LIBADD += libvirt_driver_uml.la
1454
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1455

1456
libvirt_driver_uml_impl_la_CFLAGS = \
1457 1458
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1459
		$(AM_CFLAGS)
E
Eric Blake 已提交
1460
libvirt_driver_uml_impl_la_LDFLAGS = $(AM_LDFLAGS)
1461
# libvirt_driver_uml_impl_la_LIBADD =
E
Eric Blake 已提交
1462
libvirt_driver_uml_impl_la_SOURCES = $(UML_DRIVER_SOURCES)
1463
endif WITH_UML
1464

D
Daniel Veillard 已提交
1465

1466
BUILT_SOURCES += $(ESX_DRIVER_GENERATED)
D
Daniel Veillard 已提交
1467

1468 1469
ESX_GENERATED_STAMP = .esx_vi_generator.stamp

E
Eric Blake 已提交
1470 1471
EXTRA_DIST += $(ESX_GENERATED_STAMP)

1472 1473 1474
$(ESX_DRIVER_GENERATED): $(ESX_GENERATED_STAMP)

$(ESX_GENERATED_STAMP): $(srcdir)/esx/esx_vi_generator.input \
1475
                         $(srcdir)/esx/esx_vi_generator.py
1476 1477 1478 1479 1480
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/esx/esx_vi_generator.py \
	  && touch $@

MAINTAINERCLEANFILES += $(ESX_DRIVER_GENERATED) $(ESX_GENERATED_STAMP)

D
Daniel Veillard 已提交
1481

1482 1483
if WITH_ESX
noinst_LTLIBRARIES += libvirt_driver_esx.la
1484
libvirt_la_BUILT_LIBADD += libvirt_driver_esx.la
1485
libvirt_driver_esx_la_CFLAGS = $(CURL_CFLAGS) \
1486
		-I$(srcdir)/conf -I$(srcdir)/vmx $(AM_CFLAGS)
1487
libvirt_driver_esx_la_LDFLAGS = $(AM_LDFLAGS)
1488
libvirt_driver_esx_la_LIBADD = $(CURL_LIBS)
1489
libvirt_driver_esx_la_SOURCES = $(ESX_DRIVER_SOURCES)
1490
libvirt_driver_esx_la_DEPENDENCIES = $(ESX_DRIVER_GENERATED)
1491
endif WITH_ESX
1492

M
Matthias Bolte 已提交
1493

1494 1495
BUILT_SOURCES += $(HYPERV_DRIVER_GENERATED)

1496 1497
HYPERV_GENERATED_STAMP = .hyperv_wmi_generator.stamp

E
Eric Blake 已提交
1498 1499
EXTRA_DIST += $(HYPERV_GENERATED_STAMP)

1500 1501 1502
$(HYPERV_DRIVER_GENERATED): $(HYPERV_GENERATED_STAMP)

$(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \
1503
                            $(srcdir)/hyperv/hyperv_wmi_generator.py
1504 1505
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) \
	  $(srcdir)/hyperv/hyperv_wmi_generator.py \
1506 1507 1508
	  && touch $@

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

M
Matthias Bolte 已提交
1510 1511 1512 1513
if WITH_HYPERV
noinst_LTLIBRARIES += libvirt_driver_hyperv.la
libvirt_la_BUILT_LIBADD += libvirt_driver_hyperv.la
libvirt_driver_hyperv_la_CFLAGS = $(OPENWSMAN_CFLAGS) \
1514
		-I$(srcdir)/conf $(AM_CFLAGS)
M
Matthias Bolte 已提交
1515 1516 1517
libvirt_driver_hyperv_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_hyperv_la_LIBADD = $(OPENWSMAN_LIBS)
libvirt_driver_hyperv_la_SOURCES = $(HYPERV_DRIVER_SOURCES)
1518
endif WITH_HYPERV
M
Matthias Bolte 已提交
1519

1520
if WITH_VZ
1521 1522 1523 1524 1525 1526 1527 1528
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
1529
noinst_LTLIBRARIES += libvirt_driver_vz.la
1530 1531
endif ! WITH_DRIVER_MODULES
libvirt_driver_vz_impl_la_CFLAGS = \
1532 1533 1534
		-I$(srcdir)/conf \
		-I$(srcdir)/access \
		$(AM_CFLAGS) \
1535
		$(PARALLELS_SDK_CFLAGS) $(LIBNL_CFLAGS)
1536 1537
libvirt_driver_vz_impl_la_SOURCES = $(VZ_DRIVER_SOURCES)
libvirt_driver_vz_impl_la_LIBADD =  $(PARALLELS_SDK_LIBS) $(LIBNL_LIBS)
1538
endif WITH_VZ
D
Dmitry Guryanov 已提交
1539

R
Roman Bogorodskiy 已提交
1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552
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 = \
1553 1554
	-I$(srcdir)/access \
	-I$(srcdir)/conf \
R
Roman Bogorodskiy 已提交
1555 1556 1557 1558 1559
	$(AM_CFLAGS)
libvirt_driver_bhyve_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_bhyve_impl_la_SOURCES = $(BHYVE_DRIVER_SOURCES)
endif WITH_BHYVE

1560
if WITH_NETWORK
E
Eric Blake 已提交
1561 1562 1563
noinst_LTLIBRARIES += libvirt_driver_network_impl.la
libvirt_driver_network_la_SOURCES =
libvirt_driver_network_la_LIBADD = libvirt_driver_network_impl.la
1564 1565
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_network.la
1566 1567 1568 1569
libvirt_driver_network_la_LIBADD += ../gnulib/lib/libgnu.la \
	$(LIBNL_LIBS) \
	$(DBUS_LIBS) \
	$(NULL)
E
Eric Blake 已提交
1570
libvirt_driver_network_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1571
else ! WITH_DRIVER_MODULES
1572
noinst_LTLIBRARIES += libvirt_driver_network.la
1573
# Stateful, so linked to daemon instead
1574
#libvirt_la_BUILT_LIBADD += libvirt_driver_network.la
1575
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1576 1577

libvirt_driver_network_impl_la_CFLAGS = \
1578 1579
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1580 1581
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1582
		$(AM_CFLAGS)
E
Eric Blake 已提交
1583
libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
1584
libvirt_driver_network_impl_la_LIBADD  = $(DBUS_LIBS)
1585
endif WITH_NETWORK
1586 1587 1588
EXTRA_DIST += network/default.xml


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

D
Daniel P. Berrange 已提交
1618
if WITH_SECRETS
1619 1620
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_secret.la
1621
else ! WITH_DRIVER_MODULES
1622
noinst_LTLIBRARIES += libvirt_driver_secret.la
1623
# Stateful, so linked to daemon instead
1624
#libvirt_la_BUILT_LIBADD += libvirt_driver_secret.la
1625
endif ! WITH_DRIVER_MODULES
1626
libvirt_driver_secret_la_CFLAGS = \
1627 1628
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1629
		$(AM_CFLAGS)
1630
if WITH_DRIVER_MODULES
1631
libvirt_driver_secret_la_LIBADD = ../gnulib/lib/libgnu.la
1632
libvirt_driver_secret_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1633
endif WITH_DRIVER_MODULES
1634
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
1635
endif WITH_SECRETS
1636

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

1668
if WITH_STORAGE_LVM
1669
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_LVM_SOURCES)
1670
endif WITH_STORAGE_LVM
1671

1672
if WITH_STORAGE_ISCSI
1673
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_ISCSI_SOURCES)
1674
endif WITH_STORAGE_ISCSI
1675

1676
if WITH_STORAGE_SCSI
1677
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SCSI_SOURCES)
1678
endif WITH_STORAGE_SCSI
1679

D
Dave Allan 已提交
1680
if WITH_STORAGE_MPATH
1681 1682 1683
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)
1684
endif WITH_STORAGE_MPATH
D
Dave Allan 已提交
1685

1686
if WITH_STORAGE_DISK
1687
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_DISK_SOURCES)
1688
endif WITH_STORAGE_DISK
1689

1690
if WITH_STORAGE_RBD
1691 1692
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_RBD_SOURCES)
libvirt_driver_storage_impl_la_LIBADD += $(LIBRBD_LIBS)
1693
endif WITH_STORAGE_RBD
1694

1695
if WITH_STORAGE_SHEEPDOG
1696
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SHEEPDOG_SOURCES)
1697
endif WITH_STORAGE_SHEEPDOG
1698

1699 1700 1701 1702 1703 1704
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 已提交
1705 1706 1707 1708
if WITH_STORAGE_ZFS
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_ZFS_SOURCES)
endif WITH_STORAGE_ZFS

1709 1710 1711 1712
if WITH_NODE_DEVICES
# Needed to keep automake quiet about conditionals
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nodedev.la
1713
else ! WITH_DRIVER_MODULES
1714 1715
noinst_LTLIBRARIES += libvirt_driver_nodedev.la
# Stateful, so linked to daemon instead
1716
#libvirt_la_BUILT_LIBADD += libvirt_driver_nodedev.la
1717
endif ! WITH_DRIVER_MODULES
1718 1719
libvirt_driver_nodedev_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES)

1720
libvirt_driver_nodedev_la_CFLAGS = \
1721 1722
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1723
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1724
libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS)
1725
libvirt_driver_nodedev_la_LIBADD =
1726

D
Doug Goldstein 已提交
1727
if WITH_LIBVIRTD
1728
if WITH_HAL
1729 1730
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS)
1731
libvirt_driver_nodedev_la_LIBADD += $(HAL_LIBS)
1732
endif WITH_HAL
1733
if WITH_UDEV
1734
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES)
1735
libvirt_driver_nodedev_la_CFLAGS += $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS)
1736
libvirt_driver_nodedev_la_LIBADD += $(UDEV_LIBS) $(PCIACCESS_LIBS)
1737 1738
endif WITH_UDEV
endif WITH_LIBVIRTD
1739 1740

if WITH_DRIVER_MODULES
1741
libvirt_driver_nodedev_la_LIBADD += ../gnulib/lib/libgnu.la
1742
libvirt_driver_nodedev_la_LDFLAGS += -module -avoid-version
1743 1744
endif WITH_DRIVER_MODULES
endif WITH_NODE_DEVICES
1745 1746


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


1779 1780 1781 1782
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 = \
1783
		-I$(srcdir)/conf $(AM_CFLAGS)
1784
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
1785
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
1786
if WITH_SECDRIVER_SELINUX
1787 1788
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
1789
endif WITH_SECDRIVER_SELINUX
J
Jamie Strandboge 已提交
1790
if WITH_SECDRIVER_APPARMOR
1791 1792
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
1793
endif WITH_SECDRIVER_APPARMOR
1794

1795 1796
libvirt_driver_access_la_SOURCES = \
	$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
1797 1798 1799
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
1800
		-I$(srcdir)/conf $(AM_CFLAGS)
1801 1802 1803
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD =

1804 1805
EXTRA_DIST += access/genpolkit.pl

1806 1807 1808 1809
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
    $(srcdir)/access/genpolkit.pl Makefile.am
	$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@

1810 1811 1812 1813
if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)

polkitactiondir = $(datadir)/polkit-1/actions
1814
if WITH_LIBVIRTD
1815
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
1816
endif WITH_LIBVIRTD
1817 1818 1819

CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
1820
else ! WITH_POLKIT1
1821
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
1822
endif ! WITH_POLKIT1
1823

1824

1825 1826
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840

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

1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853
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 已提交
1854
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
1855 1856
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1857 1858 1859
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
1860 1861
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1862 1863
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
	  > $(srcdir)/access/viraccessapicheck.c
1864

E
Eric Blake 已提交
1865
access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
1866 1867
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1868 1869 1870
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheckqemu.h
access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
1871 1872
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1873 1874
	  qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h \
	  > $(srcdir)/access/viraccessapicheckqemu.c
1875

E
Eric Blake 已提交
1876
access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
1877 1878
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1879 1880 1881
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/access/viraccessapichecklxc.h
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
1882 1883
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1884 1885
	  lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \
	  > $(srcdir)/access/viraccessapichecklxc.c
1886

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

1932 1933
check-local: check-augeas

1934 1935 1936 1937 1938
.PHONY: check-augeas \
	check-augeas-qemu \
	check-augeas-lxc \
	check-augeas-sanlock \
	check-augeas-lockd \
1939
	check-augeas-libxl \
1940
	$(NULL)
1941

1942
check-augeas: check-augeas-qemu check-augeas-lxc check-augeas-sanlock \
1943 1944
	check-augeas-lockd check-augeas-virtlockd check-augeas-libxl \
	check-augeas-virtlogd
1945

1946
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
1947
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
1948

1949
if WITH_QEMU
1950 1951
test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
		$(srcdir)/qemu/qemu.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1952
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
1953

1954
check-augeas-qemu: test_libvirtd_qemu.aug
1955
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1956
	    '$(AUGPARSE)' -I $(srcdir)/qemu test_libvirtd_qemu.aug; \
1957
	fi
1958
else ! WITH_QEMU
1959
check-augeas-qemu:
1960
endif ! WITH_QEMU
1961

1962
if WITH_LXC
1963 1964
test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
		$(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1965
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
1966

1967
check-augeas-lxc: test_libvirtd_lxc.aug
1968
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1969
	    '$(AUGPARSE)' -I $(srcdir)/lxc test_libvirtd_lxc.aug; \
1970
	fi
1971
else ! WITH_LXC
1972
check-augeas-lxc:
1973
endif ! WITH_LXC
1974

1975
if WITH_SANLOCK
1976 1977
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1978
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
1979

1980
check-augeas-sanlock: test_libvirt_sanlock.aug
1981
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1982
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
1983
	fi
1984
else ! WITH_SANLOCK
1985
check-augeas-sanlock:
1986
endif ! WITH_SANLOCK
1987

1988
if WITH_QEMU
1989 1990 1991
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 $< $@
1992 1993 1994
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
1995

1996 1997
test_virtlockd.aug: locking/test_virtlockd.aug.in \
		locking/virtlockd.conf $(AUG_GENTEST)
1998
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
1999

2000
if WITH_QEMU
2001 2002 2003 2004
check-augeas-lockd: test_libvirt_lockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_lockd.aug; \
	fi
2005 2006 2007
else ! WITH_QEMU
check-augeas-lockd:
endif ! WITH_QEMU
2008

2009 2010 2011 2012 2013
check-augeas-virtlockd: test_virtlockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
	fi

2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
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

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

2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054
#
# 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.
#

2055
if WITH_DRIVER_MODULES
2056
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
2057
else ! WITH_DRIVER_MODULES
2058
SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
2059
endif ! WITH_DRIVER_MODULES
2060

2061
if WITH_LINUX
2062
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
2063
else ! WITH_LINUX
2064
SYM_FILES += $(srcdir)/libvirt_linux.syms
2065
endif ! WITH_LINUX
2066

2067
if WITH_ESX
2068
USED_SYM_FILES += $(srcdir)/libvirt_esx.syms
2069
else ! WITH_ESX
2070
SYM_FILES += $(srcdir)/libvirt_esx.syms
2071
endif ! WITH_ESX
2072

E
Eric Blake 已提交
2073 2074 2075 2076 2077 2078
if WITH_REMOTE
USED_SYM_FILES += $(srcdir)/libvirt_remote.syms
else ! WITH_REMOTE
SYM_FILES += $(srcdir)/libvirt_remote.syms
endif ! WITH_REMOTE

2079
if WITH_OPENVZ
2080
USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms
2081
else ! WITH_OPENVZ
2082
SYM_FILES += $(srcdir)/libvirt_openvz.syms
2083
endif ! WITH_OPENVZ
2084

2085
if WITH_VMX
2086
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
2087
else ! WITH_VMX
2088
SYM_FILES += $(srcdir)/libvirt_vmx.syms
2089
endif ! WITH_VMX
2090

2091 2092 2093 2094 2095 2096
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 已提交
2097 2098 2099 2100 2101
if WITH_XENCONFIG
USED_SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
else ! WITH_XENCONFIG
SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
endif ! WITH_XENCONFIG
2102

2103 2104 2105 2106 2107 2108
if WITH_LIBXL
USED_SYM_FILES += $(srcdir)/libvirt_xenxlconfig.syms
else ! WITH_LIBXL
SYM_FILES += $(srcdir)/libvirt_xenxlconfig.syms
endif ! WITH_LIBXL

2109
if WITH_SASL
2110
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
2111
else ! WITH_SASL
2112
SYM_FILES += $(srcdir)/libvirt_sasl.syms
2113
endif ! WITH_SASL
E
Eric Blake 已提交
2114

2115 2116
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2117
else ! WITH_GNUTLS
2118
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2119
endif ! WITH_GNUTLS
2120

2121
if WITH_SSH2
2122
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2123
else ! WITH_SSH2
2124
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2125
endif ! WITH_SSH2
2126

2127
if WITH_ATOMIC_OPS_PTHREAD
2128
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
2129
else ! WITH_ATOMIC_OPS_PTHREAD
2130
SYM_FILES += $(srcdir)/libvirt_atomic.syms
2131
endif ! WITH_ATOMIC_OPS_PTHREAD
2132

2133 2134 2135 2136 2137 2138
if WITH_LIBSSH
USED_SYM_FILES += $(srcdir)/libvirt_libssh.syms
else ! WITH_LIBSSH
SYM_FILES += $(srcdir)/libvirt_libssh.syms
endif ! WITH_LIBSSH

2139
EXTRA_DIST += \
2140 2141 2142
	libvirt_public.syms		\
	libvirt_lxc.syms		\
	libvirt_qemu.syms		\
2143
	libvirt_admin_public.syms	\
2144
	$(SYM_FILES)			\
2145
	$(ADMIN_SYM_FILES)		\
2146
	$(NULL)
2147

2148
BUILT_SOURCES += $(GENERATED_SYM_FILES)
2149

2150 2151
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(ACCESS_DRIVER_SYM_FILES) \
2152
		$(top_builddir)/config.status
2153 2154 2155 2156 2157 2158
	$(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 && \
2159
	cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
2160 2161
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
2162
	mv $@-tmp libvirt.syms
2163

2164
%.def: %.syms
2165 2166
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
2167 2168
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d'	\
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
2169
	chmod a-w $@-tmp && \
2170
	mv $@-tmp $@
2171

2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184
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

2185 2186 2187 2188
# 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 已提交
2189 2190 2191 2192 2193 2194 2195 2196 2197
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)			\
2198
		$(AM_LDFLAGS)
M
Martin Kletzander 已提交
2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210

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 += \
2211
		$(XDR_CFLAGS)			\
M
Martin Kletzander 已提交
2212 2213 2214 2215
		$(CAPNG_CFLAGS)			\
		$(YAJL_CFLAGS)			\
		$(SSH2_CFLAGS)			\
		$(SASL_CFLAGS)			\
2216 2217
		$(GNUTLS_CFLAGS)		\
		$(LIBSSH_CFLAGS)
M
Martin Kletzander 已提交
2218 2219 2220 2221 2222 2223 2224 2225

libvirt_admin_la_LIBADD += \
		$(CAPNG_LIBS)			\
		$(YAJL_LIBS)			\
		$(DEVMAPPER_LIBS)		\
		$(LIBXML_LIBS)			\
		$(SSH2_LIBS)			\
		$(SASL_LIBS)			\
2226 2227
		$(GNUTLS_LIBS)			\
		$(LIBSSH_LIBS)
M
Martin Kletzander 已提交
2228

2229 2230
ADMIN_SYM_FILES = $(srcdir)/libvirt_admin_private.syms

M
Martin Kletzander 已提交
2231 2232 2233 2234
if WITH_DTRACE_PROBES
libvirt_admin_la_LIBADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

2235 2236
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
2237 2238 2239 2240 2241 2242
libvirt_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(LIBVIRT_NODELETE) \
		$(AM_LDFLAGS) \
		$(NULL)
2243
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
2244
libvirt_la_LIBADD += \
2245
		    $(DRIVER_MODULE_LIBS) \
2246
		    $(CYGWIN_EXTRA_LIBADD)
2247
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
2248 2249 2250 2251 2252 2253
# 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)
2254

2255
if WITH_DTRACE_PROBES
2256
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
2257
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
2258
nodist_libvirt_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2259
if WITH_REMOTE
E
Eric Blake 已提交
2260
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2261
endif WITH_REMOTE
2262 2263
if WITH_DRIVER_MODULES
DTRACE2SYSTEMTAP_FLAGS = --with-modules
2264
endif WITH_DRIVER_MODULES
2265

2266 2267 2268
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

if WITH_QEMU
2269
libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.lo
2270
nodist_libvirt_driver_qemu_la_SOURCES = libvirt_qemu_probes.h
2271
BUILT_SOURCES += libvirt_qemu_probes.h
2272
endif WITH_QEMU
2273 2274

tapsetdir = $(datadir)/systemtap/tapset
2275
tapset_DATA = libvirt_probes.stp libvirt_qemu_probes.stp libvirt_functions.stp
2276

2277
%_probes.h: %_probes.d
2278 2279
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

E
Eric Blake 已提交
2280
.PRECIOUS: %_probes.o
2281
%_probes.o: %_probes.d
2282 2283
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

2284 2285 2286 2287 2288 2289 2290 2291 2292
%_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 已提交
2293
# Keep this list synced with PROTOCOL_STRUCTS
J
Jiri Denemark 已提交
2294 2295 2296
RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
2297
		  $(srcdir)/remote/lxc_protocol.x \
2298 2299
		  $(srcdir)/remote/qemu_protocol.x \
		  $(srcdir)/lxc/lxc_monitor_protocol.x \
M
Martin Kletzander 已提交
2300 2301
		  $(srcdir)/locking/lock_protocol.x \
		  $(srcdir)/admin/admin_protocol.x
2302 2303

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

2306 2307
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl \
		$(top_builddir)/config.status
2308
	$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
2309
	  $(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
2310

2311
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
2312
              libvirt_qemu_probes.h libvirt_qemu_probes.o \
2313
              libvirt_qemu_probes.lo\
2314 2315
              libvirt_functions.stp libvirt_probes.stp \
              libvirt_qemu_probes.stp
2316
endif WITH_DTRACE_PROBES
2317

2318
EXTRA_DIST += libvirt_probes.d libvirt_qemu_probes.d
2319

C
Chris Lalancette 已提交
2320
libvirt_qemu_la_SOURCES = libvirt-qemu.c
D
Daniel P. Berrange 已提交
2321 2322 2323 2324 2325
libvirt_qemu_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
2326
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
C
Chris Lalancette 已提交
2327
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
2328

2329
libvirt_lxc_la_SOURCES = libvirt-lxc.c
D
Daniel P. Berrange 已提交
2330 2331 2332 2333 2334
libvirt_lxc_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(NULL)
2335 2336 2337
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)

2338 2339 2340 2341 2342 2343 2344
# 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
2345
if WITH_SETUID_RPC_CLIENT
2346 2347 2348 2349
noinst_LTLIBRARIES += libvirt-setuid-rpc-client.la

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

libvirt_setuid_rpc_client_la_LDFLAGS =		\
		$(AM_LDFLAGS)			\
		$(LIBXML_LIBS)			\
J
Jim Fehlig 已提交
2419
		$(SECDRIVER_LIBS)		\
2420 2421 2422
		$(NULL)
libvirt_setuid_rpc_client_la_CFLAGS =		\
		-DLIBVIRT_SETUID_RPC_CLIENT	\
2423 2424
		-I$(srcdir)/conf		\
		-I$(srcdir)/rpc			\
2425
		$(AM_CFLAGS)			\
J
Jim Fehlig 已提交
2426
		$(SECDRIVER_CFLAGS)		\
P
Pavel Fedin 已提交
2427
		$(XDR_CFLAGS)			\
2428
		$(NULL)
2429
endif WITH_SETUID_RPC_CLIENT
2430

2431 2432 2433
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

2434
if WITH_LIBVIRTD
2435 2436 2437 2438 2439
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
		$(LOCK_DRIVER_LOCKD_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
		$(NULL)
2440
lockd_la_CFLAGS = -I$(srcdir)/conf \
E
Eric Blake 已提交
2441 2442
		$(XDR_CFLAGS) \
		$(AM_CFLAGS)
2443
lockd_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
2444 2445 2446 2447
lockd_la_LIBADD = ../gnulib/lib/libgnu.la \
	libvirt-net-rpc.la \
	libvirt-net-rpc-client.la \
	$(NULL)
J
Jiri Denemark 已提交
2448
augeas_DATA += locking/libvirt_lockd.aug
2449 2450
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
2451
endif WITH_DTRACE_PROBES
2452
if WITH_QEMU
2453 2454
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
2455
nodist_conf_DATA += locking/qemu-lockd.conf
2456 2457
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
2458
endif WITH_QEMU
2459

2460 2461 2462 2463 2464 2465
if WITH_LIBXL
nodist_conf_DATA += locking/libxl-lockd.conf
BUILT_SOURCES += locking/libxl-lockd.conf
DISTCLEANFILES += locking/libxl-lockd.conf
endif WITH_LIBXL

2466 2467 2468 2469 2470
locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
	$(AM_V_GEN)$(MKDIR_P) locking ; \
	cp $< $@


2471
sbin_PROGRAMS = virtlockd virtlogd
2472

2473 2474 2475
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
2476
		$(LOCK_DAEMON_GENERATED) \
2477
		$(NULL)
2478 2479
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
2480
		$(PIE_CFLAGS) \
2481
		$(XDR_CFLAGS) \
2482 2483 2484
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
2485
		$(PIE_LDFLAGS) \
2486 2487 2488 2489 2490 2491 2492 2493 2494 2495
		$(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
2496
endif WITH_DTRACE_PROBES
2497

2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523

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

2524
else ! WITH_LIBVIRTD
2525
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
2526 2527
              $(LOCK_DRIVER_LOCKD_SOURCES) \
	      $(LOG_DAEMON_SOURCES)
2528
endif ! WITH_LIBVIRTD
2529

2530 2531
EXTRA_DIST += \
	locking/virtlockd.sysconf \
J
Jiri Denemark 已提交
2532 2533
	locking/lockd.conf \
	locking/libvirt_lockd.aug \
2534
	locking/test_libvirt_lockd.aug.in \
2535
	logging/virtlogd.sysconf
2536 2537

install-sysconfig:
E
Eric Blake 已提交
2538
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
2539 2540
	$(INSTALL_DATA) $(srcdir)/locking/virtlockd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
2541 2542
	$(INSTALL_DATA) $(srcdir)/logging/virtlogd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlogd
2543 2544

uninstall-sysconfig:
2545
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlogd
2546
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
E
Eric Blake 已提交
2547
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
2548

2549
EXTRA_DIST += locking/virtlockd.init.in logging/virtlogd.init.in
2550 2551 2552

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_RED_HAT
2553
install-init:: virtlockd.init virtlogd.init install-sysconfig
E
Eric Blake 已提交
2554
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
2555 2556
	$(INSTALL_SCRIPT) virtlockd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
2557 2558
	$(INSTALL_SCRIPT) virtlogd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlogd
2559 2560

uninstall-init:: uninstall-sysconfig
E
Eric Blake 已提交
2561
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
2562
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlogd
E
Eric Blake 已提交
2563
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
2564

2565 2566
BUILT_SOURCES += virtlockd.init virtlogd.init
DISTCLEANFILES += virtlockd.init virtlogd.init
2567
else ! LIBVIRT_INIT_SCRIPT_RED_HAT
2568 2569
install-init::
uninstall-init::
2570 2571
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
else ! WITH_LIBVIRTD
2572 2573
install-init::
uninstall-init::
2574
endif ! WITH_LIBVIRTD
2575 2576

virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
2577 2578 2579 2580 2581 2582
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g'		\
	    < $< > $@-t &&					\
	    chmod a+x $@-t &&					\
2583 2584
	    mv $@-t $@

2585 2586 2587 2588 2589 2590 2591 2592 2593
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 $@

2594
POD2MAN = pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)"
2595

2596
virtlockd.8.in: locking/virtlockd.pod
2597 2598 2599 2600 2601 2602 2603 2604
	$(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 $@
2605

2606
virtlogd.8.in: logging/virtlogd.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
%.8: %.8.in $(top_srcdir)/configure.ac
2617
	$(AM_V_GEN)sed \
2618 2619 2620
		-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
		-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
		< $< > $@-t && \
2621 2622
	mv $@-t $@

2623
if WITH_LIBVIRTD
2624
man8_MANS = virtlockd.8 virtlogd.8
2625

2626
conf_DATA += locking/virtlockd.conf logging/virtlogd.conf
2627

2628 2629
augeas_DATA += locking/virtlockd.aug logging/virtlogd.aug
augeastest_DATA += test_virtlockd.aug test_virtlogd.aug
2630
endif WITH_LIBVIRTD
2631

A
Andrea Bolognani 已提交
2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643
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)
2644 2645 2646 2647

EXTRA_DIST += \
        locking/virtlockd.service.in \
        locking/virtlockd.socket.in \
2648 2649 2650
        locking/virtlockd.aug \
        locking/virtlockd.conf \
        locking/test_virtlockd.aug.in \
2651 2652 2653 2654 2655
        logging/virtlogd.service.in \
        logging/virtlogd.socket.in \
        logging/virtlogd.aug \
        logging/virtlogd.conf \
        logging/test_virtlogd.aug.in \
A
Andrea Bolognani 已提交
2656 2657
        $(PODFILES) \
        $(MANINFILES) \
2658
        $(NULL)
2659

2660 2661 2662 2663

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

2664
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
2665

2666 2667 2668 2669
BUILT_SOURCES += virtlockd.service virtlockd.socket \
		 virtlogd.service virtlogd.socket
DISTCLEANFILES += virtlockd.service virtlockd.socket \
		  virtlogd.service virtlogd.socket
2670

2671 2672
install-systemd: virtlockd.service virtlockd.socket \
                 virtlogd.service virtlogd.socket install-sysconfig
E
Eric Blake 已提交
2673
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
2674
	$(INSTALL_DATA) virtlockd.service \
2675
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2676
	$(INSTALL_DATA) virtlockd.socket \
2677
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2678 2679 2680 2681
	$(INSTALL_DATA) virtlogd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
	$(INSTALL_DATA) virtlogd.socket \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2682 2683

uninstall-systemd: uninstall-sysconfig
E
Eric Blake 已提交
2684 2685
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.socket
2686 2687
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlogd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlogd.socket
E
Eric Blake 已提交
2688
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
2689
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
2690 2691
install-systemd:
uninstall-systemd:
2692 2693
endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
else ! WITH_LIBVIRTD
2694 2695
install-systemd:
uninstall-systemd:
2696
endif ! WITH_LIBVIRTD
2697 2698

virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
2699 2700 2701
	$(AM_V_GEN)sed						\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    < $< > $@-t &&					\
2702 2703 2704
	    mv $@-t $@

virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
2705 2706 2707
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    < $< > $@-t &&					\
2708 2709
	    mv $@-t $@

2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721
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 $@

2722

2723
if WITH_SANLOCK
2724
lockdriver_LTLIBRARIES += sanlock.la
2725
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
2726
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
2727
sanlock_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
2728
sanlock_la_LIBADD = -lsanlock_client \
2729 2730 2731
		../gnulib/lib/libgnu.la

augeas_DATA += locking/libvirt_sanlock.aug
2732 2733
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
2734

E
Eric Blake 已提交
2735
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
2736
	$(AM_V_GEN)$(MKDIR_P) locking ; \
2737 2738 2739
	cp $< $@

if WITH_QEMU
2740
nodist_conf_DATA += locking/qemu-sanlock.conf
2741
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
2742
DISTCLEANFILES += locking/qemu-sanlock.conf
2743
endif WITH_QEMU
2744 2745 2746 2747 2748 2749

if WITH_LIBXL
nodist_conf_DATA += locking/libxl-sanlock.conf
BUILT_SOURCES += locking/libxl-sanlock.conf
DISTCLEANFILES += locking/libxl-sanlock.conf
endif WITH_LIBXL
2750
else ! WITH_SANLOCK
2751
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
2752
endif ! WITH_SANLOCK
2753 2754
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
2755
	locking/test_libvirt_sanlock.aug.in
2756

2757 2758 2759 2760
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
2761

2762
EXTRA_DIST += \
E
Eric Blake 已提交
2763 2764 2765 2766
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
2767 2768
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
2769

E
Eric Blake 已提交
2770
VIR_NET_RPC_GENERATED = \
2771 2772 2773 2774
	rpc/virnetprotocol.h \
	rpc/virnetprotocol.c \
	rpc/virkeepaliveprotocol.h \
	rpc/virkeepaliveprotocol.c
2775

2776
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2777

2778
libvirt_net_rpc_la_SOURCES = \
2779
	rpc/virnetmessage.h rpc/virnetmessage.c \
2780
	rpc/virnetsocket.h rpc/virnetsocket.c \
2781 2782
	rpc/virkeepalive.h rpc/virkeepalive.c \
	$(VIR_NET_RPC_GENERATED)
2783
if WITH_SSH2
2784 2785
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2786
else ! WITH_SSH2
2787 2788
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2789
endif ! WITH_SSH2
2790
if WITH_GNUTLS
2791 2792
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2793
else ! WITH_GNUTLS
2794 2795
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2796
endif ! WITH_GNUTLS
2797
if WITH_SASL
2798 2799
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2800
else ! WITH_SASL
2801 2802
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2803
endif ! WITH_SASL
2804 2805 2806 2807 2808 2809 2810
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
2811
libvirt_net_rpc_la_CFLAGS = \
2812
			$(GNUTLS_CFLAGS) \
2813
			$(SASL_CFLAGS) \
2814
			$(SSH2_CFLAGS) \
2815
			$(LIBSSH_CFLAGS) \
2816
			$(XDR_CFLAGS) \
2817 2818
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
2819
			$(GNUTLS_LIBS) \
2820
			$(SASL_LIBS) \
2821
			$(SSH2_LIBS)\
2822
			$(LIBSSH_LIBS) \
J
Jim Fehlig 已提交
2823
			$(SECDRIVER_LIBS) \
2824
			$(AM_LDFLAGS) \
2825
			$(NULL)
2826 2827 2828
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2829 2830 2831 2832
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
2833
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
2834
	rpc/virnetdaemon.h rpc/virnetdaemon.c \
2835 2836
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
2837
			$(AVAHI_CFLAGS) \
2838
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
2839
			$(XDR_CFLAGS) \
2840
			$(AM_CFLAGS)
2841 2842
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
2843
			$(AVAHI_LIBS) \
2844
			$(DBUS_LIBS) \
2845
			$(NULL)
2846 2847 2848
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2849 2850 2851 2852 2853
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 已提交
2854 2855
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
2856
libvirt_net_rpc_client_la_LDFLAGS = $(AM_LDFLAGS)
2857 2858
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
2859

2860 2861
libexec_PROGRAMS =

2862
if WITH_LIBVIRTD
2863 2864
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2865 2866 2867 2868
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2869 2870 2871
libvirt_iohelper_LDADD =		\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
2872 2873
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
2874
endif WITH_DTRACE_PROBES
2875

D
Daniel P. Berrange 已提交
2876 2877 2878 2879
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2880 2881 2882 2883

if WITH_NETWORK
libexec_PROGRAMS += libvirt_leaseshelper
libvirt_leaseshelper_SOURCES = $(NETWORK_LEASES_HELPER_SOURCES)
2884 2885 2886 2887
libvirt_leaseshelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902
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

2903
endif WITH_LIBVIRTD
2904

2905
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
2906
if WITH_LIBVIRTD
2907
libexec_PROGRAMS += libvirt_parthelper
2908

2909
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
D
Daniel P. Berrange 已提交
2910 2911 2912 2913
libvirt_parthelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2914 2915 2916 2917
libvirt_parthelper_LDADD =		\
		$(LIBPARTED_LIBS)	\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
2918 2919
if WITH_DTRACE_PROBES
libvirt_parthelper_LDADD += libvirt_probes.lo
2920
endif WITH_DTRACE_PROBES
2921

D
Daniel P. Berrange 已提交
2922 2923 2924 2925 2926
libvirt_parthelper_CFLAGS = \
		$(LIBPARTED_CFLAGS) \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2927 2928
endif WITH_LIBVIRTD
endif WITH_STORAGE_DISK
2929 2930
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)

2931

2932
if WITH_SANLOCK
2933 2934 2935
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2936
libvirt_sanlock_helper_CFLAGS = \
2937
		-I$(srcdir)/conf \
D
Daniel P. Berrange 已提交
2938 2939 2940 2941 2942 2943 2944
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2945
libvirt_sanlock_helper_LDADD = libvirt.la
2946
endif WITH_SANLOCK
2947

2948 2949 2950 2951 2952 2953
if WITH_LXC
if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_lxc

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

J
Jamie Strandboge 已提交
2990 2991 2992 2993 2994 2995
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 已提交
2996 2997 2998 2999
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
J
Jamie Strandboge 已提交
3000
virt_aa_helper_LDADD =						\
3001
		libvirt.la					\
C
Chris Lalancette 已提交
3002 3003
		libvirt_conf.la					\
		libvirt_util.la					\
3004
		libvirt_driver_storage_impl.la			\
C
Chris Lalancette 已提交
3005
		../gnulib/lib/libgnu.la
3006
if WITH_DTRACE_PROBES
3007
virt_aa_helper_LDADD += libvirt_probes.lo
3008
endif WITH_DTRACE_PROBES
J
Jamie Strandboge 已提交
3009
virt_aa_helper_CFLAGS =						\
3010 3011 3012 3013
		-I$(srcdir)/conf				\
		-I$(srcdir)/security				\
		$(AM_CFLAGS) 					\
		$(PIE_CFLAGS) 					\
D
Daniel P. Berrange 已提交
3014
		$(NULL)
3015 3016
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
J
Jamie Strandboge 已提交
3017 3018
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

3019 3020 3021 3022 3023
noinst_LTLIBRARIES += libvirt-nss.la

libvirt_nss_la_SOURCES =		\
		util/viralloc.c			\
		util/viralloc.h			\
K
Kai Kang 已提交
3024 3025
		util/viratomic.c		\
		util/viratomic.h		\
3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077
		util/virbitmap.c		\
		util/virbitmap.h		\
		util/virbuffer.c		\
		util/virbuffer.h		\
		util/vircommand.c		\
		util/vircommand.h		\
		util/virerror.c			\
		util/virerror.h			\
		util/virfile.c			\
		util/virfile.h			\
		util/virjson.c			\
		util/virjson.h			\
		util/virkmod.c			\
		util/virkmod.h			\
		util/virlease.c			\
		util/virlease.h			\
		util/virlog.c			\
		util/virlog.h			\
		util/virobject.c		\
		util/virobject.h		\
		util/virpidfile.c		\
		util/virpidfile.h		\
		util/virprocess.c		\
		util/virprocess.h		\
		util/virsocketaddr.c	\
		util/virsocketaddr.h	\
		util/virstring.c		\
		util/virstring.h		\
		util/virthread.c		\
		util/virthread.h		\
		util/virthreadjob.c		\
		util/virthreadjob.h		\
		util/virtime.c			\
		util/virtime.h			\
		util/virutil.c			\
		util/virutil.h			\
		$(NULL)

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

libvirt_nss_la_LIBADD =			\
		$(YAJL_LIBS)			\
		$(NULL)


3078
install-data-local: install-init install-systemd
3079 3080
if WITH_LIBVIRTD
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
3081
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
3082
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
3083
endif WITH_LIBVIRTD
3084 3085
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
3086
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
3087
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
3088
if WITH_SANLOCK
3089
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
3090
endif WITH_SANLOCK
3091
if WITH_QEMU
3092
	$(MKDIR_P) -m 0751 "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu"
3093
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu"
3094
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu"
3095
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu"
3096
endif WITH_QEMU
3097 3098 3099
if WITH_LXC
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lxc"
3100
endif WITH_LXC
J
Jim Fehlig 已提交
3101 3102 3103
if WITH_LIBXL
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/libxl"
J
Jim Fehlig 已提交
3104
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl"
3105
endif WITH_LIBXL
3106 3107 3108
if WITH_UML
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/uml"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/uml"
3109
endif WITH_UML
3110 3111
if WITH_XEN
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/xen"
3112
endif WITH_XEN
3113 3114
if WITH_NETWORK
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network"
3115
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq"
3116
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/network"
3117
	$(MKDIR_P) "$(DESTDIR)$(confdir)/qemu/networks/autostart"
3118
	$(INSTALL_DATA) $(srcdir)/network/default.xml \
3119
	  $(DESTDIR)$(confdir)/qemu/networks/default.xml
3120
	test -z "$(UUID)" || \
3121 3122 3123
	  { sed -e "s,</name>,</name>;  <uuid>$(UUID)</uuid>," \
	      $(DESTDIR)$(confdir)/qemu/networks/default.xml | \
	      tr ";" "\n" > \
3124 3125 3126 3127
	      $(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 已提交
3128
	( cd $(DESTDIR)$(confdir)/qemu/networks/autostart && \
3129 3130
	  rm -f default.xml && \
	  $(LN_S) ../default.xml default.xml )
3131
endif WITH_NETWORK
3132

3133
uninstall-local:: uninstall-init uninstall-systemd
3134
if WITH_LIBVIRTD
3135
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
3136 3137
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
3138
endif WITH_LIBVIRTD
3139 3140
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
3141
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
3142
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
3143
if WITH_SANLOCK
3144
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
3145
endif WITH_SANLOCK
3146 3147 3148 3149 3150
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" ||:
3151
endif WITH_QEMU
3152 3153 3154
if WITH_LXC
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||:
3155
endif WITH_LXC
J
Jim Fehlig 已提交
3156 3157 3158
if WITH_LIBXL
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||:
J
Jim Fehlig 已提交
3159
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||:
3160
endif WITH_LIBXL
3161 3162 3163
if WITH_UML
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/uml" ||:
3164
endif WITH_UML
3165 3166
if WITH_XEN
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/xen" ||:
3167
endif WITH_XEN
3168
if WITH_NETWORK
3169 3170 3171 3172
	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" || :
3173 3174
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||:
3175
endif WITH_NETWORK
3176
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
3177

3178 3179
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
3180
MAINTAINERCLEANFILES += $(REMOTE_DRIVER_GENERATED) $(VIR_NET_RPC_GENERATED)