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

3
## Copyright (C) 2005-2013 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
# No libraries with the exception of LIBXML should be listed
# here. List them against the individual XXX_la_CFLAGS targets
21
# that actually use them. Also keep GETTEXT_CPPFLAGS at the end.
22 23
INCLUDES =	-I../gnulib/lib					\
		-I$(top_srcdir)/gnulib/lib			\
24
		-I../include					\
25 26
		-I$(top_srcdir)/include				\
		-I$(top_srcdir)/src/util			\
27 28
		-DIN_LIBVIRT					\
		$(GETTEXT_CPPFLAGS)
E
Eric Blake 已提交
29

30
AM_CFLAGS =	$(LIBXML_CFLAGS)				\
31
		$(WARN_CFLAGS)					\
E
Eric Blake 已提交
32 33 34
		$(LOCK_CHECKING_CFLAGS)				\
		$(WIN32_EXTRA_CFLAGS)				\
		$(COVERAGE_CFLAGS)
35 36
AM_LDFLAGS =	$(DRIVER_MODULE_LDFLAGS)			\
		$(COVERAGE_LDFLAGS)
37

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

40
BUILT_SOURCES =
41 42 43
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
44
nodist_conf_DATA =
45

E
Eric Blake 已提交
46 47
THREAD_LIBS = $(LIB_PTHREAD) $(LTLIBMULTITHREAD)

48 49 50 51 52 53 54 55
SECDRIVER_LIBS =
if WITH_SECDRIVER_SELINUX
SECDRIVER_LIBS += $(SELINUX_LIBS)
endif
if WITH_SECDRIVER_APPARMOR
SECDRIVER_LIBS += $(APPARMOR_LIBS)
endif

56 57 58
if WITH_NETWORK
UUID=$(shell uuidgen 2>/dev/null)
endif
59

60
lib_LTLIBRARIES = libvirt.la libvirt-qemu.la libvirt-lxc.la
61

62
moddir = $(libdir)/libvirt/connection-driver
63 64
mod_LTLIBRARIES =

A
Amy Griffis 已提交
65
confdir = $(sysconfdir)/libvirt
66
conf_DATA = libvirt.conf
67

68 69 70 71 72 73
augeasdir = $(datadir)/augeas/lenses
augeas_DATA =

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

74 75
# These files are not related to driver APIs. Simply generic
# helper APIs for various purposes
76
UTIL_SOURCES =							\
77
		util/viralloc.c util/viralloc.h			\
78
		util/virarch.h util/virarch.c			\
79
		util/viratomic.h util/viratomic.c		\
80
		util/viraudit.c util/viraudit.h			\
81
		util/virauth.c util/virauth.h			\
82
		util/virauthconfig.c util/virauthconfig.h	\
83
		util/virbitmap.c util/virbitmap.h		\
84
		util/virbuffer.c util/virbuffer.h		\
85
		util/vircgroup.c util/vircgroup.h util/vircgrouppriv.h	\
86
		util/vircommand.c util/vircommand.h		\
87
		util/virconf.c util/virconf.h			\
88 89
		util/virdbus.c util/virdbus.h			\
		util/virdnsmasq.c util/virdnsmasq.h		\
90
		util/virebtables.c util/virebtables.h		\
E
Eric Blake 已提交
91
		util/virendian.h				\
92
		util/virerror.c util/virerror.h			\
93
		util/virevent.c util/virevent.h			\
94
		util/vireventpoll.c util/vireventpoll.h		\
E
Eric Blake 已提交
95
		util/virfile.c util/virfile.h			\
96 97
		util/virhash.c util/virhash.h			\
		util/virhashcode.c util/virhashcode.h		\
98
		util/virhook.c util/virhook.h			\
99
		util/viridentity.c util/viridentity.h		\
100
		util/virinitctl.c util/virinitctl.h		\
101
		util/viriptables.c util/viriptables.h		\
102
		util/virjson.c util/virjson.h			\
L
Lai Jiangshan 已提交
103
		util/virkeycode.c util/virkeycode.h		\
104
		util/virkeyfile.c util/virkeyfile.h		\
105
		util/virkeymaps.h				\
106
		util/virlockspace.c util/virlockspace.h		\
107
		util/virlog.c util/virlog.h			\
108
		util/virmacaddr.h util/virmacaddr.c		\
109
		util/virnetdev.h util/virnetdev.c		\
110
		util/virnetdevbandwidth.h util/virnetdevbandwidth.c \
111
		util/virnetdevbridge.h util/virnetdevbridge.c	\
112
		util/virnetdevmacvlan.c util/virnetdevmacvlan.h	\
A
Ansis Atteka 已提交
113
		util/virnetdevopenvswitch.h util/virnetdevopenvswitch.c \
114
		util/virnetdevtap.h util/virnetdevtap.c		\
115 116
		util/virnetdevveth.h util/virnetdevveth.c	\
		util/virnetdevvlan.h util/virnetdevvlan.c	\
117
		util/virnetdevvportprofile.h util/virnetdevvportprofile.c \
118
		util/virnetlink.c util/virnetlink.h		\
119
		util/virnodesuspend.c util/virnodesuspend.h	\
120
		util/virnuma.c util/virnuma.h			\
121 122 123
		util/virobject.c util/virobject.h		\
		util/virpci.c util/virpci.h			\
		util/virpidfile.c util/virpidfile.h		\
D
Daniel P. Berrange 已提交
124
		util/virportallocator.c util/virportallocator.h \
125
		util/virprocess.c util/virprocess.h		\
126
		util/virrandom.h util/virrandom.c		\
127
		util/virscsi.c util/virscsi.h			\
128 129 130 131 132 133 134 135 136 137 138
		util/virsexpr.c util/virsexpr.h			\
		util/virsocketaddr.h util/virsocketaddr.c	\
		util/virstatslinux.c util/virstatslinux.h	\
		util/virstoragefile.c util/virstoragefile.h	\
		util/virstring.h util/virstring.c		\
		util/virsysinfo.c util/virsysinfo.h		\
		util/virthread.c util/virthread.h		\
		util/virthreadpthread.h				\
		util/virthreadwin32.h				\
		util/virthreadpool.c util/virthreadpool.h	\
		util/virtime.h util/virtime.c			\
139
		util/virtpm.h util/virtpm.c			\
140
		util/virtypedparam.c util/virtypedparam.h	\
141
		util/virusb.c util/virusb.h			\
142 143
		util/viruri.h util/viruri.c			\
		util/virutil.c util/virutil.h			\
144
		util/viruuid.c util/viruuid.h			\
145
		util/virxml.c util/virxml.h			\
146
		$(NULL)
L
Lai Jiangshan 已提交
147

148

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

152 153
BUILT_SOURCES += $(srcdir)/util/virkeymaps.h

L
Lai Jiangshan 已提交
154 155
$(srcdir)/util/virkeymaps.h: $(srcdir)/util/keymaps.csv	\
		$(srcdir)/util/virkeycode-mapgen.py
156
	$(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py <$(srcdir)/util/keymaps.csv >$@
L
Lai Jiangshan 已提交
157

158
EXTRA_DIST += util/virthreadpthread.c util/virthreadwin32.c
159

160
# Internal generic driver infrastructure
161
NODE_INFO_SOURCES = nodeinfo.h nodeinfo.c
O
Osier Yang 已提交
162 163 164 165 166 167 168 169 170 171 172
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	\
173
		locking/domain_lock.h locking/domain_lock.c
174

175 176 177
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

178 179
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
180

181
LOCK_PROTOCOL_GENERATED = \
182 183
		$(srcdir)/locking/lock_protocol.h \
		$(srcdir)/locking/lock_protocol.c \
184 185
		$(NULL)

186 187 188
LOCK_PROTOCOL = $(srcdir)/locking/lock_protocol.x
EXTRA_DIST += $(LOCK_PROTOCOL) \
	$(LOCK_PROTOCOL_GENERATED)
189 190 191
BUILT_SOURCES += $(LOCK_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(LOCK_PROTOCOL_GENERATED)

192
LOCK_DAEMON_GENERATED = \
193
		$(srcdir)/locking/lock_daemon_dispatch_stubs.h
194 195 196
		$(NULL)

BUILT_SOURCES += $(LOCK_DAEMON_GENERATED)
197
EXTRA_DIST += $(LOCK_DAEMON_GENERATED)
198 199
MAINTAINERCLEANFILES += $(LOCK_DAEMON_GENERATED)

200 201 202 203
LOCK_DRIVER_LOCKD_SOURCES = \
		locking/lock_driver_lockd.c \
		$(NULL)

204 205 206 207 208
LOCK_DAEMON_SOURCES = \
		locking/lock_daemon.h \
		locking/lock_daemon.c \
		locking/lock_daemon_config.h \
		locking/lock_daemon_config.c \
209 210
		locking/lock_daemon_dispatch.c \
		locking/lock_daemon_dispatch.h \
211 212
		$(NULL)

213 214
$(srcdir)/locking/lock_daemon_dispatch_stubs.h: $(LOCK_PROTOCOL) \
		$(srcdir)/rpc/gendispatch.pl Makefile.am
215 216
	$(AM_V_GEN)perl -w $(srcdir)/rpc/gendispatch.pl --mode=server \
	    virLockSpaceProtocol VIR_LOCK_SPACE_PROTOCOL \
217
	    $(LOCK_PROTOCOL) > $@
218 219


220 221
NETDEV_CONF_SOURCES =						\
		conf/netdev_bandwidth_conf.h conf/netdev_bandwidth_conf.c \
222 223
		conf/netdev_vport_profile_conf.h conf/netdev_vport_profile_conf.c \
		conf/netdev_vlan_conf.h conf/netdev_vlan_conf.c
224

225
# XML configuration format handling sources
226 227
# Domain driver generic impl APIs
DOMAIN_CONF_SOURCES =						\
228
		conf/capabilities.c conf/capabilities.h		\
229
		conf/domain_conf.c conf/domain_conf.h		\
230
		conf/domain_audit.c conf/domain_audit.h		\
231 232
		conf/domain_nwfilter.c conf/domain_nwfilter.h	\
		conf/snapshot_conf.c conf/snapshot_conf.h
233 234 235

DOMAIN_EVENT_SOURCES =						\
		conf/domain_event.c conf/domain_event.h
236 237

# Network driver generic impl APIs
238
NETWORK_CONF_SOURCES =						\
239
		conf/network_conf.c conf/network_conf.h
240

241 242
# Network filter driver generic impl APIs
NWFILTER_PARAM_CONF_SOURCES =					\
243
		conf/nwfilter_params.c conf/nwfilter_params.h	\
244 245
		conf/nwfilter_ipaddrmap.c			\
		conf/nwfilter_ipaddrmap.h			\
246
		conf/nwfilter_conf.h
247

248
NWFILTER_CONF_SOURCES =						\
249 250 251
		$(NWFILTER_PARAM_CONF_SOURCES)			\
		conf/nwfilter_conf.c conf/nwfilter_conf.h

252
# Storage driver generic impl APIs
253 254
STORAGE_CONF_SOURCES =                                         \
		conf/storage_conf.h conf/storage_conf.c
255

256
# Interface driver generic impl APIs
257 258
INTERFACE_CONF_SOURCES =                                       \
		conf/interface_conf.c conf/interface_conf.h
259

260
# Secret driver generic impl APIs
261 262 263 264 265 266 267 268 269 270
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

ENCRYPTION_CONF_SOURCES =					\
		conf/storage_encryption_conf.c conf/storage_encryption_conf.h

271 272
CPU_CONF_SOURCES =						\
		conf/cpu_conf.c conf/cpu_conf.h
273

274 275
# Safe character device handling helper APIs
CHRDEV_CONF_SOURCES =						\
276
		conf/virchrdev.c conf/virchrdev.h
277

278 279 280 281
# Device Helper APIs
DEVICE_CONF_SOURCES =                                           \
		conf/device_conf.c conf/device_conf.h

282
CONF_SOURCES =							\
283
		$(NETDEV_CONF_SOURCES)				\
284 285 286
		$(DOMAIN_CONF_SOURCES)				\
		$(DOMAIN_EVENT_SOURCES)				\
		$(NETWORK_CONF_SOURCES)				\
287
		$(NWFILTER_CONF_SOURCES)			\
288 289 290 291
		$(NODE_DEVICE_CONF_SOURCES)			\
		$(STORAGE_CONF_SOURCES)				\
		$(ENCRYPTION_CONF_SOURCES)			\
		$(INTERFACE_CONF_SOURCES)			\
292
		$(SECRET_CONF_SOURCES)				\
293
		$(CPU_CONF_SOURCES)				\
294
		$(CHRDEV_CONF_SOURCES)				\
295
		$(DEVICE_CONF_SOURCES)
296

297
# The remote RPC driver, covering domains, storage, networks, etc
298
REMOTE_DRIVER_GENERATED = \
E
Eric Blake 已提交
299 300 301
		$(srcdir)/remote/remote_protocol.c		\
		$(srcdir)/remote/remote_protocol.h		\
		$(srcdir)/remote/remote_client_bodies.h		\
302 303 304
		$(srcdir)/remote/lxc_protocol.c			\
		$(srcdir)/remote/lxc_protocol.h			\
		$(srcdir)/remote/lxc_client_bodies.h		\
E
Eric Blake 已提交
305 306 307 308 309
		$(srcdir)/remote/qemu_protocol.c		\
		$(srcdir)/remote/qemu_protocol.h		\
		$(srcdir)/remote/qemu_client_bodies.h

REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x
310
LXC_PROTOCOL = $(srcdir)/remote/lxc_protocol.x
E
Eric Blake 已提交
311
QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x
312
REMOTE_DRIVER_PROTOCOL = $(REMOTE_PROTOCOL) $(QEMU_PROTOCOL) $(LXC_PROTOCOL)
313

314
$(srcdir)/remote/remote_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
315
		$(REMOTE_PROTOCOL) Makefile.am
316 317
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
	  remote REMOTE $(REMOTE_PROTOCOL) > $@
318

319
$(srcdir)/remote/lxc_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
320
		$(LXC_PROTOCOL) Makefile.am
321 322
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
	  lxc LXC $(LXC_PROTOCOL) > $@
323

324
$(srcdir)/remote/qemu_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
325
		$(QEMU_PROTOCOL) Makefile.am
326 327
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
	  qemu QEMU $(QEMU_PROTOCOL) > $@
328 329 330 331 332

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

334
EXTRA_DIST +=  $(REMOTE_DRIVER_PROTOCOL) \
335
		$(REMOTE_DRIVER_GENERATED)
336

337 338 339 340 341 342 343 344 345 346
# 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
347 348 349 350

# With pdwtags 1.8, --verbose output includes separators like these:
# /* 93 */
# /* <0> (null):0 */
351 352
# with the second line omitted for intrinsic types.
# Whereas with pdwtags 1.3, they look like this:
353
# /* <2d2> /usr/include/libio.h:180 */
354 355
# The alternation of the following regexps matches both cases.
r1 = /\* \d+ \*/
356
r2 = /\* <[[:xdigit:]]+> \S+:\d+ \*/
357
struct_prefix = (remote_|qemu_|lxc_|virNet|keepalive_)
358

359 360 361 362
# Depending on configure options, libtool creates one or both of
# {,.libs/}libvirt_remote_driver_la-remote_protocol.o.  We want the
# newest of the two, in case configure options changed and a stale
# file is left around from an earlier build.
363
PDWTAGS = \
364
	$(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then		\
365 366 367 368
	  o=`ls -t $(<:.lo=.$(OBJEXT)) .libs/$(<:.lo=.$(OBJEXT))	\
	    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;			\
369 370 371 372
	  if test -s $(@F)-t2; then					\
	    rm -rf $(@F)-t?;						\
	    echo 'WARNING: pdwtags appears broken; skipping the $@ test' >&2;\
	  else								\
373
	    $(PERL) -0777 -n						\
374
		-e 'foreach my $$p (split m!\n*(?:$(r1)|$(r2))\n!) {'	\
375 376
		-e '  if ($$p =~ /^(struct|enum) $(struct_prefix)/ ||'	\
		-e '      $$p =~ /^enum {/) {'				\
377 378 379
		-e '    $$p =~ s!\t*/\*.*?\*/!!sg;'			\
		-e '    $$p =~ s!\s+\n!\n!sg;'				\
		-e '    $$p =~ s!\s+$$!!;'				\
380
		-e '    $$p =~ s!\t!        !g;'			\
381 382 383 384
		-e '    print "$$p\n";'					\
		-e '    $$n++;'						\
		-e '  }'						\
		-e '}'							\
385 386 387
		-e 'BEGIN {'						\
		-e '  print "/* -*- c -*- */\n";'			\
		-e '}'							\
388
		-e 'END {'						\
389
		-e '  if ($$n < 1) {'					\
390 391 392 393 394 395
		-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 '}'							\
396 397
		< $(@F)-t1 > $(@F)-t3;					\
	    case $$? in 8) rm -f $(@F)-t?; exit 0;; 0) ;; *) exit 1;; esac;\
398
	    diff -u $(@)s $(@F)-t3; st=$$?; rm -f $(@F)-t?; exit $$st;	\
399
	  fi;								\
400
	else								\
401 402
	  echo 'WARNING: you lack pdwtags; skipping the $@ test' >&2;	\
	  echo 'WARNING: install the dwarves package to get pdwtags' >&2; \
403
	fi
404

405
# .libs/libvirt.so is built by libtool as a side-effect of the Makefile
406 407
# rule for libvirt.la.  However, checking symbols relies on Linux ELF layout
if WITH_LINUX
408 409 410
check-symfile: libvirt.syms libvirt.la
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symfile.pl libvirt.syms \
	  .libs/libvirt.so
411 412 413
else
check-symfile:
endif
414
check-symsorting:
415
	$(AM_V_GEN)$(PERL) $(srcdir)/check-symsorting.pl \
416
		$(srcdir) $(SYM_FILES)
J
Jiri Denemark 已提交
417
EXTRA_DIST += check-symfile.pl check-symsorting.pl
418

419 420
PROTOCOL_STRUCTS = \
	$(srcdir)/remote_protocol-structs \
421
	$(srcdir)/lxc_protocol-structs \
422
	$(srcdir)/qemu_protocol-structs \
J
Jiri Denemark 已提交
423 424
	$(srcdir)/virnetprotocol-structs \
	$(srcdir)/virkeepaliveprotocol-structs
425
if WITH_REMOTE
426 427
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)

428 429
# 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.
430 431 432
$(srcdir)/remote_protocol-struct \
	$(srcdir)/qemu_protocol-struct \
	$(srcdir)/lxc_protocol-struct: \
433
		$(srcdir)/%-struct: libvirt_driver_remote_la-%.lo
434
	$(PDWTAGS)
435 436
$(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \
		$(srcdir)/%-struct: libvirt_net_rpc_la-%.lo
437
	$(PDWTAGS)
438
else !WITH_REMOTE
439 440 441
# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be
# re-generated when configured --without-remote.
check-protocol:
442
endif
J
Jiri Denemark 已提交
443
EXTRA_DIST += $(PROTOCOL_STRUCTS)
444 445 446 447 448 449 450 451 452 453

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

454
DRIVER_SOURCE_FILES = \
455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474
	$(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) \
475
	vbox/vbox_tmpl.c \
476 477 478
	$(VMWARE_DRIVER_SOURCES) \
	$(XEN_DRIVER_SOURCES) \
	$(XENAPI_DRIVER_SOURCES) \
479 480 481 482 483
	$(NULL)


check-driverimpls:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-driverimpls.pl \
484 485
		$(filter /%,$(DRIVER_SOURCE_FILES)) \
		$(addprefix $(srcdir)/,$(filter-out /%,$(DRIVER_SOURCE_FILES)))
486 487 488

EXTRA_DIST += check-driverimpls.pl

489
check-local: check-protocol check-symfile check-symsorting \
490
	check-drivername check-driverimpls
491
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
492

493 494
# Mock driver, covering domains, storage, networks, etc
TEST_DRIVER_SOURCES =						\
495
		test/test_driver.c test/test_driver.h
496 497 498

# Now the Hypervisor specific drivers
XEN_DRIVER_SOURCES =						\
499 500 501 502 503 504
		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
505
if WITH_XEN_INOTIFY
506
XEN_DRIVER_SOURCES += xen/xen_inotify.c xen/xen_inotify.h
507
endif
508

509 510 511
LXC_MONITOR_PROTOCOL_GENERATED = \
	$(srcdir)/lxc/lxc_monitor_protocol.h \
	$(srcdir)/lxc/lxc_monitor_protocol.c \
512 513 514 515 516 517 518 519 520 521 522
	$(NULL)

LXC_MONITOR_GENERATED = \
	$(srcdir)/lxc/lxc_monitor_dispatch.h \
	$(NULL)

LXC_CONTROLLER_GENERATED = \
	$(srcdir)/lxc/lxc_controller_dispatch.h \
	$(NULL)

LXC_GENERATED = \
523
	$(LXC_MONITOR_PROTOCOL_GENERATED) \
524 525 526 527
	$(LXC_MONITOR_GENERATED) \
	$(LXC_CONTROLLER_GENERATED) \
	$(NULL)

528
LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x
529 530

$(srcdir)/lxc/lxc_monitor_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
531
		$(LXC_MONITOR_PROTOCOL) Makefile.am
532 533
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > $@
534 535

$(srcdir)/lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
536
		$(REMOTE_PROTOCOL) Makefile.am
537 538
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > $@
539 540

EXTRA_DIST += \
541
	$(LXC_MONITOR_PROTOCOL) \
542 543 544 545 546
	$(LXC_GENERATED) \
	$(NULL)

BUILT_SOURCES += $(LXC_GENERATED)

547 548
CLEANFILES += $(LXC_GENERATED)

549
LXC_DRIVER_SOURCES =						\
550
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
551
		$(LXC_MONITOR_GENERATED)			\
552 553
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
554
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
555
		lxc/lxc_domain.c lxc/lxc_domain.h		\
556
		lxc/lxc_hostdev.c lxc/lxc_hostdev.h		\
557
		lxc/lxc_monitor.c lxc/lxc_monitor.h		\
558
		lxc/lxc_process.c lxc/lxc_process.h		\
G
Gao feng 已提交
559
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
560
		lxc/lxc_driver.c lxc/lxc_driver.h
561

562
LXC_CONTROLLER_SOURCES =					\
563
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
564
		$(LXC_CONTROLLER_GENERATED)			\
565 566
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
567
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
568
		lxc/lxc_domain.c lxc/lxc_domain.h		\
G
Gao feng 已提交
569
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
570
		lxc/lxc_controller.c
571

J
Jamie Strandboge 已提交
572
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES =			\
E
Eric Blake 已提交
573
		$(DATATYPES_SOURCES)				\
J
Jamie Strandboge 已提交
574 575
		security/virt-aa-helper.c

576 577 578
PHYP_DRIVER_SOURCES =						\
		phyp/phyp_driver.c phyp/phyp_driver.h

579
OPENVZ_DRIVER_SOURCES =						\
580
		openvz/openvz_conf.c openvz/openvz_conf.h	\
581 582
		openvz/openvz_driver.c openvz/openvz_driver.h   \
		openvz/openvz_util.c openvz/openvz_util.h
583

E
Eric Blake 已提交
584
VMWARE_DRIVER_SOURCES =						\
585
		vmware/vmware_driver.c vmware/vmware_driver.h	\
586 587
		vmware/vmware_conf.c vmware/vmware_conf.h

588
VBOX_DRIVER_SOURCES =						\
E
Eric Blake 已提交
589 590 591 592 593 594
	vbox/vbox_glue.c vbox/vbox_glue.h			\
	vbox/vbox_driver.c vbox/vbox_driver.h			\
	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			\
595
	vbox/vbox_V4_0.c vbox/vbox_CAPI_v4_0.h			\
596 597
	vbox/vbox_V4_1.c vbox/vbox_CAPI_v4_1.h			\
	vbox/vbox_V4_2.c vbox/vbox_CAPI_v4_2.h
598

E
Eric Blake 已提交
599
VBOX_DRIVER_EXTRA_DIST =					\
600 601 602
		vbox/vbox_tmpl.c vbox/README			\
		vbox/vbox_MSCOMGlue.c vbox/vbox_MSCOMGlue.h	\
		vbox/vbox_XPCOMCGlue.c vbox/vbox_XPCOMCGlue.h
603

O
Osier Yang 已提交
604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621
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			\
		qemu/qemu_conf.c qemu/qemu_conf.h			\
		qemu/qemu_process.c qemu/qemu_process.h			\
		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				\
		qemu/qemu_driver.c qemu/qemu_driver.h			\
		qemu/qemu_bridge_filter.c				\
622
		qemu/qemu_bridge_filter.h
R
Richard W.M. Jones 已提交
623

O
Osier Yang 已提交
624
XENAPI_DRIVER_SOURCES =						\
625
		xenapi/xenapi_driver.c xenapi/xenapi_driver.h	\
O
Osier Yang 已提交
626
		xenapi/xenapi_driver_private.h			\
627 628
		xenapi/xenapi_utils.c xenapi/xenapi_utils.h

J
Jim Fehlig 已提交
629 630 631 632
LIBXL_DRIVER_SOURCES =						\
		libxl/libxl_conf.c libxl/libxl_conf.h		\
		libxl/libxl_driver.c libxl/libxl_driver.h

633
UML_DRIVER_SOURCES =						\
D
Daniel P. Berrange 已提交
634 635
		uml/uml_conf.c uml/uml_conf.h			\
		uml/uml_driver.c uml/uml_driver.h
636

O
Osier Yang 已提交
637 638 639 640 641 642
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	\
643
		esx/esx_storage_backend_vmfs.c esx/esx_storage_backend_vmfs.h	\
644
		esx/esx_storage_backend_iscsi.c esx/esx_storage_backend_iscsi.h	\
O
Osier Yang 已提交
645
		esx/esx_device_monitor.c esx/esx_device_monitor.h	\
646
		esx/esx_secret_driver.c esx/esx_secret_driver.h		\
O
Osier Yang 已提交
647 648 649 650
		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		\
651
		esx/esx_vi_types.c esx/esx_vi_types.h
652

653
ESX_DRIVER_GENERATED =							\
654 655
		esx/esx_vi_methods.generated.c				\
		esx/esx_vi_methods.generated.h				\
656
		esx/esx_vi_methods.generated.macro			\
657 658 659 660 661
		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			\
662 663 664
		esx/esx_vi_types.generated.typefromstring		\
		esx/esx_vi.generated.c					\
		esx/esx_vi.generated.h
665

O
Osier Yang 已提交
666
ESX_DRIVER_EXTRA_DIST =							\
667 668 669 670 671
		esx/README						\
		esx/esx_vi_generator.input				\
		esx/esx_vi_generator.py					\
		$(ESX_DRIVER_GENERATED)

O
Osier Yang 已提交
672
HYPERV_DRIVER_SOURCES =									\
M
Matthias Bolte 已提交
673 674 675 676 677 678 679
		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		\
680
		hyperv/hyperv_nwfilter_driver.c hyperv/hyperv_nwfilter_driver.h		\
681
		hyperv/hyperv_util.c hyperv/hyperv_util.h				\
682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697
		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 已提交
698 699
PARALLELS_DRIVER_SOURCES =					\
		parallels/parallels_driver.h			\
700
		parallels/parallels_driver.c			\
701 702
		parallels/parallels_utils.c			\
		parallels/parallels_utils.h			\
D
Dmitry Guryanov 已提交
703 704
		parallels/parallels_storage.c		\
		parallels/parallels_network.c
D
Dmitry Guryanov 已提交
705

706
NETWORK_DRIVER_SOURCES =					\
707
		network/bridge_driver.h network/bridge_driver.c
708

709 710 711 712
INTERFACE_DRIVER_SOURCES =

if WITH_INTERFACE
INTERFACE_DRIVER_SOURCES +=					\
713 714
		interface/interface_driver.h        \
		interface/interface_driver.c
715 716 717 718

if WITH_NETCF
INTERFACE_DRIVER_SOURCES +=					\
		interface/interface_backend_netcf.c
719
endif
720
if WITH_UDEV
721 722 723 724
INTERFACE_DRIVER_SOURCES +=					\
		interface/interface_backend_udev.c
endif
endif
725

726
SECRET_DRIVER_SOURCES =						\
727
		secret/secret_driver.h secret/secret_driver.c
728

729
# Storage backend specific impls
O
Osier Yang 已提交
730 731
STORAGE_DRIVER_SOURCES =						\
		storage/storage_driver.h storage/storage_driver.c	\
732
		storage/storage_backend.h storage/storage_backend.c
733 734

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

737
STORAGE_DRIVER_LVM_SOURCES =					\
O
Osier Yang 已提交
738
		storage/storage_backend_logical.h		\
739
		storage/storage_backend_logical.c
740 741

STORAGE_DRIVER_ISCSI_SOURCES =					\
742
		storage/storage_backend_iscsi.h storage/storage_backend_iscsi.c
743

744
STORAGE_DRIVER_SCSI_SOURCES =					\
745
		storage/storage_backend_scsi.h storage/storage_backend_scsi.c
746

D
Dave Allan 已提交
747
STORAGE_DRIVER_MPATH_SOURCES =					\
748
		storage/storage_backend_mpath.h storage/storage_backend_mpath.c
D
Dave Allan 已提交
749

750
STORAGE_DRIVER_DISK_SOURCES =					\
751
		storage/storage_backend_disk.h storage/storage_backend_disk.c
752

753 754 755
STORAGE_DRIVER_RBD_SOURCES =					\
		storage/storage_backend_rbd.h storage/storage_backend_rbd.c

756 757 758
STORAGE_DRIVER_SHEEPDOG_SOURCES =				\
		storage/storage_backend_sheepdog.h storage/storage_backend_sheepdog.c

759
STORAGE_HELPER_DISK_SOURCES =					\
760
		storage/parthelper.c
761

762 763 764
UTIL_IO_HELPER_SOURCES =					\
		util/iohelper.c

765
# Network filters
O
Osier Yang 已提交
766
NWFILTER_DRIVER_SOURCES =						\
767
		nwfilter/nwfilter_driver.h nwfilter/nwfilter_driver.c	\
768 769
		nwfilter/nwfilter_gentech_driver.c			\
		nwfilter/nwfilter_gentech_driver.h			\
S
Stefan Berger 已提交
770 771
		nwfilter/nwfilter_dhcpsnoop.c				\
		nwfilter/nwfilter_dhcpsnoop.h				\
772
		nwfilter/nwfilter_ebiptables_driver.c			\
773 774 775
		nwfilter/nwfilter_ebiptables_driver.h			\
		nwfilter/nwfilter_learnipaddr.c				\
		nwfilter/nwfilter_learnipaddr.h
776

777

778
# Security framework and drivers for various models
O
Osier Yang 已提交
779 780 781 782 783
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		\
784
		security/security_manager.h security/security_manager.c
785

786
SECURITY_DRIVER_SELINUX_SOURCES =				\
787
		security/security_selinux.h security/security_selinux.c
788

J
Jamie Strandboge 已提交
789 790 791
SECURITY_DRIVER_APPARMOR_SOURCES =				\
		security/security_apparmor.h security/security_apparmor.c

792 793 794 795 796 797 798 799 800
ACCESS_DRIVER_GENERATED = \
		access/viraccessapicheck.h access/viraccessapicheck.c \
		access/viraccessapicheckqemu.h access/viraccessapicheckqemu.c \
		access/viraccessapichecklxc.h access/viraccessapichecklxc.c

ACCESS_DRIVER_SYMFILES = \
		libvirt_access.syms \
		libvirt_access_qemu.syms \
		libvirt_access_lxc.syms
801

802 803 804 805 806 807 808
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

809 810 811 812 813 814 815
ACCESS_DRIVER_POLKIT_SOURCES = \
		access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c

ACCESS_DRIVER_POLKIT_POLICY = \
		access/org.libvirt.api.policy


816
NODE_DEVICE_DRIVER_SOURCES =					\
O
Osier Yang 已提交
817 818
		node_device/node_device_driver.c		\
		node_device/node_device_driver.h		\
819
		node_device/node_device_linux_sysfs.c
820 821

NODE_DEVICE_DRIVER_HAL_SOURCES =				\
822
		node_device/node_device_hal.c			\
823
		node_device/node_device_hal.h
824

825
NODE_DEVICE_DRIVER_UDEV_SOURCES =				\
D
Daniel Veillard 已提交
826 827
		node_device/node_device_udev.c			\
		node_device/node_device_udev.h
828

J
Jiri Denemark 已提交
829 830 831 832
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 已提交
833
		cpu/cpu_s390.h cpu/cpu_s390.c			\
C
Chuck Short 已提交
834
		cpu/cpu_arm.h cpu/cpu_arm.c			\
P
Prerna Saxena 已提交
835
		cpu/cpu_map.h cpu/cpu_map.c cpu/cpu_powerpc.h	\
836
		cpu/cpu_powerpc.c cpu/cpu_ppc_data.h
837

838 839 840
VMX_SOURCES =							\
		vmx/vmx.c vmx/vmx.h

841 842
XENXS_SOURCES =							\
		xenxs/xenxs_private.h				\
843 844
		xenxs/xen_sxpr.c xenxs/xen_sxpr.h		\
		xenxs/xen_xm.c xenxs/xen_xm.h
845

J
Jiri Denemark 已提交
846 847
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
848
EXTRA_DIST +=	$(pkgdata_DATA)
849

850 851 852 853 854 855
#########################
#
# Build up list of libvirt.la source files based on configure conditions
#
# First deal with sources usable in non-daemon context

856
noinst_LTLIBRARIES = libvirt_util.la
857 858
libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
libvirt_la_BUILT_LIBADD = libvirt_util.la
859 860
libvirt_util_la_SOURCES =					\
		$(UTIL_SOURCES)
861
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
862
		$(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
863
		$(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS)
864
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
865
		$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
866
		$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(MSCOM_LIBS) $(LIBXML_LIBS) \
867
		$(SECDRIVER_LIBS) $(NUMACTL_LIBS)
868

869 870

noinst_LTLIBRARIES += libvirt_conf.la
871
libvirt_la_BUILT_LIBADD += libvirt_conf.la
872
libvirt_conf_la_SOURCES = $(CONF_SOURCES)
873 874
libvirt_conf_la_CFLAGS = $(AM_CFLAGS)
libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS)
875

J
Jiri Denemark 已提交
876
noinst_LTLIBRARIES += libvirt_cpu.la
877
libvirt_la_BUILT_LIBADD += libvirt_cpu.la
J
Jiri Denemark 已提交
878
libvirt_cpu_la_CFLAGS = \
879
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
J
Jiri Denemark 已提交
880 881
libvirt_cpu_la_SOURCES = $(CPU_SOURCES)

882 883 884 885
if WITH_VMX
noinst_LTLIBRARIES += libvirt_vmx.la
libvirt_la_BUILT_LIBADD += libvirt_vmx.la
libvirt_vmx_la_CFLAGS = \
886
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
887 888 889
libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
endif

890
if WITH_XENXS
891 892 893
noinst_LTLIBRARIES += libvirt_xenxs.la
libvirt_la_BUILT_LIBADD += libvirt_xenxs.la
libvirt_xenxs_la_CFLAGS = \
894
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
895 896 897
libvirt_xenxs_la_SOURCES = $(XENXS_SOURCES)
endif

898

899
noinst_LTLIBRARIES += libvirt_driver.la
900
libvirt_la_BUILT_LIBADD += libvirt_driver.la
901
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
902

903
libvirt_driver_la_CFLAGS = \
904
		$(GNUTLS_CFLAGS) $(CURL_CFLAGS) \
905
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
906
libvirt_driver_la_LIBADD = \
907
		$(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS)
908

909
SYM_FILES = $(USED_SYM_FILES)
910
USED_SYM_FILES = $(srcdir)/libvirt_private.syms
911

912
if WITH_TEST
913
noinst_LTLIBRARIES += libvirt_driver_test.la
914
libvirt_la_BUILT_LIBADD += libvirt_driver_test.la
915
libvirt_driver_test_la_CFLAGS = \
916
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
917
libvirt_driver_test_la_SOURCES = $(TEST_DRIVER_SOURCES)
918 919 920
endif

if WITH_REMOTE
921
noinst_LTLIBRARIES += libvirt_driver_remote.la
922
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
923 924
libvirt_driver_remote_la_CFLAGS =				\
		$(GNUTLS_CFLAGS)				\
E
Eric Blake 已提交
925
		$(XDR_CFLAGS)					\
926 927
		-I$(top_srcdir)/src/conf			\
		-I$(top_srcdir)/src/rpc				\
928 929
		$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
930 931 932 933
libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) \
                libvirt-net-rpc-client.la \
                libvirt-net-rpc-server.la \
                libvirt-net-rpc.la
934
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
935

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

938 939
endif WITH_REMOTE

940
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
941
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
E
Eric Blake 已提交
942
	       $< $@
943

944
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
945
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
E
Eric Blake 已提交
946
	       $< $@
947

948
if WITH_XEN
E
Eric Blake 已提交
949 950 951
noinst_LTLIBRARIES += libvirt_driver_xen_impl.la
libvirt_driver_xen_la_SOURCES =
libvirt_driver_xen_la_LIBADD = libvirt_driver_xen_impl.la
952 953
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_xen.la
E
Eric Blake 已提交
954 955
libvirt_driver_xen_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_xen_la_LDFLAGS = -module -avoid-version
956
else
957
noinst_LTLIBRARIES += libvirt_driver_xen.la
958 959
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_xen.la
960
endif
E
Eric Blake 已提交
961 962

libvirt_driver_xen_impl_la_CFLAGS =					\
963
		$(XEN_CFLAGS)					\
964 965
		-I$(top_srcdir)/src/conf			\
		-I$(top_srcdir)/src/xenxs			\
966
		$(AM_CFLAGS)
E
Eric Blake 已提交
967 968 969
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)
970 971
endif

972 973
if WITH_PHYP
noinst_LTLIBRARIES += libvirt_driver_phyp.la
974
libvirt_la_BUILT_LIBADD += libvirt_driver_phyp.la
975 976
libvirt_driver_phyp_la_LIBADD = $(SSH2_LIBS)
libvirt_driver_phyp_la_CFLAGS = $(SSH2_CFLAGS) \
977
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
978 979 980
libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES)
endif

981
if WITH_OPENVZ
982
noinst_LTLIBRARIES += libvirt_driver_openvz.la
983
libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la
984
libvirt_driver_openvz_la_CFLAGS = \
985
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
986
libvirt_driver_openvz_la_SOURCES = $(OPENVZ_DRIVER_SOURCES)
987 988
endif

989 990 991 992
if WITH_VMWARE
noinst_LTLIBRARIES += libvirt_driver_vmware.la
libvirt_la_BUILT_LIBADD += libvirt_driver_vmware.la
libvirt_driver_vmware_la_CFLAGS = \
993
		-I$(top_srcdir)/src/conf -I$(top_srcdir)/src/vmx $(AM_CFLAGS)
994 995 996
libvirt_driver_vmware_la_SOURCES = $(VMWARE_DRIVER_SOURCES)
endif

997
if WITH_VBOX
998 999 1000 1001 1002 1003 1004 1005
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
libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version
else
1006
noinst_LTLIBRARIES += libvirt_driver_vbox.la
1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017
# GPLv2-only license requries that it be linked into
# libvirtd and *not* libvirt.so
#libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la
endif

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)
1018 1019
endif

1020 1021
if WITH_XENAPI
noinst_LTLIBRARIES += libvirt_driver_xenapi.la
1022
libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la
1023
libvirt_driver_xenapi_la_CFLAGS = $(LIBXENSERVER_CFLAGS) $(CURL_CFLAGS) \
1024
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
1025
libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS)
1026
libvirt_driver_xenapi_la_LIBADD = $(LIBXENSERVER_LIBS) $(CURL_LIBS)
1027 1028 1029
libvirt_driver_xenapi_la_SOURCES = $(XENAPI_DRIVER_SOURCES)
endif

J
Jim Fehlig 已提交
1030
if WITH_LIBXL
E
Eric Blake 已提交
1031 1032 1033
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 已提交
1034 1035
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_libxl.la
E
Eric Blake 已提交
1036 1037
libvirt_driver_libxl_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_libxl_la_LDFLAGS = -module -avoid-version
J
Jim Fehlig 已提交
1038 1039 1040 1041 1042
else
noinst_LTLIBRARIES += libvirt_driver_libxl.la
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_libxl.la
endif
E
Eric Blake 已提交
1043 1044

libvirt_driver_libxl_impl_la_CFLAGS = $(LIBXL_CFLAGS)		\
1045 1046
		-I$(top_srcdir)/src/conf			\
		-I$(top_srcdir)/src/xenxs			\
1047
		$(AM_CFLAGS)
E
Eric Blake 已提交
1048 1049 1050
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)
J
Jim Fehlig 已提交
1051 1052
endif

1053
if WITH_QEMU
E
Eric Blake 已提交
1054 1055 1056
noinst_LTLIBRARIES += libvirt_driver_qemu_impl.la
libvirt_driver_qemu_la_SOURCES =
libvirt_driver_qemu_la_LIBADD = libvirt_driver_qemu_impl.la
1057 1058
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_qemu.la
E
Eric Blake 已提交
1059 1060
libvirt_driver_qemu_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_qemu_la_LDFLAGS = -module -avoid-version
1061
else
1062
noinst_LTLIBRARIES += libvirt_driver_qemu.la
1063
# Stateful, so linked to daemon instead
1064
#libvirt_la_BUILT_LIBADD += libvirt_driver_qemu.la
1065
endif
E
Eric Blake 已提交
1066

1067 1068 1069 1070 1071 1072
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 已提交
1073
libvirt_driver_qemu_impl_la_LDFLAGS = $(AM_LDFLAGS)
1074
libvirt_driver_qemu_impl_la_LIBADD = $(CAPNG_LIBS) \
1075
                                $(GNUTLS_LIBS) \
S
Serge Hallyn 已提交
1076
				$(LIBNL_LIBS)
E
Eric Blake 已提交
1077
libvirt_driver_qemu_impl_la_SOURCES = $(QEMU_DRIVER_SOURCES)
1078

A
Amy Griffis 已提交
1079
conf_DATA += qemu/qemu.conf
1080

1081
augeas_DATA += qemu/libvirtd_qemu.aug
1082 1083
augeastest_DATA += test_libvirtd_qemu.aug
CLEANFILES += test_libvirtd_qemu.aug
1084

1085
endif
1086
EXTRA_DIST += qemu/qemu.conf qemu/libvirtd_qemu.aug \
1087
		qemu/test_libvirtd_qemu.aug.in qemu/THREADS.txt
1088

1089 1090

if WITH_LXC
E
Eric Blake 已提交
1091 1092 1093
noinst_LTLIBRARIES += libvirt_driver_lxc_impl.la
libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = libvirt_driver_lxc_impl.la
1094 1095
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_lxc.la
E
Eric Blake 已提交
1096 1097
libvirt_driver_lxc_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_lxc_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1098
else
1099
noinst_LTLIBRARIES += libvirt_driver_lxc.la
1100
# Stateful, so linked to daemon instead
1101
#libvirt_la_BUILT_LIBADD += libvirt_driver_lxc.la
1102
endif
E
Eric Blake 已提交
1103 1104

libvirt_driver_lxc_impl_la_CFLAGS = \
S
Serge Hallyn 已提交
1105
		$(LIBNL_CFLAGS) \
G
Gao feng 已提交
1106
		$(FUSE_CFLAGS) \
1107
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
G
Gao feng 已提交
1108
libvirt_driver_lxc_impl_la_LIBADD = $(CAPNG_LIBS) $(LIBNL_LIBS) $(FUSE_LIBS)
1109
if WITH_BLKID
E
Eric Blake 已提交
1110 1111
libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS)
1112
endif
1113
libvirt_driver_lxc_impl_la_LIBADD += $(SECDRIVER_LIBS)
E
Eric Blake 已提交
1114
libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES)
A
Amy Griffis 已提交
1115 1116 1117

conf_DATA += lxc/lxc.conf

1118
augeas_DATA += lxc/libvirtd_lxc.aug
1119 1120
augeastest_DATA += test_libvirtd_lxc.aug
CLEANFILES += test_libvirtd_lxc.aug
1121

1122
endif
1123
EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in
1124

1125
if WITH_UML
E
Eric Blake 已提交
1126 1127 1128
noinst_LTLIBRARIES += libvirt_driver_uml_impl.la
libvirt_driver_uml_la_SOURCES =
libvirt_driver_uml_la_LIBADD = libvirt_driver_uml_impl.la
1129 1130
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_uml.la
E
Eric Blake 已提交
1131 1132
libvirt_driver_uml_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_uml_la_LDFLAGS = -module -avoid-version
1133
else
1134 1135
noinst_LTLIBRARIES += libvirt_driver_uml.la
# Stateful, so linked to daemon instead
1136
#libvirt_la_BUILT_LIBADD += libvirt_driver_uml.la
1137
endif
E
Eric Blake 已提交
1138

1139
libvirt_driver_uml_impl_la_CFLAGS = \
1140
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
E
Eric Blake 已提交
1141
libvirt_driver_uml_impl_la_LDFLAGS = $(AM_LDFLAGS)
1142
# libvirt_driver_uml_impl_la_LIBADD =
E
Eric Blake 已提交
1143
libvirt_driver_uml_impl_la_SOURCES = $(UML_DRIVER_SOURCES)
1144
endif
1145

D
Daniel Veillard 已提交
1146

1147
BUILT_SOURCES += $(ESX_DRIVER_GENERATED)
D
Daniel Veillard 已提交
1148

1149 1150
ESX_GENERATED_STAMP = .esx_vi_generator.stamp

E
Eric Blake 已提交
1151 1152
EXTRA_DIST += $(ESX_GENERATED_STAMP)

1153 1154 1155
$(ESX_DRIVER_GENERATED): $(ESX_GENERATED_STAMP)

$(ESX_GENERATED_STAMP): $(srcdir)/esx/esx_vi_generator.input \
1156
                         $(srcdir)/esx/esx_vi_generator.py
1157 1158 1159 1160 1161
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/esx/esx_vi_generator.py \
	  && touch $@

MAINTAINERCLEANFILES += $(ESX_DRIVER_GENERATED) $(ESX_GENERATED_STAMP)

D
Daniel Veillard 已提交
1162

1163 1164
if WITH_ESX
noinst_LTLIBRARIES += libvirt_driver_esx.la
1165
libvirt_la_BUILT_LIBADD += libvirt_driver_esx.la
1166
libvirt_driver_esx_la_CFLAGS = $(CURL_CFLAGS) \
1167
		-I$(top_srcdir)/src/conf -I$(top_srcdir)/src/vmx $(AM_CFLAGS)
1168
libvirt_driver_esx_la_LDFLAGS = $(AM_LDFLAGS)
1169
libvirt_driver_esx_la_LIBADD = $(CURL_LIBS)
1170
libvirt_driver_esx_la_SOURCES = $(ESX_DRIVER_SOURCES)
1171
libvirt_driver_esx_la_DEPENDENCIES = $(ESX_DRIVER_GENERATED)
1172 1173
endif

M
Matthias Bolte 已提交
1174

1175 1176
BUILT_SOURCES += $(HYPERV_DRIVER_GENERATED)

1177 1178
HYPERV_GENERATED_STAMP = .hyperv_wmi_generator.stamp

E
Eric Blake 已提交
1179 1180
EXTRA_DIST += $(HYPERV_GENERATED_STAMP)

1181 1182 1183
$(HYPERV_DRIVER_GENERATED): $(HYPERV_GENERATED_STAMP)

$(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \
1184
                            $(srcdir)/hyperv/hyperv_wmi_generator.py
1185 1186 1187 1188
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/hyperv/hyperv_wmi_generator.py \
	  && touch $@

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

M
Matthias Bolte 已提交
1190 1191 1192 1193
if WITH_HYPERV
noinst_LTLIBRARIES += libvirt_driver_hyperv.la
libvirt_la_BUILT_LIBADD += libvirt_driver_hyperv.la
libvirt_driver_hyperv_la_CFLAGS = $(OPENWSMAN_CFLAGS) \
1194
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
M
Matthias Bolte 已提交
1195 1196 1197 1198 1199
libvirt_driver_hyperv_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_hyperv_la_LIBADD = $(OPENWSMAN_LIBS)
libvirt_driver_hyperv_la_SOURCES = $(HYPERV_DRIVER_SOURCES)
endif

D
Dmitry Guryanov 已提交
1200 1201 1202 1203 1204 1205 1206 1207
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)
endif

1208
if WITH_NETWORK
E
Eric Blake 已提交
1209 1210 1211
noinst_LTLIBRARIES += libvirt_driver_network_impl.la
libvirt_driver_network_la_SOURCES =
libvirt_driver_network_la_LIBADD = libvirt_driver_network_impl.la
1212 1213
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_network.la
1214
libvirt_driver_network_la_LIBADD += ../gnulib/lib/libgnu.la $(LIBNL_LIBS) $(DBUS_LIBS)
E
Eric Blake 已提交
1215
libvirt_driver_network_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1216
else
1217
noinst_LTLIBRARIES += libvirt_driver_network.la
1218
# Stateful, so linked to daemon instead
1219
#libvirt_la_BUILT_LIBADD += libvirt_driver_network.la
1220
endif
E
Eric Blake 已提交
1221 1222

libvirt_driver_network_impl_la_CFLAGS = \
1223
		$(LIBNL_CFLAGS) $(DBUS_CFLAGS) \
1224
		-I$(top_srcdir)/src/conf $(AM_CFLAGS) $(DBUS_CFLAGS)
E
Eric Blake 已提交
1225
libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
1226
endif
1227 1228 1229
EXTRA_DIST += network/default.xml


1230
if WITH_INTERFACE
1231 1232 1233 1234
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_interface.la
else
noinst_LTLIBRARIES += libvirt_driver_interface.la
1235 1236
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_interface.la
1237
endif
1238
libvirt_driver_interface_la_CFLAGS = -I$(top_srcdir)/src/conf $(AM_CFLAGS)
1239
libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS)
1240 1241 1242 1243
libvirt_driver_interface_la_LIBADD =
if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
1244
else
1245
if WITH_UDEV
1246 1247 1248
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
endif
1249
endif
1250
if WITH_DRIVER_MODULES
1251
libvirt_driver_interface_la_LIBADD += ../gnulib/lib/libgnu.la
1252 1253 1254
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
endif
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
D
Daniel Veillard 已提交
1255 1256
endif

D
Daniel P. Berrange 已提交
1257
if WITH_SECRETS
1258 1259 1260 1261
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_secret.la
else
noinst_LTLIBRARIES += libvirt_driver_secret.la
1262
# Stateful, so linked to daemon instead
1263
#libvirt_la_BUILT_LIBADD += libvirt_driver_secret.la
1264
endif
1265
libvirt_driver_secret_la_CFLAGS = \
1266
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
1267
if WITH_DRIVER_MODULES
1268
libvirt_driver_secret_la_LIBADD = ../gnulib/lib/libgnu.la
1269
libvirt_driver_secret_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1270 1271
endif
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
D
Daniel P. Berrange 已提交
1272
endif
1273

1274
# Needed to keep automake quiet about conditionals
1275 1276
libvirt_driver_storage_impl_la_SOURCES =
libvirt_driver_storage_impl_la_CFLAGS = \
1277
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
1278 1279
libvirt_driver_storage_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_storage_impl_la_LIBADD =
1280
libvirt_driver_storage_impl_la_LIBADD += $(SECDRIVER_LIBS)
1281
if WITH_BLKID
1282 1283
libvirt_driver_storage_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(BLKID_LIBS)
O
Osier Yang 已提交
1284
endif
1285
if WITH_STORAGE
1286 1287 1288
noinst_LTLIBRARIES += libvirt_driver_storage_impl.la
libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_LIBADD = libvirt_driver_storage_impl.la
1289 1290
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_storage.la
1291
libvirt_driver_storage_la_LIBADD += ../gnulib/lib/libgnu.la
1292
libvirt_driver_storage_la_LDFLAGS = -module -avoid-version
1293
else
1294
noinst_LTLIBRARIES += libvirt_driver_storage.la
1295
# Stateful, so linked to daemon instead
1296
#libvirt_la_BUILT_LIBADD += libvirt_driver_storage.la
1297
endif
1298 1299
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_FS_SOURCES)
1300 1301
endif

1302
if WITH_STORAGE_LVM
1303
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_LVM_SOURCES)
1304 1305
endif

1306
if WITH_STORAGE_ISCSI
1307
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_ISCSI_SOURCES)
1308 1309
endif

1310
if WITH_STORAGE_SCSI
1311
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SCSI_SOURCES)
1312 1313
endif

D
Dave Allan 已提交
1314
if WITH_STORAGE_MPATH
1315 1316 1317
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)
D
Dave Allan 已提交
1318 1319
endif

1320
if WITH_STORAGE_DISK
1321
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_DISK_SOURCES)
1322
endif
1323

1324
if WITH_STORAGE_RBD
1325 1326
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_RBD_SOURCES)
libvirt_driver_storage_impl_la_LIBADD += $(LIBRBD_LIBS)
1327 1328
endif

1329
if WITH_STORAGE_SHEEPDOG
1330
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SHEEPDOG_SOURCES)
1331 1332
endif

1333 1334 1335 1336 1337 1338 1339
if WITH_NODE_DEVICES
# Needed to keep automake quiet about conditionals
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nodedev.la
else
noinst_LTLIBRARIES += libvirt_driver_nodedev.la
# Stateful, so linked to daemon instead
1340
#libvirt_la_BUILT_LIBADD += libvirt_driver_nodedev.la
1341 1342 1343
endif
libvirt_driver_nodedev_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES)

1344
libvirt_driver_nodedev_la_CFLAGS = \
1345
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
1346
libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS)
1347
libvirt_driver_nodedev_la_LIBADD =
1348

D
Doug Goldstein 已提交
1349
if WITH_LIBVIRTD
1350
if WITH_HAL
1351 1352
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS)
1353
libvirt_driver_nodedev_la_LIBADD += $(HAL_LIBS)
1354
endif
1355
if WITH_UDEV
1356
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES)
1357
libvirt_driver_nodedev_la_CFLAGS += $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS)
1358
libvirt_driver_nodedev_la_LIBADD += $(UDEV_LIBS) $(PCIACCESS_LIBS)
1359
endif
D
Doug Goldstein 已提交
1360
endif
1361 1362

if WITH_DRIVER_MODULES
1363
libvirt_driver_nodedev_la_LIBADD += ../gnulib/lib/libgnu.la
1364 1365 1366 1367 1368
libvirt_driver_nodedev_la_LDFLAGS += -module -avoid-version
endif
endif


1369 1370 1371 1372 1373
if WITH_NWFILTER
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nwfilter.la
else
noinst_LTLIBRARIES += libvirt_driver_nwfilter.la
1374 1375
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_nwfilter.la
1376
endif
1377
libvirt_driver_nwfilter_la_CFLAGS = $(LIBPCAP_CFLAGS) \
1378
		-I$(top_srcdir)/src/conf $(LIBNL_CFLAGS) $(AM_CFLAGS) $(DBUS_CFLAGS)
1379
libvirt_driver_nwfilter_la_LDFLAGS = $(LD_AMFLAGS)
1380
libvirt_driver_nwfilter_la_LIBADD = $(LIBPCAP_LIBS) $(LIBNL_LIBS) $(DBUS_LIBS)
1381
if WITH_DRIVER_MODULES
1382
libvirt_driver_nwfilter_la_LIBADD += ../gnulib/lib/libgnu.la
1383
libvirt_driver_nwfilter_la_LDFLAGS += -module -avoid-version
1384 1385 1386 1387 1388
endif
libvirt_driver_nwfilter_la_SOURCES = $(NWFILTER_DRIVER_SOURCES)
endif


1389 1390 1391 1392
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 = \
1393
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
1394
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
1395
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
1396
if WITH_SECDRIVER_SELINUX
1397 1398
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
1399
endif
J
Jamie Strandboge 已提交
1400
if WITH_SECDRIVER_APPARMOR
1401 1402
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
J
Jamie Strandboge 已提交
1403
endif
1404

1405
libvirt_driver_access_la_SOURCES = $(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
1406 1407 1408 1409 1410 1411 1412
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 =

1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430
EXTRA_DIST += access/genpolkit.pl

if WITH_POLKIT1
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)

polkitactiondir = $(datadir)/polkit-1/actions
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)

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

CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
else
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
endif

1431

1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475
USED_SYM_FILES += $(ACCESS_DRIVER_SYMFILES)
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_SYMFILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_SYMFILES)

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

access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
	  remote REMOTE $(REMOTE_PROTOCOL) > $@
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h > $@

access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
	  qemu QEMU $(QEMU_PROTOCOL) > $@
access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
	  qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h > $@

access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
	  lxc LXC $(LXC_PROTOCOL) > $@
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
	  lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h > $@

1476 1477 1478 1479 1480 1481 1482
# Add all conditional sources just in case...
EXTRA_DIST +=							\
		$(TEST_DRIVER_SOURCES)				\
		$(REMOTE_DRIVER_SOURCES)			\
		$(XEN_DRIVER_SOURCES)				\
		$(QEMU_DRIVER_SOURCES)				\
		$(LXC_DRIVER_SOURCES)				\
1483
		$(UML_DRIVER_SOURCES)				\
1484
		$(OPENVZ_DRIVER_SOURCES)			\
1485
		$(PHYP_DRIVER_SOURCES)				\
1486
		$(VBOX_DRIVER_SOURCES)				\
1487
		$(XENAPI_DRIVER_SOURCES)			\
O
Osier Yang 已提交
1488
		$(LIBXL_DRIVER_SOURCES)				\
1489
		$(ESX_DRIVER_SOURCES)				\
1490
		$(ESX_DRIVER_EXTRA_DIST)			\
M
Matthias Bolte 已提交
1491
		$(HYPERV_DRIVER_SOURCES)			\
1492
		$(HYPERV_DRIVER_EXTRA_DIST)			\
O
Osier Yang 已提交
1493
		$(PARALLELS_DRIVER_SOURCES)			\
1494
		$(NETWORK_DRIVER_SOURCES)			\
1495
		$(INTERFACE_DRIVER_SOURCES)			\
1496 1497 1498 1499
		$(STORAGE_DRIVER_SOURCES)			\
		$(STORAGE_DRIVER_FS_SOURCES)			\
		$(STORAGE_DRIVER_LVM_SOURCES)			\
		$(STORAGE_DRIVER_ISCSI_SOURCES)			\
1500
		$(STORAGE_DRIVER_SCSI_SOURCES)			\
D
Dave Allan 已提交
1501
		$(STORAGE_DRIVER_MPATH_SOURCES)			\
1502
		$(STORAGE_DRIVER_DISK_SOURCES)			\
1503
		$(STORAGE_DRIVER_RBD_SOURCES)			\
1504
		$(STORAGE_DRIVER_SHEEPDOG_SOURCES)		\
1505 1506
		$(NODE_DEVICE_DRIVER_SOURCES)			\
		$(NODE_DEVICE_DRIVER_HAL_SOURCES)		\
1507
		$(NODE_DEVICE_DRIVER_UDEV_SOURCES)		\
1508
		$(NWFILTER_DRIVER_SOURCES)			\
1509
		$(SECURITY_DRIVER_SELINUX_SOURCES)		\
J
Jamie Strandboge 已提交
1510
		$(SECURITY_DRIVER_APPARMOR_SOURCES)		\
D
Daniel P. Berrange 已提交
1511
		$(SECRET_DRIVER_SOURCES)			\
1512
		$(VBOX_DRIVER_EXTRA_DIST)			\
1513
		$(VMWARE_DRIVER_SOURCES)			\
1514 1515
		$(XENXS_SOURCES)				\
		$(ACCESS_DRIVER_POLKIT_POLICY)
1516

1517 1518
check-local: check-augeas

1519 1520 1521 1522 1523 1524
.PHONY: check-augeas \
	check-augeas-qemu \
	check-augeas-lxc \
	check-augeas-sanlock \
	check-augeas-lockd \
	$(NULL)
1525

1526
check-augeas: check-augeas-qemu check-augeas-lxc check-augeas-sanlock check-augeas-lockd
1527

1528
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
1529
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
1530

1531
if WITH_QEMU
1532 1533
test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
		$(srcdir)/qemu/qemu.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1534
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
1535

1536
check-augeas-qemu: test_libvirtd_qemu.aug
1537
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1538
	    '$(AUGPARSE)' -I $(srcdir)/qemu test_libvirtd_qemu.aug; \
1539
	fi
1540 1541
else
check-augeas-qemu:
1542
endif
1543

1544
if WITH_LXC
1545 1546
test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
		$(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1547
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
1548

1549
check-augeas-lxc: test_libvirtd_lxc.aug
1550
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1551
	    '$(AUGPARSE)' -I $(srcdir)/lxc test_libvirtd_lxc.aug; \
1552
	fi
1553 1554
else
check-augeas-lxc:
1555
endif
1556

1557
if WITH_SANLOCK
1558 1559
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1560
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
1561

1562
check-augeas-sanlock: test_libvirt_sanlock.aug
1563
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1564
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
1565
	fi
1566 1567 1568
else
check-augeas-sanlock:
endif
1569

1570 1571 1572 1573 1574 1575 1576 1577 1578
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 $< $@

check-augeas-lockd: test_libvirt_lockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_lockd.aug; \
	fi

1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597
#
# 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.
#

1598
if WITH_DRIVER_MODULES
1599
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
1600 1601
else
SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
1602
endif
1603

1604
if WITH_LINUX
1605
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
1606 1607
else
SYM_FILES += $(srcdir)/libvirt_linux.syms
1608
endif
1609

1610
if WITH_ESX
1611
USED_SYM_FILES += $(srcdir)/libvirt_esx.syms
1612 1613
else
SYM_FILES += $(srcdir)/libvirt_esx.syms
1614 1615
endif

1616
if WITH_LIBVIRTD
1617
USED_SYM_FILES += $(srcdir)/libvirt_daemon.syms
1618 1619
else
SYM_FILES += $(srcdir)/libvirt_daemon.syms
1620 1621
endif

1622
if WITH_OPENVZ
1623
USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms
1624 1625
else
SYM_FILES += $(srcdir)/libvirt_openvz.syms
1626 1627
endif

1628
if WITH_VMX
1629
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
1630 1631
else
SYM_FILES += $(srcdir)/libvirt_vmx.syms
1632 1633
endif

1634
if WITH_XENXS
1635
USED_SYM_FILES += $(srcdir)/libvirt_xenxs.syms
1636 1637
else
SYM_FILES += $(srcdir)/libvirt_xenxs.syms
1638 1639
endif

1640
if WITH_SASL
1641
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
1642 1643
else
SYM_FILES += $(srcdir)/libvirt_sasl.syms
E
Eric Blake 已提交
1644 1645
endif

1646 1647 1648 1649 1650 1651
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
else
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
endif

1652
if WITH_SSH2
1653
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
1654 1655
else
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
1656 1657
endif

1658
if WITH_ATOMIC_OPS_PTHREAD
1659
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
1660 1661
else
SYM_FILES += $(srcdir)/libvirt_atomic.syms
1662 1663
endif

1664
EXTRA_DIST += \
1665 1666 1667 1668 1669
	libvirt_public.syms		\
	libvirt_lxc.syms		\
	libvirt_qemu.syms		\
	$(SYM_FILES)			\
	$(NULL)
1670

E
Eric Blake 已提交
1671 1672
GENERATED_SYM_FILES = \
	libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def
1673 1674

BUILT_SOURCES += $(GENERATED_SYM_FILES)
1675

1676 1677
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(top_builddir)/config.status
1678 1679 1680 1681 1682 1683
	$(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 && \
E
Eric Blake 已提交
1684
	cat $(USED_SYM_FILES) >>$@-tmp && \
1685 1686
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
1687
	mv $@-tmp libvirt.syms
1688

1689 1690 1691
libvirt.def: libvirt.syms
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
E
Eric Blake 已提交
1692
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d; s/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
1693 1694 1695
	chmod a-w $@-tmp && \
	mv $@-tmp libvirt.def

1696 1697 1698
libvirt_qemu.def: $(srcdir)/libvirt_qemu.syms
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
E
Eric Blake 已提交
1699
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d; s/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
1700 1701 1702
	chmod a-w $@-tmp && \
	mv $@-tmp libvirt_qemu.def

1703 1704 1705 1706 1707 1708 1709
libvirt_lxc.def: $(srcdir)/libvirt_lxc.syms
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d; s/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
	chmod a-w $@-tmp && \
	mv $@-tmp libvirt_lxc.def

1710 1711
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
1712 1713 1714 1715 1716 1717 1718 1719 1720
libvirt_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(LIBVIRT_NODELETE) \
		$(AM_LDFLAGS) \
		$(RELRO_LDFLAGS) \
		$(CYGWIN_EXTRA_LDFLAGS) \
		$(MINGW_EXTRA_LDFLAGS) \
		$(NULL)
1721
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
1722
libvirt_la_LIBADD += \
1723
		    $(DRIVER_MODULE_LIBS) \
1724
		    $(CYGWIN_EXTRA_LIBADD)
1725
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
1726 1727 1728 1729 1730 1731
# 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)
1732

1733
if WITH_DTRACE_PROBES
1734
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
1735
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
1736
nodist_libvirt_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
1737
if WITH_REMOTE
E
Eric Blake 已提交
1738
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
1739
endif WITH_REMOTE
1740 1741 1742
if WITH_DRIVER_MODULES
DTRACE2SYSTEMTAP_FLAGS = --with-modules
endif
1743

1744 1745 1746
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

if WITH_QEMU
1747
libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.lo
1748
nodist_libvirt_driver_qemu_la_SOURCES = libvirt_qemu_probes.h
1749
BUILT_SOURCES += libvirt_qemu_probes.h
1750
endif
1751 1752

tapsetdir = $(datadir)/systemtap/tapset
1753
tapset_DATA = libvirt_probes.stp libvirt_qemu_probes.stp libvirt_functions.stp
1754

1755
%_probes.h: %_probes.d
1756 1757
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

E
Eric Blake 已提交
1758
.PRECIOUS: %_probes.o
1759
%_probes.o: %_probes.d
1760 1761
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

1762 1763 1764 1765 1766 1767 1768 1769 1770
%_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='$<'" \
	> $@

J
Jiri Denemark 已提交
1771 1772 1773
RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
1774
		  $(srcdir)/remote/lxc_protocol.x \
1775 1776 1777
		  $(srcdir)/remote/qemu_protocol.x \
		  $(srcdir)/lxc/lxc_monitor_protocol.x \
		  $(srcdir)/locking/lock_protocol.x
1778 1779

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

1782
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl $(top_builddir)/config.status
1783
	$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
1784
	  $(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
1785

1786
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
1787
              libvirt_qemu_probes.h libvirt_qemu_probes.o \
1788
              libvirt_qemu_probes.lo\
1789 1790
              libvirt_functions.stp libvirt_probes.stp \
              libvirt_qemu_probes.stp
1791 1792
endif

1793
EXTRA_DIST += libvirt_probes.d libvirt_qemu_probes.d
1794

C
Chris Lalancette 已提交
1795
libvirt_qemu_la_SOURCES = libvirt-qemu.c
D
Daniel P. Berrange 已提交
1796 1797 1798 1799 1800 1801 1802 1803
libvirt_qemu_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(RELRO_LDFLAGS) \
		$(CYGWIN_EXTRA_LDFLAGS) \
		$(MINGW_EXTRA_LDFLAGS) \
		$(NULL)
1804
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
C
Chris Lalancette 已提交
1805
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
1806

1807
libvirt_lxc_la_SOURCES = libvirt-lxc.c
D
Daniel P. Berrange 已提交
1808 1809 1810 1811 1812 1813 1814 1815
libvirt_lxc_la_LDFLAGS = \
		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
		-version-info $(LIBVIRT_VERSION_INFO) \
		$(AM_LDFLAGS) \
		$(RELRO_LDFLAGS) \
		$(CYGWIN_EXTRA_LDFLAGS) \
		$(MINGW_EXTRA_LDFLAGS) \
		$(NULL)
1816 1817 1818 1819
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
EXTRA_DIST += $(LIBVIRT_LXC_SYMBOL_FILE)

1820 1821 1822
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

1823
if WITH_LIBVIRTD
1824 1825 1826 1827 1828
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
		$(LOCK_DRIVER_LOCKD_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
		$(NULL)
E
Eric Blake 已提交
1829 1830 1831
lockd_la_CFLAGS = -I$(top_srcdir)/src/conf \
		$(XDR_CFLAGS) \
		$(AM_CFLAGS)
1832 1833
lockd_la_LDFLAGS = -module -avoid-version
lockd_la_LIBADD = ../gnulib/lib/libgnu.la libvirt-net-rpc.la libvirt-net-rpc-client.la
J
Jiri Denemark 已提交
1834 1835 1836
augeas_DATA += locking/libvirt_lockd.aug
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
1837 1838 1839 1840
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
endif
if WITH_QEMU
1841
nodist_conf_DATA += locking/qemu-lockd.conf
1842 1843 1844 1845 1846 1847 1848 1849 1850
BUILT_SOURCES += locking/qemu-lockd.conf
DISTCLEANFILES += locking/qemu-lockd.conf
endif

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


1851 1852
sbin_PROGRAMS = virtlockd

1853 1854 1855
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
1856
		$(LOCK_DAEMON_GENERATED) \
1857
		$(NULL)
1858 1859
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
1860
		$(PIE_CFLAGS) \
1861
		$(XDR_CFLAGS) \
1862 1863 1864
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
1865
		$(PIE_LDFLAGS) \
D
Daniel P. Berrange 已提交
1866
		$(RELRO_LDFLAGS) \
1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881
		$(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
endif

else
1882 1883
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
              $(LOCK_DRIVER_LOCKD_SOURCES)
1884 1885
endif

J
Jiri Denemark 已提交
1886 1887 1888 1889
EXTRA_DIST += locking/virtlockd.sysconf \
	locking/lockd.conf \
	locking/libvirt_lockd.aug \
	locking/test_libvirt_lockd.aug.in
1890 1891

install-sysconfig:
E
Eric Blake 已提交
1892
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
1893 1894 1895 1896 1897
	$(INSTALL_DATA) $(srcdir)/locking/virtlockd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd

uninstall-sysconfig:
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
E
Eric Blake 已提交
1898
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
1899 1900 1901 1902 1903 1904

EXTRA_DIST += locking/virtlockd.init.in

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_RED_HAT
install-init:: virtlockd.init install-sysconfig
E
Eric Blake 已提交
1905
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
1906 1907 1908 1909
	$(INSTALL_SCRIPT) virtlockd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd

uninstall-init:: uninstall-sysconfig
E
Eric Blake 已提交
1910 1911
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
1912 1913

BUILT_SOURCES += virtlockd.init
E
Eric Blake 已提交
1914
DISTCLEANFILES += virtlockd.init
1915 1916 1917 1918 1919 1920 1921 1922 1923 1924
else
install-init::
uninstall-init::
endif
else
install-init::
uninstall-init::
endif

virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
1925 1926 1927 1928 1929 1930
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g'		\
	    < $< > $@-t &&					\
	    chmod a+x $@-t &&					\
1931 1932 1933 1934
	    mv $@-t $@



1935 1936 1937 1938 1939 1940 1941 1942
EXTRA_DIST += locking/virtlockd.service.in locking/virtlockd.socket.in

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

SYSTEMD_UNIT_DIR = /lib/systemd/system

BUILT_SOURCES += virtlockd.service virtlockd.socket
E
Eric Blake 已提交
1943
DISTCLEANFILES += virtlockd.service virtlockd.socket
1944

E
Eric Blake 已提交
1945 1946
install-systemd: virtlockd.service virtlockd.socket install-sysconfig
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
1947
	$(INSTALL_DATA) virtlockd.service \
1948
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
1949
	$(INSTALL_DATA) virtlockd.socket \
1950 1951 1952
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/

uninstall-systemd: uninstall-sysconfig
E
Eric Blake 已提交
1953 1954 1955
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.socket
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
1956 1957 1958 1959 1960 1961 1962 1963 1964 1965
else
install-systemd:
uninstall-systemd:
endif
else
install-systemd:
uninstall-systemd:
endif

virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
1966 1967 1968
	$(AM_V_GEN)sed						\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    < $< > $@-t &&					\
1969 1970 1971
	    mv $@-t $@

virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
1972 1973 1974
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    < $< > $@-t &&					\
1975 1976 1977
	    mv $@-t $@


1978
if WITH_SANLOCK
1979
lockdriver_LTLIBRARIES += sanlock.la
1980
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
1981
sanlock_la_CFLAGS = -I$(top_srcdir)/src/conf $(AM_CFLAGS)
1982
sanlock_la_LDFLAGS = -module -avoid-version
1983
sanlock_la_LIBADD = -lsanlock_client \
1984 1985 1986
		../gnulib/lib/libgnu.la

augeas_DATA += locking/libvirt_sanlock.aug
1987 1988
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
1989

E
Eric Blake 已提交
1990
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
1991
	$(AM_V_GEN)$(MKDIR_P) locking ; \
1992 1993 1994
	cp $< $@

if WITH_QEMU
1995
nodist_conf_DATA += locking/qemu-sanlock.conf
1996
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
1997
DISTCLEANFILES += locking/qemu-sanlock.conf
1998
endif
1999
else
2000
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
2001
endif
2002 2003
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
2004
	locking/test_libvirt_sanlock.aug.in
2005

2006 2007 2008 2009
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
2010

2011
EXTRA_DIST += \
E
Eric Blake 已提交
2012 2013 2014 2015
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
2016 2017
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
2018

E
Eric Blake 已提交
2019 2020
VIR_NET_RPC_GENERATED = \
	$(srcdir)/rpc/virnetprotocol.h \
J
Jiri Denemark 已提交
2021 2022 2023
	$(srcdir)/rpc/virnetprotocol.c \
	$(srcdir)/rpc/virkeepaliveprotocol.h \
	$(srcdir)/rpc/virkeepaliveprotocol.c
2024

2025
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2026

2027
libvirt_net_rpc_la_SOURCES = \
2028
	rpc/virnetmessage.h rpc/virnetmessage.c \
2029
	rpc/virnetprotocol.h rpc/virnetprotocol.c \
2030
	rpc/virnetsocket.h rpc/virnetsocket.c \
2031 2032
	rpc/virkeepaliveprotocol.h rpc/virkeepaliveprotocol.c \
	rpc/virkeepalive.h rpc/virkeepalive.c
2033
if WITH_SSH2
2034 2035 2036 2037 2038 2039
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
else
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
endif
2040
if WITH_GNUTLS
2041 2042 2043 2044 2045 2046
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
else
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
endif
2047
if WITH_SASL
2048 2049 2050 2051 2052 2053
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
else
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
endif
2054
libvirt_net_rpc_la_CFLAGS = \
2055
			$(GNUTLS_CFLAGS) \
2056
			$(SASL_CFLAGS) \
2057
			$(SSH2_CFLAGS) \
2058
			$(XDR_CFLAGS) \
2059 2060
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
2061
			$(GNUTLS_LIBS) \
2062
			$(SASL_LIBS) \
2063
			$(SSH2_LIBS)\
2064 2065 2066 2067 2068 2069
			$(AM_LDFLAGS) \
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2070 2071 2072 2073
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
2074
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
2075 2076
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
2077
			$(AVAHI_CFLAGS) \
2078
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
2079
			$(XDR_CFLAGS) \
J
Jim Fehlig 已提交
2080 2081
			$(AM_CFLAGS) \
			$(POLKIT_CFLAGS)
2082 2083
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
2084
			$(AVAHI_LIBS) \
2085
			$(DBUS_LIBS) \
J
Jim Fehlig 已提交
2086
			$(POLKIT_LIBS) \
2087 2088 2089 2090 2091
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2092 2093 2094 2095 2096
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 已提交
2097 2098
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
2099 2100 2101 2102 2103 2104
libvirt_net_rpc_client_la_LDFLAGS = \
			$(AM_LDFLAGS) \
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
2105

2106 2107
libexec_PROGRAMS =

2108
if WITH_LIBVIRTD
2109 2110
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2111 2112 2113
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
D
Daniel P. Berrange 已提交
2114
		$(RELRO_LDFLAGS) \
D
Daniel P. Berrange 已提交
2115
		$(NULL)
2116 2117 2118
libvirt_iohelper_LDADD =		\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
2119 2120 2121
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
endif
2122

D
Daniel P. Berrange 已提交
2123 2124 2125 2126
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2127
endif
2128

2129
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
2130
if WITH_LIBVIRTD
2131
libexec_PROGRAMS += libvirt_parthelper
2132

2133
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
D
Daniel P. Berrange 已提交
2134 2135 2136
libvirt_parthelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
D
Daniel P. Berrange 已提交
2137
		$(RELRO_LDFLAGS) \
D
Daniel P. Berrange 已提交
2138
		$(NULL)
2139 2140 2141 2142
libvirt_parthelper_LDADD =		\
		$(LIBPARTED_LIBS)	\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
2143 2144 2145
if WITH_DTRACE_PROBES
libvirt_parthelper_LDADD += libvirt_probes.lo
endif
2146

D
Daniel P. Berrange 已提交
2147 2148 2149 2150 2151
libvirt_parthelper_CFLAGS = \
		$(LIBPARTED_CFLAGS) \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
R
Richard W.M. Jones 已提交
2152
endif
2153
endif
2154 2155
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)

2156

2157
if WITH_SANLOCK
2158 2159 2160
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2161 2162 2163 2164 2165 2166 2167 2168
libvirt_sanlock_helper_CFLAGS = \
		-I$(top_srcdir)/src/conf \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
D
Daniel P. Berrange 已提交
2169
		$(RELRO_LDFLAGS) \
D
Daniel P. Berrange 已提交
2170
		$(NULL)
2171 2172 2173
libvirt_sanlock_helper_LDADD = libvirt.la
endif

2174 2175 2176 2177 2178 2179
if WITH_LXC
if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_lxc

libvirt_lxc_SOURCES =						\
		$(LXC_CONTROLLER_SOURCES)			\
O
Osier Yang 已提交
2180 2181
		$(NODE_INFO_SOURCES)				\
		$(DATATYPES_SOURCES)
D
Daniel P. Berrange 已提交
2182 2183 2184
libvirt_lxc_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
D
Daniel P. Berrange 已提交
2185
		$(RELRO_LDFLAGS) \
D
Daniel P. Berrange 已提交
2186
		$(NULL)
2187
libvirt_lxc_LDADD =			\
G
Gao feng 已提交
2188
		$(FUSE_LIBS) \
2189 2190
		libvirt-net-rpc-server.la \
		libvirt-net-rpc.la \
2191
		libvirt_security_manager.la \
2192 2193
		libvirt_conf.la \
		libvirt_util.la \
2194
		../gnulib/lib/libgnu.la
2195
if WITH_DTRACE_PROBES
2196
libvirt_lxc_LDADD += libvirt_probes.lo
2197
endif
2198
libvirt_lxc_LDADD += $(SECDRIVER_LIBS)
2199
libvirt_lxc_CFLAGS =				\
2200
		-I$(top_srcdir)/src/conf	\
2201
		$(AM_CFLAGS)                    \
D
Daniel P. Berrange 已提交
2202
		$(PIE_CFLAGS)			\
G
Gao feng 已提交
2203
		$(LIBNL_CFLAGS)			\
D
Daniel P. Berrange 已提交
2204 2205
		$(FUSE_CFLAGS)			\
		$(NULL)
2206
if WITH_BLKID
2207 2208 2209
libvirt_lxc_CFLAGS += $(BLKID_CFLAGS)
libvirt_lxc_LDADD += $(BLKID_LIBS)
endif
2210 2211 2212
if WITH_SECDRIVER_SELINUX
libvirt_lxc_CFLAGS += $(SELINUX_CFLAGS)
endif
J
Jiri Denemark 已提交
2213 2214 2215
if WITH_SECDRIVER_APPARMOR
libvirt_lxc_CFLAGS += $(APPARMOR_CFLAGS)
endif
2216 2217 2218 2219
endif
endif
EXTRA_DIST += $(LXC_CONTROLLER_SOURCES)

J
Jamie Strandboge 已提交
2220 2221 2222 2223 2224 2225
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 已提交
2226 2227 2228
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
D
Daniel P. Berrange 已提交
2229
		$(RELRO_LDFLAGS) \
D
Daniel P. Berrange 已提交
2230
		$(NULL)
J
Jamie Strandboge 已提交
2231
virt_aa_helper_LDADD =						\
C
Chris Lalancette 已提交
2232 2233 2234
		libvirt_conf.la					\
		libvirt_util.la					\
		../gnulib/lib/libgnu.la
2235
if WITH_DTRACE_PROBES
2236
virt_aa_helper_LDADD += libvirt_probes.lo
2237
endif
J
Jamie Strandboge 已提交
2238
virt_aa_helper_CFLAGS =						\
2239 2240
		-I$(top_srcdir)/src/conf			\
		-I$(top_srcdir)/src/security			\
D
Daniel P. Berrange 已提交
2241 2242 2243
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
J
Jamie Strandboge 已提交
2244 2245 2246 2247
endif
endif
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

2248
install-data-local: install-init install-systemd
2249 2250
if WITH_LIBVIRTD
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
2251
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
2252 2253
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
endif
2254 2255
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
2256
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
2257
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
2258
if WITH_SANLOCK
2259 2260
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
endif
2261 2262
if WITH_QEMU
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu"
2263
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu/channel/target"
2264
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu"
2265
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu"
2266
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu"
2267 2268 2269 2270 2271
endif
if WITH_LXC
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lxc"
endif
J
Jim Fehlig 已提交
2272 2273 2274
if WITH_LIBXL
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/libxl"
J
Jim Fehlig 已提交
2275
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl"
J
Jim Fehlig 已提交
2276
endif
2277 2278 2279 2280
if WITH_UML
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/uml"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/uml"
endif
2281 2282 2283
if WITH_XEN
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/xen"
endif
2284 2285
if WITH_NETWORK
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network"
2286
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq"
2287
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/network"
2288 2289 2290 2291
	$(MKDIR_P) "$(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart"
	$(INSTALL_DATA) $(srcdir)/network/default.xml \
	  $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/default.xml
	test -z "$(UUID)" || \
E
Eric Blake 已提交
2292 2293 2294 2295 2296 2297
	  { sed -e "s,</name>,</name>\n  <uuid>$(UUID)</uuid>," \
	      $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/default.xml > \
	      $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/default.xml.t && \
	    cp $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/default.xml.t \
	      $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/default.xml && \
	    rm $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/default.xml.t; }
2298
	test -e $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml || \
E
Eric Blake 已提交
2299
	   ln -s ../default.xml \
2300 2301 2302
	    $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml
endif

2303
uninstall-local:: uninstall-init uninstall-systemd
2304
if WITH_LIBVIRTD
2305
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
2306 2307 2308
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
endif
2309 2310
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
2311
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
2312
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
2313
if WITH_SANLOCK
2314 2315
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
endif
2316 2317 2318 2319 2320
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" ||:
2321
endif
2322 2323 2324 2325
if WITH_LXC
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||:
endif
J
Jim Fehlig 已提交
2326 2327 2328
if WITH_LIBXL
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||:
J
Jim Fehlig 已提交
2329
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||:
J
Jim Fehlig 已提交
2330
endif
2331 2332 2333 2334
if WITH_UML
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/uml" ||:
endif
2335 2336 2337
if WITH_XEN
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/xen" ||:
endif
2338 2339 2340 2341 2342 2343 2344 2345 2346
if WITH_NETWORK
	rm -f $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml
	rm -f $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/default.xml
	rmdir "$(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart" || :
	rmdir "$(DESTDIR)$(sysconfdir)/libvirt/qemu/networks" || :
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||:
endif
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
2347

2348 2349
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
2350
MAINTAINERCLEANFILES += $(REMOTE_DRIVER_GENERATED) $(VIR_NET_RPC_GENERATED)