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

3
## Copyright (C) 2005-2014 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)
23
abs_topsrcdir = $(shell cd $(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

L
Lai Jiangshan 已提交
176 177 178
EXTRA_DIST += $(srcdir)/util/virkeymaps.h $(srcdir)/util/keymaps.csv \
		$(srcdir)/util/virkeycode-mapgen.py

E
Eric Blake 已提交
179
BUILT_SOURCES += util/virkeymaps.h
180

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

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

220 221 222
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

223 224
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
225

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

316
# Secret driver generic impl APIs
317 318 319 320 321 322 323
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

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

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

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

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

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

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

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

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

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

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

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

395 396 397 398 399 400 401 402 403 404
# 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
405 406 407 408

# With pdwtags 1.8, --verbose output includes separators like these:
# /* 93 */
# /* <0> (null):0 */
409 410
# with the second line omitted for intrinsic types.
# Whereas with pdwtags 1.3, they look like this:
411
# /* <2d2> /usr/include/libio.h:180 */
412 413
# The alternation of the following regexps matches both cases.
r1 = /\* \d+ \*/
414
r2 = /\* <[[:xdigit:]]+> \S+:\d+ \*/
E
Eric Blake 已提交
415
struct_prefix = (remote_|qemu_|lxc_|keepalive|vir(Net|LockSpace|LXCMonitor))
416

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

464
# .libs/libvirt.so is built by libtool as a side-effect of the Makefile
465 466
# rule for libvirt.la.  However, checking symbols relies on Linux ELF layout
if WITH_LINUX
467 468 469
check-symfile: libvirt.syms libvirt.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt.syms \
	  .libs/libvirt.so
470
else ! WITH_LINUX
471
check-symfile:
472
endif ! WITH_LINUX
473
check-symsorting:
474
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
475
		$(srcdir) $(SYM_FILES)
J
Jiri Denemark 已提交
476
EXTRA_DIST += check-symfile.pl check-symsorting.pl
477

E
Eric Blake 已提交
478
# Keep this list synced with RPC_PROBE_FILES
479 480
PROTOCOL_STRUCTS = \
	$(srcdir)/remote_protocol-structs \
481
	$(srcdir)/lxc_protocol-structs \
482
	$(srcdir)/qemu_protocol-structs \
J
Jiri Denemark 已提交
483
	$(srcdir)/virnetprotocol-structs \
E
Eric Blake 已提交
484 485 486 487 488
	$(srcdir)/virkeepaliveprotocol-structs \
	$(srcdir)/lxc_monitor_protocol-structs \
	$(srcdir)/lock_protocol-structs \
	$(NULL)

489
if WITH_REMOTE
490 491
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)

492 493
# 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.
494 495 496
$(srcdir)/remote_protocol-struct \
	$(srcdir)/qemu_protocol-struct \
	$(srcdir)/lxc_protocol-struct: \
E
Eric Blake 已提交
497
		$(srcdir)/%-struct: remote/libvirt_driver_remote_la-%.lo
498
	$(PDWTAGS)
499
$(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \
E
Eric Blake 已提交
500
		$(srcdir)/%-struct: rpc/libvirt_net_rpc_la-%.lo
501
	$(PDWTAGS)
E
Eric Blake 已提交
502
$(srcdir)/lxc_monitor_protocol-struct: \
E
Eric Blake 已提交
503
		$(srcdir)/%-struct: lxc/libvirt_driver_lxc_impl_la-%.lo
E
Eric Blake 已提交
504 505
	$(PDWTAGS)
$(srcdir)/lock_protocol-struct: \
E
Eric Blake 已提交
506
		$(srcdir)/%-struct: locking/lockd_la-%.lo
E
Eric Blake 已提交
507 508
	$(PDWTAGS)

509
else !WITH_REMOTE
510 511 512
# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be
# re-generated when configured --without-remote.
check-protocol:
513
endif !WITH_REMOTE
J
Jiri Denemark 已提交
514
EXTRA_DIST += $(PROTOCOL_STRUCTS)
515 516 517 518 519 520 521 522 523 524

check-drivername:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-drivername.pl \
		$(srcdir)/driver.h \
		$(srcdir)/libvirt_public.syms \
		$(srcdir)/libvirt_qemu.syms \
		$(srcdir)/libvirt_lxc.syms

EXTRA_DIST += check-drivername.pl

525
DRIVER_SOURCE_FILES = \
526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545
	$(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) \
	$(PARALLELS_DRIVER_SOURCES) \
	$(PHYP_DRIVER_SOURCES) \
	$(QEMU_DRIVER_SOURCES) \
	$(REMOTE_DRIVER_SOURCES) \
	$(SECRET_DRIVER_SOURCES) \
	$(STORAGE_DRIVER_SOURCES) \
	$(TEST_DRIVER_SOURCES) \
	$(UML_DRIVER_SOURCES) \
	$(VBOX_DRIVER_SOURCES) \
546
	vbox/vbox_tmpl.c \
547 548 549
	$(VMWARE_DRIVER_SOURCES) \
	$(XEN_DRIVER_SOURCES) \
	$(XENAPI_DRIVER_SOURCES) \
550 551
	$(NULL)

552
STATEFUL_DRIVER_SOURCE_FILES = \
R
Roman Bogorodskiy 已提交
553
	$(BHYVE_DRIVER_SOURCES) \
554 555 556 557 558 559 560 561 562 563 564 565 566
	$(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)

567 568 569

check-driverimpls:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-driverimpls.pl \
570
		$(filter /%,$(DRIVER_SOURCE_FILES)) \
E
Eric Blake 已提交
571 572 573
		$(filter $(srcdir)/%,$(DRIVER_SOURCE_FILES)) \
		$(addprefix $(srcdir)/,$(filter-out $(srcdir)/%, \
			$(filter-out /%,$(DRIVER_SOURCE_FILES))))
574

575 576
check-aclrules:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclrules.pl \
E
Eric Blake 已提交
577
		$(REMOTE_PROTOCOL) \
578
		$(addprefix $(srcdir)/,$(filter-out /%,$(STATEFUL_DRIVER_SOURCE_FILES)))
579

580 581 582 583 584
check-aclperms:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclperms.pl \
		$(srcdir)/access/viraccessperm.h \
		$(srcdir)/access/viraccessperm.c

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

587
check-local: check-protocol check-symfile check-symsorting \
588 589
	check-drivername check-driverimpls check-aclrules \
	check-aclperms
590
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
591

592 593
# Mock driver, covering domains, storage, networks, etc
TEST_DRIVER_SOURCES =						\
594
		test/test_driver.c test/test_driver.h
595 596 597

# Now the Hypervisor specific drivers
XEN_DRIVER_SOURCES =						\
598 599 600 601 602 603
		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
604
if WITH_XEN_INOTIFY
605
XEN_DRIVER_SOURCES += xen/xen_inotify.c xen/xen_inotify.h
606
endif WITH_XEN_INOTIFY
607

608
LXC_MONITOR_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
609 610
	lxc/lxc_monitor_protocol.h \
	lxc/lxc_monitor_protocol.c \
611 612 613
	$(NULL)

LXC_MONITOR_GENERATED = \
E
Eric Blake 已提交
614
	lxc/lxc_monitor_dispatch.h \
615 616 617
	$(NULL)

LXC_CONTROLLER_GENERATED = \
E
Eric Blake 已提交
618
	lxc/lxc_controller_dispatch.h \
619 620 621
	$(NULL)

LXC_GENERATED = \
622
	$(LXC_MONITOR_PROTOCOL_GENERATED) \
623 624 625 626
	$(LXC_MONITOR_GENERATED) \
	$(LXC_CONTROLLER_GENERATED) \
	$(NULL)

627
LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x
628

E
Eric Blake 已提交
629
lxc/lxc_monitor_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
630
		$(LXC_MONITOR_PROTOCOL) Makefile.am
631
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
632 633
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_monitor_dispatch.h
634

E
Eric Blake 已提交
635
lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
636
		$(REMOTE_PROTOCOL) Makefile.am
637
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \
E
Eric Blake 已提交
638 639
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_controller_dispatch.h
640 641

EXTRA_DIST += \
642
	$(LXC_MONITOR_PROTOCOL) \
643 644 645 646 647
	$(LXC_GENERATED) \
	$(NULL)

BUILT_SOURCES += $(LXC_GENERATED)

648 649
CLEANFILES += $(LXC_GENERATED)

650
LXC_DRIVER_SOURCES =						\
651
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
652
		$(LXC_MONITOR_GENERATED)			\
653 654
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
655
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
656
		lxc/lxc_domain.c lxc/lxc_domain.h		\
657
		lxc/lxc_hostdev.c lxc/lxc_hostdev.h		\
658
		lxc/lxc_monitor.c lxc/lxc_monitor.h		\
659
		lxc/lxc_process.c lxc/lxc_process.h		\
G
Gao feng 已提交
660
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
661
		lxc/lxc_native.c lxc/lxc_native.h		\
662
		lxc/lxc_driver.c lxc/lxc_driver.h
663

664
LXC_CONTROLLER_SOURCES =					\
665
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
666
		$(LXC_CONTROLLER_GENERATED)			\
667 668
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
669
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
670
		lxc/lxc_domain.c lxc/lxc_domain.h		\
G
Gao feng 已提交
671
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
672
		lxc/lxc_controller.c
673

J
Jamie Strandboge 已提交
674
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES =			\
E
Eric Blake 已提交
675
		$(DATATYPES_SOURCES)				\
J
Jamie Strandboge 已提交
676 677
		security/virt-aa-helper.c

678 679 680
PHYP_DRIVER_SOURCES =						\
		phyp/phyp_driver.c phyp/phyp_driver.h

681
OPENVZ_DRIVER_SOURCES =						\
682
		openvz/openvz_conf.c openvz/openvz_conf.h	\
683 684
		openvz/openvz_driver.c openvz/openvz_driver.h   \
		openvz/openvz_util.c openvz/openvz_util.h
685

E
Eric Blake 已提交
686
VMWARE_DRIVER_SOURCES =						\
687
		vmware/vmware_driver.c vmware/vmware_driver.h	\
688 689
		vmware/vmware_conf.c vmware/vmware_conf.h

690
VBOX_DRIVER_SOURCES =						\
E
Eric Blake 已提交
691 692
	vbox/vbox_glue.c vbox/vbox_glue.h			\
	vbox/vbox_driver.c vbox/vbox_driver.h			\
T
Taowei 已提交
693
	vbox/vbox_snapshot_conf.c vbox/vbox_snapshot_conf.h     \
E
Eric Blake 已提交
694 695 696 697
	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			\
698
	vbox/vbox_V4_0.c vbox/vbox_CAPI_v4_0.h			\
699
	vbox/vbox_V4_1.c vbox/vbox_CAPI_v4_1.h			\
R
Ryota Ozaki 已提交
700
	vbox/vbox_V4_2.c vbox/vbox_CAPI_v4_2.h			\
T
Taowei 已提交
701
	vbox/vbox_V4_2_20.c vbox/vbox_CAPI_v4_2_20.h		\
702
	vbox/vbox_V4_3.c vbox/vbox_CAPI_v4_3.h			\
T
Taowei 已提交
703 704 705
	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                               \
706 707 708
	vbox/vbox_get_driver.h					\
	vbox/vbox_network.c					\
	vbox/vbox_storage.c
T
Taowei Luo 已提交
709

E
Eric Blake 已提交
710
VBOX_DRIVER_EXTRA_DIST =					\
711 712 713
		vbox/vbox_tmpl.c vbox/README			\
		vbox/vbox_MSCOMGlue.c vbox/vbox_MSCOMGlue.h	\
		vbox/vbox_XPCOMCGlue.c vbox/vbox_XPCOMCGlue.h
714

O
Osier Yang 已提交
715 716 717 718 719 720 721 722
QEMU_DRIVER_SOURCES =							\
		qemu/qemu_agent.c qemu/qemu_agent.h			\
		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			\
723
		qemu/qemu_hotplugpriv.h					\
O
Osier Yang 已提交
724 725
		qemu/qemu_conf.c qemu/qemu_conf.h			\
		qemu/qemu_process.c qemu/qemu_process.h			\
726
		qemu/qemu_processpriv.h					\
O
Osier Yang 已提交
727 728 729 730 731 732
		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				\
733 734
		qemu/qemu_driver.c qemu/qemu_driver.h	\
		qemu/qemu_interface.c qemu/qemu_interface.h
R
Richard W.M. Jones 已提交
735

O
Osier Yang 已提交
736
XENAPI_DRIVER_SOURCES =						\
737
		xenapi/xenapi_driver.c xenapi/xenapi_driver.h	\
O
Osier Yang 已提交
738
		xenapi/xenapi_driver_private.h			\
739 740
		xenapi/xenapi_utils.c xenapi/xenapi_utils.h

J
Jim Fehlig 已提交
741 742
LIBXL_DRIVER_SOURCES =						\
		libxl/libxl_conf.c libxl/libxl_conf.h		\
J
Jim Fehlig 已提交
743
		libxl/libxl_domain.c libxl/libxl_domain.h       \
J
Jim Fehlig 已提交
744 745
		libxl/libxl_driver.c libxl/libxl_driver.h       \
		libxl/libxl_migration.c libxl/libxl_migration.h
J
Jim Fehlig 已提交
746

747
UML_DRIVER_SOURCES =						\
D
Daniel P. Berrange 已提交
748 749
		uml/uml_conf.c uml/uml_conf.h			\
		uml/uml_driver.c uml/uml_driver.h
750

O
Osier Yang 已提交
751 752 753 754 755 756
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	\
757
		esx/esx_storage_backend_vmfs.c esx/esx_storage_backend_vmfs.h	\
758
		esx/esx_storage_backend_iscsi.c esx/esx_storage_backend_iscsi.h	\
759
		esx/esx_stream.c esx/esx_stream.h			\
O
Osier Yang 已提交
760 761 762
		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		\
763
		esx/esx_vi_types.c esx/esx_vi_types.h
764

765
ESX_DRIVER_GENERATED =							\
766 767
		esx/esx_vi_methods.generated.c				\
		esx/esx_vi_methods.generated.h				\
768
		esx/esx_vi_methods.generated.macro			\
769 770 771 772 773
		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			\
774 775 776
		esx/esx_vi_types.generated.typefromstring		\
		esx/esx_vi.generated.c					\
		esx/esx_vi.generated.h
777

O
Osier Yang 已提交
778
ESX_DRIVER_EXTRA_DIST =							\
779 780 781 782 783
		esx/README						\
		esx/esx_vi_generator.input				\
		esx/esx_vi_generator.py					\
		$(ESX_DRIVER_GENERATED)

O
Osier Yang 已提交
784
HYPERV_DRIVER_SOURCES =									\
M
Matthias Bolte 已提交
785 786
		hyperv/hyperv_private.h							\
		hyperv/hyperv_driver.c hyperv/hyperv_driver.h				\
787
		hyperv/hyperv_util.c hyperv/hyperv_util.h				\
788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803
		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)

D
Dmitry Guryanov 已提交
804 805
PARALLELS_DRIVER_SOURCES =					\
		parallels/parallels_driver.h			\
806
		parallels/parallels_driver.c			\
807 808
		parallels/parallels_utils.c			\
		parallels/parallels_utils.h			\
D
Dmitry Guryanov 已提交
809
		parallels/parallels_storage.c		\
810 811 812
		parallels/parallels_network.c		\
		parallels/parallels_sdk.h			\
		parallels/parallels_sdk.c
D
Dmitry Guryanov 已提交
813

R
Roman Bogorodskiy 已提交
814
BHYVE_DRIVER_SOURCES =						\
815 816
		bhyve/bhyve_capabilities.c			\
		bhyve/bhyve_capabilities.h			\
R
Roman Bogorodskiy 已提交
817 818
		bhyve/bhyve_command.c				\
		bhyve/bhyve_command.h				\
819 820 821 822
		bhyve/bhyve_device.c				\
		bhyve/bhyve_device.h				\
		bhyve/bhyve_domain.c				\
		bhyve/bhyve_domain.h				\
R
Roman Bogorodskiy 已提交
823 824
		bhyve/bhyve_driver.h				\
		bhyve/bhyve_driver.c				\
825 826
		bhyve/bhyve_monitor.c				\
		bhyve/bhyve_monitor.h				\
R
Roman Bogorodskiy 已提交
827 828 829 830 831
		bhyve/bhyve_process.c				\
		bhyve/bhyve_process.h				\
		bhyve/bhyve_utils.h				\
		$(NULL)

832
NETWORK_DRIVER_SOURCES =					\
833 834 835 836 837
		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
838

839 840 841 842
INTERFACE_DRIVER_SOURCES =

if WITH_INTERFACE
INTERFACE_DRIVER_SOURCES +=					\
843 844
		interface/interface_driver.h        \
		interface/interface_driver.c
845 846 847 848

if WITH_NETCF
INTERFACE_DRIVER_SOURCES +=					\
		interface/interface_backend_netcf.c
849
endif WITH_NETCF
850
if WITH_UDEV
851 852
INTERFACE_DRIVER_SOURCES +=					\
		interface/interface_backend_udev.c
853 854
endif WITH_UDEV
endif WITH_INTERFACE
855

856
SECRET_DRIVER_SOURCES =						\
857
		secret/secret_driver.h secret/secret_driver.c
858

859
# Storage backend specific impls
O
Osier Yang 已提交
860 861
STORAGE_DRIVER_SOURCES =						\
		storage/storage_driver.h storage/storage_driver.c	\
862
		storage/storage_backend.h storage/storage_backend.c
863 864

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

867
STORAGE_DRIVER_LVM_SOURCES =					\
O
Osier Yang 已提交
868
		storage/storage_backend_logical.h		\
869
		storage/storage_backend_logical.c
870 871

STORAGE_DRIVER_ISCSI_SOURCES =					\
872
		storage/storage_backend_iscsi.h storage/storage_backend_iscsi.c
873

874
STORAGE_DRIVER_SCSI_SOURCES =					\
875
		storage/storage_backend_scsi.h storage/storage_backend_scsi.c
876

D
Dave Allan 已提交
877
STORAGE_DRIVER_MPATH_SOURCES =					\
878
		storage/storage_backend_mpath.h storage/storage_backend_mpath.c
D
Dave Allan 已提交
879

880
STORAGE_DRIVER_DISK_SOURCES =					\
881
		storage/storage_backend_disk.h storage/storage_backend_disk.c
882

883 884 885
STORAGE_DRIVER_RBD_SOURCES =					\
		storage/storage_backend_rbd.h storage/storage_backend_rbd.c

886 887 888
STORAGE_DRIVER_SHEEPDOG_SOURCES =				\
		storage/storage_backend_sheepdog.h storage/storage_backend_sheepdog.c

889 890 891
STORAGE_DRIVER_GLUSTER_SOURCES =				\
		storage/storage_backend_gluster.h storage/storage_backend_gluster.c

R
Roman Bogorodskiy 已提交
892 893 894
STORAGE_DRIVER_ZFS_SOURCES =					\
                storage/storage_backend_zfs.h storage/storage_backend_zfs.c

895
STORAGE_HELPER_DISK_SOURCES =					\
896
		storage/parthelper.c
897

898 899 900
UTIL_IO_HELPER_SOURCES =					\
		util/iohelper.c

901 902 903
NETWORK_LEASES_HELPER_SOURCES =                                 \
               network/leaseshelper.c

904
# Network filters
O
Osier Yang 已提交
905
NWFILTER_DRIVER_SOURCES =						\
906
		nwfilter/nwfilter_driver.h nwfilter/nwfilter_driver.c	\
907
		nwfilter/nwfilter_tech_driver.h				\
908 909
		nwfilter/nwfilter_gentech_driver.c			\
		nwfilter/nwfilter_gentech_driver.h			\
S
Stefan Berger 已提交
910 911
		nwfilter/nwfilter_dhcpsnoop.c				\
		nwfilter/nwfilter_dhcpsnoop.h				\
912
		nwfilter/nwfilter_ebiptables_driver.c			\
913 914 915
		nwfilter/nwfilter_ebiptables_driver.h			\
		nwfilter/nwfilter_learnipaddr.c				\
		nwfilter/nwfilter_learnipaddr.h
916

917

918
# Security framework and drivers for various models
O
Osier Yang 已提交
919 920 921 922 923
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		\
924
		security/security_manager.h security/security_manager.c
925

926
SECURITY_DRIVER_SELINUX_SOURCES =				\
927
		security/security_selinux.h security/security_selinux.c
928

J
Jamie Strandboge 已提交
929 930 931
SECURITY_DRIVER_APPARMOR_SOURCES =				\
		security/security_apparmor.h security/security_apparmor.c

932
ACCESS_DRIVER_GENERATED = \
E
Eric Blake 已提交
933 934 935 936 937 938 939
		access/viraccessapicheck.h \
		access/viraccessapicheck.c \
		access/viraccessapicheckqemu.h \
		access/viraccessapicheckqemu.c \
		access/viraccessapichecklxc.h \
		access/viraccessapichecklxc.c \
		$(NULL)
940

941
ACCESS_DRIVER_SYM_FILES = \
942 943 944
		libvirt_access.syms \
		libvirt_access_qemu.syms \
		libvirt_access_lxc.syms
945

946 947 948 949 950
ACCESS_DRIVER_API_FILES = \
		libvirt_access.xml \
		libvirt_access_qemu.xml \
		libvirt_access_lxc.xml

951 952 953 954 955 956 957
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

958 959 960 961
ACCESS_DRIVER_POLKIT_SOURCES = \
		access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c

ACCESS_DRIVER_POLKIT_POLICY = \
962
		$(srcdir)/access/org.libvirt.api.policy
963 964


965
NODE_DEVICE_DRIVER_SOURCES =					\
O
Osier Yang 已提交
966 967
		node_device/node_device_driver.c		\
		node_device/node_device_driver.h		\
968
		node_device/node_device_linux_sysfs.c
969 970

NODE_DEVICE_DRIVER_HAL_SOURCES =				\
971
		node_device/node_device_hal.c			\
972
		node_device/node_device_hal.h
973

974
NODE_DEVICE_DRIVER_UDEV_SOURCES =				\
D
Daniel Veillard 已提交
975 976
		node_device/node_device_udev.c			\
		node_device/node_device_udev.h
977

J
Jiri Denemark 已提交
978 979 980 981
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 已提交
982
		cpu/cpu_s390.h cpu/cpu_s390.c			\
C
Chuck Short 已提交
983
		cpu/cpu_arm.h cpu/cpu_arm.c			\
984
		cpu/cpu_aarch64.h cpu/cpu_aarch64.c		\
P
Prerna Saxena 已提交
985
		cpu/cpu_map.h cpu/cpu_map.c cpu/cpu_powerpc.h	\
986
		cpu/cpu_powerpc.c cpu/cpu_ppc_data.h
987

988 989 990
VMX_SOURCES =							\
		vmx/vmx.c vmx/vmx.h

991 992
XENCONFIG_SOURCES =						\
		xenconfig/xenxs_private.h			\
993
		xenconfig/xen_common.c xenconfig/xen_common.h   \
994
		xenconfig/xen_sxpr.c xenconfig/xen_sxpr.h	\
995
		xenconfig/xen_xm.c xenconfig/xen_xm.h
996 997 998 999
if WITH_LIBXL
XENCONFIG_SOURCES +=						\
		xenconfig/xen_xl.c xenconfig/xen_xl.h
endif WITH_LIBXL
1000

J
Jiri Denemark 已提交
1001 1002
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
1003
EXTRA_DIST +=	$(pkgdata_DATA)
1004

1005 1006 1007 1008 1009 1010
#########################
#
# Build up list of libvirt.la source files based on configure conditions
#
# First deal with sources usable in non-daemon context

1011
noinst_LTLIBRARIES = libvirt_util.la
1012 1013
libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
libvirt_la_BUILT_LIBADD = libvirt_util.la
1014 1015
libvirt_util_la_SOURCES =					\
		$(UTIL_SOURCES)
1016
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
1017
		$(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
1018
		$(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS)	\
1019
		$(SYSTEMD_DAEMON_CFLAGS) $(POLKIT_CFLAGS) \
1020
		-I$(srcdir)/conf
1021
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
1022
		$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
1023
		$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(MSCOM_LIBS) $(LIBXML_LIBS) \
1024 1025
		$(SECDRIVER_LIBS) $(NUMACTL_LIBS) $(SYSTEMD_DAEMON_LIBS) \
		$(POLKIT_LIBS)
1026

1027 1028

noinst_LTLIBRARIES += libvirt_conf.la
1029
libvirt_la_BUILT_LIBADD += libvirt_conf.la
1030
libvirt_conf_la_SOURCES = $(CONF_SOURCES)
1031 1032
libvirt_conf_la_CFLAGS = $(AM_CFLAGS)
libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS)
1033
libvirt_conf_la_LIBADD = $(LIBXML_LIBS)
1034

J
Jiri Denemark 已提交
1035
noinst_LTLIBRARIES += libvirt_cpu.la
1036
libvirt_la_BUILT_LIBADD += libvirt_cpu.la
J
Jiri Denemark 已提交
1037
libvirt_cpu_la_CFLAGS = \
1038
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jiri Denemark 已提交
1039 1040
libvirt_cpu_la_SOURCES = $(CPU_SOURCES)

1041 1042 1043 1044
if WITH_VMX
noinst_LTLIBRARIES += libvirt_vmx.la
libvirt_la_BUILT_LIBADD += libvirt_vmx.la
libvirt_vmx_la_CFLAGS = \
1045
		-I$(srcdir)/conf $(AM_CFLAGS)
1046
libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
1047
endif WITH_VMX
1048

J
Jim Fehlig 已提交
1049 1050 1051
if WITH_XENCONFIG
noinst_LTLIBRARIES += libvirt_xenconfig.la
libvirt_la_BUILT_LIBADD += libvirt_xenconfig.la
1052
libvirt_la_LIBADD += $(LIBXL_LIBS)
J
Jim Fehlig 已提交
1053
libvirt_xenconfig_la_CFLAGS = \
1054
		-I$(srcdir)/conf $(AM_CFLAGS)
J
Jim Fehlig 已提交
1055 1056
libvirt_xenconfig_la_SOURCES = $(XENCONFIG_SOURCES)
endif WITH_XENCONFIG
1057

1058

1059
noinst_LTLIBRARIES += libvirt_driver.la
1060
libvirt_la_BUILT_LIBADD += libvirt_driver.la
1061
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
1062

1063
libvirt_driver_la_CFLAGS = \
1064
		$(GNUTLS_CFLAGS) $(CURL_CFLAGS) \
1065
		-I$(srcdir)/conf $(AM_CFLAGS)
1066
libvirt_driver_la_LIBADD = \
1067
		$(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS)
1068

1069 1070
# 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.
1071
SYM_FILES = $(USED_SYM_FILES)
1072
USED_SYM_FILES = $(srcdir)/libvirt_private.syms
1073 1074 1075 1076
GENERATED_SYM_FILES = \
	$(ACCESS_DRIVER_SYM_FILES) \
	libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \
	$(NULL)
1077

1078
if WITH_TEST
1079
noinst_LTLIBRARIES += libvirt_driver_test.la
1080
libvirt_la_BUILT_LIBADD += libvirt_driver_test.la
1081
libvirt_driver_test_la_CFLAGS = \
1082
		-I$(srcdir)/conf $(AM_CFLAGS)
1083
libvirt_driver_test_la_SOURCES = $(TEST_DRIVER_SOURCES)
1084
endif WITH_TEST
1085 1086

if WITH_REMOTE
1087
noinst_LTLIBRARIES += libvirt_driver_remote.la
1088
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
1089 1090
libvirt_driver_remote_la_CFLAGS =				\
		$(GNUTLS_CFLAGS)				\
E
Eric Blake 已提交
1091
		$(XDR_CFLAGS)					\
1092 1093
		-I$(srcdir)/conf				\
		-I$(srcdir)/rpc					\
1094 1095
		$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
1096 1097 1098 1099
libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) \
                libvirt-net-rpc-client.la \
                libvirt-net-rpc-server.la \
                libvirt-net-rpc.la
1100
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
1101

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

1104 1105
endif WITH_REMOTE

1106
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
1107
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
1108
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1109

1110
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
1111
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
1112
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1113

1114
if WITH_XEN
E
Eric Blake 已提交
1115 1116 1117
noinst_LTLIBRARIES += libvirt_driver_xen_impl.la
libvirt_driver_xen_la_SOURCES =
libvirt_driver_xen_la_LIBADD = libvirt_driver_xen_impl.la
1118 1119
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_xen.la
E
Eric Blake 已提交
1120
libvirt_driver_xen_la_LIBADD += ../gnulib/lib/libgnu.la
1121
libvirt_driver_xen_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1122
else ! WITH_DRIVER_MODULES
1123
noinst_LTLIBRARIES += libvirt_driver_xen.la
1124 1125
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_xen.la
1126
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1127

1128
libvirt_driver_xen_impl_la_CFLAGS =				\
1129
		$(XEN_CFLAGS)					\
1130 1131 1132
		-I$(srcdir)/access				\
		-I$(srcdir)/conf				\
		-I$(srcdir)/xenconfig				\
1133
		$(AM_CFLAGS)
E
Eric Blake 已提交
1134 1135 1136
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)
1137
endif WITH_XEN
1138

1139 1140
if WITH_PHYP
noinst_LTLIBRARIES += libvirt_driver_phyp.la
1141
libvirt_la_BUILT_LIBADD += libvirt_driver_phyp.la
1142 1143
libvirt_driver_phyp_la_LIBADD = $(SSH2_LIBS)
libvirt_driver_phyp_la_CFLAGS = $(SSH2_CFLAGS) \
1144
		-I$(srcdir)/conf $(AM_CFLAGS)
1145
libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES)
1146
endif WITH_PHYP
1147

1148
if WITH_OPENVZ
1149
noinst_LTLIBRARIES += libvirt_driver_openvz.la
1150
libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la
1151
libvirt_driver_openvz_la_CFLAGS = \
1152
		-I$(srcdir)/conf $(AM_CFLAGS)
1153
libvirt_driver_openvz_la_SOURCES = $(OPENVZ_DRIVER_SOURCES)
1154
endif WITH_OPENVZ
1155

1156 1157 1158 1159
if WITH_VMWARE
noinst_LTLIBRARIES += libvirt_driver_vmware.la
libvirt_la_BUILT_LIBADD += libvirt_driver_vmware.la
libvirt_driver_vmware_la_CFLAGS = \
1160
		-I$(srcdir)/conf -I$(srcdir)/vmx $(AM_CFLAGS)
1161
libvirt_driver_vmware_la_SOURCES = $(VMWARE_DRIVER_SOURCES)
1162
endif WITH_VMWARE
1163

1164
if WITH_VBOX
M
Michal Privoznik 已提交
1165
noinst_LTLIBRARIES += \
1166
		libvirt_driver_vbox_impl.la
1167 1168 1169
libvirt_driver_vbox_la_SOURCES =
libvirt_driver_vbox_la_LIBADD = libvirt_driver_vbox_impl.la
if WITH_DRIVER_MODULES
M
Michal Privoznik 已提交
1170
mod_LTLIBRARIES += \
1171
		libvirt_driver_vbox.la
1172
libvirt_driver_vbox_la_LIBADD += ../gnulib/lib/libgnu.la
1173
libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1174
else ! WITH_DRIVER_MODULES
1175
noinst_LTLIBRARIES += libvirt_driver_vbox.la
1176 1177 1178
# GPLv2-only license requries that it be linked into
# libvirtd and *not* libvirt.so
#libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la
1179
endif ! WITH_DRIVER_MODULES
1180 1181

libvirt_driver_vbox_impl_la_CFLAGS =				\
1182 1183
		-I$(srcdir)/conf				\
		$(AM_CFLAGS)					\
M
Michal Privoznik 已提交
1184
		-DVBOX_DRIVER
1185
libvirt_driver_vbox_impl_la_LDFLAGS = $(AM_LDFLAGS)
1186 1187 1188
libvirt_driver_vbox_impl_la_LIBADD =  $(DLOPEN_LIBS)		\
		$(MSCOM_LIBS)					\
		$(LIBXML_LIBS)
1189
libvirt_driver_vbox_impl_la_SOURCES = $(VBOX_DRIVER_SOURCES)
1190
endif WITH_VBOX
1191

1192 1193
if WITH_XENAPI
noinst_LTLIBRARIES += libvirt_driver_xenapi.la
1194
libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la
1195
libvirt_driver_xenapi_la_CFLAGS = $(LIBXENSERVER_CFLAGS) $(CURL_CFLAGS) \
1196
		-I$(srcdir)/conf $(AM_CFLAGS)
1197
libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS)
1198
libvirt_driver_xenapi_la_LIBADD = $(LIBXENSERVER_LIBS) $(CURL_LIBS)
1199
libvirt_driver_xenapi_la_SOURCES = $(XENAPI_DRIVER_SOURCES)
1200
endif WITH_XENAPI
1201

J
Jim Fehlig 已提交
1202
if WITH_LIBXL
E
Eric Blake 已提交
1203 1204 1205
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 已提交
1206 1207
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_libxl.la
E
Eric Blake 已提交
1208
libvirt_driver_libxl_la_LIBADD += ../gnulib/lib/libgnu.la
1209
libvirt_driver_libxl_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1210
else ! WITH_DRIVER_MODULES
J
Jim Fehlig 已提交
1211 1212 1213
noinst_LTLIBRARIES += libvirt_driver_libxl.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_libxl.la
1214
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1215

1216 1217
libvirt_driver_libxl_impl_la_CFLAGS = 		\
		$(LIBXL_CFLAGS)			\
1218 1219 1220
		-I$(srcdir)/access	\
		-I$(srcdir)/conf	\
		-I$(srcdir)/xenconfig	\
1221
		$(AM_CFLAGS)
E
Eric Blake 已提交
1222
libvirt_driver_libxl_impl_la_LDFLAGS = $(AM_LDFLAGS)
J
Jim Fehlig 已提交
1223
libvirt_driver_libxl_impl_la_LIBADD = $(LIBXL_LIBS) libvirt_xenconfig.la
E
Eric Blake 已提交
1224
libvirt_driver_libxl_impl_la_SOURCES = $(LIBXL_DRIVER_SOURCES)
1225 1226 1227 1228 1229 1230

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

1231
endif WITH_LIBXL
1232 1233
EXTRA_DIST += libxl/libxl.conf libxl/libvirtd_libxl.aug \
		libxl/test_libvirtd_libxl.aug.in
J
Jim Fehlig 已提交
1234

1235
if WITH_QEMU
E
Eric Blake 已提交
1236 1237 1238
noinst_LTLIBRARIES += libvirt_driver_qemu_impl.la
libvirt_driver_qemu_la_SOURCES =
libvirt_driver_qemu_la_LIBADD = libvirt_driver_qemu_impl.la
1239 1240
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_qemu.la
E
Eric Blake 已提交
1241
libvirt_driver_qemu_la_LIBADD += ../gnulib/lib/libgnu.la
1242
libvirt_driver_qemu_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1243
else ! WITH_DRIVER_MODULES
1244
noinst_LTLIBRARIES += libvirt_driver_qemu.la
1245
# Stateful, so linked to daemon instead
1246
#libvirt_la_BUILT_LIBADD += libvirt_driver_qemu.la
1247
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1248

1249 1250 1251
libvirt_driver_qemu_impl_la_CFLAGS = \
		$(GNUTLS_CFLAGS) \
		$(LIBNL_CFLAGS) \
1252 1253
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1254
		$(AM_CFLAGS)
E
Eric Blake 已提交
1255
libvirt_driver_qemu_impl_la_LDFLAGS = $(AM_LDFLAGS)
1256
libvirt_driver_qemu_impl_la_LIBADD = $(CAPNG_LIBS) \
1257
                                $(GNUTLS_LIBS) \
1258 1259 1260
				$(LIBNL_LIBS) \
				$(LIBXML_LIBS) \
				$(NULL)
E
Eric Blake 已提交
1261
libvirt_driver_qemu_impl_la_SOURCES = $(QEMU_DRIVER_SOURCES)
1262

A
Amy Griffis 已提交
1263
conf_DATA += qemu/qemu.conf
1264

1265
augeas_DATA += qemu/libvirtd_qemu.aug
1266 1267
augeastest_DATA += test_libvirtd_qemu.aug
CLEANFILES += test_libvirtd_qemu.aug
1268

1269
endif WITH_QEMU
1270
EXTRA_DIST += qemu/qemu.conf qemu/libvirtd_qemu.aug \
1271
		qemu/test_libvirtd_qemu.aug.in qemu/THREADS.txt
1272

1273 1274

if WITH_LXC
E
Eric Blake 已提交
1275 1276 1277
noinst_LTLIBRARIES += libvirt_driver_lxc_impl.la
libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = libvirt_driver_lxc_impl.la
1278 1279
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_lxc.la
E
Eric Blake 已提交
1280 1281
libvirt_driver_lxc_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_lxc_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1282
else ! WITH_DRIVER_MODULES
1283
noinst_LTLIBRARIES += libvirt_driver_lxc.la
1284
# Stateful, so linked to daemon instead
1285
#libvirt_la_BUILT_LIBADD += libvirt_driver_lxc.la
1286
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1287 1288

libvirt_driver_lxc_impl_la_CFLAGS = \
S
Serge Hallyn 已提交
1289
		$(LIBNL_CFLAGS) \
G
Gao feng 已提交
1290
		$(FUSE_CFLAGS) \
1291 1292
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1293
		$(AM_CFLAGS)
G
Gao feng 已提交
1294
libvirt_driver_lxc_impl_la_LIBADD = $(CAPNG_LIBS) $(LIBNL_LIBS) $(FUSE_LIBS)
1295
if WITH_BLKID
E
Eric Blake 已提交
1296 1297
libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS)
1298
endif WITH_BLKID
1299
libvirt_driver_lxc_impl_la_LIBADD += $(SECDRIVER_LIBS)
E
Eric Blake 已提交
1300
libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES)
A
Amy Griffis 已提交
1301 1302 1303

conf_DATA += lxc/lxc.conf

1304
augeas_DATA += lxc/libvirtd_lxc.aug
1305 1306
augeastest_DATA += test_libvirtd_lxc.aug
CLEANFILES += test_libvirtd_lxc.aug
1307

1308
endif WITH_LXC
1309
EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in
1310

1311
if WITH_UML
E
Eric Blake 已提交
1312 1313 1314
noinst_LTLIBRARIES += libvirt_driver_uml_impl.la
libvirt_driver_uml_la_SOURCES =
libvirt_driver_uml_la_LIBADD = libvirt_driver_uml_impl.la
1315 1316
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_uml.la
E
Eric Blake 已提交
1317
libvirt_driver_uml_la_LIBADD += ../gnulib/lib/libgnu.la
1318
libvirt_driver_uml_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1319
else ! WITH_DRIVER_MODULES
1320 1321
noinst_LTLIBRARIES += libvirt_driver_uml.la
# Stateful, so linked to daemon instead
1322
#libvirt_la_BUILT_LIBADD += libvirt_driver_uml.la
1323
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1324

1325
libvirt_driver_uml_impl_la_CFLAGS = \
1326 1327
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1328
		$(AM_CFLAGS)
E
Eric Blake 已提交
1329
libvirt_driver_uml_impl_la_LDFLAGS = $(AM_LDFLAGS)
1330
# libvirt_driver_uml_impl_la_LIBADD =
E
Eric Blake 已提交
1331
libvirt_driver_uml_impl_la_SOURCES = $(UML_DRIVER_SOURCES)
1332
endif WITH_UML
1333

D
Daniel Veillard 已提交
1334

1335
BUILT_SOURCES += $(ESX_DRIVER_GENERATED)
D
Daniel Veillard 已提交
1336

1337 1338
ESX_GENERATED_STAMP = .esx_vi_generator.stamp

E
Eric Blake 已提交
1339 1340
EXTRA_DIST += $(ESX_GENERATED_STAMP)

1341 1342 1343
$(ESX_DRIVER_GENERATED): $(ESX_GENERATED_STAMP)

$(ESX_GENERATED_STAMP): $(srcdir)/esx/esx_vi_generator.input \
1344
                         $(srcdir)/esx/esx_vi_generator.py
1345 1346 1347 1348 1349
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/esx/esx_vi_generator.py \
	  && touch $@

MAINTAINERCLEANFILES += $(ESX_DRIVER_GENERATED) $(ESX_GENERATED_STAMP)

D
Daniel Veillard 已提交
1350

1351 1352
if WITH_ESX
noinst_LTLIBRARIES += libvirt_driver_esx.la
1353
libvirt_la_BUILT_LIBADD += libvirt_driver_esx.la
1354
libvirt_driver_esx_la_CFLAGS = $(CURL_CFLAGS) \
1355
		-I$(srcdir)/conf -I$(srcdir)/vmx $(AM_CFLAGS)
1356
libvirt_driver_esx_la_LDFLAGS = $(AM_LDFLAGS)
1357
libvirt_driver_esx_la_LIBADD = $(CURL_LIBS)
1358
libvirt_driver_esx_la_SOURCES = $(ESX_DRIVER_SOURCES)
1359
libvirt_driver_esx_la_DEPENDENCIES = $(ESX_DRIVER_GENERATED)
1360
endif WITH_ESX
1361

M
Matthias Bolte 已提交
1362

1363 1364
BUILT_SOURCES += $(HYPERV_DRIVER_GENERATED)

1365 1366
HYPERV_GENERATED_STAMP = .hyperv_wmi_generator.stamp

E
Eric Blake 已提交
1367 1368
EXTRA_DIST += $(HYPERV_GENERATED_STAMP)

1369 1370 1371
$(HYPERV_DRIVER_GENERATED): $(HYPERV_GENERATED_STAMP)

$(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \
1372
                            $(srcdir)/hyperv/hyperv_wmi_generator.py
1373 1374
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) \
	  $(srcdir)/hyperv/hyperv_wmi_generator.py \
1375 1376 1377
	  && touch $@

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

M
Matthias Bolte 已提交
1379 1380 1381 1382
if WITH_HYPERV
noinst_LTLIBRARIES += libvirt_driver_hyperv.la
libvirt_la_BUILT_LIBADD += libvirt_driver_hyperv.la
libvirt_driver_hyperv_la_CFLAGS = $(OPENWSMAN_CFLAGS) \
1383
		-I$(srcdir)/conf $(AM_CFLAGS)
M
Matthias Bolte 已提交
1384 1385 1386
libvirt_driver_hyperv_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_hyperv_la_LIBADD = $(OPENWSMAN_LIBS)
libvirt_driver_hyperv_la_SOURCES = $(HYPERV_DRIVER_SOURCES)
1387
endif WITH_HYPERV
M
Matthias Bolte 已提交
1388

D
Dmitry Guryanov 已提交
1389 1390 1391 1392
if WITH_PARALLELS
noinst_LTLIBRARIES += libvirt_driver_parallels.la
libvirt_la_BUILT_LIBADD += libvirt_driver_parallels.la
libvirt_driver_parallels_la_CFLAGS = \
1393
		-I$(srcdir)/conf $(AM_CFLAGS) \
1394 1395
		$(PARALLELS_SDK_CFLAGS) $(LIBNL_CFLAGS)
libvirt_driver_parallels_la_LIBADD = $(PARALLELS_SDK_LIBS) $(LIBNL_LIBS)
D
Dmitry Guryanov 已提交
1396
libvirt_driver_parallels_la_SOURCES = $(PARALLELS_DRIVER_SOURCES)
1397
endif WITH_PARALLELS
D
Dmitry Guryanov 已提交
1398

R
Roman Bogorodskiy 已提交
1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411
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 = \
1412 1413
	-I$(srcdir)/access \
	-I$(srcdir)/conf \
R
Roman Bogorodskiy 已提交
1414 1415 1416 1417 1418
	$(AM_CFLAGS)
libvirt_driver_bhyve_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_bhyve_impl_la_SOURCES = $(BHYVE_DRIVER_SOURCES)
endif WITH_BHYVE

1419
if WITH_NETWORK
E
Eric Blake 已提交
1420 1421 1422
noinst_LTLIBRARIES += libvirt_driver_network_impl.la
libvirt_driver_network_la_SOURCES =
libvirt_driver_network_la_LIBADD = libvirt_driver_network_impl.la
1423 1424
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_network.la
1425 1426 1427 1428
libvirt_driver_network_la_LIBADD += ../gnulib/lib/libgnu.la \
	$(LIBNL_LIBS) \
	$(DBUS_LIBS) \
	$(NULL)
E
Eric Blake 已提交
1429
libvirt_driver_network_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1430
else ! WITH_DRIVER_MODULES
1431
noinst_LTLIBRARIES += libvirt_driver_network.la
1432
# Stateful, so linked to daemon instead
1433
#libvirt_la_BUILT_LIBADD += libvirt_driver_network.la
1434
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1435 1436

libvirt_driver_network_impl_la_CFLAGS = \
1437 1438
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1439 1440
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1441
		$(AM_CFLAGS)
E
Eric Blake 已提交
1442
libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
1443
libvirt_driver_network_impl_la_LIBADD  = $(DBUS_LIBS)
1444
endif WITH_NETWORK
1445 1446 1447
EXTRA_DIST += network/default.xml


1448
if WITH_INTERFACE
1449 1450
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_interface.la
1451
else ! WITH_DRIVER_MODULES
1452
noinst_LTLIBRARIES += libvirt_driver_interface.la
1453 1454
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_interface.la
1455
endif ! WITH_DRIVER_MODULES
1456
libvirt_driver_interface_la_CFLAGS = \
1457 1458
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1459
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1460
libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS)
1461 1462 1463 1464
libvirt_driver_interface_la_LIBADD =
if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
1465
endif WITH_NETCF
1466
if WITH_UDEV
1467 1468
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
1469
endif WITH_UDEV
1470
if WITH_DRIVER_MODULES
1471
libvirt_driver_interface_la_LIBADD += ../gnulib/lib/libgnu.la
1472
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
1473
endif WITH_DRIVER_MODULES
1474
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
1475
endif WITH_INTERFACE
D
Daniel Veillard 已提交
1476

D
Daniel P. Berrange 已提交
1477
if WITH_SECRETS
1478 1479
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_secret.la
1480
else ! WITH_DRIVER_MODULES
1481
noinst_LTLIBRARIES += libvirt_driver_secret.la
1482
# Stateful, so linked to daemon instead
1483
#libvirt_la_BUILT_LIBADD += libvirt_driver_secret.la
1484
endif ! WITH_DRIVER_MODULES
1485
libvirt_driver_secret_la_CFLAGS = \
1486 1487
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1488
		$(AM_CFLAGS)
1489
if WITH_DRIVER_MODULES
1490
libvirt_driver_secret_la_LIBADD = ../gnulib/lib/libgnu.la
1491
libvirt_driver_secret_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1492
endif WITH_DRIVER_MODULES
1493
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
1494
endif WITH_SECRETS
1495

1496
# Needed to keep automake quiet about conditionals
1497 1498
libvirt_driver_storage_impl_la_SOURCES =
libvirt_driver_storage_impl_la_CFLAGS = \
1499 1500
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1501
		$(AM_CFLAGS)
1502 1503
libvirt_driver_storage_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_storage_impl_la_LIBADD =
1504
libvirt_driver_storage_impl_la_LIBADD += $(SECDRIVER_LIBS) $(LIBXML_LIBS)
1505
if WITH_BLKID
1506 1507
libvirt_driver_storage_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(BLKID_LIBS)
1508
endif WITH_BLKID
1509
if WITH_STORAGE
1510 1511 1512
noinst_LTLIBRARIES += libvirt_driver_storage_impl.la
libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_LIBADD = libvirt_driver_storage_impl.la
1513 1514
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_storage.la
1515
libvirt_driver_storage_la_LIBADD += ../gnulib/lib/libgnu.la
1516
libvirt_driver_storage_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1517
else ! WITH_DRIVER_MODULES
1518
noinst_LTLIBRARIES += libvirt_driver_storage.la
1519
# Stateful, so linked to daemon instead
1520
#libvirt_la_BUILT_LIBADD += libvirt_driver_storage.la
1521
endif ! WITH_DRIVER_MODULES
1522 1523
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_FS_SOURCES)
1524
endif WITH_STORAGE
1525

1526
if WITH_STORAGE_LVM
1527
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_LVM_SOURCES)
1528
endif WITH_STORAGE_LVM
1529

1530
if WITH_STORAGE_ISCSI
1531
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_ISCSI_SOURCES)
1532
endif WITH_STORAGE_ISCSI
1533

1534
if WITH_STORAGE_SCSI
1535
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SCSI_SOURCES)
1536
endif WITH_STORAGE_SCSI
1537

D
Dave Allan 已提交
1538
if WITH_STORAGE_MPATH
1539 1540 1541
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)
1542
endif WITH_STORAGE_MPATH
D
Dave Allan 已提交
1543

1544
if WITH_STORAGE_DISK
1545
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_DISK_SOURCES)
1546
endif WITH_STORAGE_DISK
1547

1548
if WITH_STORAGE_RBD
1549 1550
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_RBD_SOURCES)
libvirt_driver_storage_impl_la_LIBADD += $(LIBRBD_LIBS)
1551
endif WITH_STORAGE_RBD
1552

1553
if WITH_STORAGE_SHEEPDOG
1554
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SHEEPDOG_SOURCES)
1555
endif WITH_STORAGE_SHEEPDOG
1556

1557 1558 1559 1560 1561 1562
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 已提交
1563 1564 1565 1566
if WITH_STORAGE_ZFS
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_ZFS_SOURCES)
endif WITH_STORAGE_ZFS

1567 1568 1569 1570
if WITH_NODE_DEVICES
# Needed to keep automake quiet about conditionals
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nodedev.la
1571
else ! WITH_DRIVER_MODULES
1572 1573
noinst_LTLIBRARIES += libvirt_driver_nodedev.la
# Stateful, so linked to daemon instead
1574
#libvirt_la_BUILT_LIBADD += libvirt_driver_nodedev.la
1575
endif ! WITH_DRIVER_MODULES
1576 1577
libvirt_driver_nodedev_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES)

1578
libvirt_driver_nodedev_la_CFLAGS = \
1579 1580
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1581
		$(AM_CFLAGS) $(LIBNL_CFLAGS)
1582
libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS)
1583
libvirt_driver_nodedev_la_LIBADD =
1584

D
Doug Goldstein 已提交
1585
if WITH_LIBVIRTD
1586
if WITH_HAL
1587 1588
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS)
1589
libvirt_driver_nodedev_la_LIBADD += $(HAL_LIBS)
1590
endif WITH_HAL
1591
if WITH_UDEV
1592
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES)
1593
libvirt_driver_nodedev_la_CFLAGS += $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS)
1594
libvirt_driver_nodedev_la_LIBADD += $(UDEV_LIBS) $(PCIACCESS_LIBS)
1595 1596
endif WITH_UDEV
endif WITH_LIBVIRTD
1597 1598

if WITH_DRIVER_MODULES
1599
libvirt_driver_nodedev_la_LIBADD += ../gnulib/lib/libgnu.la
1600
libvirt_driver_nodedev_la_LDFLAGS += -module -avoid-version
1601 1602
endif WITH_DRIVER_MODULES
endif WITH_NODE_DEVICES
1603 1604


1605
if WITH_NWFILTER
1606 1607 1608
noinst_LTLIBRARIES += libvirt_driver_nwfilter_impl.la
libvirt_driver_nwfilter_la_SOURCES =
libvirt_driver_nwfilter_la_LIBADD = libvirt_driver_nwfilter_impl.la
1609 1610
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nwfilter.la
1611
libvirt_driver_nwfilter_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1612
else ! WITH_DRIVER_MODULES
1613
noinst_LTLIBRARIES += libvirt_driver_nwfilter.la
1614 1615
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_nwfilter.la
1616
endif ! WITH_DRIVER_MODULES
1617
libvirt_driver_nwfilter_impl_la_CFLAGS = \
1618 1619 1620
		$(LIBPCAP_CFLAGS) \
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
1621 1622
		-I$(srcdir)/access \
		-I$(srcdir)/conf \
1623
		$(AM_CFLAGS)
1624 1625 1626 1627 1628
libvirt_driver_nwfilter_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_nwfilter_impl_la_LIBADD = \
		$(LIBPCAP_LIBS) \
		$(LIBNL_LIBS) \
		$(DBUS_LIBS)
1629
if WITH_DRIVER_MODULES
1630 1631
libvirt_driver_nwfilter_impl_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_nwfilter_impl_la_LDFLAGS += -module -avoid-version
1632
endif WITH_DRIVER_MODULES
1633
libvirt_driver_nwfilter_impl_la_SOURCES = $(NWFILTER_DRIVER_SOURCES)
1634
endif WITH_NWFILTER
1635 1636


1637 1638 1639 1640
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 = \
1641
		-I$(srcdir)/conf $(AM_CFLAGS)
1642
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
1643
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
1644
if WITH_SECDRIVER_SELINUX
1645 1646
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
1647
endif WITH_SECDRIVER_SELINUX
J
Jamie Strandboge 已提交
1648
if WITH_SECDRIVER_APPARMOR
1649 1650
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
1651
endif WITH_SECDRIVER_APPARMOR
1652

1653 1654
libvirt_driver_access_la_SOURCES = \
	$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
1655 1656 1657
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
1658
		-I$(srcdir)/conf $(AM_CFLAGS)
1659 1660 1661
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD =

1662 1663
EXTRA_DIST += access/genpolkit.pl

1664 1665 1666 1667
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
    $(srcdir)/access/genpolkit.pl Makefile.am
	$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@

1668 1669 1670 1671
if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)

polkitactiondir = $(datadir)/polkit-1/actions
1672
if WITH_LIBVIRTD
1673
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
1674
endif WITH_LIBVIRTD
1675 1676 1677

CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
1678
else ! WITH_POLKIT1
1679
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
1680
endif ! WITH_POLKIT1
1681

1682

1683 1684
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698

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

1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711
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 已提交
1712
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
1713 1714
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1715 1716 1717
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
1718 1719
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1720 1721
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
	  > $(srcdir)/access/viraccessapicheck.c
1722

E
Eric Blake 已提交
1723
access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
1724 1725
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1726 1727 1728
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheckqemu.h
access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
1729 1730
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1731 1732
	  qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h \
	  > $(srcdir)/access/viraccessapicheckqemu.c
1733

E
Eric Blake 已提交
1734
access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
1735 1736
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1737 1738 1739
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/access/viraccessapichecklxc.h
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
1740 1741
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1742 1743
	  lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \
	  > $(srcdir)/access/viraccessapichecklxc.c
1744

1745 1746 1747 1748 1749 1750 1751
# Add all conditional sources just in case...
EXTRA_DIST +=							\
		$(TEST_DRIVER_SOURCES)				\
		$(REMOTE_DRIVER_SOURCES)			\
		$(XEN_DRIVER_SOURCES)				\
		$(QEMU_DRIVER_SOURCES)				\
		$(LXC_DRIVER_SOURCES)				\
1752
		$(UML_DRIVER_SOURCES)				\
1753
		$(OPENVZ_DRIVER_SOURCES)			\
1754
		$(PHYP_DRIVER_SOURCES)				\
1755
		$(VBOX_DRIVER_SOURCES)				\
1756
		$(XENAPI_DRIVER_SOURCES)			\
O
Osier Yang 已提交
1757
		$(LIBXL_DRIVER_SOURCES)				\
1758
		$(ESX_DRIVER_SOURCES)				\
1759
		$(ESX_DRIVER_EXTRA_DIST)			\
M
Matthias Bolte 已提交
1760
		$(HYPERV_DRIVER_SOURCES)			\
1761
		$(HYPERV_DRIVER_EXTRA_DIST)			\
O
Osier Yang 已提交
1762
		$(PARALLELS_DRIVER_SOURCES)			\
R
Roman Bogorodskiy 已提交
1763
		$(BHYVE_DRIVER_SOURCES)				\
1764
		$(NETWORK_DRIVER_SOURCES)			\
1765
		$(INTERFACE_DRIVER_SOURCES)			\
1766 1767 1768 1769
		$(STORAGE_DRIVER_SOURCES)			\
		$(STORAGE_DRIVER_FS_SOURCES)			\
		$(STORAGE_DRIVER_LVM_SOURCES)			\
		$(STORAGE_DRIVER_ISCSI_SOURCES)			\
1770
		$(STORAGE_DRIVER_SCSI_SOURCES)			\
D
Dave Allan 已提交
1771
		$(STORAGE_DRIVER_MPATH_SOURCES)			\
1772
		$(STORAGE_DRIVER_DISK_SOURCES)			\
1773
		$(STORAGE_DRIVER_RBD_SOURCES)			\
1774
		$(STORAGE_DRIVER_SHEEPDOG_SOURCES)		\
1775
		$(STORAGE_DRIVER_GLUSTER_SOURCES)		\
R
Roman Bogorodskiy 已提交
1776
		$(STORAGE_DRIVER_ZFS_SOURCES)			\
1777 1778
		$(NODE_DEVICE_DRIVER_SOURCES)			\
		$(NODE_DEVICE_DRIVER_HAL_SOURCES)		\
1779
		$(NODE_DEVICE_DRIVER_UDEV_SOURCES)		\
1780
		$(NWFILTER_DRIVER_SOURCES)			\
1781
		$(SECURITY_DRIVER_SELINUX_SOURCES)		\
J
Jamie Strandboge 已提交
1782
		$(SECURITY_DRIVER_APPARMOR_SOURCES)		\
D
Daniel P. Berrange 已提交
1783
		$(SECRET_DRIVER_SOURCES)			\
1784
		$(VBOX_DRIVER_EXTRA_DIST)			\
1785
		$(VMWARE_DRIVER_SOURCES)			\
J
Jim Fehlig 已提交
1786
		$(XENCONFIG_SOURCES)				\
1787
		$(ACCESS_DRIVER_POLKIT_POLICY)
1788

1789 1790
check-local: check-augeas

1791 1792 1793 1794 1795
.PHONY: check-augeas \
	check-augeas-qemu \
	check-augeas-lxc \
	check-augeas-sanlock \
	check-augeas-lockd \
1796
	check-augeas-libxl \
1797
	$(NULL)
1798

1799
check-augeas: check-augeas-qemu check-augeas-lxc check-augeas-sanlock \
1800
	check-augeas-lockd check-augeas-virtlockd check-augeas-libxl
1801

1802
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
1803
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
1804

1805
if WITH_QEMU
1806 1807
test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
		$(srcdir)/qemu/qemu.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1808
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
1809

1810
check-augeas-qemu: test_libvirtd_qemu.aug
1811
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1812
	    '$(AUGPARSE)' -I $(srcdir)/qemu test_libvirtd_qemu.aug; \
1813
	fi
1814
else ! WITH_QEMU
1815
check-augeas-qemu:
1816
endif ! WITH_QEMU
1817

1818
if WITH_LXC
1819 1820
test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
		$(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1821
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
1822

1823
check-augeas-lxc: test_libvirtd_lxc.aug
1824
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1825
	    '$(AUGPARSE)' -I $(srcdir)/lxc test_libvirtd_lxc.aug; \
1826
	fi
1827
else ! WITH_LXC
1828
check-augeas-lxc:
1829
endif ! WITH_LXC
1830

1831
if WITH_SANLOCK
1832 1833
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1834
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
1835

1836
check-augeas-sanlock: test_libvirt_sanlock.aug
1837
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1838
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
1839
	fi
1840
else ! WITH_SANLOCK
1841
check-augeas-sanlock:
1842
endif ! WITH_SANLOCK
1843

1844
if WITH_QEMU
1845 1846 1847
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 $< $@
1848 1849 1850
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
1851

1852 1853
test_virtlockd.aug: locking/test_virtlockd.aug.in \
		locking/virtlockd.conf $(AUG_GENTEST)
1854
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
1855

1856
if WITH_QEMU
1857 1858 1859 1860
check-augeas-lockd: test_libvirt_lockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_lockd.aug; \
	fi
1861 1862 1863
else ! WITH_QEMU
check-augeas-lockd:
endif ! WITH_QEMU
1864

1865 1866 1867 1868 1869
check-augeas-virtlockd: test_virtlockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
	fi

1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882
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

1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901
#
# 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.
#

1902
if WITH_DRIVER_MODULES
1903
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
1904
else ! WITH_DRIVER_MODULES
1905
SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
1906
endif ! WITH_DRIVER_MODULES
1907

1908
if WITH_LINUX
1909
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
1910
else ! WITH_LINUX
1911
SYM_FILES += $(srcdir)/libvirt_linux.syms
1912
endif ! WITH_LINUX
1913

1914
if WITH_ESX
1915
USED_SYM_FILES += $(srcdir)/libvirt_esx.syms
1916
else ! WITH_ESX
1917
SYM_FILES += $(srcdir)/libvirt_esx.syms
1918
endif ! WITH_ESX
1919

E
Eric Blake 已提交
1920 1921 1922 1923 1924 1925
if WITH_REMOTE
USED_SYM_FILES += $(srcdir)/libvirt_remote.syms
else ! WITH_REMOTE
SYM_FILES += $(srcdir)/libvirt_remote.syms
endif ! WITH_REMOTE

1926
if WITH_OPENVZ
1927
USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms
1928
else ! WITH_OPENVZ
1929
SYM_FILES += $(srcdir)/libvirt_openvz.syms
1930
endif ! WITH_OPENVZ
1931

1932
if WITH_VMX
1933
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
1934
else ! WITH_VMX
1935
SYM_FILES += $(srcdir)/libvirt_vmx.syms
1936
endif ! WITH_VMX
1937

1938 1939 1940 1941 1942 1943
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 已提交
1944 1945 1946 1947 1948
if WITH_XENCONFIG
USED_SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
else ! WITH_XENCONFIG
SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
endif ! WITH_XENCONFIG
1949

1950 1951 1952 1953 1954 1955
if WITH_LIBXL
USED_SYM_FILES += $(srcdir)/libvirt_xenxlconfig.syms
else ! WITH_LIBXL
SYM_FILES += $(srcdir)/libvirt_xenxlconfig.syms
endif ! WITH_LIBXL

1956
if WITH_SASL
1957
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
1958
else ! WITH_SASL
1959
SYM_FILES += $(srcdir)/libvirt_sasl.syms
1960
endif ! WITH_SASL
E
Eric Blake 已提交
1961

1962 1963
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
1964
else ! WITH_GNUTLS
1965
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
1966
endif ! WITH_GNUTLS
1967

1968
if WITH_SSH2
1969
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
1970
else ! WITH_SSH2
1971
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
1972
endif ! WITH_SSH2
1973

1974
if WITH_ATOMIC_OPS_PTHREAD
1975
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
1976
else ! WITH_ATOMIC_OPS_PTHREAD
1977
SYM_FILES += $(srcdir)/libvirt_atomic.syms
1978
endif ! WITH_ATOMIC_OPS_PTHREAD
1979

1980
EXTRA_DIST += \
1981 1982 1983 1984 1985
	libvirt_public.syms		\
	libvirt_lxc.syms		\
	libvirt_qemu.syms		\
	$(SYM_FILES)			\
	$(NULL)
1986

1987
BUILT_SOURCES += $(GENERATED_SYM_FILES)
1988

1989 1990
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(ACCESS_DRIVER_SYM_FILES) \
1991
		$(top_builddir)/config.status
1992 1993 1994 1995 1996 1997
	$(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 && \
1998
	cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
1999 2000
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
2001
	mv $@-tmp libvirt.syms
2002

2003 2004 2005
libvirt.def: libvirt.syms
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
2006 2007
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d'	\
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
2008 2009 2010
	chmod a-w $@-tmp && \
	mv $@-tmp libvirt.def

2011 2012 2013
libvirt_qemu.def: $(srcdir)/libvirt_qemu.syms
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
2014 2015
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d'	\
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
2016 2017 2018
	chmod a-w $@-tmp && \
	mv $@-tmp libvirt_qemu.def

2019 2020 2021
libvirt_lxc.def: $(srcdir)/libvirt_lxc.syms
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
2022 2023
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d'	\
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
2024 2025 2026
	chmod a-w $@-tmp && \
	mv $@-tmp libvirt_lxc.def

2027 2028
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
2029 2030 2031 2032 2033 2034 2035 2036
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)
2037
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
2038
libvirt_la_LIBADD += \
2039
		    $(DRIVER_MODULE_LIBS) \
2040
		    $(CYGWIN_EXTRA_LIBADD)
2041
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
2042 2043 2044 2045 2046 2047
# 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)
2048

2049
if WITH_DTRACE_PROBES
2050
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
2051
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
2052
nodist_libvirt_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2053
if WITH_REMOTE
E
Eric Blake 已提交
2054
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
2055
endif WITH_REMOTE
2056 2057
if WITH_DRIVER_MODULES
DTRACE2SYSTEMTAP_FLAGS = --with-modules
2058
endif WITH_DRIVER_MODULES
2059

2060 2061 2062
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

if WITH_QEMU
2063
libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.lo
2064
nodist_libvirt_driver_qemu_la_SOURCES = libvirt_qemu_probes.h
2065
BUILT_SOURCES += libvirt_qemu_probes.h
2066
endif WITH_QEMU
2067 2068

tapsetdir = $(datadir)/systemtap/tapset
2069
tapset_DATA = libvirt_probes.stp libvirt_qemu_probes.stp libvirt_functions.stp
2070

2071
%_probes.h: %_probes.d
2072 2073
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

E
Eric Blake 已提交
2074
.PRECIOUS: %_probes.o
2075
%_probes.o: %_probes.d
2076 2077
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

2078 2079 2080 2081 2082 2083 2084 2085 2086
%_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 已提交
2087
# Keep this list synced with PROTOCOL_STRUCTS
J
Jiri Denemark 已提交
2088 2089 2090
RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
2091
		  $(srcdir)/remote/lxc_protocol.x \
2092 2093 2094
		  $(srcdir)/remote/qemu_protocol.x \
		  $(srcdir)/lxc/lxc_monitor_protocol.x \
		  $(srcdir)/locking/lock_protocol.x
2095 2096

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

2099 2100
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl \
		$(top_builddir)/config.status
2101
	$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
2102
	  $(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
2103

2104
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
2105
              libvirt_qemu_probes.h libvirt_qemu_probes.o \
2106
              libvirt_qemu_probes.lo\
2107 2108
              libvirt_functions.stp libvirt_probes.stp \
              libvirt_qemu_probes.stp
2109
endif WITH_DTRACE_PROBES
2110

2111
EXTRA_DIST += libvirt_probes.d libvirt_qemu_probes.d
2112

C
Chris Lalancette 已提交
2113
libvirt_qemu_la_SOURCES = libvirt-qemu.c
D
Daniel P. Berrange 已提交
2114 2115 2116 2117 2118 2119 2120
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)
2121
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
C
Chris Lalancette 已提交
2122
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
2123

2124
libvirt_lxc_la_SOURCES = libvirt-lxc.c
D
Daniel P. Berrange 已提交
2125 2126 2127 2128 2129 2130 2131
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)
2132 2133 2134
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)

2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146
# 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			\
2147 2148
		util/viratomic.c		\
		util/viratomic.h		\
2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168
		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		\
2169
		util/virthreadjob.c		\
2170 2171 2172 2173 2174
		util/virtypedparam.c		\
		util/viruri.c			\
		util/virutil.c			\
		util/viruuid.c			\
		conf/domain_event.c		\
2175
		conf/network_event.c		\
2176
		conf/object_event.c		\
2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192
		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			\
2193
		libvirt-domain.c		\
2194
		libvirt-domain-snapshot.c	\
2195
		libvirt-host.c			\
2196
		libvirt-interface.c		\
2197
		libvirt-network.c		\
2198
		libvirt-nodedev.c		\
2199
		libvirt-nwfilter.c		\
2200
		libvirt-secret.c		\
2201
		libvirt-storage.c		\
2202
		libvirt-stream.c		\
2203 2204 2205 2206 2207 2208
		libvirt-lxc.c			\
		$(NULL)

libvirt_setuid_rpc_client_la_LDFLAGS =		\
		$(AM_LDFLAGS)			\
		$(LIBXML_LIBS)			\
J
Jim Fehlig 已提交
2209
		$(SECDRIVER_LIBS)		\
2210 2211 2212
		$(NULL)
libvirt_setuid_rpc_client_la_CFLAGS =		\
		-DLIBVIRT_SETUID_RPC_CLIENT	\
2213 2214
		-I$(srcdir)/conf		\
		-I$(srcdir)/rpc			\
2215
		$(AM_CFLAGS)			\
J
Jim Fehlig 已提交
2216
		$(SECDRIVER_CFLAGS)		\
2217 2218 2219
		$(NULL)
endif WITH_LXC

2220 2221 2222
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

2223
if WITH_LIBVIRTD
2224 2225 2226 2227 2228
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
		$(LOCK_DRIVER_LOCKD_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
		$(NULL)
2229
lockd_la_CFLAGS = -I$(srcdir)/conf \
E
Eric Blake 已提交
2230 2231
		$(XDR_CFLAGS) \
		$(AM_CFLAGS)
2232
lockd_la_LDFLAGS = -module -avoid-version
2233 2234 2235 2236
lockd_la_LIBADD = ../gnulib/lib/libgnu.la \
	libvirt-net-rpc.la \
	libvirt-net-rpc-client.la \
	$(NULL)
J
Jiri Denemark 已提交
2237
augeas_DATA += locking/libvirt_lockd.aug
2238 2239
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
2240
endif WITH_DTRACE_PROBES
2241
if WITH_QEMU
2242 2243
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
2244
nodist_conf_DATA += locking/qemu-lockd.conf
2245 2246
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
2247
endif WITH_QEMU
2248 2249 2250 2251 2252 2253

locking/%-lockd.conf: $(srcdir)/locking/lockd.conf
	$(AM_V_GEN)$(MKDIR_P) locking ; \
	cp $< $@


2254 2255
sbin_PROGRAMS = virtlockd

2256 2257 2258
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
2259
		$(LOCK_DAEMON_GENERATED) \
2260
		$(NULL)
2261 2262
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
2263
		$(PIE_CFLAGS) \
2264
		$(XDR_CFLAGS) \
2265 2266 2267
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
2268
		$(PIE_LDFLAGS) \
2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280
		$(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
2281
endif WITH_DTRACE_PROBES
2282

2283
else ! WITH_LIBVIRTD
2284 2285
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
              $(LOCK_DRIVER_LOCKD_SOURCES)
2286
endif ! WITH_LIBVIRTD
2287

J
Jiri Denemark 已提交
2288 2289 2290 2291
EXTRA_DIST += locking/virtlockd.sysconf \
	locking/lockd.conf \
	locking/libvirt_lockd.aug \
	locking/test_libvirt_lockd.aug.in
2292 2293

install-sysconfig:
E
Eric Blake 已提交
2294
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
2295 2296 2297 2298 2299
	$(INSTALL_DATA) $(srcdir)/locking/virtlockd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd

uninstall-sysconfig:
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
E
Eric Blake 已提交
2300
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
2301 2302 2303 2304 2305 2306

EXTRA_DIST += locking/virtlockd.init.in

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_RED_HAT
install-init:: virtlockd.init install-sysconfig
E
Eric Blake 已提交
2307
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
2308 2309 2310 2311
	$(INSTALL_SCRIPT) virtlockd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd

uninstall-init:: uninstall-sysconfig
E
Eric Blake 已提交
2312 2313
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
2314 2315

BUILT_SOURCES += virtlockd.init
E
Eric Blake 已提交
2316
DISTCLEANFILES += virtlockd.init
2317
else ! LIBVIRT_INIT_SCRIPT_RED_HAT
2318 2319
install-init::
uninstall-init::
2320 2321
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
else ! WITH_LIBVIRTD
2322 2323
install-init::
uninstall-init::
2324
endif ! WITH_LIBVIRTD
2325 2326

virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
2327 2328 2329 2330 2331 2332
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g'		\
	    < $< > $@-t &&					\
	    chmod a+x $@-t &&					\
2333 2334
	    mv $@-t $@

2335 2336
POD2MAN = pod2man -c "Virtualization Support" \
			-r "$(PACKAGE)-$(VERSION)" -s 8
2337

2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348
$(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 $@

2349
if WITH_LIBVIRTD
2350 2351
man8_MANS = virtlockd.8

2352 2353 2354 2355
conf_DATA += locking/virtlockd.conf

augeas_DATA += locking/virtlockd.aug
augeastest_DATA += test_virtlockd.aug
2356
endif WITH_LIBVIRTD
2357

2358
CLEANFILES += test_virtlockd.aug virtlockd.8
2359 2360 2361 2362 2363 2364 2365
MAINTAINERCLEANFILES += $(srcdir)/virtlockd.8.in

EXTRA_DIST += \
        locking/virtlockd.service.in \
        locking/virtlockd.socket.in \
        locking/virtlockd.pod.in \
        virtlockd.8.in \
2366 2367 2368
        locking/virtlockd.aug \
        locking/virtlockd.conf \
        locking/test_virtlockd.aug.in \
2369
        $(NULL)
2370

2371 2372 2373 2374

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

2375
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
2376 2377

BUILT_SOURCES += virtlockd.service virtlockd.socket
E
Eric Blake 已提交
2378
DISTCLEANFILES += virtlockd.service virtlockd.socket
2379

E
Eric Blake 已提交
2380 2381
install-systemd: virtlockd.service virtlockd.socket install-sysconfig
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
2382
	$(INSTALL_DATA) virtlockd.service \
2383
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2384
	$(INSTALL_DATA) virtlockd.socket \
2385 2386 2387
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/

uninstall-systemd: uninstall-sysconfig
E
Eric Blake 已提交
2388 2389 2390
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.socket
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
2391
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
2392 2393
install-systemd:
uninstall-systemd:
2394 2395
endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
else ! WITH_LIBVIRTD
2396 2397
install-systemd:
uninstall-systemd:
2398
endif ! WITH_LIBVIRTD
2399 2400

virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
2401 2402 2403
	$(AM_V_GEN)sed						\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    < $< > $@-t &&					\
2404 2405 2406
	    mv $@-t $@

virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
2407 2408 2409
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    < $< > $@-t &&					\
2410 2411 2412
	    mv $@-t $@


2413
if WITH_SANLOCK
2414
lockdriver_LTLIBRARIES += sanlock.la
2415
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
2416
sanlock_la_CFLAGS = -I$(srcdir)/conf $(AM_CFLAGS)
2417
sanlock_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
2418
sanlock_la_LIBADD = -lsanlock_client \
2419 2420 2421
		../gnulib/lib/libgnu.la

augeas_DATA += locking/libvirt_sanlock.aug
2422 2423
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
2424

E
Eric Blake 已提交
2425
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
2426
	$(AM_V_GEN)$(MKDIR_P) locking ; \
2427 2428 2429
	cp $< $@

if WITH_QEMU
2430
nodist_conf_DATA += locking/qemu-sanlock.conf
2431
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
2432
DISTCLEANFILES += locking/qemu-sanlock.conf
2433 2434
endif WITH_QEMU
else ! WITH_SANLOCK
2435
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
2436
endif ! WITH_SANLOCK
2437 2438
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
2439
	locking/test_libvirt_sanlock.aug.in
2440

2441 2442 2443 2444
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
2445

2446
EXTRA_DIST += \
E
Eric Blake 已提交
2447 2448 2449 2450
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
2451 2452
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
2453

E
Eric Blake 已提交
2454
VIR_NET_RPC_GENERATED = \
2455 2456 2457 2458
	rpc/virnetprotocol.h \
	rpc/virnetprotocol.c \
	rpc/virkeepaliveprotocol.h \
	rpc/virkeepaliveprotocol.c
2459

2460
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2461

2462
libvirt_net_rpc_la_SOURCES = \
2463
	rpc/virnetmessage.h rpc/virnetmessage.c \
2464
	rpc/virnetsocket.h rpc/virnetsocket.c \
2465 2466
	rpc/virkeepalive.h rpc/virkeepalive.c \
	$(VIR_NET_RPC_GENERATED)
2467
if WITH_SSH2
2468 2469
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2470
else ! WITH_SSH2
2471 2472
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2473
endif ! WITH_SSH2
2474
if WITH_GNUTLS
2475 2476
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2477
else ! WITH_GNUTLS
2478 2479
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2480
endif ! WITH_GNUTLS
2481
if WITH_SASL
2482 2483
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2484
else ! WITH_SASL
2485 2486
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2487
endif ! WITH_SASL
2488
libvirt_net_rpc_la_CFLAGS = \
2489
			$(GNUTLS_CFLAGS) \
2490
			$(SASL_CFLAGS) \
2491
			$(SSH2_CFLAGS) \
2492
			$(XDR_CFLAGS) \
2493 2494
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
2495
			$(GNUTLS_LIBS) \
2496
			$(SASL_LIBS) \
2497
			$(SSH2_LIBS)\
J
Jim Fehlig 已提交
2498
			$(SECDRIVER_LIBS) \
2499 2500 2501 2502 2503 2504
			$(AM_LDFLAGS) \
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2505 2506 2507 2508
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
2509
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
2510 2511
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
2512
			$(AVAHI_CFLAGS) \
2513
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
2514
			$(XDR_CFLAGS) \
2515
			$(AM_CFLAGS)
2516 2517
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
2518
			$(AVAHI_LIBS) \
2519
			$(DBUS_LIBS) \
2520 2521 2522 2523 2524
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2525 2526 2527 2528 2529
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 已提交
2530 2531
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
2532 2533 2534 2535 2536 2537
libvirt_net_rpc_client_la_LDFLAGS = \
			$(AM_LDFLAGS) \
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
2538

2539 2540
libexec_PROGRAMS =

2541
if WITH_LIBVIRTD
2542 2543
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2544 2545 2546 2547
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2548 2549 2550
libvirt_iohelper_LDADD =		\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
2551 2552
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
2553
endif WITH_DTRACE_PROBES
2554

D
Daniel P. Berrange 已提交
2555 2556 2557 2558
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577

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

2578
endif WITH_LIBVIRTD
2579

2580
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
2581
if WITH_LIBVIRTD
2582
libexec_PROGRAMS += libvirt_parthelper
2583

2584
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
D
Daniel P. Berrange 已提交
2585 2586 2587 2588
libvirt_parthelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2589 2590 2591 2592
libvirt_parthelper_LDADD =		\
		$(LIBPARTED_LIBS)	\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
2593 2594
if WITH_DTRACE_PROBES
libvirt_parthelper_LDADD += libvirt_probes.lo
2595
endif WITH_DTRACE_PROBES
2596

D
Daniel P. Berrange 已提交
2597 2598 2599 2600 2601
libvirt_parthelper_CFLAGS = \
		$(LIBPARTED_CFLAGS) \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2602 2603
endif WITH_LIBVIRTD
endif WITH_STORAGE_DISK
2604 2605
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)

2606

2607
if WITH_SANLOCK
2608 2609 2610
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2611
libvirt_sanlock_helper_CFLAGS = \
2612
		-I$(srcdir)/conf \
D
Daniel P. Berrange 已提交
2613 2614 2615 2616 2617 2618 2619
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2620
libvirt_sanlock_helper_LDADD = libvirt.la
2621
endif WITH_SANLOCK
2622

2623 2624 2625 2626 2627 2628
if WITH_LXC
if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_lxc

libvirt_lxc_SOURCES =						\
		$(LXC_CONTROLLER_SOURCES)			\
O
Osier Yang 已提交
2629 2630
		$(NODE_INFO_SOURCES)				\
		$(DATATYPES_SOURCES)
D
Daniel P. Berrange 已提交
2631 2632 2633 2634
libvirt_lxc_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2635
libvirt_lxc_LDADD =			\
G
Gao feng 已提交
2636
		$(FUSE_LIBS) \
2637 2638
		libvirt-net-rpc-server.la \
		libvirt-net-rpc.la \
2639
		libvirt_security_manager.la \
2640 2641
		libvirt_conf.la \
		libvirt_util.la \
2642
		../gnulib/lib/libgnu.la
2643
if WITH_DTRACE_PROBES
2644
libvirt_lxc_LDADD += libvirt_probes.lo
2645
endif WITH_DTRACE_PROBES
2646
libvirt_lxc_LDADD += $(SECDRIVER_LIBS)
2647
libvirt_lxc_CFLAGS =				\
2648
		-I$(srcdir)/conf	\
2649
		$(AM_CFLAGS)                    \
D
Daniel P. Berrange 已提交
2650
		$(PIE_CFLAGS)			\
G
Gao feng 已提交
2651
		$(LIBNL_CFLAGS)			\
D
Daniel P. Berrange 已提交
2652
		$(FUSE_CFLAGS)			\
2653
		$(DBUS_CFLAGS)			\
D
Daniel P. Berrange 已提交
2654
		$(NULL)
2655
if WITH_BLKID
2656 2657
libvirt_lxc_CFLAGS += $(BLKID_CFLAGS)
libvirt_lxc_LDADD += $(BLKID_LIBS)
2658
endif WITH_BLKID
J
Jim Fehlig 已提交
2659
libvirt_lxc_CFLAGS += $(SECDRIVER_CFLAGS)
2660 2661
endif WITH_LIBVIRTD
endif WITH_LXC
2662 2663
EXTRA_DIST += $(LXC_CONTROLLER_SOURCES)

J
Jamie Strandboge 已提交
2664 2665 2666 2667 2668 2669
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 已提交
2670 2671 2672 2673
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
J
Jamie Strandboge 已提交
2674
virt_aa_helper_LDADD =						\
2675
		libvirt.la					\
C
Chris Lalancette 已提交
2676 2677
		libvirt_conf.la					\
		libvirt_util.la					\
2678
		libvirt_driver_storage_impl.la			\
C
Chris Lalancette 已提交
2679
		../gnulib/lib/libgnu.la
2680
if WITH_DTRACE_PROBES
2681
virt_aa_helper_LDADD += libvirt_probes.lo
2682
endif WITH_DTRACE_PROBES
J
Jamie Strandboge 已提交
2683
virt_aa_helper_CFLAGS =						\
2684 2685 2686 2687
		-I$(srcdir)/conf				\
		-I$(srcdir)/security				\
		$(AM_CFLAGS) 					\
		$(PIE_CFLAGS) 					\
D
Daniel P. Berrange 已提交
2688
		$(NULL)
2689 2690
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
J
Jamie Strandboge 已提交
2691 2692
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

2693
install-data-local: install-init install-systemd
2694 2695
if WITH_LIBVIRTD
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
2696
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
2697
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
2698
endif WITH_LIBVIRTD
2699 2700
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
2701
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
2702
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
2703
if WITH_SANLOCK
2704
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
2705
endif WITH_SANLOCK
2706 2707
if WITH_QEMU
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu"
2708
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu/channel/target"
2709
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu/nvram"
2710
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu"
2711
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu"
2712
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu"
2713
endif WITH_QEMU
2714 2715 2716
if WITH_LXC
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lxc"
2717
endif WITH_LXC
J
Jim Fehlig 已提交
2718 2719 2720
if WITH_LIBXL
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/libxl"
J
Jim Fehlig 已提交
2721
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl"
2722
endif WITH_LIBXL
2723 2724 2725
if WITH_UML
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/uml"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/uml"
2726
endif WITH_UML
2727 2728
if WITH_XEN
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/xen"
2729
endif WITH_XEN
2730 2731
if WITH_NETWORK
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network"
2732
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq"
2733
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/network"
2734
	$(MKDIR_P) "$(DESTDIR)$(confdir)/qemu/networks/autostart"
2735
	$(INSTALL_DATA) $(srcdir)/network/default.xml \
2736
	  $(DESTDIR)$(confdir)/qemu/networks/default.xml
2737
	test -z "$(UUID)" || \
E
Eric Blake 已提交
2738
	  { sed -e "s,</name>,</name>\n  <uuid>$(UUID)</uuid>," \
2739 2740 2741 2742 2743 2744
	      $(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 已提交
2745
	   ln -s ../default.xml \
2746
	    $(DESTDIR)$(confdir)/qemu/networks/autostart/default.xml
2747
endif WITH_NETWORK
2748

2749
uninstall-local:: uninstall-init uninstall-systemd
2750
if WITH_LIBVIRTD
2751
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
2752 2753
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
2754
endif WITH_LIBVIRTD
2755 2756
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
2757
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
2758
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
2759
if WITH_SANLOCK
2760
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
2761
endif WITH_SANLOCK
2762 2763 2764 2765 2766
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" ||:
2767
endif WITH_QEMU
2768 2769 2770
if WITH_LXC
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||:
2771
endif WITH_LXC
J
Jim Fehlig 已提交
2772 2773 2774
if WITH_LIBXL
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||:
J
Jim Fehlig 已提交
2775
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||:
2776
endif WITH_LIBXL
2777 2778 2779
if WITH_UML
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/uml" ||:
2780
endif WITH_UML
2781 2782
if WITH_XEN
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/xen" ||:
2783
endif WITH_XEN
2784
if WITH_NETWORK
2785 2786 2787 2788
	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" || :
2789 2790
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||:
2791
endif WITH_NETWORK
2792
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
2793

2794 2795
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
2796
MAINTAINERCLEANFILES += $(REMOTE_DRIVER_GENERATED) $(VIR_NET_RPC_GENERATED)