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

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

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

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

39
AM_CFLAGS =	$(LIBXML_CFLAGS)				\
40
		$(WARN_CFLAGS)					\
E
Eric Blake 已提交
41 42 43
		$(LOCK_CHECKING_CFLAGS)				\
		$(WIN32_EXTRA_CFLAGS)				\
		$(COVERAGE_CFLAGS)
44
AM_LDFLAGS =	$(DRIVER_MODULE_LDFLAGS)			\
G
Guido Günther 已提交
45 46
		$(COVERAGE_LDFLAGS)				\
		$(RELRO_LDFLAGS)				\
47
		$(NO_INDIRECT_LDFLAGS)				\
G
Guido Günther 已提交
48
		$(NULL)
49

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

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

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

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

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

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

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

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

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

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

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

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

E
Eric Blake 已提交
177
BUILT_SOURCES += util/virkeymaps.h
178
MAINTAINERCLEANFILES += util/virkeymaps.h
179

E
Eric Blake 已提交
180
util/virkeymaps.h: $(srcdir)/util/keymaps.csv	\
L
Lai Jiangshan 已提交
181
		$(srcdir)/util/virkeycode-mapgen.py
182
	$(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py \
183
	  <$(srcdir)/util/keymaps.csv >util/virkeymaps.h
L
Lai Jiangshan 已提交
184

185
# Internal generic driver infrastructure
186
NODE_INFO_SOURCES = nodeinfo.h nodeinfo.c nodeinfopriv.h
O
Osier Yang 已提交
187 188 189
DATATYPES_SOURCES = datatypes.h datatypes.c
DRIVER_SOURCES =							\
		driver.c driver.h					\
190 191 192 193 194 195 196 197 198
		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 已提交
199 200 201 202 203
		internal.h						\
		$(DATATYPES_SOURCES)					\
		fdstream.c fdstream.h					\
		$(NODE_INFO_SOURCES)					\
		libvirt.c libvirt_internal.h				\
204
		libvirt-domain.c 					\
205
		libvirt-domain-snapshot.c 				\
206
		libvirt-host.c 						\
207
		libvirt-interface.c	 				\
208
		libvirt-network.c	 				\
209
		libvirt-nodedev.c	 				\
210
		libvirt-nwfilter.c	 				\
211
		libvirt-secret.c	 				\
212
		libvirt-storage.c	 				\
213
		libvirt-stream.c	 				\
O
Osier Yang 已提交
214 215 216
		locking/lock_manager.c locking/lock_manager.h		\
		locking/lock_driver.h					\
		locking/lock_driver_nop.h locking/lock_driver_nop.c	\
217
		locking/domain_lock.h locking/domain_lock.c
218

219 220 221
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

222 223
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
224

225
LOCK_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
226 227
		locking/lock_protocol.h \
		locking/lock_protocol.c \
228 229
		$(NULL)

230 231 232
LOCK_PROTOCOL = $(srcdir)/locking/lock_protocol.x
EXTRA_DIST += $(LOCK_PROTOCOL) \
	$(LOCK_PROTOCOL_GENERATED)
233 234 235
BUILT_SOURCES += $(LOCK_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(LOCK_PROTOCOL_GENERATED)

236
LOCK_DAEMON_GENERATED = \
237
		locking/lock_daemon_dispatch_stubs.h
238 239 240
		$(NULL)

BUILT_SOURCES += $(LOCK_DAEMON_GENERATED)
241
EXTRA_DIST += $(LOCK_DAEMON_GENERATED)
242 243
MAINTAINERCLEANFILES += $(LOCK_DAEMON_GENERATED)

244 245 246 247
LOCK_DRIVER_LOCKD_SOURCES = \
		locking/lock_driver_lockd.c \
		$(NULL)

248 249 250 251 252
LOCK_DAEMON_SOURCES = \
		locking/lock_daemon.h \
		locking/lock_daemon.c \
		locking/lock_daemon_config.h \
		locking/lock_daemon_config.c \
253 254
		locking/lock_daemon_dispatch.c \
		locking/lock_daemon_dispatch.h \
255 256
		$(NULL)

E
Eric Blake 已提交
257
locking/lock_daemon_dispatch_stubs.h: $(LOCK_PROTOCOL) \
258
		$(srcdir)/rpc/gendispatch.pl Makefile.am
259 260
	$(AM_V_GEN)perl -w $(srcdir)/rpc/gendispatch.pl --mode=server \
	    virLockSpaceProtocol VIR_LOCK_SPACE_PROTOCOL \
E
Eric Blake 已提交
261
	    $(LOCK_PROTOCOL) > $(srcdir)/locking/lock_daemon_dispatch_stubs.h
262 263


264 265
NETDEV_CONF_SOURCES =						\
		conf/netdev_bandwidth_conf.h conf/netdev_bandwidth_conf.c \
266 267
		conf/netdev_vport_profile_conf.h conf/netdev_vport_profile_conf.c \
		conf/netdev_vlan_conf.h conf/netdev_vlan_conf.c
268

269
# XML configuration format handling sources
270 271
# Domain driver generic impl APIs
DOMAIN_CONF_SOURCES =						\
272
		conf/capabilities.c conf/capabilities.h		\
273
		conf/domain_addr.c conf/domain_addr.h		\
M
Michal Privoznik 已提交
274
		conf/domain_capabilities.c conf/domain_capabilities.h	\
275
		conf/domain_conf.c conf/domain_conf.h		\
276
		conf/domain_audit.c conf/domain_audit.h		\
277
		conf/domain_nwfilter.c conf/domain_nwfilter.h	\
278
		conf/snapshot_conf.c conf/snapshot_conf.h	\
279
		conf/numa_conf.c conf/numa_conf.h
280

281 282 283 284
OBJECT_EVENT_SOURCES =						\
		conf/object_event.c conf/object_event.h \
		conf/object_event_private.h

285 286
DOMAIN_EVENT_SOURCES =						\
		conf/domain_event.c conf/domain_event.h
287

288 289 290
NETWORK_EVENT_SOURCES =						\
		conf/network_event.c conf/network_event.h

291
# Network driver generic impl APIs
292
NETWORK_CONF_SOURCES =						\
293 294
		conf/network_conf.c conf/network_conf.h \
		conf/networkcommon_conf.c conf/networkcommon_conf.h
295

296 297
# Network filter driver generic impl APIs
NWFILTER_PARAM_CONF_SOURCES =					\
298
		conf/nwfilter_params.c conf/nwfilter_params.h	\
299 300
		conf/nwfilter_ipaddrmap.c			\
		conf/nwfilter_ipaddrmap.h			\
301
		conf/nwfilter_conf.h
302

303
NWFILTER_CONF_SOURCES =						\
304 305 306
		$(NWFILTER_PARAM_CONF_SOURCES)			\
		conf/nwfilter_conf.c conf/nwfilter_conf.h

307
# Storage driver generic impl APIs
308 309
STORAGE_CONF_SOURCES =                                         \
		conf/storage_conf.h conf/storage_conf.c
310

311
# Interface driver generic impl APIs
312 313
INTERFACE_CONF_SOURCES =                                       \
		conf/interface_conf.c conf/interface_conf.h
314

315
# Secret driver generic impl APIs
316 317 318 319 320 321 322
SECRET_CONF_SOURCES =                                          \
		conf/secret_conf.h conf/secret_conf.c

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

323 324
CPU_CONF_SOURCES =						\
		conf/cpu_conf.c conf/cpu_conf.h
325

326 327
# Safe character device handling helper APIs
CHRDEV_CONF_SOURCES =						\
328
		conf/virchrdev.c conf/virchrdev.h
329

330 331 332 333
# Device Helper APIs
DEVICE_CONF_SOURCES =                                           \
		conf/device_conf.c conf/device_conf.h

334
CONF_SOURCES =							\
335
		$(NETDEV_CONF_SOURCES)				\
336
		$(DOMAIN_CONF_SOURCES)				\
337
		$(OBJECT_EVENT_SOURCES)				\
338
		$(DOMAIN_EVENT_SOURCES)				\
339
		$(NETWORK_EVENT_SOURCES)			\
340
		$(NETWORK_CONF_SOURCES)				\
341
		$(NWFILTER_CONF_SOURCES)			\
342 343 344
		$(NODE_DEVICE_CONF_SOURCES)			\
		$(STORAGE_CONF_SOURCES)				\
		$(INTERFACE_CONF_SOURCES)			\
345
		$(SECRET_CONF_SOURCES)				\
346
		$(CPU_CONF_SOURCES)				\
347
		$(CHRDEV_CONF_SOURCES)				\
348
		$(DEVICE_CONF_SOURCES)
349

350
# The remote RPC driver, covering domains, storage, networks, etc
351
REMOTE_DRIVER_GENERATED = \
E
Eric Blake 已提交
352 353 354 355 356 357 358 359 360 361
		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 已提交
362 363

REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x
364
LXC_PROTOCOL = $(srcdir)/remote/lxc_protocol.x
E
Eric Blake 已提交
365
QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x
366
REMOTE_DRIVER_PROTOCOL = $(REMOTE_PROTOCOL) $(QEMU_PROTOCOL) $(LXC_PROTOCOL)
367

E
Eric Blake 已提交
368
remote/remote_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
369
		$(REMOTE_PROTOCOL) Makefile.am
370
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
371 372
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/remote/remote_client_bodies.h
373

E
Eric Blake 已提交
374
remote/lxc_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
375
		$(LXC_PROTOCOL) Makefile.am
376
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
377 378
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/remote/lxc_client_bodies.h
379

E
Eric Blake 已提交
380
remote/qemu_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
381
		$(QEMU_PROTOCOL) Makefile.am
382
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
383 384
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/remote/qemu_client_bodies.h
385 386 387 388 389

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

391
EXTRA_DIST +=  $(REMOTE_DRIVER_PROTOCOL) \
392
		$(REMOTE_DRIVER_GENERATED)
393

M
Martin Kletzander 已提交
394 395 396 397
ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x

ADMIN_PROTOCOL_GENERATED = \
		admin/admin_protocol.c	\
398 399 400 401 402 403 404 405
		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 已提交
406 407 408 409 410

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

411 412 413 414 415 416 417 418 419 420
# 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
421 422 423 424

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

435
# Depending on configure options, libtool creates one or both of
E
Eric Blake 已提交
436 437
# remote/{,.libs/}libvirt_driver_remote_la-remote_protocol.o.  We want
# the newest of the two, in case configure options changed and a stale
438
# file is left around from an earlier build.
439
PDWTAGS = \
440
	$(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then		\
E
Eric Blake 已提交
441 442
	  o=`ls -t $(<:.lo=.$(OBJEXT))					\
	     $(subst /,/.libs/,$(<:.lo=.$(OBJEXT)))			\
443 444 445
	    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 已提交
446
	  if test ! -s $(@F)-t1 && test -s $(@F)-t2; then		\
447 448 449
	    rm -rf $(@F)-t?;						\
	    echo 'WARNING: pdwtags appears broken; skipping the $@ test' >&2;\
	  else								\
450
	    $(PERL) -0777 -n						\
451
		-e 'foreach my $$p (split m!\n*(?:$(r1)|$(r2))\n!) {'	\
452
		-e '  if ($$p =~ /^(struct|enum) $(struct_prefix)/ ||'	\
453
		-e '      $$p =~ /^enum \{/) {'				\
454 455 456
		-e '    $$p =~ s!\t*/\*.*?\*/!!sg;'			\
		-e '    $$p =~ s!\s+\n!\n!sg;'				\
		-e '    $$p =~ s!\s+$$!!;'				\
457
		-e '    $$p =~ s!\t!        !g;'			\
458 459 460 461
		-e '    print "$$p\n";'					\
		-e '    $$n++;'						\
		-e '  }'						\
		-e '}'							\
462 463 464
		-e 'BEGIN {'						\
		-e '  print "/* -*- c -*- */\n";'			\
		-e '}'							\
465
		-e 'END {'						\
466
		-e '  if ($$n < 1) {'					\
467 468 469 470 471 472
		-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 '}'							\
473 474
		< $(@F)-t1 > $(@F)-t3;					\
	    case $$? in 8) rm -f $(@F)-t?; exit 0;; 0) ;; *) exit 1;; esac;\
475
	    diff -u $(@)s $(@F)-t3; st=$$?; rm -f $(@F)-t?; exit $$st;	\
476
	  fi;								\
477
	else								\
478 479
	  echo 'WARNING: you lack pdwtags; skipping the $@ test' >&2;	\
	  echo 'WARNING: install the dwarves package to get pdwtags' >&2; \
480
	fi
481

482
# .libs/libvirt.so is built by libtool as a side-effect of the Makefile
483 484
# rule for libvirt.la.  However, checking symbols relies on Linux ELF layout
if WITH_LINUX
485 486 487
check-symfile: libvirt.syms libvirt.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt.syms \
	  .libs/libvirt.so
488 489 490
check-admin-symfile: libvirt_admin.syms libvirt-admin.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt_admin.syms \
	  .libs/libvirt-admin.so
491
else ! WITH_LINUX
492
check-symfile:
493
check-admin-symfile:
494
endif ! WITH_LINUX
495
check-symsorting:
496
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
497
		$(srcdir) $(SYM_FILES)
498 499 500
check-admin-symsorting:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
		$(srcdir) $(ADMIN_SYM_FILES)
J
Jiri Denemark 已提交
501
EXTRA_DIST += check-symfile.pl check-symsorting.pl
502

E
Eric Blake 已提交
503
# Keep this list synced with RPC_PROBE_FILES
504 505
PROTOCOL_STRUCTS = \
	$(srcdir)/remote_protocol-structs \
506
	$(srcdir)/lxc_protocol-structs \
507
	$(srcdir)/qemu_protocol-structs \
J
Jiri Denemark 已提交
508
	$(srcdir)/virnetprotocol-structs \
E
Eric Blake 已提交
509 510 511
	$(srcdir)/virkeepaliveprotocol-structs \
	$(srcdir)/lxc_monitor_protocol-structs \
	$(srcdir)/lock_protocol-structs \
M
Martin Kletzander 已提交
512
	$(srcdir)/admin_protocol-structs \
E
Eric Blake 已提交
513 514
	$(NULL)

515
if WITH_REMOTE
516 517
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)

518 519
# 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.
520 521 522
$(srcdir)/remote_protocol-struct \
	$(srcdir)/qemu_protocol-struct \
	$(srcdir)/lxc_protocol-struct: \
E
Eric Blake 已提交
523
		$(srcdir)/%-struct: remote/libvirt_driver_remote_la-%.lo
524
	$(PDWTAGS)
525
$(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \
E
Eric Blake 已提交
526
		$(srcdir)/%-struct: rpc/libvirt_net_rpc_la-%.lo
527
	$(PDWTAGS)
E
Eric Blake 已提交
528
$(srcdir)/lxc_monitor_protocol-struct: \
E
Eric Blake 已提交
529
		$(srcdir)/%-struct: lxc/libvirt_driver_lxc_impl_la-%.lo
E
Eric Blake 已提交
530 531
	$(PDWTAGS)
$(srcdir)/lock_protocol-struct: \
E
Eric Blake 已提交
532
		$(srcdir)/%-struct: locking/lockd_la-%.lo
E
Eric Blake 已提交
533
	$(PDWTAGS)
M
Martin Kletzander 已提交
534 535 536
$(srcdir)/admin_protocol-struct: \
		$(srcdir)/%-struct: admin/libvirt_admin_la-%.lo
	$(PDWTAGS)
E
Eric Blake 已提交
537

538
else !WITH_REMOTE
539 540 541
# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be
# re-generated when configured --without-remote.
check-protocol:
542
endif !WITH_REMOTE
J
Jiri Denemark 已提交
543
EXTRA_DIST += $(PROTOCOL_STRUCTS)
544 545 546 547 548

check-drivername:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-drivername.pl \
		$(srcdir)/driver.h \
		$(srcdir)/libvirt_public.syms \
549
		$(srcdir)/libvirt_admin_public.syms \
550 551 552 553 554
		$(srcdir)/libvirt_qemu.syms \
		$(srcdir)/libvirt_lxc.syms

EXTRA_DIST += check-drivername.pl

555
DRIVER_SOURCE_FILES = \
556 557 558 559 560 561 562 563 564 565 566
	$(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) \
567
	$(VZ_DRIVER_SOURCES) \
568 569 570 571 572 573 574 575
	$(PHYP_DRIVER_SOURCES) \
	$(QEMU_DRIVER_SOURCES) \
	$(REMOTE_DRIVER_SOURCES) \
	$(SECRET_DRIVER_SOURCES) \
	$(STORAGE_DRIVER_SOURCES) \
	$(TEST_DRIVER_SOURCES) \
	$(UML_DRIVER_SOURCES) \
	$(VBOX_DRIVER_SOURCES) \
576
	vbox/vbox_tmpl.c \
577 578 579
	$(VMWARE_DRIVER_SOURCES) \
	$(XEN_DRIVER_SOURCES) \
	$(XENAPI_DRIVER_SOURCES) \
580 581
	$(NULL)

582
STATEFUL_DRIVER_SOURCE_FILES = \
R
Roman Bogorodskiy 已提交
583
	$(BHYVE_DRIVER_SOURCES) \
584 585 586 587 588 589 590 591 592 593 594 595 596
	$(INTERFACE_DRIVER_SOURCES) \
	$(LIBXL_DRIVER_SOURCES) \
	$(LXC_DRIVER_SOURCES) \
	$(NETWORK_DRIVER_SOURCES) \
	$(NODE_DEVICE_DRIVER_SOURCES) \
	$(NWFILTER_DRIVER_SOURCES) \
	$(QEMU_DRIVER_SOURCES) \
	$(SECRET_DRIVER_SOURCES) \
	$(STORAGE_DRIVER_SOURCES) \
	$(UML_DRIVER_SOURCES) \
	$(XEN_DRIVER_SOURCES) \
	$(NULL)

597 598 599

check-driverimpls:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-driverimpls.pl \
600
		$(filter /%,$(DRIVER_SOURCE_FILES)) \
E
Eric Blake 已提交
601 602 603
		$(filter $(srcdir)/%,$(DRIVER_SOURCE_FILES)) \
		$(addprefix $(srcdir)/,$(filter-out $(srcdir)/%, \
			$(filter-out /%,$(DRIVER_SOURCE_FILES))))
604

605 606
check-aclrules:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclrules.pl \
E
Eric Blake 已提交
607
		$(REMOTE_PROTOCOL) \
608
		$(addprefix $(srcdir)/,$(filter-out /%,$(STATEFUL_DRIVER_SOURCE_FILES)))
609

610 611 612 613 614
check-aclperms:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclperms.pl \
		$(srcdir)/access/viraccessperm.h \
		$(srcdir)/access/viraccessperm.c

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

617
check-local: check-protocol check-symfile check-symsorting \
618
	check-drivername check-driverimpls check-aclrules \
619
	check-aclperms check-admin-symfile check-admin-symsorting
620
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
621

622 623
# Mock driver, covering domains, storage, networks, etc
TEST_DRIVER_SOURCES =						\
624
		test/test_driver.c test/test_driver.h
625 626 627

# Now the Hypervisor specific drivers
XEN_DRIVER_SOURCES =						\
628 629 630 631 632 633
		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
634
if WITH_XEN_INOTIFY
635
XEN_DRIVER_SOURCES += xen/xen_inotify.c xen/xen_inotify.h
636
endif WITH_XEN_INOTIFY
637

638
LXC_MONITOR_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
639 640
	lxc/lxc_monitor_protocol.h \
	lxc/lxc_monitor_protocol.c \
641 642 643
	$(NULL)

LXC_MONITOR_GENERATED = \
E
Eric Blake 已提交
644
	lxc/lxc_monitor_dispatch.h \
645 646 647
	$(NULL)

LXC_CONTROLLER_GENERATED = \
E
Eric Blake 已提交
648
	lxc/lxc_controller_dispatch.h \
649 650 651
	$(NULL)

LXC_GENERATED = \
652
	$(LXC_MONITOR_PROTOCOL_GENERATED) \
653 654 655 656
	$(LXC_MONITOR_GENERATED) \
	$(LXC_CONTROLLER_GENERATED) \
	$(NULL)

657
LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x
658

E
Eric Blake 已提交
659
lxc/lxc_monitor_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
660
		$(LXC_MONITOR_PROTOCOL) Makefile.am
661
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
662 663
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_monitor_dispatch.h
664

E
Eric Blake 已提交
665
lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
666
		$(REMOTE_PROTOCOL) Makefile.am
667
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \
E
Eric Blake 已提交
668 669
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_controller_dispatch.h
670 671

EXTRA_DIST += \
672
	$(LXC_MONITOR_PROTOCOL) \
673 674 675 676 677
	$(LXC_GENERATED) \
	$(NULL)

BUILT_SOURCES += $(LXC_GENERATED)

678 679
CLEANFILES += $(LXC_GENERATED)

680
LXC_DRIVER_SOURCES =						\
681
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
682
		$(LXC_MONITOR_GENERATED)			\
683 684
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
685
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
686
		lxc/lxc_domain.c lxc/lxc_domain.h		\
687
		lxc/lxc_hostdev.c lxc/lxc_hostdev.h		\
688
		lxc/lxc_monitor.c lxc/lxc_monitor.h		\
689
		lxc/lxc_process.c lxc/lxc_process.h		\
G
Gao feng 已提交
690
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
691
		lxc/lxc_native.c lxc/lxc_native.h		\
692
		lxc/lxc_driver.c lxc/lxc_driver.h
693

694
LXC_CONTROLLER_SOURCES =					\
695
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
696
		$(LXC_CONTROLLER_GENERATED)			\
697 698
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
699
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
700
		lxc/lxc_domain.c lxc/lxc_domain.h		\
G
Gao feng 已提交
701
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
702
		lxc/lxc_controller.c
703

J
Jamie Strandboge 已提交
704
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES =			\
E
Eric Blake 已提交
705
		$(DATATYPES_SOURCES)				\
J
Jamie Strandboge 已提交
706 707
		security/virt-aa-helper.c

708 709 710
PHYP_DRIVER_SOURCES =						\
		phyp/phyp_driver.c phyp/phyp_driver.h

711
OPENVZ_DRIVER_SOURCES =						\
712
		openvz/openvz_conf.c openvz/openvz_conf.h	\
713 714
		openvz/openvz_driver.c openvz/openvz_driver.h   \
		openvz/openvz_util.c openvz/openvz_util.h
715

E
Eric Blake 已提交
716
VMWARE_DRIVER_SOURCES =						\
717
		vmware/vmware_driver.c vmware/vmware_driver.h	\
718 719
		vmware/vmware_conf.c vmware/vmware_conf.h

720
VBOX_DRIVER_SOURCES =						\
E
Eric Blake 已提交
721 722
	vbox/vbox_glue.c vbox/vbox_glue.h			\
	vbox/vbox_driver.c vbox/vbox_driver.h			\
T
Taowei 已提交
723
	vbox/vbox_snapshot_conf.c vbox/vbox_snapshot_conf.h     \
E
Eric Blake 已提交
724 725 726 727
	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			\
728
	vbox/vbox_V4_0.c vbox/vbox_CAPI_v4_0.h			\
729
	vbox/vbox_V4_1.c vbox/vbox_CAPI_v4_1.h			\
R
Ryota Ozaki 已提交
730
	vbox/vbox_V4_2.c vbox/vbox_CAPI_v4_2.h			\
T
Taowei 已提交
731
	vbox/vbox_V4_2_20.c vbox/vbox_CAPI_v4_2_20.h		\
732
	vbox/vbox_V4_3.c vbox/vbox_CAPI_v4_3.h			\
T
Taowei 已提交
733 734 735
	vbox/vbox_V4_3_4.c vbox/vbox_CAPI_v4_3_4.h              \
	vbox/vbox_common.c vbox/vbox_common.h                   \
	vbox/vbox_uniformed_api.h                               \
736 737 738
	vbox/vbox_get_driver.h					\
	vbox/vbox_network.c					\
	vbox/vbox_storage.c
T
Taowei Luo 已提交
739

E
Eric Blake 已提交
740
VBOX_DRIVER_EXTRA_DIST =					\
741 742 743
		vbox/vbox_tmpl.c vbox/README			\
		vbox/vbox_MSCOMGlue.c vbox/vbox_MSCOMGlue.h	\
		vbox/vbox_XPCOMCGlue.c vbox/vbox_XPCOMCGlue.h
744

O
Osier Yang 已提交
745 746
QEMU_DRIVER_SOURCES =							\
		qemu/qemu_agent.c qemu/qemu_agent.h			\
747
		qemu/qemu_blockjob.c qemu/qemu_blockjob.h		\
O
Osier Yang 已提交
748 749 750 751 752 753
		qemu/qemu_capabilities.c qemu/qemu_capabilities.h	\
		qemu/qemu_command.c qemu/qemu_command.h			\
		qemu/qemu_domain.c qemu/qemu_domain.h			\
		qemu/qemu_cgroup.c qemu/qemu_cgroup.h			\
		qemu/qemu_hostdev.c qemu/qemu_hostdev.h			\
		qemu/qemu_hotplug.c qemu/qemu_hotplug.h			\
754
		qemu/qemu_hotplugpriv.h					\
O
Osier Yang 已提交
755 756
		qemu/qemu_conf.c qemu/qemu_conf.h			\
		qemu/qemu_process.c qemu/qemu_process.h			\
757
		qemu/qemu_processpriv.h					\
O
Osier Yang 已提交
758 759 760 761 762 763
		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				\
764
		qemu/qemu_driver.c qemu/qemu_driver.h	\
765 766
		qemu/qemu_interface.c qemu/qemu_interface.h		\
		qemu/qemu_capspriv.h
R
Richard W.M. Jones 已提交
767

O
Osier Yang 已提交
768
XENAPI_DRIVER_SOURCES =						\
769
		xenapi/xenapi_driver.c xenapi/xenapi_driver.h	\
O
Osier Yang 已提交
770
		xenapi/xenapi_driver_private.h			\
771 772
		xenapi/xenapi_utils.c xenapi/xenapi_utils.h

J
Jim Fehlig 已提交
773 774
LIBXL_DRIVER_SOURCES =						\
		libxl/libxl_conf.c libxl/libxl_conf.h		\
J
Jim Fehlig 已提交
775
		libxl/libxl_domain.c libxl/libxl_domain.h       \
J
Jim Fehlig 已提交
776 777
		libxl/libxl_driver.c libxl/libxl_driver.h       \
		libxl/libxl_migration.c libxl/libxl_migration.h
J
Jim Fehlig 已提交
778

779
UML_DRIVER_SOURCES =						\
D
Daniel P. Berrange 已提交
780 781
		uml/uml_conf.c uml/uml_conf.h			\
		uml/uml_driver.c uml/uml_driver.h
782

O
Osier Yang 已提交
783 784 785 786 787 788
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	\
789
		esx/esx_storage_backend_vmfs.c esx/esx_storage_backend_vmfs.h	\
790
		esx/esx_storage_backend_iscsi.c esx/esx_storage_backend_iscsi.h	\
791
		esx/esx_stream.c esx/esx_stream.h			\
O
Osier Yang 已提交
792 793 794
		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		\
795
		esx/esx_vi_types.c esx/esx_vi_types.h
796

797
ESX_DRIVER_GENERATED =							\
798 799
		esx/esx_vi_methods.generated.c				\
		esx/esx_vi_methods.generated.h				\
800
		esx/esx_vi_methods.generated.macro			\
801 802 803 804 805
		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			\
806 807 808
		esx/esx_vi_types.generated.typefromstring		\
		esx/esx_vi.generated.c					\
		esx/esx_vi.generated.h
809

O
Osier Yang 已提交
810
ESX_DRIVER_EXTRA_DIST =							\
811 812 813 814 815
		esx/README						\
		esx/esx_vi_generator.input				\
		esx/esx_vi_generator.py					\
		$(ESX_DRIVER_GENERATED)

O
Osier Yang 已提交
816
HYPERV_DRIVER_SOURCES =									\
M
Matthias Bolte 已提交
817 818
		hyperv/hyperv_private.h							\
		hyperv/hyperv_driver.c hyperv/hyperv_driver.h				\
819
		hyperv/hyperv_util.c hyperv/hyperv_util.h				\
820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835
		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)

836 837 838 839 840 841 842 843
VZ_DRIVER_SOURCES =					\
		vz/vz_driver.h			\
		vz/vz_driver.c			\
		vz/vz_utils.c			\
		vz/vz_utils.h			\
		vz/vz_storage.c		\
		vz/vz_sdk.h			\
		vz/vz_sdk.c
D
Dmitry Guryanov 已提交
844

R
Roman Bogorodskiy 已提交
845
BHYVE_DRIVER_SOURCES =						\
846 847
		bhyve/bhyve_capabilities.c			\
		bhyve/bhyve_capabilities.h			\
R
Roman Bogorodskiy 已提交
848 849
		bhyve/bhyve_command.c				\
		bhyve/bhyve_command.h				\
850 851 852 853
		bhyve/bhyve_device.c				\
		bhyve/bhyve_device.h				\
		bhyve/bhyve_domain.c				\
		bhyve/bhyve_domain.h				\
R
Roman Bogorodskiy 已提交
854 855
		bhyve/bhyve_driver.h				\
		bhyve/bhyve_driver.c				\
856 857
		bhyve/bhyve_monitor.c				\
		bhyve/bhyve_monitor.h				\
R
Roman Bogorodskiy 已提交
858 859 860 861 862
		bhyve/bhyve_process.c				\
		bhyve/bhyve_process.h				\
		bhyve/bhyve_utils.h				\
		$(NULL)

863
NETWORK_DRIVER_SOURCES =					\
864 865 866 867 868
		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
869

870 871 872 873
INTERFACE_DRIVER_SOURCES =

if WITH_INTERFACE
INTERFACE_DRIVER_SOURCES +=					\
874 875
		interface/interface_driver.h        \
		interface/interface_driver.c
876 877 878 879

if WITH_NETCF
INTERFACE_DRIVER_SOURCES +=					\
		interface/interface_backend_netcf.c
880
endif WITH_NETCF
881
if WITH_UDEV
882 883
INTERFACE_DRIVER_SOURCES +=					\
		interface/interface_backend_udev.c
884 885
endif WITH_UDEV
endif WITH_INTERFACE
886

887
SECRET_DRIVER_SOURCES =						\
888
		secret/secret_driver.h secret/secret_driver.c
889

890
# Storage backend specific impls
O
Osier Yang 已提交
891 892
STORAGE_DRIVER_SOURCES =						\
		storage/storage_driver.h storage/storage_driver.c	\
893
		storage/storage_backend.h storage/storage_backend.c
894 895

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

898
STORAGE_DRIVER_LVM_SOURCES =					\
O
Osier Yang 已提交
899
		storage/storage_backend_logical.h		\
900
		storage/storage_backend_logical.c
901 902

STORAGE_DRIVER_ISCSI_SOURCES =					\
903
		storage/storage_backend_iscsi.h storage/storage_backend_iscsi.c
904

905
STORAGE_DRIVER_SCSI_SOURCES =					\
906
		storage/storage_backend_scsi.h storage/storage_backend_scsi.c
907

D
Dave Allan 已提交
908
STORAGE_DRIVER_MPATH_SOURCES =					\
909
		storage/storage_backend_mpath.h storage/storage_backend_mpath.c
D
Dave Allan 已提交
910

911
STORAGE_DRIVER_DISK_SOURCES =					\
912
		storage/storage_backend_disk.h storage/storage_backend_disk.c
913

914 915 916
STORAGE_DRIVER_RBD_SOURCES =					\
		storage/storage_backend_rbd.h storage/storage_backend_rbd.c

917 918 919
STORAGE_DRIVER_SHEEPDOG_SOURCES =				\
		storage/storage_backend_sheepdog.h storage/storage_backend_sheepdog.c

920 921 922
STORAGE_DRIVER_GLUSTER_SOURCES =				\
		storage/storage_backend_gluster.h storage/storage_backend_gluster.c

R
Roman Bogorodskiy 已提交
923 924 925
STORAGE_DRIVER_ZFS_SOURCES =					\
                storage/storage_backend_zfs.h storage/storage_backend_zfs.c

926
STORAGE_HELPER_DISK_SOURCES =					\
927
		storage/parthelper.c
928

929 930 931
UTIL_IO_HELPER_SOURCES =					\
		util/iohelper.c

932 933 934
NETWORK_LEASES_HELPER_SOURCES =                                 \
               network/leaseshelper.c

935
# Network filters
O
Osier Yang 已提交
936
NWFILTER_DRIVER_SOURCES =						\
937
		nwfilter/nwfilter_driver.h nwfilter/nwfilter_driver.c	\
938
		nwfilter/nwfilter_tech_driver.h				\
939 940
		nwfilter/nwfilter_gentech_driver.c			\
		nwfilter/nwfilter_gentech_driver.h			\
S
Stefan Berger 已提交
941 942
		nwfilter/nwfilter_dhcpsnoop.c				\
		nwfilter/nwfilter_dhcpsnoop.h				\
943
		nwfilter/nwfilter_ebiptables_driver.c			\
944 945 946
		nwfilter/nwfilter_ebiptables_driver.h			\
		nwfilter/nwfilter_learnipaddr.c				\
		nwfilter/nwfilter_learnipaddr.h
947

948

949
# Security framework and drivers for various models
O
Osier Yang 已提交
950 951 952 953 954
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		\
955
		security/security_manager.h security/security_manager.c
956

957
SECURITY_DRIVER_SELINUX_SOURCES =				\
958
		security/security_selinux.h security/security_selinux.c
959

J
Jamie Strandboge 已提交
960 961 962
SECURITY_DRIVER_APPARMOR_SOURCES =				\
		security/security_apparmor.h security/security_apparmor.c

963
ACCESS_DRIVER_GENERATED = \
E
Eric Blake 已提交
964 965 966 967 968 969 970
		access/viraccessapicheck.h \
		access/viraccessapicheck.c \
		access/viraccessapicheckqemu.h \
		access/viraccessapicheckqemu.c \
		access/viraccessapichecklxc.h \
		access/viraccessapichecklxc.c \
		$(NULL)
971

972
ACCESS_DRIVER_SYM_FILES = \
973 974 975
		libvirt_access.syms \
		libvirt_access_qemu.syms \
		libvirt_access_lxc.syms
976

977 978 979 980 981
ACCESS_DRIVER_API_FILES = \
		libvirt_access.xml \
		libvirt_access_qemu.xml \
		libvirt_access_lxc.xml

982 983 984 985 986 987 988
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

989 990 991 992
ACCESS_DRIVER_POLKIT_SOURCES = \
		access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c

ACCESS_DRIVER_POLKIT_POLICY = \
993
		$(srcdir)/access/org.libvirt.api.policy
994 995


996
NODE_DEVICE_DRIVER_SOURCES =					\
O
Osier Yang 已提交
997 998
		node_device/node_device_driver.c		\
		node_device/node_device_driver.h		\
999 1000
		node_device/node_device_linux_sysfs.c           \
		node_device/node_device_linux_sysfs.h
1001 1002

NODE_DEVICE_DRIVER_HAL_SOURCES =				\
1003
		node_device/node_device_hal.c			\
1004
		node_device/node_device_hal.h
1005

1006
NODE_DEVICE_DRIVER_UDEV_SOURCES =				\
D
Daniel Veillard 已提交
1007 1008
		node_device/node_device_udev.c			\
		node_device/node_device_udev.h
1009

J
Jiri Denemark 已提交
1010 1011 1012 1013
CPU_SOURCES =							\
		cpu/cpu.h cpu/cpu.c				\
		cpu/cpu_generic.h cpu/cpu_generic.c		\
		cpu/cpu_x86.h cpu/cpu_x86.c cpu/cpu_x86_data.h	\
T
Thang Pham 已提交
1014
		cpu/cpu_s390.h cpu/cpu_s390.c			\
C
Chuck Short 已提交
1015
		cpu/cpu_arm.h cpu/cpu_arm.c			\
1016
		cpu/cpu_aarch64.h cpu/cpu_aarch64.c		\
1017 1018 1019
		cpu/cpu_ppc64.h cpu/cpu_ppc64.c			\
		cpu/cpu_ppc64_data.h				\
		cpu/cpu_map.h cpu/cpu_map.c
1020

1021 1022 1023
VMX_SOURCES =							\
		vmx/vmx.c vmx/vmx.h

1024 1025
XENCONFIG_SOURCES =						\
		xenconfig/xenxs_private.h			\
1026
		xenconfig/xen_common.c xenconfig/xen_common.h   \
1027
		xenconfig/xen_sxpr.c xenconfig/xen_sxpr.h	\
1028
		xenconfig/xen_xm.c xenconfig/xen_xm.h
1029 1030 1031 1032
if WITH_LIBXL
XENCONFIG_SOURCES +=						\
		xenconfig/xen_xl.c xenconfig/xen_xl.h
endif WITH_LIBXL
1033

J
Jiri Denemark 已提交
1034 1035
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
1036
EXTRA_DIST +=	$(pkgdata_DATA)
1037

1038 1039 1040 1041 1042 1043
#########################
#
# Build up list of libvirt.la source files based on configure conditions
#
# First deal with sources usable in non-daemon context

1044
noinst_LTLIBRARIES = libvirt_util.la
1045 1046
libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
libvirt_la_BUILT_LIBADD = libvirt_util.la
1047 1048
libvirt_util_la_SOURCES =					\
		$(UTIL_SOURCES)
1049
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
1050
		$(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
1051
		$(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS)	\
1052
		$(SYSTEMD_DAEMON_CFLAGS) $(POLKIT_CFLAGS) \
1053
		-I$(srcdir)/conf
1054
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
1055
		$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
1056
		$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(MSCOM_LIBS) $(LIBXML_LIBS) \
1057 1058
		$(SECDRIVER_LIBS) $(NUMACTL_LIBS) $(SYSTEMD_DAEMON_LIBS) \
		$(POLKIT_LIBS)
1059

1060 1061

noinst_LTLIBRARIES += libvirt_conf.la
1062
libvirt_la_BUILT_LIBADD += libvirt_conf.la
1063
libvirt_conf_la_SOURCES = $(CONF_SOURCES)
1064 1065
libvirt_conf_la_CFLAGS = $(AM_CFLAGS)
libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS)
1066
libvirt_conf_la_LIBADD = $(LIBXML_LIBS)
1067

J
Jiri Denemark 已提交
1068
noinst_LTLIBRARIES += libvirt_cpu.la
1069
libvirt_la_BUILT_LIBADD += libvirt_cpu.la
J
Jiri Denemark 已提交
1070
libvirt_cpu_la_CFLAGS = \
1071
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jiri Denemark 已提交
1072 1073
libvirt_cpu_la_SOURCES = $(CPU_SOURCES)

1074 1075 1076 1077
if WITH_VMX
noinst_LTLIBRARIES += libvirt_vmx.la
libvirt_la_BUILT_LIBADD += libvirt_vmx.la
libvirt_vmx_la_CFLAGS = \
1078
		-I$(srcdir)/conf $(AM_CFLAGS)
1079
libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
1080
endif WITH_VMX
1081

J
Jim Fehlig 已提交
1082 1083 1084
if WITH_XENCONFIG
noinst_LTLIBRARIES += libvirt_xenconfig.la
libvirt_la_BUILT_LIBADD += libvirt_xenconfig.la
1085
libvirt_la_LIBADD += $(LIBXL_LIBS)
J
Jim Fehlig 已提交
1086
libvirt_xenconfig_la_CFLAGS = \
1087
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jim Fehlig 已提交
1088 1089
libvirt_xenconfig_la_SOURCES = $(XENCONFIG_SOURCES)
endif WITH_XENCONFIG
1090

1091

1092
noinst_LTLIBRARIES += libvirt_driver.la
1093
libvirt_la_BUILT_LIBADD += libvirt_driver.la
1094
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
1095

1096
libvirt_driver_la_CFLAGS = \
1097
		$(GNUTLS_CFLAGS) $(CURL_CFLAGS) \
1098
		-I$(srcdir)/conf $(AM_CFLAGS)
1099
libvirt_driver_la_LIBADD = \
1100
		$(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS)
1101

1102 1103
# 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.
1104
SYM_FILES = $(USED_SYM_FILES)
1105
USED_SYM_FILES = $(srcdir)/libvirt_private.syms
1106 1107 1108
GENERATED_SYM_FILES = \
	$(ACCESS_DRIVER_SYM_FILES) \
	libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \
1109
	libvirt_admin.syms libvirt_admin.def \
1110
	$(NULL)
1111

1112
if WITH_TEST
1113
noinst_LTLIBRARIES += libvirt_driver_test.la
1114
libvirt_la_BUILT_LIBADD += libvirt_driver_test.la
1115
libvirt_driver_test_la_CFLAGS = \
1116
		-I$(srcdir)/conf $(AM_CFLAGS)
1117
libvirt_driver_test_la_SOURCES = $(TEST_DRIVER_SOURCES)
1118
endif WITH_TEST
1119 1120

if WITH_REMOTE
1121
noinst_LTLIBRARIES += libvirt_driver_remote.la
1122
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
1123 1124
libvirt_driver_remote_la_CFLAGS =				\
		$(GNUTLS_CFLAGS)				\
E
Eric Blake 已提交
1125
		$(XDR_CFLAGS)					\
1126 1127
		-I$(srcdir)/conf				\
		-I$(srcdir)/rpc					\
1128 1129
		$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
1130 1131 1132 1133
libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) \
                libvirt-net-rpc-client.la \
                libvirt-net-rpc-server.la \
                libvirt-net-rpc.la
1134
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
1135

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

1138 1139
endif WITH_REMOTE

1140
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
1141
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
1142
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1143

1144
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
1145
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
1146
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1147

1148
if WITH_XEN
E
Eric Blake 已提交
1149 1150 1151
noinst_LTLIBRARIES += libvirt_driver_xen_impl.la
libvirt_driver_xen_la_SOURCES =
libvirt_driver_xen_la_LIBADD = libvirt_driver_xen_impl.la
1152 1153
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_xen.la
E
Eric Blake 已提交
1154
libvirt_driver_xen_la_LIBADD += ../gnulib/lib/libgnu.la
1155
libvirt_driver_xen_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1156
else ! WITH_DRIVER_MODULES
1157
noinst_LTLIBRARIES += libvirt_driver_xen.la
1158 1159
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_xen.la
1160
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1161

1162
libvirt_driver_xen_impl_la_CFLAGS =				\
1163
		$(XEN_CFLAGS)					\
1164 1165 1166
		-I$(srcdir)/access				\
		-I$(srcdir)/conf				\
		-I$(srcdir)/xenconfig				\
1167
		$(AM_CFLAGS)
E
Eric Blake 已提交
1168 1169 1170
libvirt_driver_xen_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_xen_impl_la_LIBADD = $(XEN_LIBS)
libvirt_driver_xen_impl_la_SOURCES = $(XEN_DRIVER_SOURCES)
1171
endif WITH_XEN
1172

1173 1174
if WITH_PHYP
noinst_LTLIBRARIES += libvirt_driver_phyp.la
1175
libvirt_la_BUILT_LIBADD += libvirt_driver_phyp.la
1176 1177
libvirt_driver_phyp_la_LIBADD = $(SSH2_LIBS)
libvirt_driver_phyp_la_CFLAGS = $(SSH2_CFLAGS) \
1178
		-I$(srcdir)/conf $(AM_CFLAGS)
1179
libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES)
1180
endif WITH_PHYP
1181

1182
if WITH_OPENVZ
1183
noinst_LTLIBRARIES += libvirt_driver_openvz.la
1184
libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la
1185
libvirt_driver_openvz_la_CFLAGS = \
1186
		-I$(srcdir)/conf $(AM_CFLAGS)
1187
libvirt_driver_openvz_la_SOURCES = $(OPENVZ_DRIVER_SOURCES)
1188
endif WITH_OPENVZ
1189

1190 1191 1192 1193
if WITH_VMWARE
noinst_LTLIBRARIES += libvirt_driver_vmware.la
libvirt_la_BUILT_LIBADD += libvirt_driver_vmware.la
libvirt_driver_vmware_la_CFLAGS = \
1194
		-I$(srcdir)/conf -I$(srcdir)/vmx $(AM_CFLAGS)
1195
libvirt_driver_vmware_la_SOURCES = $(VMWARE_DRIVER_SOURCES)
1196
endif WITH_VMWARE
1197

1198
if WITH_VBOX
M
Michal Privoznik 已提交
1199
noinst_LTLIBRARIES += \
1200
		libvirt_driver_vbox_impl.la
1201 1202 1203
libvirt_driver_vbox_la_SOURCES =
libvirt_driver_vbox_la_LIBADD = libvirt_driver_vbox_impl.la
if WITH_DRIVER_MODULES
M
Michal Privoznik 已提交
1204
mod_LTLIBRARIES += \
1205
		libvirt_driver_vbox.la
1206
libvirt_driver_vbox_la_LIBADD += ../gnulib/lib/libgnu.la
1207
libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1208
else ! WITH_DRIVER_MODULES
1209
noinst_LTLIBRARIES += libvirt_driver_vbox.la
1210 1211 1212
# GPLv2-only license requries that it be linked into
# libvirtd and *not* libvirt.so
#libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la
1213
endif ! WITH_DRIVER_MODULES
1214 1215

libvirt_driver_vbox_impl_la_CFLAGS =				\
1216 1217
		-I$(srcdir)/conf				\
		$(AM_CFLAGS)					\
M
Michal Privoznik 已提交
1218
		-DVBOX_DRIVER
1219
libvirt_driver_vbox_impl_la_LDFLAGS = $(AM_LDFLAGS)
1220 1221 1222
libvirt_driver_vbox_impl_la_LIBADD =  $(DLOPEN_LIBS)		\
		$(MSCOM_LIBS)					\
		$(LIBXML_LIBS)
1223
libvirt_driver_vbox_impl_la_SOURCES = $(VBOX_DRIVER_SOURCES)
1224
endif WITH_VBOX
1225

1226 1227
if WITH_XENAPI
noinst_LTLIBRARIES += libvirt_driver_xenapi.la
1228
libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la
1229
libvirt_driver_xenapi_la_CFLAGS = $(LIBXENSERVER_CFLAGS) $(CURL_CFLAGS) \
1230
		-I$(srcdir)/conf $(AM_CFLAGS)
1231
libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS)
1232
libvirt_driver_xenapi_la_LIBADD = $(LIBXENSERVER_LIBS) $(CURL_LIBS)
1233
libvirt_driver_xenapi_la_SOURCES = $(XENAPI_DRIVER_SOURCES)
1234
endif WITH_XENAPI
1235

J
Jim Fehlig 已提交
1236
if WITH_LIBXL
E
Eric Blake 已提交
1237 1238 1239
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 已提交
1240 1241
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_libxl.la
E
Eric Blake 已提交
1242
libvirt_driver_libxl_la_LIBADD += ../gnulib/lib/libgnu.la
1243
libvirt_driver_libxl_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1244
else ! WITH_DRIVER_MODULES
J
Jim Fehlig 已提交
1245 1246 1247
noinst_LTLIBRARIES += libvirt_driver_libxl.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_libxl.la
1248
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1249

1250 1251
libvirt_driver_libxl_impl_la_CFLAGS = 		\
		$(LIBXL_CFLAGS)			\
1252 1253 1254
		-I$(srcdir)/access	\
		-I$(srcdir)/conf	\
		-I$(srcdir)/xenconfig	\
1255
		$(AM_CFLAGS)
E
Eric Blake 已提交
1256
libvirt_driver_libxl_impl_la_LDFLAGS = $(AM_LDFLAGS)
J
Jim Fehlig 已提交
1257
libvirt_driver_libxl_impl_la_LIBADD = $(LIBXL_LIBS) libvirt_xenconfig.la
E
Eric Blake 已提交
1258
libvirt_driver_libxl_impl_la_SOURCES = $(LIBXL_DRIVER_SOURCES)
1259 1260 1261 1262 1263 1264

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

1265
endif WITH_LIBXL
1266 1267
EXTRA_DIST += libxl/libxl.conf libxl/libvirtd_libxl.aug \
		libxl/test_libvirtd_libxl.aug.in
J
Jim Fehlig 已提交
1268

1269
if WITH_QEMU
E
Eric Blake 已提交
1270 1271 1272
noinst_LTLIBRARIES += libvirt_driver_qemu_impl.la
libvirt_driver_qemu_la_SOURCES =
libvirt_driver_qemu_la_LIBADD = libvirt_driver_qemu_impl.la
1273 1274
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_qemu.la
E
Eric Blake 已提交
1275
libvirt_driver_qemu_la_LIBADD += ../gnulib/lib/libgnu.la
1276
libvirt_driver_qemu_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1277
else ! WITH_DRIVER_MODULES
1278
noinst_LTLIBRARIES += libvirt_driver_qemu.la
1279
# Stateful, so linked to daemon instead
1280
#libvirt_la_BUILT_LIBADD += libvirt_driver_qemu.la
1281
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1282

1283 1284 1285
libvirt_driver_qemu_impl_la_CFLAGS = \
		$(GNUTLS_CFLAGS) \
		$(LIBNL_CFLAGS) \
1286 1287
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1288
		$(AM_CFLAGS)
E
Eric Blake 已提交
1289
libvirt_driver_qemu_impl_la_LDFLAGS = $(AM_LDFLAGS)
1290
libvirt_driver_qemu_impl_la_LIBADD = $(CAPNG_LIBS) \
1291
                                $(GNUTLS_LIBS) \
1292 1293 1294
				$(LIBNL_LIBS) \
				$(LIBXML_LIBS) \
				$(NULL)
E
Eric Blake 已提交
1295
libvirt_driver_qemu_impl_la_SOURCES = $(QEMU_DRIVER_SOURCES)
1296

A
Amy Griffis 已提交
1297
conf_DATA += qemu/qemu.conf
1298

1299
augeas_DATA += qemu/libvirtd_qemu.aug
1300 1301
augeastest_DATA += test_libvirtd_qemu.aug
CLEANFILES += test_libvirtd_qemu.aug
1302

1303
endif WITH_QEMU
1304
EXTRA_DIST += qemu/qemu.conf qemu/libvirtd_qemu.aug \
1305
		qemu/test_libvirtd_qemu.aug.in qemu/THREADS.txt
1306

1307 1308

if WITH_LXC
E
Eric Blake 已提交
1309 1310 1311
noinst_LTLIBRARIES += libvirt_driver_lxc_impl.la
libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = libvirt_driver_lxc_impl.la
1312 1313
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_lxc.la
E
Eric Blake 已提交
1314 1315
libvirt_driver_lxc_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_lxc_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1316
else ! WITH_DRIVER_MODULES
1317
noinst_LTLIBRARIES += libvirt_driver_lxc.la
1318
# Stateful, so linked to daemon instead
1319
#libvirt_la_BUILT_LIBADD += libvirt_driver_lxc.la
1320
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1321 1322

libvirt_driver_lxc_impl_la_CFLAGS = \
S
Serge Hallyn 已提交
1323
		$(LIBNL_CFLAGS) \
G
Gao feng 已提交
1324
		$(FUSE_CFLAGS) \
P
Pavel Fedin 已提交
1325
		$(XDR_CFLAGS) \
1326 1327
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1328
		$(AM_CFLAGS)
I
ik.nitk 已提交
1329 1330 1331 1332 1333 1334
libvirt_driver_lxc_impl_la_LIBADD = \
               $(CAPNG_LIBS) \
               $(LIBNL_LIBS) \
               $(LIBXML_LIBS) \
               $(FUSE_LIBS)

1335
if WITH_BLKID
E
Eric Blake 已提交
1336 1337
libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS)
1338
endif WITH_BLKID
1339
libvirt_driver_lxc_impl_la_LIBADD += $(SECDRIVER_LIBS)
E
Eric Blake 已提交
1340
libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES)
A
Amy Griffis 已提交
1341 1342 1343

conf_DATA += lxc/lxc.conf

1344
augeas_DATA += lxc/libvirtd_lxc.aug
1345 1346
augeastest_DATA += test_libvirtd_lxc.aug
CLEANFILES += test_libvirtd_lxc.aug
1347

1348
endif WITH_LXC
1349
EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in
1350

1351
if WITH_UML
E
Eric Blake 已提交
1352 1353 1354
noinst_LTLIBRARIES += libvirt_driver_uml_impl.la
libvirt_driver_uml_la_SOURCES =
libvirt_driver_uml_la_LIBADD = libvirt_driver_uml_impl.la
1355 1356
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_uml.la
E
Eric Blake 已提交
1357
libvirt_driver_uml_la_LIBADD += ../gnulib/lib/libgnu.la
1358
libvirt_driver_uml_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1359
else ! WITH_DRIVER_MODULES
1360 1361
noinst_LTLIBRARIES += libvirt_driver_uml.la
# Stateful, so linked to daemon instead
1362
#libvirt_la_BUILT_LIBADD += libvirt_driver_uml.la
1363
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1364

1365
libvirt_driver_uml_impl_la_CFLAGS = \
1366 1367
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1368
		$(AM_CFLAGS)
E
Eric Blake 已提交
1369
libvirt_driver_uml_impl_la_LDFLAGS = $(AM_LDFLAGS)
1370
# libvirt_driver_uml_impl_la_LIBADD =
E
Eric Blake 已提交
1371
libvirt_driver_uml_impl_la_SOURCES = $(UML_DRIVER_SOURCES)
1372
endif WITH_UML
1373

D
Daniel Veillard 已提交
1374

1375
BUILT_SOURCES += $(ESX_DRIVER_GENERATED)
D
Daniel Veillard 已提交
1376

1377 1378
ESX_GENERATED_STAMP = .esx_vi_generator.stamp

E
Eric Blake 已提交
1379 1380
EXTRA_DIST += $(ESX_GENERATED_STAMP)

1381 1382 1383
$(ESX_DRIVER_GENERATED): $(ESX_GENERATED_STAMP)

$(ESX_GENERATED_STAMP): $(srcdir)/esx/esx_vi_generator.input \
1384
                         $(srcdir)/esx/esx_vi_generator.py
1385 1386 1387 1388 1389
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/esx/esx_vi_generator.py \
	  && touch $@

MAINTAINERCLEANFILES += $(ESX_DRIVER_GENERATED) $(ESX_GENERATED_STAMP)

D
Daniel Veillard 已提交
1390

1391 1392
if WITH_ESX
noinst_LTLIBRARIES += libvirt_driver_esx.la
1393
libvirt_la_BUILT_LIBADD += libvirt_driver_esx.la
1394
libvirt_driver_esx_la_CFLAGS = $(CURL_CFLAGS) \
1395
		-I$(srcdir)/conf -I$(srcdir)/vmx $(AM_CFLAGS)
1396
libvirt_driver_esx_la_LDFLAGS = $(AM_LDFLAGS)
1397
libvirt_driver_esx_la_LIBADD = $(CURL_LIBS)
1398
libvirt_driver_esx_la_SOURCES = $(ESX_DRIVER_SOURCES)
1399
libvirt_driver_esx_la_DEPENDENCIES = $(ESX_DRIVER_GENERATED)
1400
endif WITH_ESX
1401

M
Matthias Bolte 已提交
1402

1403 1404
BUILT_SOURCES += $(HYPERV_DRIVER_GENERATED)

1405 1406
HYPERV_GENERATED_STAMP = .hyperv_wmi_generator.stamp

E
Eric Blake 已提交
1407 1408
EXTRA_DIST += $(HYPERV_GENERATED_STAMP)

1409 1410 1411
$(HYPERV_DRIVER_GENERATED): $(HYPERV_GENERATED_STAMP)

$(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \
1412
                            $(srcdir)/hyperv/hyperv_wmi_generator.py
1413 1414
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) \
	  $(srcdir)/hyperv/hyperv_wmi_generator.py \
1415 1416 1417
	  && touch $@

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

M
Matthias Bolte 已提交
1419 1420 1421 1422
if WITH_HYPERV
noinst_LTLIBRARIES += libvirt_driver_hyperv.la
libvirt_la_BUILT_LIBADD += libvirt_driver_hyperv.la
libvirt_driver_hyperv_la_CFLAGS = $(OPENWSMAN_CFLAGS) \
1423
		-I$(srcdir)/conf $(AM_CFLAGS)
M
Matthias Bolte 已提交
1424 1425 1426
libvirt_driver_hyperv_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_hyperv_la_LIBADD = $(OPENWSMAN_LIBS)
libvirt_driver_hyperv_la_SOURCES = $(HYPERV_DRIVER_SOURCES)
1427
endif WITH_HYPERV
M
Matthias Bolte 已提交
1428

1429
if WITH_VZ
1430 1431 1432
noinst_LTLIBRARIES += libvirt_driver_vz.la
libvirt_la_BUILT_LIBADD += libvirt_driver_vz.la
libvirt_driver_vz_la_CFLAGS = \
1433
		-I$(srcdir)/conf $(AM_CFLAGS) \
1434
		$(PARALLELS_SDK_CFLAGS) $(LIBNL_CFLAGS)
1435 1436
libvirt_driver_vz_la_LIBADD = $(PARALLELS_SDK_LIBS) $(LIBNL_LIBS)
libvirt_driver_vz_la_SOURCES = $(VZ_DRIVER_SOURCES)
1437
endif WITH_VZ
D
Dmitry Guryanov 已提交
1438

R
Roman Bogorodskiy 已提交
1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451
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 = \
1452 1453
	-I$(srcdir)/access \
	-I$(srcdir)/conf \
R
Roman Bogorodskiy 已提交
1454 1455 1456 1457 1458
	$(AM_CFLAGS)
libvirt_driver_bhyve_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_bhyve_impl_la_SOURCES = $(BHYVE_DRIVER_SOURCES)
endif WITH_BHYVE

1459
if WITH_NETWORK
E
Eric Blake 已提交
1460 1461 1462
noinst_LTLIBRARIES += libvirt_driver_network_impl.la
libvirt_driver_network_la_SOURCES =
libvirt_driver_network_la_LIBADD = libvirt_driver_network_impl.la
1463 1464
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_network.la
1465 1466 1467 1468
libvirt_driver_network_la_LIBADD += ../gnulib/lib/libgnu.la \
	$(LIBNL_LIBS) \
	$(DBUS_LIBS) \
	$(NULL)
E
Eric Blake 已提交
1469
libvirt_driver_network_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1470
else ! WITH_DRIVER_MODULES
1471
noinst_LTLIBRARIES += libvirt_driver_network.la
1472
# Stateful, so linked to daemon instead
1473
#libvirt_la_BUILT_LIBADD += libvirt_driver_network.la
1474
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1475 1476

libvirt_driver_network_impl_la_CFLAGS = \
1477 1478
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1479 1480
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1481
		$(AM_CFLAGS)
E
Eric Blake 已提交
1482
libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
1483
libvirt_driver_network_impl_la_LIBADD  = $(DBUS_LIBS)
1484
endif WITH_NETWORK
1485 1486 1487
EXTRA_DIST += network/default.xml


1488
if WITH_INTERFACE
1489 1490
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_interface.la
1491
else ! WITH_DRIVER_MODULES
1492
noinst_LTLIBRARIES += libvirt_driver_interface.la
1493 1494
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_interface.la
1495
endif ! WITH_DRIVER_MODULES
1496
libvirt_driver_interface_la_CFLAGS = \
1497 1498
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1499
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1500
libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS)
1501 1502 1503 1504
libvirt_driver_interface_la_LIBADD =
if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
1505
endif WITH_NETCF
1506
if WITH_UDEV
1507 1508
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
1509
endif WITH_UDEV
1510
if WITH_DRIVER_MODULES
1511
libvirt_driver_interface_la_LIBADD += ../gnulib/lib/libgnu.la
1512
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
1513
endif WITH_DRIVER_MODULES
1514
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
1515
endif WITH_INTERFACE
D
Daniel Veillard 已提交
1516

D
Daniel P. Berrange 已提交
1517
if WITH_SECRETS
1518 1519
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_secret.la
1520
else ! WITH_DRIVER_MODULES
1521
noinst_LTLIBRARIES += libvirt_driver_secret.la
1522
# Stateful, so linked to daemon instead
1523
#libvirt_la_BUILT_LIBADD += libvirt_driver_secret.la
1524
endif ! WITH_DRIVER_MODULES
1525
libvirt_driver_secret_la_CFLAGS = \
1526 1527
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1528
		$(AM_CFLAGS)
1529
if WITH_DRIVER_MODULES
1530
libvirt_driver_secret_la_LIBADD = ../gnulib/lib/libgnu.la
1531
libvirt_driver_secret_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1532
endif WITH_DRIVER_MODULES
1533
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
1534
endif WITH_SECRETS
1535

1536
# Needed to keep automake quiet about conditionals
1537 1538
libvirt_driver_storage_impl_la_SOURCES =
libvirt_driver_storage_impl_la_CFLAGS = \
1539 1540
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1541
		$(AM_CFLAGS)
1542 1543
libvirt_driver_storage_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_storage_impl_la_LIBADD =
1544
libvirt_driver_storage_impl_la_LIBADD += $(SECDRIVER_LIBS) $(LIBXML_LIBS)
1545
if WITH_BLKID
1546 1547
libvirt_driver_storage_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(BLKID_LIBS)
1548
endif WITH_BLKID
1549
if WITH_STORAGE
1550 1551 1552
noinst_LTLIBRARIES += libvirt_driver_storage_impl.la
libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_LIBADD = libvirt_driver_storage_impl.la
1553 1554
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_storage.la
1555
libvirt_driver_storage_la_LIBADD += ../gnulib/lib/libgnu.la
1556
libvirt_driver_storage_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1557
else ! WITH_DRIVER_MODULES
1558
noinst_LTLIBRARIES += libvirt_driver_storage.la
1559
# Stateful, so linked to daemon instead
1560
#libvirt_la_BUILT_LIBADD += libvirt_driver_storage.la
1561
endif ! WITH_DRIVER_MODULES
1562 1563
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_FS_SOURCES)
1564
endif WITH_STORAGE
1565

1566
if WITH_STORAGE_LVM
1567
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_LVM_SOURCES)
1568
endif WITH_STORAGE_LVM
1569

1570
if WITH_STORAGE_ISCSI
1571
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_ISCSI_SOURCES)
1572
endif WITH_STORAGE_ISCSI
1573

1574
if WITH_STORAGE_SCSI
1575
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SCSI_SOURCES)
1576
endif WITH_STORAGE_SCSI
1577

D
Dave Allan 已提交
1578
if WITH_STORAGE_MPATH
1579 1580 1581
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)
1582
endif WITH_STORAGE_MPATH
D
Dave Allan 已提交
1583

1584
if WITH_STORAGE_DISK
1585
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_DISK_SOURCES)
1586
endif WITH_STORAGE_DISK
1587

1588
if WITH_STORAGE_RBD
1589 1590
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_RBD_SOURCES)
libvirt_driver_storage_impl_la_LIBADD += $(LIBRBD_LIBS)
1591
endif WITH_STORAGE_RBD
1592

1593
if WITH_STORAGE_SHEEPDOG
1594
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SHEEPDOG_SOURCES)
1595
endif WITH_STORAGE_SHEEPDOG
1596

1597 1598 1599 1600 1601 1602
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 已提交
1603 1604 1605 1606
if WITH_STORAGE_ZFS
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_ZFS_SOURCES)
endif WITH_STORAGE_ZFS

1607 1608 1609 1610
if WITH_NODE_DEVICES
# Needed to keep automake quiet about conditionals
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nodedev.la
1611
else ! WITH_DRIVER_MODULES
1612 1613
noinst_LTLIBRARIES += libvirt_driver_nodedev.la
# Stateful, so linked to daemon instead
1614
#libvirt_la_BUILT_LIBADD += libvirt_driver_nodedev.la
1615
endif ! WITH_DRIVER_MODULES
1616 1617
libvirt_driver_nodedev_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES)

1618
libvirt_driver_nodedev_la_CFLAGS = \
1619 1620
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1621
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1622
libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS)
1623
libvirt_driver_nodedev_la_LIBADD =
1624

D
Doug Goldstein 已提交
1625
if WITH_LIBVIRTD
1626
if WITH_HAL
1627 1628
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS)
1629
libvirt_driver_nodedev_la_LIBADD += $(HAL_LIBS)
1630
endif WITH_HAL
1631
if WITH_UDEV
1632
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES)
1633
libvirt_driver_nodedev_la_CFLAGS += $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS)
1634
libvirt_driver_nodedev_la_LIBADD += $(UDEV_LIBS) $(PCIACCESS_LIBS)
1635 1636
endif WITH_UDEV
endif WITH_LIBVIRTD
1637 1638

if WITH_DRIVER_MODULES
1639
libvirt_driver_nodedev_la_LIBADD += ../gnulib/lib/libgnu.la
1640
libvirt_driver_nodedev_la_LDFLAGS += -module -avoid-version
1641 1642
endif WITH_DRIVER_MODULES
endif WITH_NODE_DEVICES
1643 1644


1645
if WITH_NWFILTER
1646 1647 1648
noinst_LTLIBRARIES += libvirt_driver_nwfilter_impl.la
libvirt_driver_nwfilter_la_SOURCES =
libvirt_driver_nwfilter_la_LIBADD = libvirt_driver_nwfilter_impl.la
1649 1650
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nwfilter.la
1651
libvirt_driver_nwfilter_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1652
else ! WITH_DRIVER_MODULES
1653
noinst_LTLIBRARIES += libvirt_driver_nwfilter.la
1654 1655
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_nwfilter.la
1656
endif ! WITH_DRIVER_MODULES
1657
libvirt_driver_nwfilter_impl_la_CFLAGS = \
1658 1659 1660
		$(LIBPCAP_CFLAGS) \
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1661 1662
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1663
		$(AM_CFLAGS)
1664 1665 1666 1667 1668
libvirt_driver_nwfilter_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_nwfilter_impl_la_LIBADD = \
		$(LIBPCAP_LIBS) \
		$(LIBNL_LIBS) \
		$(DBUS_LIBS)
1669
if WITH_DRIVER_MODULES
1670 1671
libvirt_driver_nwfilter_impl_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_nwfilter_impl_la_LDFLAGS += -module -avoid-version
1672
endif WITH_DRIVER_MODULES
1673
libvirt_driver_nwfilter_impl_la_SOURCES = $(NWFILTER_DRIVER_SOURCES)
1674
endif WITH_NWFILTER
1675 1676


1677 1678 1679 1680
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 = \
1681
		-I$(srcdir)/conf $(AM_CFLAGS)
1682
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
1683
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
1684
if WITH_SECDRIVER_SELINUX
1685 1686
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
1687
endif WITH_SECDRIVER_SELINUX
J
Jamie Strandboge 已提交
1688
if WITH_SECDRIVER_APPARMOR
1689 1690
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
1691
endif WITH_SECDRIVER_APPARMOR
1692

1693 1694
libvirt_driver_access_la_SOURCES = \
	$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
1695 1696 1697
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
1698
		-I$(srcdir)/conf $(AM_CFLAGS)
1699 1700 1701
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD =

1702 1703
EXTRA_DIST += access/genpolkit.pl

1704 1705 1706 1707
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
    $(srcdir)/access/genpolkit.pl Makefile.am
	$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@

1708 1709 1710 1711
if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)

polkitactiondir = $(datadir)/polkit-1/actions
1712
if WITH_LIBVIRTD
1713
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
1714
endif WITH_LIBVIRTD
1715 1716 1717

CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
1718
else ! WITH_POLKIT1
1719
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
1720
endif ! WITH_POLKIT1
1721

1722

1723 1724
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738

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

1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751
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 已提交
1752
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
1753 1754
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1755 1756 1757
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
1758 1759
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1760 1761
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
	  > $(srcdir)/access/viraccessapicheck.c
1762

E
Eric Blake 已提交
1763
access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
1764 1765
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1766 1767 1768
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheckqemu.h
access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
1769 1770
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1771 1772
	  qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h \
	  > $(srcdir)/access/viraccessapicheckqemu.c
1773

E
Eric Blake 已提交
1774
access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
1775 1776
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1777 1778 1779
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/access/viraccessapichecklxc.h
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
1780 1781
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1782 1783
	  lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \
	  > $(srcdir)/access/viraccessapichecklxc.c
1784

1785 1786 1787 1788 1789 1790 1791
# Add all conditional sources just in case...
EXTRA_DIST +=							\
		$(TEST_DRIVER_SOURCES)				\
		$(REMOTE_DRIVER_SOURCES)			\
		$(XEN_DRIVER_SOURCES)				\
		$(QEMU_DRIVER_SOURCES)				\
		$(LXC_DRIVER_SOURCES)				\
1792
		$(UML_DRIVER_SOURCES)				\
1793
		$(OPENVZ_DRIVER_SOURCES)			\
1794
		$(PHYP_DRIVER_SOURCES)				\
1795
		$(VBOX_DRIVER_SOURCES)				\
1796
		$(XENAPI_DRIVER_SOURCES)			\
O
Osier Yang 已提交
1797
		$(LIBXL_DRIVER_SOURCES)				\
1798
		$(ESX_DRIVER_SOURCES)				\
1799
		$(ESX_DRIVER_EXTRA_DIST)			\
M
Matthias Bolte 已提交
1800
		$(HYPERV_DRIVER_SOURCES)			\
1801
		$(HYPERV_DRIVER_EXTRA_DIST)			\
1802
		$(VZ_DRIVER_SOURCES)				\
R
Roman Bogorodskiy 已提交
1803
		$(BHYVE_DRIVER_SOURCES)				\
1804
		$(NETWORK_DRIVER_SOURCES)			\
1805
		$(INTERFACE_DRIVER_SOURCES)			\
1806 1807 1808 1809
		$(STORAGE_DRIVER_SOURCES)			\
		$(STORAGE_DRIVER_FS_SOURCES)			\
		$(STORAGE_DRIVER_LVM_SOURCES)			\
		$(STORAGE_DRIVER_ISCSI_SOURCES)			\
1810
		$(STORAGE_DRIVER_SCSI_SOURCES)			\
D
Dave Allan 已提交
1811
		$(STORAGE_DRIVER_MPATH_SOURCES)			\
1812
		$(STORAGE_DRIVER_DISK_SOURCES)			\
1813
		$(STORAGE_DRIVER_RBD_SOURCES)			\
1814
		$(STORAGE_DRIVER_SHEEPDOG_SOURCES)		\
1815
		$(STORAGE_DRIVER_GLUSTER_SOURCES)		\
R
Roman Bogorodskiy 已提交
1816
		$(STORAGE_DRIVER_ZFS_SOURCES)			\
1817 1818
		$(NODE_DEVICE_DRIVER_SOURCES)			\
		$(NODE_DEVICE_DRIVER_HAL_SOURCES)		\
1819
		$(NODE_DEVICE_DRIVER_UDEV_SOURCES)		\
1820
		$(NWFILTER_DRIVER_SOURCES)			\
1821
		$(SECURITY_DRIVER_SELINUX_SOURCES)		\
J
Jamie Strandboge 已提交
1822
		$(SECURITY_DRIVER_APPARMOR_SOURCES)		\
D
Daniel P. Berrange 已提交
1823
		$(SECRET_DRIVER_SOURCES)			\
1824
		$(VBOX_DRIVER_EXTRA_DIST)			\
1825
		$(VMWARE_DRIVER_SOURCES)			\
J
Jim Fehlig 已提交
1826
		$(XENCONFIG_SOURCES)				\
1827
		$(ACCESS_DRIVER_POLKIT_POLICY)
1828

1829 1830
check-local: check-augeas

1831 1832 1833 1834 1835
.PHONY: check-augeas \
	check-augeas-qemu \
	check-augeas-lxc \
	check-augeas-sanlock \
	check-augeas-lockd \
1836
	check-augeas-libxl \
1837
	$(NULL)
1838

1839
check-augeas: check-augeas-qemu check-augeas-lxc check-augeas-sanlock \
1840
	check-augeas-lockd check-augeas-virtlockd check-augeas-libxl
1841

1842
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
1843
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
1844

1845
if WITH_QEMU
1846 1847
test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
		$(srcdir)/qemu/qemu.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1848
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
1849

1850
check-augeas-qemu: test_libvirtd_qemu.aug
1851
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1852
	    '$(AUGPARSE)' -I $(srcdir)/qemu test_libvirtd_qemu.aug; \
1853
	fi
1854
else ! WITH_QEMU
1855
check-augeas-qemu:
1856
endif ! WITH_QEMU
1857

1858
if WITH_LXC
1859 1860
test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
		$(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1861
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
1862

1863
check-augeas-lxc: test_libvirtd_lxc.aug
1864
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1865
	    '$(AUGPARSE)' -I $(srcdir)/lxc test_libvirtd_lxc.aug; \
1866
	fi
1867
else ! WITH_LXC
1868
check-augeas-lxc:
1869
endif ! WITH_LXC
1870

1871
if WITH_SANLOCK
1872 1873
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1874
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
1875

1876
check-augeas-sanlock: test_libvirt_sanlock.aug
1877
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1878
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
1879
	fi
1880
else ! WITH_SANLOCK
1881
check-augeas-sanlock:
1882
endif ! WITH_SANLOCK
1883

1884
if WITH_QEMU
1885 1886 1887
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 $< $@
1888 1889 1890
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
1891

1892 1893
test_virtlockd.aug: locking/test_virtlockd.aug.in \
		locking/virtlockd.conf $(AUG_GENTEST)
1894
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
1895

1896
if WITH_QEMU
1897 1898 1899 1900
check-augeas-lockd: test_libvirt_lockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_lockd.aug; \
	fi
1901 1902 1903
else ! WITH_QEMU
check-augeas-lockd:
endif ! WITH_QEMU
1904

1905 1906 1907 1908 1909
check-augeas-virtlockd: test_virtlockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
	fi

1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922
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

1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941
#
# 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.
#

1942
if WITH_DRIVER_MODULES
1943
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
1944
else ! WITH_DRIVER_MODULES
1945
SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
1946
endif ! WITH_DRIVER_MODULES
1947

1948
if WITH_LINUX
1949
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
1950
else ! WITH_LINUX
1951
SYM_FILES += $(srcdir)/libvirt_linux.syms
1952
endif ! WITH_LINUX
1953

1954
if WITH_ESX
1955
USED_SYM_FILES += $(srcdir)/libvirt_esx.syms
1956
else ! WITH_ESX
1957
SYM_FILES += $(srcdir)/libvirt_esx.syms
1958
endif ! WITH_ESX
1959

E
Eric Blake 已提交
1960 1961 1962 1963 1964 1965
if WITH_REMOTE
USED_SYM_FILES += $(srcdir)/libvirt_remote.syms
else ! WITH_REMOTE
SYM_FILES += $(srcdir)/libvirt_remote.syms
endif ! WITH_REMOTE

1966
if WITH_OPENVZ
1967
USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms
1968
else ! WITH_OPENVZ
1969
SYM_FILES += $(srcdir)/libvirt_openvz.syms
1970
endif ! WITH_OPENVZ
1971

1972
if WITH_VMX
1973
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
1974
else ! WITH_VMX
1975
SYM_FILES += $(srcdir)/libvirt_vmx.syms
1976
endif ! WITH_VMX
1977

1978 1979 1980 1981 1982 1983
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 已提交
1984 1985 1986 1987 1988
if WITH_XENCONFIG
USED_SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
else ! WITH_XENCONFIG
SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
endif ! WITH_XENCONFIG
1989

1990 1991 1992 1993 1994 1995
if WITH_LIBXL
USED_SYM_FILES += $(srcdir)/libvirt_xenxlconfig.syms
else ! WITH_LIBXL
SYM_FILES += $(srcdir)/libvirt_xenxlconfig.syms
endif ! WITH_LIBXL

1996
if WITH_SASL
1997
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
1998
else ! WITH_SASL
1999
SYM_FILES += $(srcdir)/libvirt_sasl.syms
2000
endif ! WITH_SASL
E
Eric Blake 已提交
2001

2002 2003
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2004
else ! WITH_GNUTLS
2005
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
2006
endif ! WITH_GNUTLS
2007

2008
if WITH_SSH2
2009
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2010
else ! WITH_SSH2
2011
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
2012
endif ! WITH_SSH2
2013

2014
if WITH_ATOMIC_OPS_PTHREAD
2015
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
2016
else ! WITH_ATOMIC_OPS_PTHREAD
2017
SYM_FILES += $(srcdir)/libvirt_atomic.syms
2018
endif ! WITH_ATOMIC_OPS_PTHREAD
2019

2020
EXTRA_DIST += \
2021 2022 2023
	libvirt_public.syms		\
	libvirt_lxc.syms		\
	libvirt_qemu.syms		\
2024
	libvirt_admin_public.syms	\
2025
	$(SYM_FILES)			\
2026
	$(ADMIN_SYM_FILES)		\
2027
	$(NULL)
2028

2029
BUILT_SOURCES += $(GENERATED_SYM_FILES)
2030

2031 2032
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(ACCESS_DRIVER_SYM_FILES) \
2033
		$(top_builddir)/config.status
2034 2035 2036 2037 2038 2039
	$(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 && \
2040
	cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
2041 2042
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
2043
	mv $@-tmp libvirt.syms
2044

2045
%.def: %.syms
2046 2047
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
2048 2049
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d'	\
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
2050
	chmod a-w $@-tmp && \
2051
	mv $@-tmp $@
2052

2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065
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

M
Martin Kletzander 已提交
2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104
lib_LTLIBRARIES += libvirt-admin.la
libvirt_admin_la_SOURCES = \
		libvirt-admin.c			\
		$(ADMIN_PROTOCOL_GENERATED)	\
		$(DATATYPES_SOURCES)

libvirt_admin_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_ADMIN_SYMBOL_FILE)	\
		-version-info $(LIBVIRT_VERSION_INFO)			\
		$(AM_LDFLAGS) 						\
		$(CYGWIN_EXTRA_LDFLAGS) 				\
		$(MINGW_EXTRA_LDFLAGS)

libvirt_admin_la_LIBADD = \
		libvirt.la		\
		$(CYGWIN_EXTRA_LIBADD)

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

libvirt_admin_la_CFLAGS += \
		$(CAPNG_CFLAGS)			\
		$(YAJL_CFLAGS)			\
		$(SSH2_CFLAGS)			\
		$(SASL_CFLAGS)			\
		$(GNUTLS_CFLAGS)

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

2105 2106
ADMIN_SYM_FILES = $(srcdir)/libvirt_admin_private.syms

M
Martin Kletzander 已提交
2107 2108 2109 2110
if WITH_DTRACE_PROBES
libvirt_admin_la_LIBADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES

2111 2112
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
2113 2114 2115 2116 2117 2118 2119 2120
libvirt_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(LIBVIRT_NODELETE) \
		$(AM_LDFLAGS) \
		$(CYGWIN_EXTRA_LDFLAGS) \
		$(MINGW_EXTRA_LDFLAGS) \
		$(NULL)
2121
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
2122
libvirt_la_LIBADD += \
2123
		    $(DRIVER_MODULE_LIBS) \
2124
		    $(CYGWIN_EXTRA_LIBADD)
2125
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
2126 2127 2128 2129 2130 2131
# 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)
2132

2133
if WITH_DTRACE_PROBES
2134
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
2135
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
2136
nodist_libvirt_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2137
if WITH_REMOTE
E
Eric Blake 已提交
2138
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2139
endif WITH_REMOTE
2140 2141
if WITH_DRIVER_MODULES
DTRACE2SYSTEMTAP_FLAGS = --with-modules
2142
endif WITH_DRIVER_MODULES
2143

2144 2145 2146
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

if WITH_QEMU
2147
libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.lo
2148
nodist_libvirt_driver_qemu_la_SOURCES = libvirt_qemu_probes.h
2149
BUILT_SOURCES += libvirt_qemu_probes.h
2150
endif WITH_QEMU
2151 2152

tapsetdir = $(datadir)/systemtap/tapset
2153
tapset_DATA = libvirt_probes.stp libvirt_qemu_probes.stp libvirt_functions.stp
2154

2155
%_probes.h: %_probes.d
2156 2157
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

E
Eric Blake 已提交
2158
.PRECIOUS: %_probes.o
2159
%_probes.o: %_probes.d
2160 2161
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

2162 2163 2164 2165 2166 2167 2168 2169 2170
%_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 已提交
2171
# Keep this list synced with PROTOCOL_STRUCTS
J
Jiri Denemark 已提交
2172 2173 2174
RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
2175
		  $(srcdir)/remote/lxc_protocol.x \
2176 2177
		  $(srcdir)/remote/qemu_protocol.x \
		  $(srcdir)/lxc/lxc_monitor_protocol.x \
M
Martin Kletzander 已提交
2178 2179
		  $(srcdir)/locking/lock_protocol.x \
		  $(srcdir)/admin/admin_protocol.x
2180 2181

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

2184 2185
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl \
		$(top_builddir)/config.status
2186
	$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
2187
	  $(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
2188

2189
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
2190
              libvirt_qemu_probes.h libvirt_qemu_probes.o \
2191
              libvirt_qemu_probes.lo\
2192 2193
              libvirt_functions.stp libvirt_probes.stp \
              libvirt_qemu_probes.stp
2194
endif WITH_DTRACE_PROBES
2195

2196
EXTRA_DIST += libvirt_probes.d libvirt_qemu_probes.d
2197

C
Chris Lalancette 已提交
2198
libvirt_qemu_la_SOURCES = libvirt-qemu.c
D
Daniel P. Berrange 已提交
2199 2200 2201 2202 2203 2204 2205
libvirt_qemu_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(CYGWIN_EXTRA_LDFLAGS) \
		$(MINGW_EXTRA_LDFLAGS) \
		$(NULL)
2206
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
C
Chris Lalancette 已提交
2207
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
2208

2209
libvirt_lxc_la_SOURCES = libvirt-lxc.c
D
Daniel P. Berrange 已提交
2210 2211 2212 2213 2214 2215 2216
libvirt_lxc_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(CYGWIN_EXTRA_LDFLAGS) \
		$(MINGW_EXTRA_LDFLAGS) \
		$(NULL)
2217 2218 2219
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)

2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231
# 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
if WITH_LXC
noinst_LTLIBRARIES += libvirt-setuid-rpc-client.la

libvirt_setuid_rpc_client_la_SOURCES = 		\
		util/viralloc.c			\
2232 2233
		util/viratomic.c		\
		util/viratomic.h		\
2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253
		util/virbitmap.c		\
		util/virbuffer.c		\
		util/vircommand.c		\
		util/virconf.c			\
		util/virerror.c			\
		util/virevent.c			\
		util/vireventpoll.c		\
		util/virfile.c			\
		util/virhash.c			\
		util/virhashcode.c		\
		util/virjson.c			\
		util/virlog.c			\
		util/virobject.c		\
		util/virpidfile.c		\
		util/virprocess.c		\
		util/virrandom.c		\
		util/virsocketaddr.c		\
		util/virstring.c		\
		util/virtime.c			\
		util/virthread.c		\
2254
		util/virthreadjob.c		\
2255 2256 2257 2258 2259
		util/virtypedparam.c		\
		util/viruri.c			\
		util/virutil.c			\
		util/viruuid.c			\
		conf/domain_event.c		\
2260
		conf/network_event.c		\
2261
		conf/object_event.c		\
2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277
		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			\
2278
		libvirt-domain.c		\
2279
		libvirt-domain-snapshot.c	\
2280
		libvirt-host.c			\
2281
		libvirt-interface.c		\
2282
		libvirt-network.c		\
2283
		libvirt-nodedev.c		\
2284
		libvirt-nwfilter.c		\
2285
		libvirt-secret.c		\
2286
		libvirt-storage.c		\
2287
		libvirt-stream.c		\
2288 2289 2290 2291 2292 2293
		libvirt-lxc.c			\
		$(NULL)

libvirt_setuid_rpc_client_la_LDFLAGS =		\
		$(AM_LDFLAGS)			\
		$(LIBXML_LIBS)			\
J
Jim Fehlig 已提交
2294
		$(SECDRIVER_LIBS)		\
2295 2296 2297
		$(NULL)
libvirt_setuid_rpc_client_la_CFLAGS =		\
		-DLIBVIRT_SETUID_RPC_CLIENT	\
2298 2299
		-I$(srcdir)/conf		\
		-I$(srcdir)/rpc			\
2300
		$(AM_CFLAGS)			\
J
Jim Fehlig 已提交
2301
		$(SECDRIVER_CFLAGS)		\
P
Pavel Fedin 已提交
2302
		$(XDR_CFLAGS)			\
2303 2304 2305
		$(NULL)
endif WITH_LXC

2306 2307 2308
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

2309
if WITH_LIBVIRTD
2310 2311 2312 2313 2314
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
		$(LOCK_DRIVER_LOCKD_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
		$(NULL)
2315
lockd_la_CFLAGS = -I$(srcdir)/conf \
E
Eric Blake 已提交
2316 2317
		$(XDR_CFLAGS) \
		$(AM_CFLAGS)
2318
lockd_la_LDFLAGS = -module -avoid-version
2319 2320 2321 2322
lockd_la_LIBADD = ../gnulib/lib/libgnu.la \
	libvirt-net-rpc.la \
	libvirt-net-rpc-client.la \
	$(NULL)
J
Jiri Denemark 已提交
2323
augeas_DATA += locking/libvirt_lockd.aug
2324 2325
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
2326
endif WITH_DTRACE_PROBES
2327
if WITH_QEMU
2328 2329
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
2330
nodist_conf_DATA += locking/qemu-lockd.conf
2331 2332
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
2333
endif WITH_QEMU
2334

2335 2336 2337 2338 2339 2340
if WITH_LIBXL
nodist_conf_DATA += locking/libxl-lockd.conf
BUILT_SOURCES += locking/libxl-lockd.conf
DISTCLEANFILES += locking/libxl-lockd.conf
endif WITH_LIBXL

2341 2342 2343 2344 2345
locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
	$(AM_V_GEN)$(MKDIR_P) locking ; \
	cp $< $@


2346 2347
sbin_PROGRAMS = virtlockd

2348 2349 2350
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
2351
		$(LOCK_DAEMON_GENERATED) \
2352
		$(NULL)
2353 2354
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
2355
		$(PIE_CFLAGS) \
2356
		$(XDR_CFLAGS) \
2357 2358 2359
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
2360
		$(PIE_LDFLAGS) \
2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372
		$(CYGWIN_EXTRA_LDFLAGS) \
		$(MINGW_EXTRA_LDFLAGS) \
		$(NULL)
virtlockd_LDADD = \
		libvirt-net-rpc-server.la \
		libvirt-net-rpc.la \
		libvirt_util.la \
		../gnulib/lib/libgnu.la \
		$(CYGWIN_EXTRA_LIBADD) \
		$(NULL)
if WITH_DTRACE_PROBES
virtlockd_LDADD += libvirt_probes.lo
2373
endif WITH_DTRACE_PROBES
2374

2375
else ! WITH_LIBVIRTD
2376 2377
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
              $(LOCK_DRIVER_LOCKD_SOURCES)
2378
endif ! WITH_LIBVIRTD
2379

J
Jiri Denemark 已提交
2380 2381 2382 2383
EXTRA_DIST += locking/virtlockd.sysconf \
	locking/lockd.conf \
	locking/libvirt_lockd.aug \
	locking/test_libvirt_lockd.aug.in
2384 2385

install-sysconfig:
E
Eric Blake 已提交
2386
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
2387 2388 2389 2390 2391
	$(INSTALL_DATA) $(srcdir)/locking/virtlockd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd

uninstall-sysconfig:
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
E
Eric Blake 已提交
2392
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
2393 2394 2395 2396 2397 2398

EXTRA_DIST += locking/virtlockd.init.in

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_RED_HAT
install-init:: virtlockd.init install-sysconfig
E
Eric Blake 已提交
2399
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
2400 2401 2402 2403
	$(INSTALL_SCRIPT) virtlockd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd

uninstall-init:: uninstall-sysconfig
E
Eric Blake 已提交
2404 2405
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
2406 2407

BUILT_SOURCES += virtlockd.init
E
Eric Blake 已提交
2408
DISTCLEANFILES += virtlockd.init
2409
else ! LIBVIRT_INIT_SCRIPT_RED_HAT
2410 2411
install-init::
uninstall-init::
2412 2413
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
else ! WITH_LIBVIRTD
2414 2415
install-init::
uninstall-init::
2416
endif ! WITH_LIBVIRTD
2417 2418

virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
2419 2420 2421 2422 2423 2424
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g'		\
	    < $< > $@-t &&					\
	    chmod a+x $@-t &&					\
2425 2426
	    mv $@-t $@

2427 2428
POD2MAN = pod2man -c "Virtualization Support" \
			-r "$(PACKAGE)-$(VERSION)" -s 8
2429

2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440
$(srcdir)/virtlockd.8.in: locking/virtlockd.pod.in $(top_srcdir)/configure.ac
	$(AM_V_GEN)$(POD2MAN) --name VIRTLOCKD $< $@ \
	    && if grep 'POD ERROR' $@ ; then rm $@; exit 1; fi

virtlockd.8: $(srcdir)/virtlockd.8.in
	$(AM_V_GEN)sed \
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
	mv $@-t $@

2441
if WITH_LIBVIRTD
2442 2443
man8_MANS = virtlockd.8

2444 2445 2446 2447
conf_DATA += locking/virtlockd.conf

augeas_DATA += locking/virtlockd.aug
augeastest_DATA += test_virtlockd.aug
2448
endif WITH_LIBVIRTD
2449

2450
CLEANFILES += test_virtlockd.aug virtlockd.8
2451 2452 2453 2454 2455 2456 2457
MAINTAINERCLEANFILES += $(srcdir)/virtlockd.8.in

EXTRA_DIST += \
        locking/virtlockd.service.in \
        locking/virtlockd.socket.in \
        locking/virtlockd.pod.in \
        virtlockd.8.in \
2458 2459 2460
        locking/virtlockd.aug \
        locking/virtlockd.conf \
        locking/test_virtlockd.aug.in \
2461
        $(NULL)
2462

2463 2464 2465 2466

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

2467
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
2468 2469

BUILT_SOURCES += virtlockd.service virtlockd.socket
E
Eric Blake 已提交
2470
DISTCLEANFILES += virtlockd.service virtlockd.socket
2471

E
Eric Blake 已提交
2472 2473
install-systemd: virtlockd.service virtlockd.socket install-sysconfig
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
2474
	$(INSTALL_DATA) virtlockd.service \
2475
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2476
	$(INSTALL_DATA) virtlockd.socket \
2477 2478 2479
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/

uninstall-systemd: uninstall-sysconfig
E
Eric Blake 已提交
2480 2481 2482
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.socket
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
2483
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
2484 2485
install-systemd:
uninstall-systemd:
2486 2487
endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
else ! WITH_LIBVIRTD
2488 2489
install-systemd:
uninstall-systemd:
2490
endif ! WITH_LIBVIRTD
2491 2492

virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
2493 2494 2495
	$(AM_V_GEN)sed						\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    < $< > $@-t &&					\
2496 2497 2498
	    mv $@-t $@

virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
2499 2500 2501
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    < $< > $@-t &&					\
2502 2503 2504
	    mv $@-t $@


2505
if WITH_SANLOCK
2506
lockdriver_LTLIBRARIES += sanlock.la
2507
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
2508
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
2509
sanlock_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
2510
sanlock_la_LIBADD = -lsanlock_client \
2511 2512 2513
		../gnulib/lib/libgnu.la

augeas_DATA += locking/libvirt_sanlock.aug
2514 2515
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
2516

E
Eric Blake 已提交
2517
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
2518
	$(AM_V_GEN)$(MKDIR_P) locking ; \
2519 2520 2521
	cp $< $@

if WITH_QEMU
2522
nodist_conf_DATA += locking/qemu-sanlock.conf
2523
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
2524
DISTCLEANFILES += locking/qemu-sanlock.conf
2525
endif WITH_QEMU
2526 2527 2528 2529 2530 2531

if WITH_LIBXL
nodist_conf_DATA += locking/libxl-sanlock.conf
BUILT_SOURCES += locking/libxl-sanlock.conf
DISTCLEANFILES += locking/libxl-sanlock.conf
endif WITH_LIBXL
2532
else ! WITH_SANLOCK
2533
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
2534
endif ! WITH_SANLOCK
2535 2536
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
2537
	locking/test_libvirt_sanlock.aug.in
2538

2539 2540 2541 2542
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
2543

2544
EXTRA_DIST += \
E
Eric Blake 已提交
2545 2546 2547 2548
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
2549 2550
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
2551

E
Eric Blake 已提交
2552
VIR_NET_RPC_GENERATED = \
2553 2554 2555 2556
	rpc/virnetprotocol.h \
	rpc/virnetprotocol.c \
	rpc/virkeepaliveprotocol.h \
	rpc/virkeepaliveprotocol.c
2557

2558
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2559

2560
libvirt_net_rpc_la_SOURCES = \
2561
	rpc/virnetmessage.h rpc/virnetmessage.c \
2562
	rpc/virnetsocket.h rpc/virnetsocket.c \
2563 2564
	rpc/virkeepalive.h rpc/virkeepalive.c \
	$(VIR_NET_RPC_GENERATED)
2565
if WITH_SSH2
2566 2567
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2568
else ! WITH_SSH2
2569 2570
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2571
endif ! WITH_SSH2
2572
if WITH_GNUTLS
2573 2574
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2575
else ! WITH_GNUTLS
2576 2577
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2578
endif ! WITH_GNUTLS
2579
if WITH_SASL
2580 2581
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2582
else ! WITH_SASL
2583 2584
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2585
endif ! WITH_SASL
2586
libvirt_net_rpc_la_CFLAGS = \
2587
			$(GNUTLS_CFLAGS) \
2588
			$(SASL_CFLAGS) \
2589
			$(SSH2_CFLAGS) \
2590
			$(XDR_CFLAGS) \
2591 2592
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
2593
			$(GNUTLS_LIBS) \
2594
			$(SASL_LIBS) \
2595
			$(SSH2_LIBS)\
J
Jim Fehlig 已提交
2596
			$(SECDRIVER_LIBS) \
2597 2598 2599 2600 2601 2602
			$(AM_LDFLAGS) \
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2603 2604 2605 2606
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
2607
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
2608
	rpc/virnetdaemon.h rpc/virnetdaemon.c \
2609 2610
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
2611
			$(AVAHI_CFLAGS) \
2612
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
2613
			$(XDR_CFLAGS) \
2614
			$(AM_CFLAGS)
2615 2616
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
2617
			$(AVAHI_LIBS) \
2618
			$(DBUS_LIBS) \
2619 2620 2621 2622 2623
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2624 2625 2626 2627 2628
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 已提交
2629 2630
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
2631 2632 2633 2634 2635 2636
libvirt_net_rpc_client_la_LDFLAGS = \
			$(AM_LDFLAGS) \
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
2637

2638 2639
libexec_PROGRAMS =

2640
if WITH_LIBVIRTD
2641 2642
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2643 2644 2645 2646
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2647 2648 2649
libvirt_iohelper_LDADD =		\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
2650 2651
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
2652
endif WITH_DTRACE_PROBES
2653

D
Daniel P. Berrange 已提交
2654 2655 2656 2657
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676

if WITH_NETWORK
libexec_PROGRAMS += libvirt_leaseshelper
libvirt_leaseshelper_SOURCES = $(NETWORK_LEASES_HELPER_SOURCES)
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

2677
endif WITH_LIBVIRTD
2678

2679
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
2680
if WITH_LIBVIRTD
2681
libexec_PROGRAMS += libvirt_parthelper
2682

2683
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
D
Daniel P. Berrange 已提交
2684 2685 2686 2687
libvirt_parthelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2688 2689 2690 2691
libvirt_parthelper_LDADD =		\
		$(LIBPARTED_LIBS)	\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
2692 2693
if WITH_DTRACE_PROBES
libvirt_parthelper_LDADD += libvirt_probes.lo
2694
endif WITH_DTRACE_PROBES
2695

D
Daniel P. Berrange 已提交
2696 2697 2698 2699 2700
libvirt_parthelper_CFLAGS = \
		$(LIBPARTED_CFLAGS) \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2701 2702
endif WITH_LIBVIRTD
endif WITH_STORAGE_DISK
2703 2704
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)

2705

2706
if WITH_SANLOCK
2707 2708 2709
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2710
libvirt_sanlock_helper_CFLAGS = \
2711
		-I$(srcdir)/conf \
D
Daniel P. Berrange 已提交
2712 2713 2714 2715 2716 2717 2718
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2719
libvirt_sanlock_helper_LDADD = libvirt.la
2720
endif WITH_SANLOCK
2721

2722 2723 2724 2725 2726 2727
if WITH_LXC
if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_lxc

libvirt_lxc_SOURCES =						\
		$(LXC_CONTROLLER_SOURCES)			\
O
Osier Yang 已提交
2728 2729
		$(NODE_INFO_SOURCES)				\
		$(DATATYPES_SOURCES)
D
Daniel P. Berrange 已提交
2730 2731 2732 2733
libvirt_lxc_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2734
libvirt_lxc_LDADD =			\
G
Gao feng 已提交
2735
		$(FUSE_LIBS) \
2736 2737
		libvirt-net-rpc-server.la \
		libvirt-net-rpc.la \
2738
		libvirt_security_manager.la \
2739 2740
		libvirt_conf.la \
		libvirt_util.la \
2741
		../gnulib/lib/libgnu.la
2742
if WITH_DTRACE_PROBES
2743
libvirt_lxc_LDADD += libvirt_probes.lo
2744
endif WITH_DTRACE_PROBES
2745
libvirt_lxc_LDADD += $(SECDRIVER_LIBS)
2746
libvirt_lxc_CFLAGS =				\
2747
		-I$(srcdir)/conf	\
2748
		$(AM_CFLAGS)                    \
D
Daniel P. Berrange 已提交
2749
		$(PIE_CFLAGS)			\
G
Gao feng 已提交
2750
		$(LIBNL_CFLAGS)			\
D
Daniel P. Berrange 已提交
2751
		$(FUSE_CFLAGS)			\
2752
		$(DBUS_CFLAGS)			\
P
Pavel Fedin 已提交
2753
		$(XDR_CFLAGS)			\
D
Daniel P. Berrange 已提交
2754
		$(NULL)
2755
if WITH_BLKID
2756 2757
libvirt_lxc_CFLAGS += $(BLKID_CFLAGS)
libvirt_lxc_LDADD += $(BLKID_LIBS)
2758
endif WITH_BLKID
J
Jim Fehlig 已提交
2759
libvirt_lxc_CFLAGS += $(SECDRIVER_CFLAGS)
2760 2761
endif WITH_LIBVIRTD
endif WITH_LXC
2762 2763
EXTRA_DIST += $(LXC_CONTROLLER_SOURCES)

J
Jamie Strandboge 已提交
2764 2765 2766 2767 2768 2769
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 已提交
2770 2771 2772 2773
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
J
Jamie Strandboge 已提交
2774
virt_aa_helper_LDADD =						\
2775
		libvirt.la					\
C
Chris Lalancette 已提交
2776 2777
		libvirt_conf.la					\
		libvirt_util.la					\
2778
		libvirt_driver_storage_impl.la			\
C
Chris Lalancette 已提交
2779
		../gnulib/lib/libgnu.la
2780
if WITH_DTRACE_PROBES
2781
virt_aa_helper_LDADD += libvirt_probes.lo
2782
endif WITH_DTRACE_PROBES
J
Jamie Strandboge 已提交
2783
virt_aa_helper_CFLAGS =						\
2784 2785 2786 2787
		-I$(srcdir)/conf				\
		-I$(srcdir)/security				\
		$(AM_CFLAGS) 					\
		$(PIE_CFLAGS) 					\
D
Daniel P. Berrange 已提交
2788
		$(NULL)
2789 2790
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
J
Jamie Strandboge 已提交
2791 2792
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

2793
install-data-local: install-init install-systemd
2794 2795
if WITH_LIBVIRTD
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
2796
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
2797
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
2798
endif WITH_LIBVIRTD
2799 2800
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
2801
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
2802
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
2803
if WITH_SANLOCK
2804
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
2805
endif WITH_SANLOCK
2806
if WITH_QEMU
2807
	$(MKDIR_P) -m 0751 "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu"
2808
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu"
2809
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu"
2810
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu"
2811
endif WITH_QEMU
2812 2813 2814
if WITH_LXC
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lxc"
2815
endif WITH_LXC
J
Jim Fehlig 已提交
2816 2817 2818
if WITH_LIBXL
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/libxl"
J
Jim Fehlig 已提交
2819
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl"
2820
endif WITH_LIBXL
2821 2822 2823
if WITH_UML
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/uml"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/uml"
2824
endif WITH_UML
2825 2826
if WITH_XEN
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/xen"
2827
endif WITH_XEN
2828 2829
if WITH_NETWORK
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network"
2830
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq"
2831
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/network"
2832
	$(MKDIR_P) "$(DESTDIR)$(confdir)/qemu/networks/autostart"
2833
	$(INSTALL_DATA) $(srcdir)/network/default.xml \
2834
	  $(DESTDIR)$(confdir)/qemu/networks/default.xml
2835
	test -z "$(UUID)" || \
E
Eric Blake 已提交
2836
	  { sed -e "s,</name>,</name>\n  <uuid>$(UUID)</uuid>," \
2837 2838 2839 2840 2841 2842
	      $(DESTDIR)$(confdir)/qemu/networks/default.xml > \
	      $(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; }
	test -e $(DESTDIR)$(confdir)/qemu/networks/autostart/default.xml || \
E
Eric Blake 已提交
2843
	   ln -s ../default.xml \
2844
	    $(DESTDIR)$(confdir)/qemu/networks/autostart/default.xml
2845
endif WITH_NETWORK
2846

2847
uninstall-local:: uninstall-init uninstall-systemd
2848
if WITH_LIBVIRTD
2849
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
2850 2851
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
2852
endif WITH_LIBVIRTD
2853 2854
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
2855
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
2856
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
2857
if WITH_SANLOCK
2858
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
2859
endif WITH_SANLOCK
2860 2861 2862 2863 2864
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" ||:
2865
endif WITH_QEMU
2866 2867 2868
if WITH_LXC
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||:
2869
endif WITH_LXC
J
Jim Fehlig 已提交
2870 2871 2872
if WITH_LIBXL
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||:
J
Jim Fehlig 已提交
2873
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||:
2874
endif WITH_LIBXL
2875 2876 2877
if WITH_UML
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/uml" ||:
2878
endif WITH_UML
2879 2880
if WITH_XEN
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/xen" ||:
2881
endif WITH_XEN
2882
if WITH_NETWORK
2883 2884 2885 2886
	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" || :
2887 2888
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||:
2889
endif WITH_NETWORK
2890
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
2891

2892 2893
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
2894
MAINTAINERCLEANFILES += $(REMOTE_DRIVER_GENERATED) $(VIR_NET_RPC_GENERATED)