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/virnetdev.h util/virnetdev.c		\
141
		util/virnetdevbandwidth.h util/virnetdevbandwidth.c \
142
		util/virnetdevbridge.h util/virnetdevbridge.c	\
143
		util/virnetdevip.h util/virnetdevip.c		\
144
		util/virnetdevmacvlan.c util/virnetdevmacvlan.h	\
145
		util/virnetdevmidonet.h util/virnetdevmidonet.c \
A
Ansis Atteka 已提交
146
		util/virnetdevopenvswitch.h util/virnetdevopenvswitch.c \
147
		util/virnetdevtap.h util/virnetdevtap.c		\
148 149
		util/virnetdevveth.h util/virnetdevveth.c	\
		util/virnetdevvlan.h util/virnetdevvlan.c	\
150
		util/virnetdevvportprofile.h util/virnetdevvportprofile.c \
151
		util/virnetlink.c util/virnetlink.h		\
152
		util/virnodesuspend.c util/virnodesuspend.h	\
153
		util/virkmod.c util/virkmod.h                   \
154
		util/virnuma.c util/virnuma.h			\
155 156 157
		util/virobject.c util/virobject.h		\
		util/virpci.c util/virpci.h			\
		util/virpidfile.c util/virpidfile.h		\
158
		util/virpolkit.c util/virpolkit.h               \
D
Daniel P. Berrange 已提交
159
		util/virportallocator.c util/virportallocator.h \
160
		util/virprobe.h					\
161
		util/virprocess.c util/virprocess.h		\
162
		util/virqemu.c util/virqemu.h			\
163
		util/virrandom.h util/virrandom.c		\
164
		util/virrotatingfile.h util/virrotatingfile.c   \
165
		util/virscsi.c util/virscsi.h			\
166
		util/virscsivhost.c util/virscsivhost.h		\
167
		util/virseclabel.c util/virseclabel.h		\
168
		util/virsecret.c util/virsecret.h		\
169 170
		util/virsexpr.c util/virsexpr.h			\
		util/virsocketaddr.h util/virsocketaddr.c	\
171
		util/virstats.c util/virstats.h	\
172
		util/virstorageencryption.c util/virstorageencryption.h \
173 174 175
		util/virstoragefile.c util/virstoragefile.h	\
		util/virstring.h util/virstring.c		\
		util/virsysinfo.c util/virsysinfo.h		\
176
		util/virsystemd.c util/virsystemd.h		\
177
		util/virthread.c util/virthread.h		\
P
Pavel Hrdina 已提交
178
		util/virthreadjob.c util/virthreadjob.h		\
179 180
		util/virthreadpool.c util/virthreadpool.h	\
		util/virtime.h util/virtime.c			\
181
		util/virtpm.h util/virtpm.c			\
182
		util/virtypedparam.c util/virtypedparam.h	\
183
		util/virusb.c util/virusb.h			\
184 185
		util/viruri.h util/viruri.c			\
		util/virutil.c util/virutil.h			\
186
		util/viruuid.c util/viruuid.h			\
187
		util/virxdrdefs.h                               \
188
		util/virxml.c util/virxml.h			\
189
		$(NULL)
L
Lai Jiangshan 已提交
190

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

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

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

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

238 239 240
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

241 242
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
243

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

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

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

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

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

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

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


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

289 290
DRIVER_SOURCES += $(LOG_PROTOCOL_GENERATED)

291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311
LOG_PROTOCOL = $(srcdir)/logging/log_protocol.x
EXTRA_DIST += $(LOG_PROTOCOL) \
	$(LOG_PROTOCOL_GENERATED)
BUILT_SOURCES += $(LOG_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(LOG_PROTOCOL_GENERATED)

LOG_DAEMON_GENERATED = \
		logging/log_daemon_dispatch_stubs.h
		$(NULL)

BUILT_SOURCES += $(LOG_DAEMON_GENERATED)
EXTRA_DIST += $(LOG_DAEMON_GENERATED)
MAINTAINERCLEANFILES += $(LOG_DAEMON_GENERATED)

LOG_DAEMON_SOURCES = \
		logging/log_daemon.h \
		logging/log_daemon.c \
		logging/log_daemon_config.h \
		logging/log_daemon_config.c \
		logging/log_daemon_dispatch.c \
		logging/log_daemon_dispatch.h \
312 313
		logging/log_handler.c \
		logging/log_handler.h \
314 315 316 317 318 319 320 321 322
		$(NULL)

logging/log_daemon_dispatch_stubs.h: $(LOG_PROTOCOL) \
		$(srcdir)/rpc/gendispatch.pl Makefile.am
	$(AM_V_GEN)perl -w $(srcdir)/rpc/gendispatch.pl --mode=server \
	    virLogManagerProtocol VIR_LOG_MANAGER_PROTOCOL \
	    $(LOG_PROTOCOL) > $(srcdir)/logging/log_daemon_dispatch_stubs.h


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

EXTRA_DIST += check-drivername.pl

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

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

666 667 668

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

BUILT_SOURCES += $(LXC_GENERATED)

747 748
CLEANFILES += $(LXC_GENERATED)

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

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

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

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

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

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

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

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

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

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

847 848 849 850 851
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 已提交
852
		libxl/libxl_migration.c libxl/libxl_migration.h
J
Jim Fehlig 已提交
853

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

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

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

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

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

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

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

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

946 947 948 949
INTERFACE_DRIVER_SOURCES =

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1005
STORAGE_HELPER_DISK_SOURCES =					\
1006
		storage/parthelper.c
1007

1008 1009 1010
UTIL_IO_HELPER_SOURCES =					\
		util/iohelper.c

1011 1012 1013
NETWORK_LEASES_HELPER_SOURCES =                                 \
               network/leaseshelper.c

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

1027

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

1137 1138

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

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

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

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

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

1175

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

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

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

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

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

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

1222 1223
endif WITH_REMOTE

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1397 1398

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

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

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

conf_DATA += lxc/lxc.conf

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

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

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

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

D
Daniel Veillard 已提交
1464

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

1467 1468
ESX_GENERATED_STAMP = .esx_vi_generator.stamp

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

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

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

MAINTAINERCLEANFILES += $(ESX_DRIVER_GENERATED) $(ESX_GENERATED_STAMP)

D
Daniel Veillard 已提交
1480

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

M
Matthias Bolte 已提交
1492

1493 1494
BUILT_SOURCES += $(HYPERV_DRIVER_GENERATED)

1495 1496
HYPERV_GENERATED_STAMP = .hyperv_wmi_generator.stamp

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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


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

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

1803 1804
EXTRA_DIST += access/genpolkit.pl

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

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

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

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

1823

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

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

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

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

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

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

1931 1932
check-local: check-augeas

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

2147
BUILT_SOURCES += $(GENERATED_SYM_FILES)
2148

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

2317
EXTRA_DIST += libvirt_probes.d libvirt_qemu_probes.d
2318

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

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

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

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

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

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

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

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

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


2470
sbin_PROGRAMS = virtlockd virtlogd
2471

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

2615
%.8: %.8.in $(top_srcdir)/configure.ac
2616
	$(AM_V_GEN)sed \
2617 2618 2619
		-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
		-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
		< $< > $@-t && \
2620 2621
	mv $@-t $@

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

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

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

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

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

2659 2660 2661 2662

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

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

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

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

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

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

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

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

2721

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

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

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

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

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

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

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

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

2775
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2776

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

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

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

2859 2860
libexec_PROGRAMS =

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

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

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

2902
endif WITH_LIBVIRTD
2903

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

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

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

2930

2931
if WITH_SANLOCK
2932 2933 2934
libexec_PROGRAMS += libvirt_sanlock_helper

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

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

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

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

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

libvirt_nss_la_SOURCES =		\
		util/viralloc.c			\
		util/viralloc.h			\
K
Kai Kang 已提交
3023 3024
		util/viratomic.c		\
		util/viratomic.h		\
3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076
		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)


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

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

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