Makefile.am 86.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 23
abs_srcdir = $(shell cd $(srcdir) && pwd)

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

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

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

50
BUILT_SOURCES =
51 52 53
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
54
nodist_conf_DATA =
55

E
Eric Blake 已提交
56 57
THREAD_LIBS = $(LIB_PTHREAD) $(LTLIBMULTITHREAD)

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

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

73
lib_LTLIBRARIES = libvirt.la libvirt-qemu.la libvirt-lxc.la
74

75
moddir = $(libdir)/libvirt/connection-driver
76 77
mod_LTLIBRARIES =

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

81 82 83 84 85 86
augeasdir = $(datadir)/augeas/lenses
augeas_DATA =

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

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

170

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

E
Eric Blake 已提交
174
BUILT_SOURCES += util/virkeymaps.h
175

E
Eric Blake 已提交
176
util/virkeymaps.h: $(srcdir)/util/keymaps.csv	\
L
Lai Jiangshan 已提交
177
		$(srcdir)/util/virkeycode-mapgen.py
178
	$(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py \
E
Eric Blake 已提交
179
	  <$(srcdir)/util/keymaps.csv >$(srcdir)/util/virkeymaps.h
L
Lai Jiangshan 已提交
180

181
# Internal generic driver infrastructure
182
NODE_INFO_SOURCES = nodeinfo.h nodeinfo.c nodeinfopriv.h
O
Osier Yang 已提交
183 184 185 186 187 188 189 190 191 192 193
DATATYPES_SOURCES = datatypes.h datatypes.c
DRIVER_SOURCES =							\
		driver.c driver.h					\
		internal.h						\
		$(DATATYPES_SOURCES)					\
		fdstream.c fdstream.h					\
		$(NODE_INFO_SOURCES)					\
		libvirt.c libvirt_internal.h				\
		locking/lock_manager.c locking/lock_manager.h		\
		locking/lock_driver.h					\
		locking/lock_driver_nop.h locking/lock_driver_nop.c	\
194
		locking/domain_lock.h locking/domain_lock.c
195

196 197 198
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

199 200
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
201

202
LOCK_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
203 204
		locking/lock_protocol.h \
		locking/lock_protocol.c \
205 206
		$(NULL)

207 208 209
LOCK_PROTOCOL = $(srcdir)/locking/lock_protocol.x
EXTRA_DIST += $(LOCK_PROTOCOL) \
	$(LOCK_PROTOCOL_GENERATED)
210 211 212
BUILT_SOURCES += $(LOCK_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(LOCK_PROTOCOL_GENERATED)

213
LOCK_DAEMON_GENERATED = \
214
		locking/lock_daemon_dispatch_stubs.h
215 216 217
		$(NULL)

BUILT_SOURCES += $(LOCK_DAEMON_GENERATED)
218
EXTRA_DIST += $(LOCK_DAEMON_GENERATED)
219 220
MAINTAINERCLEANFILES += $(LOCK_DAEMON_GENERATED)

221 222 223 224
LOCK_DRIVER_LOCKD_SOURCES = \
		locking/lock_driver_lockd.c \
		$(NULL)

225 226 227 228 229
LOCK_DAEMON_SOURCES = \
		locking/lock_daemon.h \
		locking/lock_daemon.c \
		locking/lock_daemon_config.h \
		locking/lock_daemon_config.c \
230 231
		locking/lock_daemon_dispatch.c \
		locking/lock_daemon_dispatch.h \
232 233
		$(NULL)

E
Eric Blake 已提交
234
locking/lock_daemon_dispatch_stubs.h: $(LOCK_PROTOCOL) \
235
		$(srcdir)/rpc/gendispatch.pl Makefile.am
236 237
	$(AM_V_GEN)perl -w $(srcdir)/rpc/gendispatch.pl --mode=server \
	    virLockSpaceProtocol VIR_LOCK_SPACE_PROTOCOL \
E
Eric Blake 已提交
238
	    $(LOCK_PROTOCOL) > $(srcdir)/locking/lock_daemon_dispatch_stubs.h
239 240


241 242
NETDEV_CONF_SOURCES =						\
		conf/netdev_bandwidth_conf.h conf/netdev_bandwidth_conf.c \
243 244
		conf/netdev_vport_profile_conf.h conf/netdev_vport_profile_conf.c \
		conf/netdev_vlan_conf.h conf/netdev_vlan_conf.c
245

246
# XML configuration format handling sources
247 248
# Domain driver generic impl APIs
DOMAIN_CONF_SOURCES =						\
249
		conf/capabilities.c conf/capabilities.h		\
250
		conf/domain_addr.c conf/domain_addr.h		\
251
		conf/domain_conf.c conf/domain_conf.h		\
252
		conf/domain_audit.c conf/domain_audit.h		\
253 254
		conf/domain_nwfilter.c conf/domain_nwfilter.h	\
		conf/snapshot_conf.c conf/snapshot_conf.h
255

256 257 258 259
OBJECT_EVENT_SOURCES =						\
		conf/object_event.c conf/object_event.h \
		conf/object_event_private.h

260 261
DOMAIN_EVENT_SOURCES =						\
		conf/domain_event.c conf/domain_event.h
262

263 264 265
NETWORK_EVENT_SOURCES =						\
		conf/network_event.c conf/network_event.h

266
# Network driver generic impl APIs
267
NETWORK_CONF_SOURCES =						\
268
		conf/network_conf.c conf/network_conf.h
269

270 271
# Network filter driver generic impl APIs
NWFILTER_PARAM_CONF_SOURCES =					\
272
		conf/nwfilter_params.c conf/nwfilter_params.h	\
273 274
		conf/nwfilter_ipaddrmap.c			\
		conf/nwfilter_ipaddrmap.h			\
275
		conf/nwfilter_conf.h
276

277
NWFILTER_CONF_SOURCES =						\
278 279 280
		$(NWFILTER_PARAM_CONF_SOURCES)			\
		conf/nwfilter_conf.c conf/nwfilter_conf.h

281
# Storage driver generic impl APIs
282 283
STORAGE_CONF_SOURCES =                                         \
		conf/storage_conf.h conf/storage_conf.c
284

285
# Interface driver generic impl APIs
286 287
INTERFACE_CONF_SOURCES =                                       \
		conf/interface_conf.c conf/interface_conf.h
288

289
# Secret driver generic impl APIs
290 291 292 293 294 295 296
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

297 298
CPU_CONF_SOURCES =						\
		conf/cpu_conf.c conf/cpu_conf.h
299

300 301
# Safe character device handling helper APIs
CHRDEV_CONF_SOURCES =						\
302
		conf/virchrdev.c conf/virchrdev.h
303

304 305 306 307
# Device Helper APIs
DEVICE_CONF_SOURCES =                                           \
		conf/device_conf.c conf/device_conf.h

308
CONF_SOURCES =							\
309
		$(NETDEV_CONF_SOURCES)				\
310
		$(DOMAIN_CONF_SOURCES)				\
311
		$(OBJECT_EVENT_SOURCES)				\
312
		$(DOMAIN_EVENT_SOURCES)				\
313
		$(NETWORK_EVENT_SOURCES)			\
314
		$(NETWORK_CONF_SOURCES)				\
315
		$(NWFILTER_CONF_SOURCES)			\
316 317 318
		$(NODE_DEVICE_CONF_SOURCES)			\
		$(STORAGE_CONF_SOURCES)				\
		$(INTERFACE_CONF_SOURCES)			\
319
		$(SECRET_CONF_SOURCES)				\
320
		$(CPU_CONF_SOURCES)				\
321
		$(CHRDEV_CONF_SOURCES)				\
322
		$(DEVICE_CONF_SOURCES)
323

324
# The remote RPC driver, covering domains, storage, networks, etc
325
REMOTE_DRIVER_GENERATED = \
E
Eric Blake 已提交
326 327 328 329 330 331 332 333 334 335
		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 已提交
336 337

REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x
338
LXC_PROTOCOL = $(srcdir)/remote/lxc_protocol.x
E
Eric Blake 已提交
339
QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x
340
REMOTE_DRIVER_PROTOCOL = $(REMOTE_PROTOCOL) $(QEMU_PROTOCOL) $(LXC_PROTOCOL)
341

E
Eric Blake 已提交
342
remote/remote_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
343
		$(REMOTE_PROTOCOL) Makefile.am
344
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
345 346
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/remote/remote_client_bodies.h
347

E
Eric Blake 已提交
348
remote/lxc_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
349
		$(LXC_PROTOCOL) Makefile.am
350
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
351 352
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/remote/lxc_client_bodies.h
353

E
Eric Blake 已提交
354
remote/qemu_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
355
		$(QEMU_PROTOCOL) Makefile.am
356
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
357 358
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/remote/qemu_client_bodies.h
359 360 361 362 363

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

365
EXTRA_DIST +=  $(REMOTE_DRIVER_PROTOCOL) \
366
		$(REMOTE_DRIVER_GENERATED)
367

368 369 370 371 372 373 374 375 376 377
# 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
378 379 380 381

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

390
# Depending on configure options, libtool creates one or both of
E
Eric Blake 已提交
391 392
# remote/{,.libs/}libvirt_driver_remote_la-remote_protocol.o.  We want
# the newest of the two, in case configure options changed and a stale
393
# file is left around from an earlier build.
394
PDWTAGS = \
395
	$(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then		\
E
Eric Blake 已提交
396 397
	  o=`ls -t $(<:.lo=.$(OBJEXT))					\
	     $(subst /,/.libs/,$(<:.lo=.$(OBJEXT)))			\
398 399 400
	    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 已提交
401
	  if test ! -s $(@F)-t1 && test -s $(@F)-t2; then		\
402 403 404
	    rm -rf $(@F)-t?;						\
	    echo 'WARNING: pdwtags appears broken; skipping the $@ test' >&2;\
	  else								\
405
	    $(PERL) -0777 -n						\
406
		-e 'foreach my $$p (split m!\n*(?:$(r1)|$(r2))\n!) {'	\
407 408
		-e '  if ($$p =~ /^(struct|enum) $(struct_prefix)/ ||'	\
		-e '      $$p =~ /^enum {/) {'				\
409 410 411
		-e '    $$p =~ s!\t*/\*.*?\*/!!sg;'			\
		-e '    $$p =~ s!\s+\n!\n!sg;'				\
		-e '    $$p =~ s!\s+$$!!;'				\
412
		-e '    $$p =~ s!\t!        !g;'			\
413 414 415 416
		-e '    print "$$p\n";'					\
		-e '    $$n++;'						\
		-e '  }'						\
		-e '}'							\
417 418 419
		-e 'BEGIN {'						\
		-e '  print "/* -*- c -*- */\n";'			\
		-e '}'							\
420
		-e 'END {'						\
421
		-e '  if ($$n < 1) {'					\
422 423 424 425 426 427
		-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 '}'							\
428 429
		< $(@F)-t1 > $(@F)-t3;					\
	    case $$? in 8) rm -f $(@F)-t?; exit 0;; 0) ;; *) exit 1;; esac;\
430
	    diff -u $(@)s $(@F)-t3; st=$$?; rm -f $(@F)-t?; exit $$st;	\
431
	  fi;								\
432
	else								\
433 434
	  echo 'WARNING: you lack pdwtags; skipping the $@ test' >&2;	\
	  echo 'WARNING: install the dwarves package to get pdwtags' >&2; \
435
	fi
436

437
# .libs/libvirt.so is built by libtool as a side-effect of the Makefile
438 439
# rule for libvirt.la.  However, checking symbols relies on Linux ELF layout
if WITH_LINUX
440 441 442
check-symfile: libvirt.syms libvirt.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt.syms \
	  .libs/libvirt.so
443
else ! WITH_LINUX
444
check-symfile:
445
endif ! WITH_LINUX
446
check-symsorting:
447
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
448
		$(srcdir) $(SYM_FILES)
J
Jiri Denemark 已提交
449
EXTRA_DIST += check-symfile.pl check-symsorting.pl
450

E
Eric Blake 已提交
451
# Keep this list synced with RPC_PROBE_FILES
452 453
PROTOCOL_STRUCTS = \
	$(srcdir)/remote_protocol-structs \
454
	$(srcdir)/lxc_protocol-structs \
455
	$(srcdir)/qemu_protocol-structs \
J
Jiri Denemark 已提交
456
	$(srcdir)/virnetprotocol-structs \
E
Eric Blake 已提交
457 458 459 460 461
	$(srcdir)/virkeepaliveprotocol-structs \
	$(srcdir)/lxc_monitor_protocol-structs \
	$(srcdir)/lock_protocol-structs \
	$(NULL)

462
if WITH_REMOTE
463 464
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)

465 466
# 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.
467 468 469
$(srcdir)/remote_protocol-struct \
	$(srcdir)/qemu_protocol-struct \
	$(srcdir)/lxc_protocol-struct: \
E
Eric Blake 已提交
470
		$(srcdir)/%-struct: remote/libvirt_driver_remote_la-%.lo
471
	$(PDWTAGS)
472
$(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \
E
Eric Blake 已提交
473
		$(srcdir)/%-struct: rpc/libvirt_net_rpc_la-%.lo
474
	$(PDWTAGS)
E
Eric Blake 已提交
475
$(srcdir)/lxc_monitor_protocol-struct: \
E
Eric Blake 已提交
476
		$(srcdir)/%-struct: lxc/libvirt_driver_lxc_impl_la-%.lo
E
Eric Blake 已提交
477 478
	$(PDWTAGS)
$(srcdir)/lock_protocol-struct: \
E
Eric Blake 已提交
479
		$(srcdir)/%-struct: locking/lockd_la-%.lo
E
Eric Blake 已提交
480 481
	$(PDWTAGS)

482
else !WITH_REMOTE
483 484 485
# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be
# re-generated when configured --without-remote.
check-protocol:
486
endif !WITH_REMOTE
J
Jiri Denemark 已提交
487
EXTRA_DIST += $(PROTOCOL_STRUCTS)
488 489 490 491 492 493 494 495 496 497

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

498
DRIVER_SOURCE_FILES = \
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518
	$(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) \
519
	vbox/vbox_tmpl.c \
520 521 522
	$(VMWARE_DRIVER_SOURCES) \
	$(XEN_DRIVER_SOURCES) \
	$(XENAPI_DRIVER_SOURCES) \
523 524
	$(NULL)

525
STATEFUL_DRIVER_SOURCE_FILES = \
R
Roman Bogorodskiy 已提交
526
	$(BHYVE_DRIVER_SOURCES) \
527 528 529 530 531 532 533 534 535 536 537 538 539
	$(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)

540 541 542

check-driverimpls:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-driverimpls.pl \
543
		$(filter /%,$(DRIVER_SOURCE_FILES)) \
E
Eric Blake 已提交
544 545 546
		$(filter $(srcdir)/%,$(DRIVER_SOURCE_FILES)) \
		$(addprefix $(srcdir)/,$(filter-out $(srcdir)/%, \
			$(filter-out /%,$(DRIVER_SOURCE_FILES))))
547

548 549
check-aclrules:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclrules.pl \
E
Eric Blake 已提交
550
		$(REMOTE_PROTOCOL) \
551
		$(addprefix $(srcdir)/,$(filter-out /%,$(STATEFUL_DRIVER_SOURCE_FILES)))
552

553 554 555 556 557
check-aclperms:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclperms.pl \
		$(srcdir)/access/viraccessperm.h \
		$(srcdir)/access/viraccessperm.c

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

560
check-local: check-protocol check-symfile check-symsorting \
561 562
	check-drivername check-driverimpls check-aclrules \
	check-aclperms
563
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
564

565 566
# Mock driver, covering domains, storage, networks, etc
TEST_DRIVER_SOURCES =						\
567
		test/test_driver.c test/test_driver.h
568 569 570

# Now the Hypervisor specific drivers
XEN_DRIVER_SOURCES =						\
571 572 573 574 575 576
		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
577
if WITH_XEN_INOTIFY
578
XEN_DRIVER_SOURCES += xen/xen_inotify.c xen/xen_inotify.h
579
endif WITH_XEN_INOTIFY
580

581
LXC_MONITOR_PROTOCOL_GENERATED = \
E
Eric Blake 已提交
582 583
	lxc/lxc_monitor_protocol.h \
	lxc/lxc_monitor_protocol.c \
584 585 586
	$(NULL)

LXC_MONITOR_GENERATED = \
E
Eric Blake 已提交
587
	lxc/lxc_monitor_dispatch.h \
588 589 590
	$(NULL)

LXC_CONTROLLER_GENERATED = \
E
Eric Blake 已提交
591
	lxc/lxc_controller_dispatch.h \
592 593 594
	$(NULL)

LXC_GENERATED = \
595
	$(LXC_MONITOR_PROTOCOL_GENERATED) \
596 597 598 599
	$(LXC_MONITOR_GENERATED) \
	$(LXC_CONTROLLER_GENERATED) \
	$(NULL)

600
LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x
601

E
Eric Blake 已提交
602
lxc/lxc_monitor_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
603
		$(LXC_MONITOR_PROTOCOL) Makefile.am
604
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
E
Eric Blake 已提交
605 606
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_monitor_dispatch.h
607

E
Eric Blake 已提交
608
lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
609
		$(REMOTE_PROTOCOL) Makefile.am
610
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \
E
Eric Blake 已提交
611 612
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > \
	  $(srcdir)/lxc/lxc_controller_dispatch.h
613 614

EXTRA_DIST += \
615
	$(LXC_MONITOR_PROTOCOL) \
616 617 618 619 620
	$(LXC_GENERATED) \
	$(NULL)

BUILT_SOURCES += $(LXC_GENERATED)

621 622
CLEANFILES += $(LXC_GENERATED)

623
LXC_DRIVER_SOURCES =						\
624
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
625
		$(LXC_MONITOR_GENERATED)			\
626 627
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
628
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
629
		lxc/lxc_domain.c lxc/lxc_domain.h		\
630
		lxc/lxc_hostdev.c lxc/lxc_hostdev.h		\
631
		lxc/lxc_monitor.c lxc/lxc_monitor.h		\
632
		lxc/lxc_process.c lxc/lxc_process.h		\
G
Gao feng 已提交
633
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
634
		lxc/lxc_native.c lxc/lxc_native.h		\
635
		lxc/lxc_driver.c lxc/lxc_driver.h
636

637
LXC_CONTROLLER_SOURCES =					\
638
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
639
		$(LXC_CONTROLLER_GENERATED)			\
640 641
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
642
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
643
		lxc/lxc_domain.c lxc/lxc_domain.h		\
G
Gao feng 已提交
644
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
645
		lxc/lxc_controller.c
646

J
Jamie Strandboge 已提交
647
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES =			\
E
Eric Blake 已提交
648
		$(DATATYPES_SOURCES)				\
J
Jamie Strandboge 已提交
649 650
		security/virt-aa-helper.c

651 652 653
PHYP_DRIVER_SOURCES =						\
		phyp/phyp_driver.c phyp/phyp_driver.h

654
OPENVZ_DRIVER_SOURCES =						\
655
		openvz/openvz_conf.c openvz/openvz_conf.h	\
656 657
		openvz/openvz_driver.c openvz/openvz_driver.h   \
		openvz/openvz_util.c openvz/openvz_util.h
658

E
Eric Blake 已提交
659
VMWARE_DRIVER_SOURCES =						\
660
		vmware/vmware_driver.c vmware/vmware_driver.h	\
661 662
		vmware/vmware_conf.c vmware/vmware_conf.h

663
VBOX_DRIVER_SOURCES =						\
E
Eric Blake 已提交
664 665
	vbox/vbox_glue.c vbox/vbox_glue.h			\
	vbox/vbox_driver.c vbox/vbox_driver.h			\
Y
Yohan BELLEGUIC 已提交
666
	vbox/vbox_snapshot_conf.c vbox/vbox_snapshot_conf.h \
E
Eric Blake 已提交
667 668 669 670
	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			\
671
	vbox/vbox_V4_0.c vbox/vbox_CAPI_v4_0.h			\
672
	vbox/vbox_V4_1.c vbox/vbox_CAPI_v4_1.h			\
R
Ryota Ozaki 已提交
673
	vbox/vbox_V4_2.c vbox/vbox_CAPI_v4_2.h			\
674 675 676
	vbox/vbox_V4_2_20.c vbox/vbox_CAPI_v4_2_20.h			\
	vbox/vbox_V4_3.c vbox/vbox_CAPI_v4_3.h			\
	vbox/vbox_V4_3_4.c vbox/vbox_CAPI_v4_3_4.h
677

E
Eric Blake 已提交
678
VBOX_DRIVER_EXTRA_DIST =					\
679 680 681
		vbox/vbox_tmpl.c vbox/README			\
		vbox/vbox_MSCOMGlue.c vbox/vbox_MSCOMGlue.h	\
		vbox/vbox_XPCOMCGlue.c vbox/vbox_XPCOMCGlue.h
682

O
Osier Yang 已提交
683 684 685 686 687 688 689 690
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			\
691
		qemu/qemu_hotplugpriv.h					\
O
Osier Yang 已提交
692 693
		qemu/qemu_conf.c qemu/qemu_conf.h			\
		qemu/qemu_process.c qemu/qemu_process.h			\
694
		qemu/qemu_processpriv.h					\
O
Osier Yang 已提交
695 696 697 698 699 700
		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				\
701
		qemu/qemu_driver.c qemu/qemu_driver.h
R
Richard W.M. Jones 已提交
702

O
Osier Yang 已提交
703
XENAPI_DRIVER_SOURCES =						\
704
		xenapi/xenapi_driver.c xenapi/xenapi_driver.h	\
O
Osier Yang 已提交
705
		xenapi/xenapi_driver_private.h			\
706 707
		xenapi/xenapi_utils.c xenapi/xenapi_utils.h

J
Jim Fehlig 已提交
708 709
LIBXL_DRIVER_SOURCES =						\
		libxl/libxl_conf.c libxl/libxl_conf.h		\
J
Jim Fehlig 已提交
710
		libxl/libxl_domain.c libxl/libxl_domain.h       \
J
Jim Fehlig 已提交
711 712
		libxl/libxl_driver.c libxl/libxl_driver.h       \
		libxl/libxl_migration.c libxl/libxl_migration.h
J
Jim Fehlig 已提交
713

714
UML_DRIVER_SOURCES =						\
D
Daniel P. Berrange 已提交
715 716
		uml/uml_conf.c uml/uml_conf.h			\
		uml/uml_driver.c uml/uml_driver.h
717

O
Osier Yang 已提交
718 719 720 721 722 723
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	\
724
		esx/esx_storage_backend_vmfs.c esx/esx_storage_backend_vmfs.h	\
725
		esx/esx_storage_backend_iscsi.c esx/esx_storage_backend_iscsi.h	\
O
Osier Yang 已提交
726
		esx/esx_device_monitor.c esx/esx_device_monitor.h	\
727
		esx/esx_secret_driver.c esx/esx_secret_driver.h		\
O
Osier Yang 已提交
728 729 730 731
		esx/esx_nwfilter_driver.c esx/esx_nwfilter_driver.h	\
		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		\
732
		esx/esx_vi_types.c esx/esx_vi_types.h
733

734
ESX_DRIVER_GENERATED =							\
735 736
		esx/esx_vi_methods.generated.c				\
		esx/esx_vi_methods.generated.h				\
737
		esx/esx_vi_methods.generated.macro			\
738 739 740 741 742
		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			\
743 744 745
		esx/esx_vi_types.generated.typefromstring		\
		esx/esx_vi.generated.c					\
		esx/esx_vi.generated.h
746

O
Osier Yang 已提交
747
ESX_DRIVER_EXTRA_DIST =							\
748 749 750 751 752
		esx/README						\
		esx/esx_vi_generator.input				\
		esx/esx_vi_generator.py					\
		$(ESX_DRIVER_GENERATED)

O
Osier Yang 已提交
753
HYPERV_DRIVER_SOURCES =									\
M
Matthias Bolte 已提交
754 755 756 757 758 759 760
		hyperv/hyperv_private.h							\
		hyperv/hyperv_driver.c hyperv/hyperv_driver.h				\
		hyperv/hyperv_interface_driver.c hyperv/hyperv_interface_driver.h	\
		hyperv/hyperv_network_driver.c hyperv/hyperv_network_driver.h		\
		hyperv/hyperv_storage_driver.c hyperv/hyperv_storage_driver.h		\
		hyperv/hyperv_device_monitor.c hyperv/hyperv_device_monitor.h		\
		hyperv/hyperv_secret_driver.c hyperv/hyperv_secret_driver.h		\
761
		hyperv/hyperv_nwfilter_driver.c hyperv/hyperv_nwfilter_driver.h		\
762
		hyperv/hyperv_util.c hyperv/hyperv_util.h				\
763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778
		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 已提交
779 780
PARALLELS_DRIVER_SOURCES =					\
		parallels/parallels_driver.h			\
781
		parallels/parallels_driver.c			\
782 783
		parallels/parallels_utils.c			\
		parallels/parallels_utils.h			\
D
Dmitry Guryanov 已提交
784 785
		parallels/parallels_storage.c		\
		parallels/parallels_network.c
D
Dmitry Guryanov 已提交
786

R
Roman Bogorodskiy 已提交
787
BHYVE_DRIVER_SOURCES =						\
788 789
		bhyve/bhyve_capabilities.c			\
		bhyve/bhyve_capabilities.h			\
R
Roman Bogorodskiy 已提交
790 791 792 793 794 795 796 797 798
		bhyve/bhyve_command.c				\
		bhyve/bhyve_command.h				\
		bhyve/bhyve_driver.h				\
		bhyve/bhyve_driver.c				\
		bhyve/bhyve_process.c				\
		bhyve/bhyve_process.h				\
		bhyve/bhyve_utils.h				\
		$(NULL)

799
NETWORK_DRIVER_SOURCES =					\
800 801 802 803 804
		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
805

806 807 808 809
INTERFACE_DRIVER_SOURCES =

if WITH_INTERFACE
INTERFACE_DRIVER_SOURCES +=					\
810 811
		interface/interface_driver.h        \
		interface/interface_driver.c
812 813 814 815

if WITH_NETCF
INTERFACE_DRIVER_SOURCES +=					\
		interface/interface_backend_netcf.c
816
endif WITH_NETCF
817
if WITH_UDEV
818 819
INTERFACE_DRIVER_SOURCES +=					\
		interface/interface_backend_udev.c
820 821
endif WITH_UDEV
endif WITH_INTERFACE
822

823
SECRET_DRIVER_SOURCES =						\
824
		secret/secret_driver.h secret/secret_driver.c
825

826
# Storage backend specific impls
O
Osier Yang 已提交
827 828
STORAGE_DRIVER_SOURCES =						\
		storage/storage_driver.h storage/storage_driver.c	\
829
		storage/storage_backend.h storage/storage_backend.c
830 831

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

834
STORAGE_DRIVER_LVM_SOURCES =					\
O
Osier Yang 已提交
835
		storage/storage_backend_logical.h		\
836
		storage/storage_backend_logical.c
837 838

STORAGE_DRIVER_ISCSI_SOURCES =					\
839
		storage/storage_backend_iscsi.h storage/storage_backend_iscsi.c
840

841
STORAGE_DRIVER_SCSI_SOURCES =					\
842
		storage/storage_backend_scsi.h storage/storage_backend_scsi.c
843

D
Dave Allan 已提交
844
STORAGE_DRIVER_MPATH_SOURCES =					\
845
		storage/storage_backend_mpath.h storage/storage_backend_mpath.c
D
Dave Allan 已提交
846

847
STORAGE_DRIVER_DISK_SOURCES =					\
848
		storage/storage_backend_disk.h storage/storage_backend_disk.c
849

850 851 852
STORAGE_DRIVER_RBD_SOURCES =					\
		storage/storage_backend_rbd.h storage/storage_backend_rbd.c

853 854 855
STORAGE_DRIVER_SHEEPDOG_SOURCES =				\
		storage/storage_backend_sheepdog.h storage/storage_backend_sheepdog.c

856 857 858
STORAGE_DRIVER_GLUSTER_SOURCES =				\
		storage/storage_backend_gluster.h storage/storage_backend_gluster.c

859
STORAGE_HELPER_DISK_SOURCES =					\
860
		storage/parthelper.c
861

862 863 864
UTIL_IO_HELPER_SOURCES =					\
		util/iohelper.c

865 866 867
NETWORK_LEASES_HELPER_SOURCES =                                 \
               network/leaseshelper.c

868
# Network filters
O
Osier Yang 已提交
869
NWFILTER_DRIVER_SOURCES =						\
870
		nwfilter/nwfilter_driver.h nwfilter/nwfilter_driver.c	\
871
		nwfilter/nwfilter_tech_driver.h				\
872 873
		nwfilter/nwfilter_gentech_driver.c			\
		nwfilter/nwfilter_gentech_driver.h			\
S
Stefan Berger 已提交
874 875
		nwfilter/nwfilter_dhcpsnoop.c				\
		nwfilter/nwfilter_dhcpsnoop.h				\
876
		nwfilter/nwfilter_ebiptables_driver.c			\
877 878 879
		nwfilter/nwfilter_ebiptables_driver.h			\
		nwfilter/nwfilter_learnipaddr.c				\
		nwfilter/nwfilter_learnipaddr.h
880

881

882
# Security framework and drivers for various models
O
Osier Yang 已提交
883 884 885 886 887
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		\
888
		security/security_manager.h security/security_manager.c
889

890
SECURITY_DRIVER_SELINUX_SOURCES =				\
891
		security/security_selinux.h security/security_selinux.c
892

J
Jamie Strandboge 已提交
893 894 895
SECURITY_DRIVER_APPARMOR_SOURCES =				\
		security/security_apparmor.h security/security_apparmor.c

896
ACCESS_DRIVER_GENERATED = \
E
Eric Blake 已提交
897 898 899 900 901 902 903
		access/viraccessapicheck.h \
		access/viraccessapicheck.c \
		access/viraccessapicheckqemu.h \
		access/viraccessapicheckqemu.c \
		access/viraccessapichecklxc.h \
		access/viraccessapichecklxc.c \
		$(NULL)
904

905
ACCESS_DRIVER_SYM_FILES = \
906 907 908
		libvirt_access.syms \
		libvirt_access_qemu.syms \
		libvirt_access_lxc.syms
909

910 911 912 913 914
ACCESS_DRIVER_API_FILES = \
		libvirt_access.xml \
		libvirt_access_qemu.xml \
		libvirt_access_lxc.xml

915 916 917 918 919 920 921
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

922 923 924 925
ACCESS_DRIVER_POLKIT_SOURCES = \
		access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c

ACCESS_DRIVER_POLKIT_POLICY = \
926
		$(srcdir)/access/org.libvirt.api.policy
927 928


929
NODE_DEVICE_DRIVER_SOURCES =					\
O
Osier Yang 已提交
930 931
		node_device/node_device_driver.c		\
		node_device/node_device_driver.h		\
932
		node_device/node_device_linux_sysfs.c
933 934

NODE_DEVICE_DRIVER_HAL_SOURCES =				\
935
		node_device/node_device_hal.c			\
936
		node_device/node_device_hal.h
937

938
NODE_DEVICE_DRIVER_UDEV_SOURCES =				\
D
Daniel Veillard 已提交
939 940
		node_device/node_device_udev.c			\
		node_device/node_device_udev.h
941

J
Jiri Denemark 已提交
942 943 944 945
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 已提交
946
		cpu/cpu_s390.h cpu/cpu_s390.c			\
C
Chuck Short 已提交
947
		cpu/cpu_arm.h cpu/cpu_arm.c			\
948
		cpu/cpu_aarch64.h cpu/cpu_aarch64.c		\
P
Prerna Saxena 已提交
949
		cpu/cpu_map.h cpu/cpu_map.c cpu/cpu_powerpc.h	\
950
		cpu/cpu_powerpc.c cpu/cpu_ppc_data.h
951

952 953 954
VMX_SOURCES =							\
		vmx/vmx.c vmx/vmx.h

955 956
XENXS_SOURCES =							\
		xenxs/xenxs_private.h				\
957 958
		xenxs/xen_sxpr.c xenxs/xen_sxpr.h		\
		xenxs/xen_xm.c xenxs/xen_xm.h
959

J
Jiri Denemark 已提交
960 961
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
962
EXTRA_DIST +=	$(pkgdata_DATA)
963

964 965 966 967 968 969
#########################
#
# Build up list of libvirt.la source files based on configure conditions
#
# First deal with sources usable in non-daemon context

970
noinst_LTLIBRARIES = libvirt_util.la
971 972
libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
libvirt_la_BUILT_LIBADD = libvirt_util.la
973 974
libvirt_util_la_SOURCES =					\
		$(UTIL_SOURCES)
975
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
976
		$(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
977
		$(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS)	\
978
		$(SYSTEMD_DAEMON_CFLAGS) -I$(top_srcdir)/src/conf
979
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
980
		$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
981
		$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(MSCOM_LIBS) $(LIBXML_LIBS) \
982
		$(SECDRIVER_LIBS) $(NUMACTL_LIBS) $(SYSTEMD_DAEMON_LIBS)
983

984 985

noinst_LTLIBRARIES += libvirt_conf.la
986
libvirt_la_BUILT_LIBADD += libvirt_conf.la
987
libvirt_conf_la_SOURCES = $(CONF_SOURCES)
988 989
libvirt_conf_la_CFLAGS = $(AM_CFLAGS)
libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS)
990

J
Jiri Denemark 已提交
991
noinst_LTLIBRARIES += libvirt_cpu.la
992
libvirt_la_BUILT_LIBADD += libvirt_cpu.la
J
Jiri Denemark 已提交
993
libvirt_cpu_la_CFLAGS = \
994
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
J
Jiri Denemark 已提交
995
libvirt_cpu_la_SOURCES = $(CPU_SOURCES)
996 997 998 999
libvirt_cpu_la_DEPENDENCIES = $(abs_builddir)/cpu/cpu_map.xml

$(abs_builddir)/cpu/cpu_map.xml:
	$(AM_V_GEN)ln -s $(abs_srcdir)/cpu/cpu_map.xml $@
J
Jiri Denemark 已提交
1000

1001 1002 1003 1004
if WITH_VMX
noinst_LTLIBRARIES += libvirt_vmx.la
libvirt_la_BUILT_LIBADD += libvirt_vmx.la
libvirt_vmx_la_CFLAGS = \
1005
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
1006
libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
1007
endif WITH_VMX
1008

1009
if WITH_XENXS
1010 1011 1012
noinst_LTLIBRARIES += libvirt_xenxs.la
libvirt_la_BUILT_LIBADD += libvirt_xenxs.la
libvirt_xenxs_la_CFLAGS = \
1013
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
1014
libvirt_xenxs_la_SOURCES = $(XENXS_SOURCES)
1015
endif WITH_XENXS
1016

1017

1018
noinst_LTLIBRARIES += libvirt_driver.la
1019
libvirt_la_BUILT_LIBADD += libvirt_driver.la
1020
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
1021

1022
libvirt_driver_la_CFLAGS = \
1023
		$(GNUTLS_CFLAGS) $(CURL_CFLAGS) \
1024
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
1025
libvirt_driver_la_LIBADD = \
1026
		$(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS)
1027

1028 1029
# 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.
1030
SYM_FILES = $(USED_SYM_FILES)
1031
USED_SYM_FILES = $(srcdir)/libvirt_private.syms
1032 1033 1034 1035
GENERATED_SYM_FILES = \
	$(ACCESS_DRIVER_SYM_FILES) \
	libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \
	$(NULL)
1036

1037
if WITH_TEST
1038
noinst_LTLIBRARIES += libvirt_driver_test.la
1039
libvirt_la_BUILT_LIBADD += libvirt_driver_test.la
1040
libvirt_driver_test_la_CFLAGS = \
1041
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
1042
libvirt_driver_test_la_SOURCES = $(TEST_DRIVER_SOURCES)
1043
endif WITH_TEST
1044 1045

if WITH_REMOTE
1046
noinst_LTLIBRARIES += libvirt_driver_remote.la
1047
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
1048 1049
libvirt_driver_remote_la_CFLAGS =				\
		$(GNUTLS_CFLAGS)				\
E
Eric Blake 已提交
1050
		$(XDR_CFLAGS)					\
1051 1052
		-I$(top_srcdir)/src/conf			\
		-I$(top_srcdir)/src/rpc				\
1053 1054
		$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
1055 1056 1057 1058
libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) \
                libvirt-net-rpc-client.la \
                libvirt-net-rpc-server.la \
                libvirt-net-rpc.la
1059
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
1060

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

1063 1064
endif WITH_REMOTE

1065
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
1066
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
1067
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1068

1069
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
1070
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
1071
	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
1072

1073
if WITH_XEN
E
Eric Blake 已提交
1074 1075 1076
noinst_LTLIBRARIES += libvirt_driver_xen_impl.la
libvirt_driver_xen_la_SOURCES =
libvirt_driver_xen_la_LIBADD = libvirt_driver_xen_impl.la
1077 1078
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_xen.la
E
Eric Blake 已提交
1079
libvirt_driver_xen_la_LIBADD += ../gnulib/lib/libgnu.la
1080
libvirt_driver_xen_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1081
else ! WITH_DRIVER_MODULES
1082
noinst_LTLIBRARIES += libvirt_driver_xen.la
1083 1084
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_xen.la
1085
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1086 1087

libvirt_driver_xen_impl_la_CFLAGS =					\
1088
		$(XEN_CFLAGS)					\
1089
		-I$(top_srcdir)/src/access			\
1090 1091
		-I$(top_srcdir)/src/conf			\
		-I$(top_srcdir)/src/xenxs			\
1092
		$(AM_CFLAGS)
E
Eric Blake 已提交
1093 1094 1095
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)
1096
endif WITH_XEN
1097

1098 1099
if WITH_PHYP
noinst_LTLIBRARIES += libvirt_driver_phyp.la
1100
libvirt_la_BUILT_LIBADD += libvirt_driver_phyp.la
1101 1102
libvirt_driver_phyp_la_LIBADD = $(SSH2_LIBS)
libvirt_driver_phyp_la_CFLAGS = $(SSH2_CFLAGS) \
1103
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
1104
libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES)
1105
endif WITH_PHYP
1106

1107
if WITH_OPENVZ
1108
noinst_LTLIBRARIES += libvirt_driver_openvz.la
1109
libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la
1110
libvirt_driver_openvz_la_CFLAGS = \
1111
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
1112
libvirt_driver_openvz_la_SOURCES = $(OPENVZ_DRIVER_SOURCES)
1113
endif WITH_OPENVZ
1114

1115 1116 1117 1118
if WITH_VMWARE
noinst_LTLIBRARIES += libvirt_driver_vmware.la
libvirt_la_BUILT_LIBADD += libvirt_driver_vmware.la
libvirt_driver_vmware_la_CFLAGS = \
1119
		-I$(top_srcdir)/src/conf -I$(top_srcdir)/src/vmx $(AM_CFLAGS)
1120
libvirt_driver_vmware_la_SOURCES = $(VMWARE_DRIVER_SOURCES)
1121
endif WITH_VMWARE
1122

1123
if WITH_VBOX
1124 1125 1126 1127 1128 1129
noinst_LTLIBRARIES += libvirt_driver_vbox_impl.la
libvirt_driver_vbox_la_SOURCES =
libvirt_driver_vbox_la_LIBADD = libvirt_driver_vbox_impl.la
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_vbox.la
libvirt_driver_vbox_la_LIBADD += ../gnulib/lib/libgnu.la
1130
libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1131
else ! WITH_DRIVER_MODULES
1132
noinst_LTLIBRARIES += libvirt_driver_vbox.la
1133 1134 1135
# GPLv2-only license requries that it be linked into
# libvirtd and *not* libvirt.so
#libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la
1136
endif ! WITH_DRIVER_MODULES
1137 1138 1139 1140 1141 1142 1143

libvirt_driver_vbox_impl_la_CFLAGS =				\
		-I$(top_srcdir)/src/conf			\
		$(AM_CFLAGS)
libvirt_driver_vbox_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_vbox_impl_la_LIBADD =  $(DLOPEN_LIBS) $(MSCOM_LIBS)
libvirt_driver_vbox_impl_la_SOURCES = $(VBOX_DRIVER_SOURCES)
1144
endif WITH_VBOX
1145

1146 1147
if WITH_XENAPI
noinst_LTLIBRARIES += libvirt_driver_xenapi.la
1148
libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la
1149
libvirt_driver_xenapi_la_CFLAGS = $(LIBXENSERVER_CFLAGS) $(CURL_CFLAGS) \
1150
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
1151
libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS)
1152
libvirt_driver_xenapi_la_LIBADD = $(LIBXENSERVER_LIBS) $(CURL_LIBS)
1153
libvirt_driver_xenapi_la_SOURCES = $(XENAPI_DRIVER_SOURCES)
1154
endif WITH_XENAPI
1155

J
Jim Fehlig 已提交
1156
if WITH_LIBXL
E
Eric Blake 已提交
1157 1158 1159
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 已提交
1160 1161
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_libxl.la
E
Eric Blake 已提交
1162
libvirt_driver_libxl_la_LIBADD += ../gnulib/lib/libgnu.la
1163
libvirt_driver_libxl_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1164
else ! WITH_DRIVER_MODULES
J
Jim Fehlig 已提交
1165 1166 1167
noinst_LTLIBRARIES += libvirt_driver_libxl.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_libxl.la
1168
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1169

1170 1171 1172 1173 1174
libvirt_driver_libxl_impl_la_CFLAGS = 		\
		$(LIBXL_CFLAGS)			\
		-I$(top_srcdir)/src/access	\
		-I$(top_srcdir)/src/conf	\
		-I$(top_srcdir)/src/xenxs	\
1175
		$(AM_CFLAGS)
E
Eric Blake 已提交
1176 1177 1178
libvirt_driver_libxl_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_libxl_impl_la_LIBADD = $(LIBXL_LIBS) libvirt_xenxs.la
libvirt_driver_libxl_impl_la_SOURCES = $(LIBXL_DRIVER_SOURCES)
1179
endif WITH_LIBXL
J
Jim Fehlig 已提交
1180

1181
if WITH_QEMU
E
Eric Blake 已提交
1182 1183 1184
noinst_LTLIBRARIES += libvirt_driver_qemu_impl.la
libvirt_driver_qemu_la_SOURCES =
libvirt_driver_qemu_la_LIBADD = libvirt_driver_qemu_impl.la
1185 1186
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_qemu.la
E
Eric Blake 已提交
1187
libvirt_driver_qemu_la_LIBADD += ../gnulib/lib/libgnu.la
1188
libvirt_driver_qemu_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1189
else ! WITH_DRIVER_MODULES
1190
noinst_LTLIBRARIES += libvirt_driver_qemu.la
1191
# Stateful, so linked to daemon instead
1192
#libvirt_la_BUILT_LIBADD += libvirt_driver_qemu.la
1193
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1194

1195 1196 1197 1198 1199 1200
libvirt_driver_qemu_impl_la_CFLAGS = \
		$(GNUTLS_CFLAGS) \
		$(LIBNL_CFLAGS) \
		-I$(top_srcdir)/src/access \
		-I$(top_srcdir)/src/conf \
		$(AM_CFLAGS)
E
Eric Blake 已提交
1201
libvirt_driver_qemu_impl_la_LDFLAGS = $(AM_LDFLAGS)
1202
libvirt_driver_qemu_impl_la_LIBADD = $(CAPNG_LIBS) \
1203
                                $(GNUTLS_LIBS) \
1204 1205 1206
				$(LIBNL_LIBS) \
				$(LIBXML_LIBS) \
				$(NULL)
E
Eric Blake 已提交
1207
libvirt_driver_qemu_impl_la_SOURCES = $(QEMU_DRIVER_SOURCES)
1208

A
Amy Griffis 已提交
1209
conf_DATA += qemu/qemu.conf
1210

1211
augeas_DATA += qemu/libvirtd_qemu.aug
1212 1213
augeastest_DATA += test_libvirtd_qemu.aug
CLEANFILES += test_libvirtd_qemu.aug
1214

1215
endif WITH_QEMU
1216
EXTRA_DIST += qemu/qemu.conf qemu/libvirtd_qemu.aug \
1217
		qemu/test_libvirtd_qemu.aug.in qemu/THREADS.txt
1218

1219 1220

if WITH_LXC
E
Eric Blake 已提交
1221 1222 1223
noinst_LTLIBRARIES += libvirt_driver_lxc_impl.la
libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = libvirt_driver_lxc_impl.la
1224 1225
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_lxc.la
E
Eric Blake 已提交
1226 1227
libvirt_driver_lxc_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_lxc_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1228
else ! WITH_DRIVER_MODULES
1229
noinst_LTLIBRARIES += libvirt_driver_lxc.la
1230
# Stateful, so linked to daemon instead
1231
#libvirt_la_BUILT_LIBADD += libvirt_driver_lxc.la
1232
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1233 1234

libvirt_driver_lxc_impl_la_CFLAGS = \
S
Serge Hallyn 已提交
1235
		$(LIBNL_CFLAGS) \
G
Gao feng 已提交
1236
		$(FUSE_CFLAGS) \
1237 1238 1239
		-I$(top_srcdir)/src/access \
		-I$(top_srcdir)/src/conf \
		$(AM_CFLAGS)
G
Gao feng 已提交
1240
libvirt_driver_lxc_impl_la_LIBADD = $(CAPNG_LIBS) $(LIBNL_LIBS) $(FUSE_LIBS)
1241
if WITH_BLKID
E
Eric Blake 已提交
1242 1243
libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS)
1244
endif WITH_BLKID
1245
libvirt_driver_lxc_impl_la_LIBADD += $(SECDRIVER_LIBS)
E
Eric Blake 已提交
1246
libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES)
A
Amy Griffis 已提交
1247 1248 1249

conf_DATA += lxc/lxc.conf

1250
augeas_DATA += lxc/libvirtd_lxc.aug
1251 1252
augeastest_DATA += test_libvirtd_lxc.aug
CLEANFILES += test_libvirtd_lxc.aug
1253

1254
endif WITH_LXC
1255
EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in
1256

1257
if WITH_UML
E
Eric Blake 已提交
1258 1259 1260
noinst_LTLIBRARIES += libvirt_driver_uml_impl.la
libvirt_driver_uml_la_SOURCES =
libvirt_driver_uml_la_LIBADD = libvirt_driver_uml_impl.la
1261 1262
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_uml.la
E
Eric Blake 已提交
1263
libvirt_driver_uml_la_LIBADD += ../gnulib/lib/libgnu.la
1264
libvirt_driver_uml_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1265
else ! WITH_DRIVER_MODULES
1266 1267
noinst_LTLIBRARIES += libvirt_driver_uml.la
# Stateful, so linked to daemon instead
1268
#libvirt_la_BUILT_LIBADD += libvirt_driver_uml.la
1269
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1270

1271
libvirt_driver_uml_impl_la_CFLAGS = \
1272 1273 1274
		-I$(top_srcdir)/src/access \
		-I$(top_srcdir)/src/conf \
		$(AM_CFLAGS)
E
Eric Blake 已提交
1275
libvirt_driver_uml_impl_la_LDFLAGS = $(AM_LDFLAGS)
1276
# libvirt_driver_uml_impl_la_LIBADD =
E
Eric Blake 已提交
1277
libvirt_driver_uml_impl_la_SOURCES = $(UML_DRIVER_SOURCES)
1278
endif WITH_UML
1279

D
Daniel Veillard 已提交
1280

1281
BUILT_SOURCES += $(ESX_DRIVER_GENERATED)
D
Daniel Veillard 已提交
1282

1283 1284
ESX_GENERATED_STAMP = .esx_vi_generator.stamp

E
Eric Blake 已提交
1285 1286
EXTRA_DIST += $(ESX_GENERATED_STAMP)

1287 1288 1289
$(ESX_DRIVER_GENERATED): $(ESX_GENERATED_STAMP)

$(ESX_GENERATED_STAMP): $(srcdir)/esx/esx_vi_generator.input \
1290
                         $(srcdir)/esx/esx_vi_generator.py
1291 1292 1293 1294 1295
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/esx/esx_vi_generator.py \
	  && touch $@

MAINTAINERCLEANFILES += $(ESX_DRIVER_GENERATED) $(ESX_GENERATED_STAMP)

D
Daniel Veillard 已提交
1296

1297 1298
if WITH_ESX
noinst_LTLIBRARIES += libvirt_driver_esx.la
1299
libvirt_la_BUILT_LIBADD += libvirt_driver_esx.la
1300
libvirt_driver_esx_la_CFLAGS = $(CURL_CFLAGS) \
1301
		-I$(top_srcdir)/src/conf -I$(top_srcdir)/src/vmx $(AM_CFLAGS)
1302
libvirt_driver_esx_la_LDFLAGS = $(AM_LDFLAGS)
1303
libvirt_driver_esx_la_LIBADD = $(CURL_LIBS)
1304
libvirt_driver_esx_la_SOURCES = $(ESX_DRIVER_SOURCES)
1305
libvirt_driver_esx_la_DEPENDENCIES = $(ESX_DRIVER_GENERATED)
1306
endif WITH_ESX
1307

M
Matthias Bolte 已提交
1308

1309 1310
BUILT_SOURCES += $(HYPERV_DRIVER_GENERATED)

1311 1312
HYPERV_GENERATED_STAMP = .hyperv_wmi_generator.stamp

E
Eric Blake 已提交
1313 1314
EXTRA_DIST += $(HYPERV_GENERATED_STAMP)

1315 1316 1317
$(HYPERV_DRIVER_GENERATED): $(HYPERV_GENERATED_STAMP)

$(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \
1318
                            $(srcdir)/hyperv/hyperv_wmi_generator.py
1319 1320
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) \
	  $(srcdir)/hyperv/hyperv_wmi_generator.py \
1321 1322 1323
	  && touch $@

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

M
Matthias Bolte 已提交
1325 1326 1327 1328
if WITH_HYPERV
noinst_LTLIBRARIES += libvirt_driver_hyperv.la
libvirt_la_BUILT_LIBADD += libvirt_driver_hyperv.la
libvirt_driver_hyperv_la_CFLAGS = $(OPENWSMAN_CFLAGS) \
1329
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
M
Matthias Bolte 已提交
1330 1331 1332
libvirt_driver_hyperv_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_hyperv_la_LIBADD = $(OPENWSMAN_LIBS)
libvirt_driver_hyperv_la_SOURCES = $(HYPERV_DRIVER_SOURCES)
1333
endif WITH_HYPERV
M
Matthias Bolte 已提交
1334

D
Dmitry Guryanov 已提交
1335 1336 1337 1338 1339 1340
if WITH_PARALLELS
noinst_LTLIBRARIES += libvirt_driver_parallels.la
libvirt_la_BUILT_LIBADD += libvirt_driver_parallels.la
libvirt_driver_parallels_la_CFLAGS = \
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
libvirt_driver_parallels_la_SOURCES = $(PARALLELS_DRIVER_SOURCES)
1341
endif WITH_PARALLELS
D
Dmitry Guryanov 已提交
1342

R
Roman Bogorodskiy 已提交
1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362
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 = \
	-I$(top_srcdir)/src/access \
	-I$(top_srcdir)/src/conf \
	$(AM_CFLAGS)
libvirt_driver_bhyve_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_bhyve_impl_la_SOURCES = $(BHYVE_DRIVER_SOURCES)
endif WITH_BHYVE

1363
if WITH_NETWORK
E
Eric Blake 已提交
1364 1365 1366
noinst_LTLIBRARIES += libvirt_driver_network_impl.la
libvirt_driver_network_la_SOURCES =
libvirt_driver_network_la_LIBADD = libvirt_driver_network_impl.la
1367 1368
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_network.la
1369 1370 1371 1372
libvirt_driver_network_la_LIBADD += ../gnulib/lib/libgnu.la \
	$(LIBNL_LIBS) \
	$(DBUS_LIBS) \
	$(NULL)
E
Eric Blake 已提交
1373
libvirt_driver_network_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1374
else ! WITH_DRIVER_MODULES
1375
noinst_LTLIBRARIES += libvirt_driver_network.la
1376
# Stateful, so linked to daemon instead
1377
#libvirt_la_BUILT_LIBADD += libvirt_driver_network.la
1378
endif ! WITH_DRIVER_MODULES
E
Eric Blake 已提交
1379 1380

libvirt_driver_network_impl_la_CFLAGS = \
1381 1382 1383 1384 1385
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
		-I$(top_srcdir)/src/access \
		-I$(top_srcdir)/src/conf \
		$(AM_CFLAGS)
E
Eric Blake 已提交
1386
libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
1387
libvirt_driver_network_impl_la_LIBADD  = $(DBUS_LIBS)
1388
endif WITH_NETWORK
1389 1390 1391
EXTRA_DIST += network/default.xml


1392
if WITH_INTERFACE
1393 1394
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_interface.la
1395
else ! WITH_DRIVER_MODULES
1396
noinst_LTLIBRARIES += libvirt_driver_interface.la
1397 1398
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_interface.la
1399
endif ! WITH_DRIVER_MODULES
1400 1401 1402 1403
libvirt_driver_interface_la_CFLAGS = \
		-I$(top_srcdir)/src/access \
		-I$(top_srcdir)/src/conf \
		$(AM_CFLAGS)
1404
libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS)
1405 1406 1407 1408
libvirt_driver_interface_la_LIBADD =
if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
1409
else ! WITH_NETCF
1410
if WITH_UDEV
1411 1412
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
1413 1414
endif WITH_UDEV
endif ! WITH_NETCF
1415
if WITH_DRIVER_MODULES
1416
libvirt_driver_interface_la_LIBADD += ../gnulib/lib/libgnu.la
1417
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
1418
endif WITH_DRIVER_MODULES
1419
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
1420
endif WITH_INTERFACE
D
Daniel Veillard 已提交
1421

D
Daniel P. Berrange 已提交
1422
if WITH_SECRETS
1423 1424
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_secret.la
1425
else ! WITH_DRIVER_MODULES
1426
noinst_LTLIBRARIES += libvirt_driver_secret.la
1427
# Stateful, so linked to daemon instead
1428
#libvirt_la_BUILT_LIBADD += libvirt_driver_secret.la
1429
endif ! WITH_DRIVER_MODULES
1430
libvirt_driver_secret_la_CFLAGS = \
1431 1432 1433
		-I$(top_srcdir)/src/access \
		-I$(top_srcdir)/src/conf \
		$(AM_CFLAGS)
1434
if WITH_DRIVER_MODULES
1435
libvirt_driver_secret_la_LIBADD = ../gnulib/lib/libgnu.la
1436
libvirt_driver_secret_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1437
endif WITH_DRIVER_MODULES
1438
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
1439
endif WITH_SECRETS
1440

1441
# Needed to keep automake quiet about conditionals
1442 1443
libvirt_driver_storage_impl_la_SOURCES =
libvirt_driver_storage_impl_la_CFLAGS = \
1444 1445 1446
		-I$(top_srcdir)/src/access \
		-I$(top_srcdir)/src/conf \
		$(AM_CFLAGS)
1447 1448
libvirt_driver_storage_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_storage_impl_la_LIBADD =
1449
libvirt_driver_storage_impl_la_LIBADD += $(SECDRIVER_LIBS)
1450
if WITH_BLKID
1451 1452
libvirt_driver_storage_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(BLKID_LIBS)
1453
endif WITH_BLKID
1454
if WITH_STORAGE
1455 1456 1457
noinst_LTLIBRARIES += libvirt_driver_storage_impl.la
libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_LIBADD = libvirt_driver_storage_impl.la
1458 1459
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_storage.la
1460
libvirt_driver_storage_la_LIBADD += ../gnulib/lib/libgnu.la
1461
libvirt_driver_storage_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1462
else ! WITH_DRIVER_MODULES
1463
noinst_LTLIBRARIES += libvirt_driver_storage.la
1464
# Stateful, so linked to daemon instead
1465
#libvirt_la_BUILT_LIBADD += libvirt_driver_storage.la
1466
endif ! WITH_DRIVER_MODULES
1467 1468
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_FS_SOURCES)
1469
endif WITH_STORAGE
1470

1471
if WITH_STORAGE_LVM
1472
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_LVM_SOURCES)
1473
endif WITH_STORAGE_LVM
1474

1475
if WITH_STORAGE_ISCSI
1476
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_ISCSI_SOURCES)
1477
endif WITH_STORAGE_ISCSI
1478

1479
if WITH_STORAGE_SCSI
1480
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SCSI_SOURCES)
1481
endif WITH_STORAGE_SCSI
1482

D
Dave Allan 已提交
1483
if WITH_STORAGE_MPATH
1484 1485 1486
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)
1487
endif WITH_STORAGE_MPATH
D
Dave Allan 已提交
1488

1489
if WITH_STORAGE_DISK
1490
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_DISK_SOURCES)
1491
endif WITH_STORAGE_DISK
1492

1493
if WITH_STORAGE_RBD
1494 1495
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_RBD_SOURCES)
libvirt_driver_storage_impl_la_LIBADD += $(LIBRBD_LIBS)
1496
endif WITH_STORAGE_RBD
1497

1498
if WITH_STORAGE_SHEEPDOG
1499
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SHEEPDOG_SOURCES)
1500
endif WITH_STORAGE_SHEEPDOG
1501

1502 1503 1504 1505 1506 1507
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

1508 1509 1510 1511
if WITH_NODE_DEVICES
# Needed to keep automake quiet about conditionals
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nodedev.la
1512
else ! WITH_DRIVER_MODULES
1513 1514
noinst_LTLIBRARIES += libvirt_driver_nodedev.la
# Stateful, so linked to daemon instead
1515
#libvirt_la_BUILT_LIBADD += libvirt_driver_nodedev.la
1516
endif ! WITH_DRIVER_MODULES
1517 1518
libvirt_driver_nodedev_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES)

1519
libvirt_driver_nodedev_la_CFLAGS = \
1520 1521 1522
		-I$(top_srcdir)/src/access \
		-I$(top_srcdir)/src/conf \
		$(AM_CFLAGS)
1523
libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS)
1524
libvirt_driver_nodedev_la_LIBADD =
1525

D
Doug Goldstein 已提交
1526
if WITH_LIBVIRTD
1527
if WITH_HAL
1528 1529
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS)
1530
libvirt_driver_nodedev_la_LIBADD += $(HAL_LIBS)
1531
endif WITH_HAL
1532
if WITH_UDEV
1533
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES)
1534
libvirt_driver_nodedev_la_CFLAGS += $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS)
1535
libvirt_driver_nodedev_la_LIBADD += $(UDEV_LIBS) $(PCIACCESS_LIBS)
1536 1537
endif WITH_UDEV
endif WITH_LIBVIRTD
1538 1539

if WITH_DRIVER_MODULES
1540
libvirt_driver_nodedev_la_LIBADD += ../gnulib/lib/libgnu.la
1541
libvirt_driver_nodedev_la_LDFLAGS += -module -avoid-version
1542 1543
endif WITH_DRIVER_MODULES
endif WITH_NODE_DEVICES
1544 1545


1546
if WITH_NWFILTER
1547 1548 1549
noinst_LTLIBRARIES += libvirt_driver_nwfilter_impl.la
libvirt_driver_nwfilter_la_SOURCES =
libvirt_driver_nwfilter_la_LIBADD = libvirt_driver_nwfilter_impl.la
1550 1551
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nwfilter.la
1552
libvirt_driver_nwfilter_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1553
else ! WITH_DRIVER_MODULES
1554
noinst_LTLIBRARIES += libvirt_driver_nwfilter.la
1555 1556
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_nwfilter.la
1557
endif ! WITH_DRIVER_MODULES
1558
libvirt_driver_nwfilter_impl_la_CFLAGS = \
1559 1560 1561 1562 1563 1564
		$(LIBPCAP_CFLAGS) \
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
		-I$(top_srcdir)/src/access \
		-I$(top_srcdir)/src/conf \
		$(AM_CFLAGS)
1565 1566 1567 1568 1569
libvirt_driver_nwfilter_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_nwfilter_impl_la_LIBADD = \
		$(LIBPCAP_LIBS) \
		$(LIBNL_LIBS) \
		$(DBUS_LIBS)
1570
if WITH_DRIVER_MODULES
1571 1572
libvirt_driver_nwfilter_impl_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_nwfilter_impl_la_LDFLAGS += -module -avoid-version
1573
endif WITH_DRIVER_MODULES
1574
libvirt_driver_nwfilter_impl_la_SOURCES = $(NWFILTER_DRIVER_SOURCES)
1575
endif WITH_NWFILTER
1576 1577


1578 1579 1580 1581
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 = \
1582
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
1583
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
1584
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
1585
if WITH_SECDRIVER_SELINUX
1586 1587
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
1588
endif WITH_SECDRIVER_SELINUX
J
Jamie Strandboge 已提交
1589
if WITH_SECDRIVER_APPARMOR
1590 1591
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
1592
endif WITH_SECDRIVER_APPARMOR
1593

1594 1595
libvirt_driver_access_la_SOURCES = \
	$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
1596 1597 1598 1599 1600 1601 1602
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD =

1603 1604
EXTRA_DIST += access/genpolkit.pl

1605 1606 1607 1608
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
    $(srcdir)/access/genpolkit.pl Makefile.am
	$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@

1609 1610 1611 1612
if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)

polkitactiondir = $(datadir)/polkit-1/actions
1613
if WITH_LIBVIRTD
1614
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
1615
endif WITH_LIBVIRTD
1616 1617 1618

CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
1619
else ! WITH_POLKIT1
1620
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
1621
endif ! WITH_POLKIT1
1622

1623

1624 1625
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639

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

1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652
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 已提交
1653
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
1654 1655
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1656 1657 1658
	  remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
1659 1660
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1661 1662
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
	  > $(srcdir)/access/viraccessapicheck.c
1663

E
Eric Blake 已提交
1664
access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
1665 1666
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1667 1668 1669
	  qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/access/viraccessapicheckqemu.h
access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
1670 1671
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1672 1673
	  qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h \
	  > $(srcdir)/access/viraccessapicheckqemu.c
1674

E
Eric Blake 已提交
1675
access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
1676 1677
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
E
Eric Blake 已提交
1678 1679 1680
	  lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/access/viraccessapichecklxc.h
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
1681 1682
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
E
Eric Blake 已提交
1683 1684
	  lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \
	  > $(srcdir)/access/viraccessapichecklxc.c
1685

1686 1687 1688 1689 1690 1691 1692
# Add all conditional sources just in case...
EXTRA_DIST +=							\
		$(TEST_DRIVER_SOURCES)				\
		$(REMOTE_DRIVER_SOURCES)			\
		$(XEN_DRIVER_SOURCES)				\
		$(QEMU_DRIVER_SOURCES)				\
		$(LXC_DRIVER_SOURCES)				\
1693
		$(UML_DRIVER_SOURCES)				\
1694
		$(OPENVZ_DRIVER_SOURCES)			\
1695
		$(PHYP_DRIVER_SOURCES)				\
1696
		$(VBOX_DRIVER_SOURCES)				\
1697
		$(XENAPI_DRIVER_SOURCES)			\
O
Osier Yang 已提交
1698
		$(LIBXL_DRIVER_SOURCES)				\
1699
		$(ESX_DRIVER_SOURCES)				\
1700
		$(ESX_DRIVER_EXTRA_DIST)			\
M
Matthias Bolte 已提交
1701
		$(HYPERV_DRIVER_SOURCES)			\
1702
		$(HYPERV_DRIVER_EXTRA_DIST)			\
O
Osier Yang 已提交
1703
		$(PARALLELS_DRIVER_SOURCES)			\
R
Roman Bogorodskiy 已提交
1704
		$(BHYVE_DRIVER_SOURCES)				\
1705
		$(NETWORK_DRIVER_SOURCES)			\
1706
		$(INTERFACE_DRIVER_SOURCES)			\
1707 1708 1709 1710
		$(STORAGE_DRIVER_SOURCES)			\
		$(STORAGE_DRIVER_FS_SOURCES)			\
		$(STORAGE_DRIVER_LVM_SOURCES)			\
		$(STORAGE_DRIVER_ISCSI_SOURCES)			\
1711
		$(STORAGE_DRIVER_SCSI_SOURCES)			\
D
Dave Allan 已提交
1712
		$(STORAGE_DRIVER_MPATH_SOURCES)			\
1713
		$(STORAGE_DRIVER_DISK_SOURCES)			\
1714
		$(STORAGE_DRIVER_RBD_SOURCES)			\
1715
		$(STORAGE_DRIVER_SHEEPDOG_SOURCES)		\
1716
		$(STORAGE_DRIVER_GLUSTER_SOURCES)		\
1717 1718
		$(NODE_DEVICE_DRIVER_SOURCES)			\
		$(NODE_DEVICE_DRIVER_HAL_SOURCES)		\
1719
		$(NODE_DEVICE_DRIVER_UDEV_SOURCES)		\
1720
		$(NWFILTER_DRIVER_SOURCES)			\
1721
		$(SECURITY_DRIVER_SELINUX_SOURCES)		\
J
Jamie Strandboge 已提交
1722
		$(SECURITY_DRIVER_APPARMOR_SOURCES)		\
D
Daniel P. Berrange 已提交
1723
		$(SECRET_DRIVER_SOURCES)			\
1724
		$(VBOX_DRIVER_EXTRA_DIST)			\
1725
		$(VMWARE_DRIVER_SOURCES)			\
1726 1727
		$(XENXS_SOURCES)				\
		$(ACCESS_DRIVER_POLKIT_POLICY)
1728

1729 1730
check-local: check-augeas

1731 1732 1733 1734 1735 1736
.PHONY: check-augeas \
	check-augeas-qemu \
	check-augeas-lxc \
	check-augeas-sanlock \
	check-augeas-lockd \
	$(NULL)
1737

1738
check-augeas: check-augeas-qemu check-augeas-lxc check-augeas-sanlock \
1739
	check-augeas-lockd check-augeas-virtlockd
1740

1741
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
1742
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
1743

1744
if WITH_QEMU
1745 1746
test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
		$(srcdir)/qemu/qemu.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1747
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
1748

1749
check-augeas-qemu: test_libvirtd_qemu.aug
1750
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1751
	    '$(AUGPARSE)' -I $(srcdir)/qemu test_libvirtd_qemu.aug; \
1752
	fi
1753
else ! WITH_QEMU
1754
check-augeas-qemu:
1755
endif ! WITH_QEMU
1756

1757
if WITH_LXC
1758 1759
test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
		$(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1760
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
1761

1762
check-augeas-lxc: test_libvirtd_lxc.aug
1763
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1764
	    '$(AUGPARSE)' -I $(srcdir)/lxc test_libvirtd_lxc.aug; \
1765
	fi
1766
else ! WITH_LXC
1767
check-augeas-lxc:
1768
endif ! WITH_LXC
1769

1770
if WITH_SANLOCK
1771 1772
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1773
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
1774

1775
check-augeas-sanlock: test_libvirt_sanlock.aug
1776
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1777
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
1778
	fi
1779
else ! WITH_SANLOCK
1780
check-augeas-sanlock:
1781
endif ! WITH_SANLOCK
1782

1783
if WITH_QEMU
1784 1785 1786
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 $< $@
1787 1788 1789
else ! WITH_QEMU
test_libvirt_lockd.aug:
endif ! WITH_QEMU
1790

1791 1792
test_virtlockd.aug: locking/test_virtlockd.aug.in \
		locking/virtlockd.conf $(AUG_GENTEST)
1793
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
1794

1795
if WITH_QEMU
1796 1797 1798 1799
check-augeas-lockd: test_libvirt_lockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_lockd.aug; \
	fi
1800 1801 1802
else ! WITH_QEMU
check-augeas-lockd:
endif ! WITH_QEMU
1803

1804 1805 1806 1807 1808
check-augeas-virtlockd: test_virtlockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
	fi

1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827
#
# 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.
#

1828
if WITH_DRIVER_MODULES
1829
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
1830
else ! WITH_DRIVER_MODULES
1831
SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
1832
endif ! WITH_DRIVER_MODULES
1833

1834
if WITH_LINUX
1835
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
1836
else ! WITH_LINUX
1837
SYM_FILES += $(srcdir)/libvirt_linux.syms
1838
endif ! WITH_LINUX
1839

1840
if WITH_ESX
1841
USED_SYM_FILES += $(srcdir)/libvirt_esx.syms
1842
else ! WITH_ESX
1843
SYM_FILES += $(srcdir)/libvirt_esx.syms
1844
endif ! WITH_ESX
1845

1846
if WITH_LIBVIRTD
1847
USED_SYM_FILES += $(srcdir)/libvirt_daemon.syms
1848
else ! WITH_LIBVIRTD
1849
SYM_FILES += $(srcdir)/libvirt_daemon.syms
1850
endif ! WITH_LIBVIRTD
1851

E
Eric Blake 已提交
1852 1853 1854 1855 1856 1857
if WITH_REMOTE
USED_SYM_FILES += $(srcdir)/libvirt_remote.syms
else ! WITH_REMOTE
SYM_FILES += $(srcdir)/libvirt_remote.syms
endif ! WITH_REMOTE

1858
if WITH_OPENVZ
1859
USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms
1860
else ! WITH_OPENVZ
1861
SYM_FILES += $(srcdir)/libvirt_openvz.syms
1862
endif ! WITH_OPENVZ
1863

1864
if WITH_VMX
1865
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
1866
else ! WITH_VMX
1867
SYM_FILES += $(srcdir)/libvirt_vmx.syms
1868
endif ! WITH_VMX
1869

1870 1871 1872 1873 1874 1875
if WITH_VMWARE
USED_SYM_FILES += $(srcdir)/libvirt_vmware.syms
else ! WITH_VMWARE
SYM_FILES += $(srcdir)/libvirt_vmware.syms
endif ! WITH_VMWARE

1876
if WITH_XENXS
1877
USED_SYM_FILES += $(srcdir)/libvirt_xenxs.syms
1878
else ! WITH_XENXS
1879
SYM_FILES += $(srcdir)/libvirt_xenxs.syms
1880
endif ! WITH_XENXS
1881

1882
if WITH_SASL
1883
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
1884
else ! WITH_SASL
1885
SYM_FILES += $(srcdir)/libvirt_sasl.syms
1886
endif ! WITH_SASL
E
Eric Blake 已提交
1887

1888 1889
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
1890
else ! WITH_GNUTLS
1891
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
1892
endif ! WITH_GNUTLS
1893

1894
if WITH_SSH2
1895
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
1896
else ! WITH_SSH2
1897
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
1898
endif ! WITH_SSH2
1899

1900
if WITH_ATOMIC_OPS_PTHREAD
1901
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
1902
else ! WITH_ATOMIC_OPS_PTHREAD
1903
SYM_FILES += $(srcdir)/libvirt_atomic.syms
1904
endif ! WITH_ATOMIC_OPS_PTHREAD
1905

1906
EXTRA_DIST += \
1907 1908 1909 1910 1911
	libvirt_public.syms		\
	libvirt_lxc.syms		\
	libvirt_qemu.syms		\
	$(SYM_FILES)			\
	$(NULL)
1912

1913
BUILT_SOURCES += $(GENERATED_SYM_FILES)
1914

1915 1916
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(ACCESS_DRIVER_SYM_FILES) \
1917
		$(top_builddir)/config.status
1918 1919 1920 1921 1922 1923
	$(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 && \
1924
	cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
1925 1926
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
1927
	mv $@-tmp libvirt.syms
1928

1929 1930 1931
libvirt.def: libvirt.syms
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
1932 1933
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d'	\
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
1934 1935 1936
	chmod a-w $@-tmp && \
	mv $@-tmp libvirt.def

1937 1938 1939
libvirt_qemu.def: $(srcdir)/libvirt_qemu.syms
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
1940 1941
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d'	\
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
1942 1943 1944
	chmod a-w $@-tmp && \
	mv $@-tmp libvirt_qemu.def

1945 1946 1947
libvirt_lxc.def: $(srcdir)/libvirt_lxc.syms
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
1948 1949
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d'	\
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
1950 1951 1952
	chmod a-w $@-tmp && \
	mv $@-tmp libvirt_lxc.def

1953 1954
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
1955 1956 1957 1958 1959 1960 1961 1962
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)
1963
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
1964
libvirt_la_LIBADD += \
1965
		    $(DRIVER_MODULE_LIBS) \
1966
		    $(CYGWIN_EXTRA_LIBADD)
1967
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
1968 1969 1970 1971 1972 1973
# 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)
1974

1975
if WITH_DTRACE_PROBES
1976
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
1977
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
1978
nodist_libvirt_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
1979
if WITH_REMOTE
E
Eric Blake 已提交
1980
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
1981
endif WITH_REMOTE
1982 1983
if WITH_DRIVER_MODULES
DTRACE2SYSTEMTAP_FLAGS = --with-modules
1984
endif WITH_DRIVER_MODULES
1985

1986 1987 1988
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

if WITH_QEMU
1989
libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.lo
1990
nodist_libvirt_driver_qemu_la_SOURCES = libvirt_qemu_probes.h
1991
BUILT_SOURCES += libvirt_qemu_probes.h
1992
endif WITH_QEMU
1993 1994

tapsetdir = $(datadir)/systemtap/tapset
1995
tapset_DATA = libvirt_probes.stp libvirt_qemu_probes.stp libvirt_functions.stp
1996

1997
%_probes.h: %_probes.d
1998 1999
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

E
Eric Blake 已提交
2000
.PRECIOUS: %_probes.o
2001
%_probes.o: %_probes.d
2002 2003
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

2004 2005 2006 2007 2008 2009 2010 2011 2012
%_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 已提交
2013
# Keep this list synced with PROTOCOL_STRUCTS
J
Jiri Denemark 已提交
2014 2015 2016
RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
2017
		  $(srcdir)/remote/lxc_protocol.x \
2018 2019 2020
		  $(srcdir)/remote/qemu_protocol.x \
		  $(srcdir)/lxc/lxc_monitor_protocol.x \
		  $(srcdir)/locking/lock_protocol.x
2021 2022

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

2025 2026
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl \
		$(top_builddir)/config.status
2027
	$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
2028
	  $(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
2029

2030
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
2031
              libvirt_qemu_probes.h libvirt_qemu_probes.o \
2032
              libvirt_qemu_probes.lo\
2033 2034
              libvirt_functions.stp libvirt_probes.stp \
              libvirt_qemu_probes.stp
2035
endif WITH_DTRACE_PROBES
2036

2037
EXTRA_DIST += libvirt_probes.d libvirt_qemu_probes.d
2038

C
Chris Lalancette 已提交
2039
libvirt_qemu_la_SOURCES = libvirt-qemu.c
D
Daniel P. Berrange 已提交
2040 2041 2042 2043 2044 2045 2046
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)
2047
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
C
Chris Lalancette 已提交
2048
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
2049

2050
libvirt_lxc_la_SOURCES = libvirt-lxc.c
D
Daniel P. Berrange 已提交
2051 2052 2053 2054 2055 2056 2057
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)
2058 2059 2060
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)

2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072
# 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			\
2073 2074
		util/viratomic.c		\
		util/viratomic.h		\
2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099
		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		\
		util/virtypedparam.c		\
		util/viruri.c			\
		util/virutil.c			\
		util/viruuid.c			\
		conf/domain_event.c		\
2100
		conf/network_event.c		\
2101
		conf/object_event.c		\
2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123
		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			\
		libvirt-lxc.c			\
		$(NULL)

libvirt_setuid_rpc_client_la_LDFLAGS =		\
		$(AM_LDFLAGS)			\
		$(LIBXML_LIBS)			\
J
Jim Fehlig 已提交
2124
		$(SECDRIVER_LIBS)		\
2125 2126 2127 2128 2129 2130
		$(NULL)
libvirt_setuid_rpc_client_la_CFLAGS =		\
		-DLIBVIRT_SETUID_RPC_CLIENT	\
		-I$(top_srcdir)/src/conf	\
		-I$(top_srcdir)/src/rpc		\
		$(AM_CFLAGS)			\
J
Jim Fehlig 已提交
2131
		$(SECDRIVER_CFLAGS)		\
2132 2133 2134
		$(NULL)
endif WITH_LXC

2135 2136 2137
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

2138
if WITH_LIBVIRTD
2139 2140 2141 2142 2143
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
		$(LOCK_DRIVER_LOCKD_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
		$(NULL)
E
Eric Blake 已提交
2144 2145 2146
lockd_la_CFLAGS = -I$(top_srcdir)/src/conf \
		$(XDR_CFLAGS) \
		$(AM_CFLAGS)
2147
lockd_la_LDFLAGS = -module -avoid-version
2148 2149 2150 2151
lockd_la_LIBADD = ../gnulib/lib/libgnu.la \
	libvirt-net-rpc.la \
	libvirt-net-rpc-client.la \
	$(NULL)
J
Jiri Denemark 已提交
2152
augeas_DATA += locking/libvirt_lockd.aug
2153 2154
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
2155
endif WITH_DTRACE_PROBES
2156
if WITH_QEMU
2157 2158
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
2159
nodist_conf_DATA += locking/qemu-lockd.conf
2160 2161
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
2162
endif WITH_QEMU
2163 2164 2165 2166 2167 2168

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


2169 2170
sbin_PROGRAMS = virtlockd

2171 2172 2173
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
2174
		$(LOCK_DAEMON_GENERATED) \
2175
		$(NULL)
2176 2177
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
2178
		$(PIE_CFLAGS) \
2179
		$(XDR_CFLAGS) \
2180 2181 2182
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
2183
		$(PIE_LDFLAGS) \
2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195
		$(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
2196
endif WITH_DTRACE_PROBES
2197

2198
else ! WITH_LIBVIRTD
2199 2200
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
              $(LOCK_DRIVER_LOCKD_SOURCES)
2201
endif ! WITH_LIBVIRTD
2202

J
Jiri Denemark 已提交
2203 2204 2205 2206
EXTRA_DIST += locking/virtlockd.sysconf \
	locking/lockd.conf \
	locking/libvirt_lockd.aug \
	locking/test_libvirt_lockd.aug.in
2207 2208

install-sysconfig:
E
Eric Blake 已提交
2209
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
2210 2211 2212 2213 2214
	$(INSTALL_DATA) $(srcdir)/locking/virtlockd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd

uninstall-sysconfig:
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
E
Eric Blake 已提交
2215
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
2216 2217 2218 2219 2220 2221

EXTRA_DIST += locking/virtlockd.init.in

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_RED_HAT
install-init:: virtlockd.init install-sysconfig
E
Eric Blake 已提交
2222
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
2223 2224 2225 2226
	$(INSTALL_SCRIPT) virtlockd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd

uninstall-init:: uninstall-sysconfig
E
Eric Blake 已提交
2227 2228
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
2229 2230

BUILT_SOURCES += virtlockd.init
E
Eric Blake 已提交
2231
DISTCLEANFILES += virtlockd.init
2232
else ! LIBVIRT_INIT_SCRIPT_RED_HAT
2233 2234
install-init::
uninstall-init::
2235 2236
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
else ! WITH_LIBVIRTD
2237 2238
install-init::
uninstall-init::
2239
endif ! WITH_LIBVIRTD
2240 2241

virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
2242 2243 2244 2245 2246 2247
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g'		\
	    < $< > $@-t &&					\
	    chmod a+x $@-t &&					\
2248 2249
	    mv $@-t $@

2250 2251
POD2MAN = pod2man -c "Virtualization Support" \
			-r "$(PACKAGE)-$(VERSION)" -s 8
2252

2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263
$(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 $@

2264
if WITH_LIBVIRTD
2265 2266
man8_MANS = virtlockd.8

2267 2268 2269 2270
conf_DATA += locking/virtlockd.conf

augeas_DATA += locking/virtlockd.aug
augeastest_DATA += test_virtlockd.aug
2271
endif WITH_LIBVIRTD
2272

2273
CLEANFILES += test_virtlockd.aug virtlockd.8
2274 2275 2276 2277 2278 2279 2280
MAINTAINERCLEANFILES += $(srcdir)/virtlockd.8.in

EXTRA_DIST += \
        locking/virtlockd.service.in \
        locking/virtlockd.socket.in \
        locking/virtlockd.pod.in \
        virtlockd.8.in \
2281 2282 2283
        locking/virtlockd.aug \
        locking/virtlockd.conf \
        locking/test_virtlockd.aug.in \
2284
        $(NULL)
2285

2286 2287 2288 2289

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

2290
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
2291 2292

BUILT_SOURCES += virtlockd.service virtlockd.socket
E
Eric Blake 已提交
2293
DISTCLEANFILES += virtlockd.service virtlockd.socket
2294

E
Eric Blake 已提交
2295 2296
install-systemd: virtlockd.service virtlockd.socket install-sysconfig
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
2297
	$(INSTALL_DATA) virtlockd.service \
2298
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2299
	$(INSTALL_DATA) virtlockd.socket \
2300 2301 2302
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/

uninstall-systemd: uninstall-sysconfig
E
Eric Blake 已提交
2303 2304 2305
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.socket
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
2306
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
2307 2308
install-systemd:
uninstall-systemd:
2309 2310
endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
else ! WITH_LIBVIRTD
2311 2312
install-systemd:
uninstall-systemd:
2313
endif ! WITH_LIBVIRTD
2314 2315

virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
2316 2317 2318
	$(AM_V_GEN)sed						\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    < $< > $@-t &&					\
2319 2320 2321
	    mv $@-t $@

virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
2322 2323 2324
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    < $< > $@-t &&					\
2325 2326 2327
	    mv $@-t $@


2328
if WITH_SANLOCK
2329
lockdriver_LTLIBRARIES += sanlock.la
2330
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
2331
sanlock_la_CFLAGS = -I$(top_srcdir)/src/conf $(AM_CFLAGS)
2332
sanlock_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
2333
sanlock_la_LIBADD = -lsanlock_client \
2334 2335 2336
		../gnulib/lib/libgnu.la

augeas_DATA += locking/libvirt_sanlock.aug
2337 2338
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
2339

E
Eric Blake 已提交
2340
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
2341
	$(AM_V_GEN)$(MKDIR_P) locking ; \
2342 2343 2344
	cp $< $@

if WITH_QEMU
2345
nodist_conf_DATA += locking/qemu-sanlock.conf
2346
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
2347
DISTCLEANFILES += locking/qemu-sanlock.conf
2348 2349
endif WITH_QEMU
else ! WITH_SANLOCK
2350
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
2351
endif ! WITH_SANLOCK
2352 2353
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
2354
	locking/test_libvirt_sanlock.aug.in
2355

2356 2357 2358 2359
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
2360

2361
EXTRA_DIST += \
E
Eric Blake 已提交
2362 2363 2364 2365
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
2366 2367
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
2368

E
Eric Blake 已提交
2369
VIR_NET_RPC_GENERATED = \
2370 2371 2372 2373
	rpc/virnetprotocol.h \
	rpc/virnetprotocol.c \
	rpc/virkeepaliveprotocol.h \
	rpc/virkeepaliveprotocol.c
2374

2375
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2376

2377
libvirt_net_rpc_la_SOURCES = \
2378
	rpc/virnetmessage.h rpc/virnetmessage.c \
2379
	rpc/virnetsocket.h rpc/virnetsocket.c \
2380 2381
	rpc/virkeepalive.h rpc/virkeepalive.c \
	$(VIR_NET_RPC_GENERATED)
2382
if WITH_SSH2
2383 2384
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2385
else ! WITH_SSH2
2386 2387
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
2388
endif ! WITH_SSH2
2389
if WITH_GNUTLS
2390 2391
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2392
else ! WITH_GNUTLS
2393 2394
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
2395
endif ! WITH_GNUTLS
2396
if WITH_SASL
2397 2398
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2399
else ! WITH_SASL
2400 2401
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
2402
endif ! WITH_SASL
2403
libvirt_net_rpc_la_CFLAGS = \
2404
			$(GNUTLS_CFLAGS) \
2405
			$(SASL_CFLAGS) \
2406
			$(SSH2_CFLAGS) \
2407
			$(XDR_CFLAGS) \
2408 2409
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
2410
			$(GNUTLS_LIBS) \
2411
			$(SASL_LIBS) \
2412
			$(SSH2_LIBS)\
J
Jim Fehlig 已提交
2413
			$(SECDRIVER_LIBS) \
2414 2415 2416 2417 2418 2419
			$(AM_LDFLAGS) \
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2420 2421 2422 2423
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
2424
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
2425 2426
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
2427
			$(AVAHI_CFLAGS) \
2428
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
2429
			$(XDR_CFLAGS) \
J
Jim Fehlig 已提交
2430 2431
			$(AM_CFLAGS) \
			$(POLKIT_CFLAGS)
2432 2433
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
2434
			$(AVAHI_LIBS) \
2435
			$(DBUS_LIBS) \
J
Jim Fehlig 已提交
2436
			$(POLKIT_LIBS) \
2437 2438 2439 2440 2441
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2442 2443 2444 2445 2446
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 已提交
2447 2448
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
2449 2450 2451 2452 2453 2454
libvirt_net_rpc_client_la_LDFLAGS = \
			$(AM_LDFLAGS) \
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
2455

2456 2457
libexec_PROGRAMS =

2458
if WITH_LIBVIRTD
2459 2460
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2461 2462 2463 2464
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2465 2466 2467
libvirt_iohelper_LDADD =		\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
2468 2469
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
2470
endif WITH_DTRACE_PROBES
2471

D
Daniel P. Berrange 已提交
2472 2473 2474 2475
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494

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

2495
endif WITH_LIBVIRTD
2496

2497
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
2498
if WITH_LIBVIRTD
2499
libexec_PROGRAMS += libvirt_parthelper
2500

2501
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
D
Daniel P. Berrange 已提交
2502 2503 2504 2505
libvirt_parthelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2506 2507 2508 2509
libvirt_parthelper_LDADD =		\
		$(LIBPARTED_LIBS)	\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
2510 2511
if WITH_DTRACE_PROBES
libvirt_parthelper_LDADD += libvirt_probes.lo
2512
endif WITH_DTRACE_PROBES
2513

D
Daniel P. Berrange 已提交
2514 2515 2516 2517 2518
libvirt_parthelper_CFLAGS = \
		$(LIBPARTED_CFLAGS) \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2519 2520
endif WITH_LIBVIRTD
endif WITH_STORAGE_DISK
2521 2522
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)

2523

2524
if WITH_SANLOCK
2525 2526 2527
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2528 2529 2530 2531 2532 2533 2534 2535 2536
libvirt_sanlock_helper_CFLAGS = \
		-I$(top_srcdir)/src/conf \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2537
libvirt_sanlock_helper_LDADD = libvirt.la
2538
endif WITH_SANLOCK
2539

2540 2541 2542 2543 2544 2545
if WITH_LXC
if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_lxc

libvirt_lxc_SOURCES =						\
		$(LXC_CONTROLLER_SOURCES)			\
O
Osier Yang 已提交
2546 2547
		$(NODE_INFO_SOURCES)				\
		$(DATATYPES_SOURCES)
D
Daniel P. Berrange 已提交
2548 2549 2550 2551
libvirt_lxc_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2552
libvirt_lxc_LDADD =			\
G
Gao feng 已提交
2553
		$(FUSE_LIBS) \
2554 2555
		libvirt-net-rpc-server.la \
		libvirt-net-rpc.la \
2556
		libvirt_security_manager.la \
2557 2558
		libvirt_conf.la \
		libvirt_util.la \
2559
		../gnulib/lib/libgnu.la
2560
if WITH_DTRACE_PROBES
2561
libvirt_lxc_LDADD += libvirt_probes.lo
2562
endif WITH_DTRACE_PROBES
2563
libvirt_lxc_LDADD += $(SECDRIVER_LIBS)
2564
libvirt_lxc_CFLAGS =				\
2565
		-I$(top_srcdir)/src/conf	\
2566
		$(AM_CFLAGS)                    \
D
Daniel P. Berrange 已提交
2567
		$(PIE_CFLAGS)			\
G
Gao feng 已提交
2568
		$(LIBNL_CFLAGS)			\
D
Daniel P. Berrange 已提交
2569
		$(FUSE_CFLAGS)			\
2570
		$(DBUS_CFLAGS)			\
D
Daniel P. Berrange 已提交
2571
		$(NULL)
2572
if WITH_BLKID
2573 2574
libvirt_lxc_CFLAGS += $(BLKID_CFLAGS)
libvirt_lxc_LDADD += $(BLKID_LIBS)
2575
endif WITH_BLKID
J
Jim Fehlig 已提交
2576
libvirt_lxc_CFLAGS += $(SECDRIVER_CFLAGS)
2577 2578
endif WITH_LIBVIRTD
endif WITH_LXC
2579 2580
EXTRA_DIST += $(LXC_CONTROLLER_SOURCES)

J
Jamie Strandboge 已提交
2581 2582 2583 2584 2585 2586
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 已提交
2587 2588 2589 2590
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
J
Jamie Strandboge 已提交
2591
virt_aa_helper_LDADD =						\
2592
		libvirt.la					\
C
Chris Lalancette 已提交
2593 2594
		libvirt_conf.la					\
		libvirt_util.la					\
2595
		libvirt_driver_storage_impl.la			\
C
Chris Lalancette 已提交
2596
		../gnulib/lib/libgnu.la
2597
if WITH_DTRACE_PROBES
2598
virt_aa_helper_LDADD += libvirt_probes.lo
2599
endif WITH_DTRACE_PROBES
J
Jamie Strandboge 已提交
2600
virt_aa_helper_CFLAGS =						\
2601 2602
		-I$(top_srcdir)/src/conf			\
		-I$(top_srcdir)/src/security			\
D
Daniel P. Berrange 已提交
2603 2604 2605
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2606 2607
endif WITH_LIBVIRTD
endif WITH_SECDRIVER_APPARMOR
J
Jamie Strandboge 已提交
2608 2609
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

2610
install-data-local: install-init install-systemd
2611 2612
if WITH_LIBVIRTD
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
2613
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
2614
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
2615
endif WITH_LIBVIRTD
2616 2617
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
2618
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
2619
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
2620
if WITH_SANLOCK
2621
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
2622
endif WITH_SANLOCK
2623 2624
if WITH_QEMU
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu"
2625
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu/channel/target"
2626
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu"
2627
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu"
2628
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu"
2629
endif WITH_QEMU
2630 2631 2632
if WITH_LXC
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lxc"
2633
endif WITH_LXC
J
Jim Fehlig 已提交
2634 2635 2636
if WITH_LIBXL
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/libxl"
J
Jim Fehlig 已提交
2637
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl"
2638
endif WITH_LIBXL
2639 2640 2641
if WITH_UML
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/uml"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/uml"
2642
endif WITH_UML
2643 2644
if WITH_XEN
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/xen"
2645
endif WITH_XEN
2646 2647
if WITH_NETWORK
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network"
2648
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq"
2649
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/network"
2650
	$(MKDIR_P) "$(DESTDIR)$(confdir)/qemu/networks/autostart"
2651
	$(INSTALL_DATA) $(srcdir)/network/default.xml \
2652
	  $(DESTDIR)$(confdir)/qemu/networks/default.xml
2653
	test -z "$(UUID)" || \
E
Eric Blake 已提交
2654
	  { sed -e "s,</name>,</name>\n  <uuid>$(UUID)</uuid>," \
2655 2656 2657 2658 2659 2660
	      $(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 已提交
2661
	   ln -s ../default.xml \
2662
	    $(DESTDIR)$(confdir)/qemu/networks/autostart/default.xml
2663
endif WITH_NETWORK
2664

2665
uninstall-local:: uninstall-init uninstall-systemd
2666
if WITH_LIBVIRTD
2667
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
2668 2669
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
2670
endif WITH_LIBVIRTD
2671 2672
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
2673
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
2674
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
2675
if WITH_SANLOCK
2676
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
2677
endif WITH_SANLOCK
2678 2679 2680 2681 2682
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" ||:
2683
endif WITH_QEMU
2684 2685 2686
if WITH_LXC
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||:
2687
endif WITH_LXC
J
Jim Fehlig 已提交
2688 2689 2690
if WITH_LIBXL
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||:
J
Jim Fehlig 已提交
2691
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||:
2692
endif WITH_LIBXL
2693 2694 2695
if WITH_UML
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/uml" ||:
2696
endif WITH_UML
2697 2698
if WITH_XEN
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/xen" ||:
2699
endif WITH_XEN
2700
if WITH_NETWORK
2701 2702 2703 2704
	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" || :
2705 2706
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||:
2707
endif WITH_NETWORK
2708
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
2709

2710 2711
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
2712
MAINTAINERCLEANFILES += $(REMOTE_DRIVER_GENERATED) $(VIR_NET_RPC_GENERATED)