Makefile.am 76.6 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
AM_LDFLAGS =	$(DRIVER_MODULE_LDFLAGS)			\
G
Guido Günther 已提交
36 37
		$(COVERAGE_LDFLAGS)				\
		$(RELRO_LDFLAGS)				\
38
		$(NO_INDIRECT_LDFLAGS)				\
G
Guido Günther 已提交
39
		$(NULL)
40

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

43
BUILT_SOURCES =
44 45 46
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
47
nodist_conf_DATA =
48

E
Eric Blake 已提交
49 50
THREAD_LIBS = $(LIB_PTHREAD) $(LTLIBMULTITHREAD)

51 52 53 54 55 56 57 58
SECDRIVER_LIBS =
if WITH_SECDRIVER_SELINUX
SECDRIVER_LIBS += $(SELINUX_LIBS)
endif
if WITH_SECDRIVER_APPARMOR
SECDRIVER_LIBS += $(APPARMOR_LIBS)
endif

59 60 61
if WITH_NETWORK
UUID=$(shell uuidgen 2>/dev/null)
endif
62

63
lib_LTLIBRARIES = libvirt.la libvirt-qemu.la libvirt-lxc.la
64

65
moddir = $(libdir)/libvirt/connection-driver
66 67
mod_LTLIBRARIES =

A
Amy Griffis 已提交
68
confdir = $(sysconfdir)/libvirt
69
conf_DATA = libvirt.conf
70

71 72 73 74 75 76
augeasdir = $(datadir)/augeas/lenses
augeas_DATA =

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

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

153

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

157 158
BUILT_SOURCES += $(srcdir)/util/virkeymaps.h

L
Lai Jiangshan 已提交
159 160
$(srcdir)/util/virkeymaps.h: $(srcdir)/util/keymaps.csv	\
		$(srcdir)/util/virkeycode-mapgen.py
161 162
	$(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py \
	  <$(srcdir)/util/keymaps.csv >$@
L
Lai Jiangshan 已提交
163

164
EXTRA_DIST += util/virthreadpthread.c util/virthreadwin32.c
165

166
# Internal generic driver infrastructure
167
NODE_INFO_SOURCES = nodeinfo.h nodeinfo.c
O
Osier Yang 已提交
168 169 170 171 172 173 174 175 176 177 178
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	\
179
		locking/domain_lock.h locking/domain_lock.c
180

181 182 183
LOCK_DRIVER_SANLOCK_SOURCES = \
		locking/lock_driver_sanlock.c

184 185
LOCK_DRIVER_SANLOCK_HELPER_SOURCES = \
		locking/sanlock_helper.c
186

187
LOCK_PROTOCOL_GENERATED = \
188 189
		$(srcdir)/locking/lock_protocol.h \
		$(srcdir)/locking/lock_protocol.c \
190 191
		$(NULL)

192 193 194
LOCK_PROTOCOL = $(srcdir)/locking/lock_protocol.x
EXTRA_DIST += $(LOCK_PROTOCOL) \
	$(LOCK_PROTOCOL_GENERATED)
195 196 197
BUILT_SOURCES += $(LOCK_PROTOCOL_GENERATED)
MAINTAINERCLEANFILES += $(LOCK_PROTOCOL_GENERATED)

198
LOCK_DAEMON_GENERATED = \
199
		$(srcdir)/locking/lock_daemon_dispatch_stubs.h
200 201 202
		$(NULL)

BUILT_SOURCES += $(LOCK_DAEMON_GENERATED)
203
EXTRA_DIST += $(LOCK_DAEMON_GENERATED)
204 205
MAINTAINERCLEANFILES += $(LOCK_DAEMON_GENERATED)

206 207 208 209
LOCK_DRIVER_LOCKD_SOURCES = \
		locking/lock_driver_lockd.c \
		$(NULL)

210 211 212 213 214
LOCK_DAEMON_SOURCES = \
		locking/lock_daemon.h \
		locking/lock_daemon.c \
		locking/lock_daemon_config.h \
		locking/lock_daemon_config.c \
215 216
		locking/lock_daemon_dispatch.c \
		locking/lock_daemon_dispatch.h \
217 218
		$(NULL)

219 220
$(srcdir)/locking/lock_daemon_dispatch_stubs.h: $(LOCK_PROTOCOL) \
		$(srcdir)/rpc/gendispatch.pl Makefile.am
221 222
	$(AM_V_GEN)perl -w $(srcdir)/rpc/gendispatch.pl --mode=server \
	    virLockSpaceProtocol VIR_LOCK_SPACE_PROTOCOL \
223
	    $(LOCK_PROTOCOL) > $@
224 225


226 227
NETDEV_CONF_SOURCES =						\
		conf/netdev_bandwidth_conf.h conf/netdev_bandwidth_conf.c \
228 229
		conf/netdev_vport_profile_conf.h conf/netdev_vport_profile_conf.c \
		conf/netdev_vlan_conf.h conf/netdev_vlan_conf.c
230

231
# XML configuration format handling sources
232 233
# Domain driver generic impl APIs
DOMAIN_CONF_SOURCES =						\
234
		conf/capabilities.c conf/capabilities.h		\
235
		conf/domain_conf.c conf/domain_conf.h		\
236
		conf/domain_audit.c conf/domain_audit.h		\
237 238
		conf/domain_nwfilter.c conf/domain_nwfilter.h	\
		conf/snapshot_conf.c conf/snapshot_conf.h
239 240 241

DOMAIN_EVENT_SOURCES =						\
		conf/domain_event.c conf/domain_event.h
242 243

# Network driver generic impl APIs
244
NETWORK_CONF_SOURCES =						\
245
		conf/network_conf.c conf/network_conf.h
246

247 248
# Network filter driver generic impl APIs
NWFILTER_PARAM_CONF_SOURCES =					\
249
		conf/nwfilter_params.c conf/nwfilter_params.h	\
250 251
		conf/nwfilter_ipaddrmap.c			\
		conf/nwfilter_ipaddrmap.h			\
252
		conf/nwfilter_conf.h
253

254
NWFILTER_CONF_SOURCES =						\
255 256 257
		$(NWFILTER_PARAM_CONF_SOURCES)			\
		conf/nwfilter_conf.c conf/nwfilter_conf.h

258
# Storage driver generic impl APIs
259 260
STORAGE_CONF_SOURCES =                                         \
		conf/storage_conf.h conf/storage_conf.c
261

262
# Interface driver generic impl APIs
263 264
INTERFACE_CONF_SOURCES =                                       \
		conf/interface_conf.c conf/interface_conf.h
265

266
# Secret driver generic impl APIs
267 268 269 270 271 272 273 274 275 276
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

277 278
CPU_CONF_SOURCES =						\
		conf/cpu_conf.c conf/cpu_conf.h
279

280 281
# Safe character device handling helper APIs
CHRDEV_CONF_SOURCES =						\
282
		conf/virchrdev.c conf/virchrdev.h
283

284 285 286 287
# Device Helper APIs
DEVICE_CONF_SOURCES =                                           \
		conf/device_conf.c conf/device_conf.h

288
CONF_SOURCES =							\
289
		$(NETDEV_CONF_SOURCES)				\
290 291 292
		$(DOMAIN_CONF_SOURCES)				\
		$(DOMAIN_EVENT_SOURCES)				\
		$(NETWORK_CONF_SOURCES)				\
293
		$(NWFILTER_CONF_SOURCES)			\
294 295 296 297
		$(NODE_DEVICE_CONF_SOURCES)			\
		$(STORAGE_CONF_SOURCES)				\
		$(ENCRYPTION_CONF_SOURCES)			\
		$(INTERFACE_CONF_SOURCES)			\
298
		$(SECRET_CONF_SOURCES)				\
299
		$(CPU_CONF_SOURCES)				\
300
		$(CHRDEV_CONF_SOURCES)				\
301
		$(DEVICE_CONF_SOURCES)
302

303
# The remote RPC driver, covering domains, storage, networks, etc
304
REMOTE_DRIVER_GENERATED = \
E
Eric Blake 已提交
305 306 307
		$(srcdir)/remote/remote_protocol.c		\
		$(srcdir)/remote/remote_protocol.h		\
		$(srcdir)/remote/remote_client_bodies.h		\
308 309 310
		$(srcdir)/remote/lxc_protocol.c			\
		$(srcdir)/remote/lxc_protocol.h			\
		$(srcdir)/remote/lxc_client_bodies.h		\
E
Eric Blake 已提交
311 312 313 314 315
		$(srcdir)/remote/qemu_protocol.c		\
		$(srcdir)/remote/qemu_protocol.h		\
		$(srcdir)/remote/qemu_client_bodies.h

REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x
316
LXC_PROTOCOL = $(srcdir)/remote/lxc_protocol.x
E
Eric Blake 已提交
317
QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x
318
REMOTE_DRIVER_PROTOCOL = $(REMOTE_PROTOCOL) $(QEMU_PROTOCOL) $(LXC_PROTOCOL)
319

320
$(srcdir)/remote/remote_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
321
		$(REMOTE_PROTOCOL) Makefile.am
322 323
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
	  remote REMOTE $(REMOTE_PROTOCOL) > $@
324

325
$(srcdir)/remote/lxc_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
326
		$(LXC_PROTOCOL) Makefile.am
327 328
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
	  lxc LXC $(LXC_PROTOCOL) > $@
329

330
$(srcdir)/remote/qemu_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
331
		$(QEMU_PROTOCOL) Makefile.am
332 333
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
	  qemu QEMU $(QEMU_PROTOCOL) > $@
334 335 336 337 338

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

340
EXTRA_DIST +=  $(REMOTE_DRIVER_PROTOCOL) \
341
		$(REMOTE_DRIVER_GENERATED)
342

343 344 345 346 347 348 349 350 351 352
# 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
353 354 355 356

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

365 366 367 368
# 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.
369
PDWTAGS = \
370
	$(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then		\
371 372 373 374
	  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;			\
375 376 377 378
	  if test -s $(@F)-t2; then					\
	    rm -rf $(@F)-t?;						\
	    echo 'WARNING: pdwtags appears broken; skipping the $@ test' >&2;\
	  else								\
379
	    $(PERL) -0777 -n						\
380
		-e 'foreach my $$p (split m!\n*(?:$(r1)|$(r2))\n!) {'	\
381 382
		-e '  if ($$p =~ /^(struct|enum) $(struct_prefix)/ ||'	\
		-e '      $$p =~ /^enum {/) {'				\
383 384 385
		-e '    $$p =~ s!\t*/\*.*?\*/!!sg;'			\
		-e '    $$p =~ s!\s+\n!\n!sg;'				\
		-e '    $$p =~ s!\s+$$!!;'				\
386
		-e '    $$p =~ s!\t!        !g;'			\
387 388 389 390
		-e '    print "$$p\n";'					\
		-e '    $$n++;'						\
		-e '  }'						\
		-e '}'							\
391 392 393
		-e 'BEGIN {'						\
		-e '  print "/* -*- c -*- */\n";'			\
		-e '}'							\
394
		-e 'END {'						\
395
		-e '  if ($$n < 1) {'					\
396 397 398 399 400 401
		-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 '}'							\
402 403
		< $(@F)-t1 > $(@F)-t3;					\
	    case $$? in 8) rm -f $(@F)-t?; exit 0;; 0) ;; *) exit 1;; esac;\
404
	    diff -u $(@)s $(@F)-t3; st=$$?; rm -f $(@F)-t?; exit $$st;	\
405
	  fi;								\
406
	else								\
407 408
	  echo 'WARNING: you lack pdwtags; skipping the $@ test' >&2;	\
	  echo 'WARNING: install the dwarves package to get pdwtags' >&2; \
409
	fi
410

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

425 426
PROTOCOL_STRUCTS = \
	$(srcdir)/remote_protocol-structs \
427
	$(srcdir)/lxc_protocol-structs \
428
	$(srcdir)/qemu_protocol-structs \
J
Jiri Denemark 已提交
429 430
	$(srcdir)/virnetprotocol-structs \
	$(srcdir)/virkeepaliveprotocol-structs
431
if WITH_REMOTE
432 433
check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)

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

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

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

487 488 489 490 491 492 493 494 495 496 497 498 499 500
STATEFUL_DRIVER_SOURCE_FILES = \
	$(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)

501 502 503

check-driverimpls:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-driverimpls.pl \
504
		$(filter /%,$(DRIVER_SOURCE_FILES)) \
E
Eric Blake 已提交
505 506 507
		$(filter $(srcdir)/%,$(DRIVER_SOURCE_FILES)) \
		$(addprefix $(srcdir)/,$(filter-out $(srcdir)/%, \
			$(filter-out /%,$(DRIVER_SOURCE_FILES))))
508

509 510
check-aclrules:
	$(AM_V_GEN)$(PERL) $(srcdir)/check-aclrules.pl \
E
Eric Blake 已提交
511
		$(REMOTE_PROTOCOL) \
512
		$(addprefix $(srcdir)/,$(filter-out /%,$(STATEFUL_DRIVER_SOURCE_FILES)))
513 514

EXTRA_DIST += check-driverimpls.pl check-aclrules.pl
515

516
check-local: check-protocol check-symfile check-symsorting \
517
	check-drivername check-driverimpls check-aclrules
518
.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
519

520 521
# Mock driver, covering domains, storage, networks, etc
TEST_DRIVER_SOURCES =						\
522
		test/test_driver.c test/test_driver.h
523 524 525

# Now the Hypervisor specific drivers
XEN_DRIVER_SOURCES =						\
526 527 528 529 530 531
		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
532
if WITH_XEN_INOTIFY
533
XEN_DRIVER_SOURCES += xen/xen_inotify.c xen/xen_inotify.h
534
endif
535

536 537 538
LXC_MONITOR_PROTOCOL_GENERATED = \
	$(srcdir)/lxc/lxc_monitor_protocol.h \
	$(srcdir)/lxc/lxc_monitor_protocol.c \
539 540 541 542 543 544 545 546 547 548 549
	$(NULL)

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

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

LXC_GENERATED = \
550
	$(LXC_MONITOR_PROTOCOL_GENERATED) \
551 552 553 554
	$(LXC_MONITOR_GENERATED) \
	$(LXC_CONTROLLER_GENERATED) \
	$(NULL)

555
LXC_MONITOR_PROTOCOL = $(srcdir)/lxc/lxc_monitor_protocol.x
556 557

$(srcdir)/lxc/lxc_monitor_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
558
		$(LXC_MONITOR_PROTOCOL) Makefile.am
559 560
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > $@
561 562

$(srcdir)/lxc/lxc_controller_dispatch.h: $(srcdir)/rpc/gendispatch.pl \
563
		$(REMOTE_PROTOCOL) Makefile.am
564 565
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=server \
	  virLXCMonitor VIR_LXC_MONITOR $(LXC_MONITOR_PROTOCOL) > $@
566 567

EXTRA_DIST += \
568
	$(LXC_MONITOR_PROTOCOL) \
569 570 571 572 573
	$(LXC_GENERATED) \
	$(NULL)

BUILT_SOURCES += $(LXC_GENERATED)

574 575
CLEANFILES += $(LXC_GENERATED)

576
LXC_DRIVER_SOURCES =						\
577
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
578
		$(LXC_MONITOR_GENERATED)			\
579 580
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
581
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
582
		lxc/lxc_domain.c lxc/lxc_domain.h		\
583
		lxc/lxc_hostdev.c lxc/lxc_hostdev.h		\
584
		lxc/lxc_monitor.c lxc/lxc_monitor.h		\
585
		lxc/lxc_process.c lxc/lxc_process.h		\
G
Gao feng 已提交
586
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
587
		lxc/lxc_driver.c lxc/lxc_driver.h
588

589
LXC_CONTROLLER_SOURCES =					\
590
		$(LXC_MONITOR_PROTOCOL_GENERATED)		\
591
		$(LXC_CONTROLLER_GENERATED)			\
592 593
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
594
		lxc/lxc_cgroup.c lxc/lxc_cgroup.h		\
595
		lxc/lxc_domain.c lxc/lxc_domain.h		\
G
Gao feng 已提交
596
		lxc/lxc_fuse.c lxc/lxc_fuse.h			\
597
		lxc/lxc_controller.c
598

J
Jamie Strandboge 已提交
599
SECURITY_DRIVER_APPARMOR_HELPER_SOURCES =			\
E
Eric Blake 已提交
600
		$(DATATYPES_SOURCES)				\
J
Jamie Strandboge 已提交
601 602
		security/virt-aa-helper.c

603 604 605
PHYP_DRIVER_SOURCES =						\
		phyp/phyp_driver.c phyp/phyp_driver.h

606
OPENVZ_DRIVER_SOURCES =						\
607
		openvz/openvz_conf.c openvz/openvz_conf.h	\
608 609
		openvz/openvz_driver.c openvz/openvz_driver.h   \
		openvz/openvz_util.c openvz/openvz_util.h
610

E
Eric Blake 已提交
611
VMWARE_DRIVER_SOURCES =						\
612
		vmware/vmware_driver.c vmware/vmware_driver.h	\
613 614
		vmware/vmware_conf.c vmware/vmware_conf.h

615
VBOX_DRIVER_SOURCES =						\
E
Eric Blake 已提交
616 617 618 619 620 621
	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			\
622
	vbox/vbox_V4_0.c vbox/vbox_CAPI_v4_0.h			\
623 624
	vbox/vbox_V4_1.c vbox/vbox_CAPI_v4_1.h			\
	vbox/vbox_V4_2.c vbox/vbox_CAPI_v4_2.h
625

E
Eric Blake 已提交
626
VBOX_DRIVER_EXTRA_DIST =					\
627 628 629
		vbox/vbox_tmpl.c vbox/README			\
		vbox/vbox_MSCOMGlue.c vbox/vbox_MSCOMGlue.h	\
		vbox/vbox_XPCOMCGlue.c vbox/vbox_XPCOMCGlue.h
630

O
Osier Yang 已提交
631 632 633 634 635 636 637 638 639 640
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			\
641
		qemu/qemu_processpriv.h					\
O
Osier Yang 已提交
642 643 644 645 646 647 648 649
		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				\
650
		qemu/qemu_bridge_filter.h
R
Richard W.M. Jones 已提交
651

O
Osier Yang 已提交
652
XENAPI_DRIVER_SOURCES =						\
653
		xenapi/xenapi_driver.c xenapi/xenapi_driver.h	\
O
Osier Yang 已提交
654
		xenapi/xenapi_driver_private.h			\
655 656
		xenapi/xenapi_utils.c xenapi/xenapi_utils.h

J
Jim Fehlig 已提交
657 658 659 660
LIBXL_DRIVER_SOURCES =						\
		libxl/libxl_conf.c libxl/libxl_conf.h		\
		libxl/libxl_driver.c libxl/libxl_driver.h

661
UML_DRIVER_SOURCES =						\
D
Daniel P. Berrange 已提交
662 663
		uml/uml_conf.c uml/uml_conf.h			\
		uml/uml_driver.c uml/uml_driver.h
664

O
Osier Yang 已提交
665 666 667 668 669 670
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	\
671
		esx/esx_storage_backend_vmfs.c esx/esx_storage_backend_vmfs.h	\
672
		esx/esx_storage_backend_iscsi.c esx/esx_storage_backend_iscsi.h	\
O
Osier Yang 已提交
673
		esx/esx_device_monitor.c esx/esx_device_monitor.h	\
674
		esx/esx_secret_driver.c esx/esx_secret_driver.h		\
O
Osier Yang 已提交
675 676 677 678
		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		\
679
		esx/esx_vi_types.c esx/esx_vi_types.h
680

681
ESX_DRIVER_GENERATED =							\
682 683
		esx/esx_vi_methods.generated.c				\
		esx/esx_vi_methods.generated.h				\
684
		esx/esx_vi_methods.generated.macro			\
685 686 687 688 689
		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			\
690 691 692
		esx/esx_vi_types.generated.typefromstring		\
		esx/esx_vi.generated.c					\
		esx/esx_vi.generated.h
693

O
Osier Yang 已提交
694
ESX_DRIVER_EXTRA_DIST =							\
695 696 697 698 699
		esx/README						\
		esx/esx_vi_generator.input				\
		esx/esx_vi_generator.py					\
		$(ESX_DRIVER_GENERATED)

O
Osier Yang 已提交
700
HYPERV_DRIVER_SOURCES =									\
M
Matthias Bolte 已提交
701 702 703 704 705 706 707
		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		\
708
		hyperv/hyperv_nwfilter_driver.c hyperv/hyperv_nwfilter_driver.h		\
709
		hyperv/hyperv_util.c hyperv/hyperv_util.h				\
710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725
		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 已提交
726 727
PARALLELS_DRIVER_SOURCES =					\
		parallels/parallels_driver.h			\
728
		parallels/parallels_driver.c			\
729 730
		parallels/parallels_utils.c			\
		parallels/parallels_utils.h			\
D
Dmitry Guryanov 已提交
731 732
		parallels/parallels_storage.c		\
		parallels/parallels_network.c
D
Dmitry Guryanov 已提交
733

734
NETWORK_DRIVER_SOURCES =					\
735 736 737 738 739
		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
740

741 742 743 744
INTERFACE_DRIVER_SOURCES =

if WITH_INTERFACE
INTERFACE_DRIVER_SOURCES +=					\
745 746
		interface/interface_driver.h        \
		interface/interface_driver.c
747 748 749 750

if WITH_NETCF
INTERFACE_DRIVER_SOURCES +=					\
		interface/interface_backend_netcf.c
751
endif
752
if WITH_UDEV
753 754 755 756
INTERFACE_DRIVER_SOURCES +=					\
		interface/interface_backend_udev.c
endif
endif
757

758
SECRET_DRIVER_SOURCES =						\
759
		secret/secret_driver.h secret/secret_driver.c
760

761
# Storage backend specific impls
O
Osier Yang 已提交
762 763
STORAGE_DRIVER_SOURCES =						\
		storage/storage_driver.h storage/storage_driver.c	\
764
		storage/storage_backend.h storage/storage_backend.c
765 766

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

769
STORAGE_DRIVER_LVM_SOURCES =					\
O
Osier Yang 已提交
770
		storage/storage_backend_logical.h		\
771
		storage/storage_backend_logical.c
772 773

STORAGE_DRIVER_ISCSI_SOURCES =					\
774
		storage/storage_backend_iscsi.h storage/storage_backend_iscsi.c
775

776
STORAGE_DRIVER_SCSI_SOURCES =					\
777
		storage/storage_backend_scsi.h storage/storage_backend_scsi.c
778

D
Dave Allan 已提交
779
STORAGE_DRIVER_MPATH_SOURCES =					\
780
		storage/storage_backend_mpath.h storage/storage_backend_mpath.c
D
Dave Allan 已提交
781

782
STORAGE_DRIVER_DISK_SOURCES =					\
783
		storage/storage_backend_disk.h storage/storage_backend_disk.c
784

785 786 787
STORAGE_DRIVER_RBD_SOURCES =					\
		storage/storage_backend_rbd.h storage/storage_backend_rbd.c

788 789 790
STORAGE_DRIVER_SHEEPDOG_SOURCES =				\
		storage/storage_backend_sheepdog.h storage/storage_backend_sheepdog.c

791
STORAGE_HELPER_DISK_SOURCES =					\
792
		storage/parthelper.c
793

794 795 796
UTIL_IO_HELPER_SOURCES =					\
		util/iohelper.c

797
# Network filters
O
Osier Yang 已提交
798
NWFILTER_DRIVER_SOURCES =						\
799
		nwfilter/nwfilter_driver.h nwfilter/nwfilter_driver.c	\
800 801
		nwfilter/nwfilter_gentech_driver.c			\
		nwfilter/nwfilter_gentech_driver.h			\
S
Stefan Berger 已提交
802 803
		nwfilter/nwfilter_dhcpsnoop.c				\
		nwfilter/nwfilter_dhcpsnoop.h				\
804
		nwfilter/nwfilter_ebiptables_driver.c			\
805 806 807
		nwfilter/nwfilter_ebiptables_driver.h			\
		nwfilter/nwfilter_learnipaddr.c				\
		nwfilter/nwfilter_learnipaddr.h
808

809

810
# Security framework and drivers for various models
O
Osier Yang 已提交
811 812 813 814 815
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		\
816
		security/security_manager.h security/security_manager.c
817

818
SECURITY_DRIVER_SELINUX_SOURCES =				\
819
		security/security_selinux.h security/security_selinux.c
820

J
Jamie Strandboge 已提交
821 822 823
SECURITY_DRIVER_APPARMOR_SOURCES =				\
		security/security_apparmor.h security/security_apparmor.c

824
ACCESS_DRIVER_GENERATED = \
825 826 827 828 829 830
		$(srcdir)/access/viraccessapicheck.h \
		$(srcdir)/access/viraccessapicheck.c \
		$(srcdir)/access/viraccessapicheckqemu.h \
		$(srcdir)/access/viraccessapicheckqemu.c \
		$(srcdir)/access/viraccessapichecklxc.h \
		$(srcdir)/access/viraccessapichecklxc.c
831

832
ACCESS_DRIVER_SYM_FILES = \
833 834 835
		libvirt_access.syms \
		libvirt_access_qemu.syms \
		libvirt_access_lxc.syms
836

837 838 839 840 841
ACCESS_DRIVER_API_FILES = \
		libvirt_access.xml \
		libvirt_access_qemu.xml \
		libvirt_access_lxc.xml

842 843 844 845 846 847 848
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

849 850 851 852
ACCESS_DRIVER_POLKIT_SOURCES = \
		access/viraccessdriverpolkit.h access/viraccessdriverpolkit.c

ACCESS_DRIVER_POLKIT_POLICY = \
853
		$(srcdir)/access/org.libvirt.api.policy
854 855


856
NODE_DEVICE_DRIVER_SOURCES =					\
O
Osier Yang 已提交
857 858
		node_device/node_device_driver.c		\
		node_device/node_device_driver.h		\
859
		node_device/node_device_linux_sysfs.c
860 861

NODE_DEVICE_DRIVER_HAL_SOURCES =				\
862
		node_device/node_device_hal.c			\
863
		node_device/node_device_hal.h
864

865
NODE_DEVICE_DRIVER_UDEV_SOURCES =				\
D
Daniel Veillard 已提交
866 867
		node_device/node_device_udev.c			\
		node_device/node_device_udev.h
868

J
Jiri Denemark 已提交
869 870 871 872
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 已提交
873
		cpu/cpu_s390.h cpu/cpu_s390.c			\
C
Chuck Short 已提交
874
		cpu/cpu_arm.h cpu/cpu_arm.c			\
P
Prerna Saxena 已提交
875
		cpu/cpu_map.h cpu/cpu_map.c cpu/cpu_powerpc.h	\
876
		cpu/cpu_powerpc.c cpu/cpu_ppc_data.h
877

878 879 880
VMX_SOURCES =							\
		vmx/vmx.c vmx/vmx.h

881 882
XENXS_SOURCES =							\
		xenxs/xenxs_private.h				\
883 884
		xenxs/xen_sxpr.c xenxs/xen_sxpr.h		\
		xenxs/xen_xm.c xenxs/xen_xm.h
885

J
Jiri Denemark 已提交
886 887
pkgdata_DATA =	cpu/cpu_map.xml

E
Eric Blake 已提交
888
EXTRA_DIST +=	$(pkgdata_DATA)
889

890 891 892 893 894 895
#########################
#
# Build up list of libvirt.la source files based on configure conditions
#
# First deal with sources usable in non-daemon context

896
noinst_LTLIBRARIES = libvirt_util.la
897 898
libvirt_la_LIBADD = $(libvirt_la_BUILT_LIBADD)
libvirt_la_BUILT_LIBADD = libvirt_util.la
899 900
libvirt_util_la_SOURCES =					\
		$(UTIL_SOURCES)
901
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
902
		$(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
903 904
		$(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS)	\
		-I$(top_srcdir)/src/conf
905
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
906
		$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
907
		$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(MSCOM_LIBS) $(LIBXML_LIBS) \
908
		$(SECDRIVER_LIBS) $(NUMACTL_LIBS)
909

910 911

noinst_LTLIBRARIES += libvirt_conf.la
912
libvirt_la_BUILT_LIBADD += libvirt_conf.la
913
libvirt_conf_la_SOURCES = $(CONF_SOURCES)
914 915
libvirt_conf_la_CFLAGS = $(AM_CFLAGS)
libvirt_conf_la_LDFLAGS = $(AM_LDFLAGS)
916

J
Jiri Denemark 已提交
917
noinst_LTLIBRARIES += libvirt_cpu.la
918
libvirt_la_BUILT_LIBADD += libvirt_cpu.la
J
Jiri Denemark 已提交
919
libvirt_cpu_la_CFLAGS = \
920
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
J
Jiri Denemark 已提交
921 922
libvirt_cpu_la_SOURCES = $(CPU_SOURCES)

923 924 925 926
if WITH_VMX
noinst_LTLIBRARIES += libvirt_vmx.la
libvirt_la_BUILT_LIBADD += libvirt_vmx.la
libvirt_vmx_la_CFLAGS = \
927
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
928 929 930
libvirt_vmx_la_SOURCES = $(VMX_SOURCES)
endif

931
if WITH_XENXS
932 933 934
noinst_LTLIBRARIES += libvirt_xenxs.la
libvirt_la_BUILT_LIBADD += libvirt_xenxs.la
libvirt_xenxs_la_CFLAGS = \
935
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
936 937 938
libvirt_xenxs_la_SOURCES = $(XENXS_SOURCES)
endif

939

940
noinst_LTLIBRARIES += libvirt_driver.la
941
libvirt_la_BUILT_LIBADD += libvirt_driver.la
942
libvirt_driver_la_SOURCES = $(DRIVER_SOURCES)
943

944
libvirt_driver_la_CFLAGS = \
945
		$(GNUTLS_CFLAGS) $(CURL_CFLAGS) \
946
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
947
libvirt_driver_la_LIBADD = \
948
		$(GNUTLS_LIBS) $(CURL_LIBS) $(DLOPEN_LIBS)
949

950 951
# 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.
952
SYM_FILES = $(USED_SYM_FILES)
953
USED_SYM_FILES = $(srcdir)/libvirt_private.syms
954 955 956 957
GENERATED_SYM_FILES = \
	$(ACCESS_DRIVER_SYM_FILES) \
	libvirt.syms libvirt.def libvirt_qemu.def libvirt_lxc.def \
	$(NULL)
958

959
if WITH_TEST
960
noinst_LTLIBRARIES += libvirt_driver_test.la
961
libvirt_la_BUILT_LIBADD += libvirt_driver_test.la
962
libvirt_driver_test_la_CFLAGS = \
963
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
964
libvirt_driver_test_la_SOURCES = $(TEST_DRIVER_SOURCES)
965 966 967
endif

if WITH_REMOTE
968
noinst_LTLIBRARIES += libvirt_driver_remote.la
969
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
970 971
libvirt_driver_remote_la_CFLAGS =				\
		$(GNUTLS_CFLAGS)				\
E
Eric Blake 已提交
972
		$(XDR_CFLAGS)					\
973 974
		-I$(top_srcdir)/src/conf			\
		-I$(top_srcdir)/src/rpc				\
975 976
		$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
977 978 979 980
libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) \
                libvirt-net-rpc-client.la \
                libvirt-net-rpc-server.la \
                libvirt-net-rpc.la
981
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
982

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

985 986
endif WITH_REMOTE

987
%protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
988
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
E
Eric Blake 已提交
989
	       $< $@
990

991
%protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
992
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
E
Eric Blake 已提交
993
	       $< $@
994

995
if WITH_XEN
E
Eric Blake 已提交
996 997 998
noinst_LTLIBRARIES += libvirt_driver_xen_impl.la
libvirt_driver_xen_la_SOURCES =
libvirt_driver_xen_la_LIBADD = libvirt_driver_xen_impl.la
999 1000
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_xen.la
E
Eric Blake 已提交
1001 1002
libvirt_driver_xen_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_xen_la_LDFLAGS = -module -avoid-version
1003
else
1004
noinst_LTLIBRARIES += libvirt_driver_xen.la
1005 1006
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_xen.la
1007
endif
E
Eric Blake 已提交
1008 1009

libvirt_driver_xen_impl_la_CFLAGS =					\
1010
		$(XEN_CFLAGS)					\
1011
		-I$(top_srcdir)/src/access			\
1012 1013
		-I$(top_srcdir)/src/conf			\
		-I$(top_srcdir)/src/xenxs			\
1014
		$(AM_CFLAGS)
E
Eric Blake 已提交
1015 1016 1017
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)
1018 1019
endif

1020 1021
if WITH_PHYP
noinst_LTLIBRARIES += libvirt_driver_phyp.la
1022
libvirt_la_BUILT_LIBADD += libvirt_driver_phyp.la
1023 1024
libvirt_driver_phyp_la_LIBADD = $(SSH2_LIBS)
libvirt_driver_phyp_la_CFLAGS = $(SSH2_CFLAGS) \
1025
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
1026 1027 1028
libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES)
endif

1029
if WITH_OPENVZ
1030
noinst_LTLIBRARIES += libvirt_driver_openvz.la
1031
libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la
1032
libvirt_driver_openvz_la_CFLAGS = \
1033
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
1034
libvirt_driver_openvz_la_SOURCES = $(OPENVZ_DRIVER_SOURCES)
1035 1036
endif

1037 1038 1039 1040
if WITH_VMWARE
noinst_LTLIBRARIES += libvirt_driver_vmware.la
libvirt_la_BUILT_LIBADD += libvirt_driver_vmware.la
libvirt_driver_vmware_la_CFLAGS = \
1041
		-I$(top_srcdir)/src/conf -I$(top_srcdir)/src/vmx $(AM_CFLAGS)
1042 1043 1044
libvirt_driver_vmware_la_SOURCES = $(VMWARE_DRIVER_SOURCES)
endif

1045
if WITH_VBOX
1046 1047 1048 1049 1050 1051 1052 1053
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
1054
noinst_LTLIBRARIES += libvirt_driver_vbox.la
1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065
# 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)
1066 1067
endif

1068 1069
if WITH_XENAPI
noinst_LTLIBRARIES += libvirt_driver_xenapi.la
1070
libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la
1071
libvirt_driver_xenapi_la_CFLAGS = $(LIBXENSERVER_CFLAGS) $(CURL_CFLAGS) \
1072
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
1073
libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS)
1074
libvirt_driver_xenapi_la_LIBADD = $(LIBXENSERVER_LIBS) $(CURL_LIBS)
1075 1076 1077
libvirt_driver_xenapi_la_SOURCES = $(XENAPI_DRIVER_SOURCES)
endif

J
Jim Fehlig 已提交
1078
if WITH_LIBXL
E
Eric Blake 已提交
1079 1080 1081
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 已提交
1082 1083
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_libxl.la
E
Eric Blake 已提交
1084 1085
libvirt_driver_libxl_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_libxl_la_LDFLAGS = -module -avoid-version
J
Jim Fehlig 已提交
1086 1087 1088 1089 1090
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 已提交
1091

1092 1093 1094 1095 1096
libvirt_driver_libxl_impl_la_CFLAGS = 		\
		$(LIBXL_CFLAGS)			\
		-I$(top_srcdir)/src/access	\
		-I$(top_srcdir)/src/conf	\
		-I$(top_srcdir)/src/xenxs	\
1097
		$(AM_CFLAGS)
E
Eric Blake 已提交
1098 1099 1100
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 已提交
1101 1102
endif

1103
if WITH_QEMU
E
Eric Blake 已提交
1104 1105 1106
noinst_LTLIBRARIES += libvirt_driver_qemu_impl.la
libvirt_driver_qemu_la_SOURCES =
libvirt_driver_qemu_la_LIBADD = libvirt_driver_qemu_impl.la
1107 1108
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_qemu.la
E
Eric Blake 已提交
1109 1110
libvirt_driver_qemu_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_qemu_la_LDFLAGS = -module -avoid-version
1111
else
1112
noinst_LTLIBRARIES += libvirt_driver_qemu.la
1113
# Stateful, so linked to daemon instead
1114
#libvirt_la_BUILT_LIBADD += libvirt_driver_qemu.la
1115
endif
E
Eric Blake 已提交
1116

1117 1118 1119 1120 1121 1122
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 已提交
1123
libvirt_driver_qemu_impl_la_LDFLAGS = $(AM_LDFLAGS)
1124
libvirt_driver_qemu_impl_la_LIBADD = $(CAPNG_LIBS) \
1125
                                $(GNUTLS_LIBS) \
1126 1127 1128
				$(LIBNL_LIBS) \
				$(LIBXML_LIBS) \
				$(NULL)
E
Eric Blake 已提交
1129
libvirt_driver_qemu_impl_la_SOURCES = $(QEMU_DRIVER_SOURCES)
1130

A
Amy Griffis 已提交
1131
conf_DATA += qemu/qemu.conf
1132

1133
augeas_DATA += qemu/libvirtd_qemu.aug
1134 1135
augeastest_DATA += test_libvirtd_qemu.aug
CLEANFILES += test_libvirtd_qemu.aug
1136

1137
endif
1138
EXTRA_DIST += qemu/qemu.conf qemu/libvirtd_qemu.aug \
1139
		qemu/test_libvirtd_qemu.aug.in qemu/THREADS.txt
1140

1141 1142

if WITH_LXC
E
Eric Blake 已提交
1143 1144 1145
noinst_LTLIBRARIES += libvirt_driver_lxc_impl.la
libvirt_driver_lxc_la_SOURCES =
libvirt_driver_lxc_la_LIBADD = libvirt_driver_lxc_impl.la
1146 1147
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_lxc.la
E
Eric Blake 已提交
1148 1149
libvirt_driver_lxc_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_lxc_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1150
else
1151
noinst_LTLIBRARIES += libvirt_driver_lxc.la
1152
# Stateful, so linked to daemon instead
1153
#libvirt_la_BUILT_LIBADD += libvirt_driver_lxc.la
1154
endif
E
Eric Blake 已提交
1155 1156

libvirt_driver_lxc_impl_la_CFLAGS = \
S
Serge Hallyn 已提交
1157
		$(LIBNL_CFLAGS) \
G
Gao feng 已提交
1158
		$(FUSE_CFLAGS) \
1159 1160 1161
		-I$(top_srcdir)/src/access \
		-I$(top_srcdir)/src/conf \
		$(AM_CFLAGS)
G
Gao feng 已提交
1162
libvirt_driver_lxc_impl_la_LIBADD = $(CAPNG_LIBS) $(LIBNL_LIBS) $(FUSE_LIBS)
1163
if WITH_BLKID
E
Eric Blake 已提交
1164 1165
libvirt_driver_lxc_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_lxc_impl_la_LIBADD += $(BLKID_LIBS)
1166
endif
1167
libvirt_driver_lxc_impl_la_LIBADD += $(SECDRIVER_LIBS)
E
Eric Blake 已提交
1168
libvirt_driver_lxc_impl_la_SOURCES = $(LXC_DRIVER_SOURCES)
A
Amy Griffis 已提交
1169 1170 1171

conf_DATA += lxc/lxc.conf

1172
augeas_DATA += lxc/libvirtd_lxc.aug
1173 1174
augeastest_DATA += test_libvirtd_lxc.aug
CLEANFILES += test_libvirtd_lxc.aug
1175

1176
endif
1177
EXTRA_DIST += lxc/lxc.conf lxc/libvirtd_lxc.aug lxc/test_libvirtd_lxc.aug.in
1178

1179
if WITH_UML
E
Eric Blake 已提交
1180 1181 1182
noinst_LTLIBRARIES += libvirt_driver_uml_impl.la
libvirt_driver_uml_la_SOURCES =
libvirt_driver_uml_la_LIBADD = libvirt_driver_uml_impl.la
1183 1184
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_uml.la
E
Eric Blake 已提交
1185 1186
libvirt_driver_uml_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_uml_la_LDFLAGS = -module -avoid-version
1187
else
1188 1189
noinst_LTLIBRARIES += libvirt_driver_uml.la
# Stateful, so linked to daemon instead
1190
#libvirt_la_BUILT_LIBADD += libvirt_driver_uml.la
1191
endif
E
Eric Blake 已提交
1192

1193
libvirt_driver_uml_impl_la_CFLAGS = \
1194 1195 1196
		-I$(top_srcdir)/src/access \
		-I$(top_srcdir)/src/conf \
		$(AM_CFLAGS)
E
Eric Blake 已提交
1197
libvirt_driver_uml_impl_la_LDFLAGS = $(AM_LDFLAGS)
1198
# libvirt_driver_uml_impl_la_LIBADD =
E
Eric Blake 已提交
1199
libvirt_driver_uml_impl_la_SOURCES = $(UML_DRIVER_SOURCES)
1200
endif
1201

D
Daniel Veillard 已提交
1202

1203
BUILT_SOURCES += $(ESX_DRIVER_GENERATED)
D
Daniel Veillard 已提交
1204

1205 1206
ESX_GENERATED_STAMP = .esx_vi_generator.stamp

E
Eric Blake 已提交
1207 1208
EXTRA_DIST += $(ESX_GENERATED_STAMP)

1209 1210 1211
$(ESX_DRIVER_GENERATED): $(ESX_GENERATED_STAMP)

$(ESX_GENERATED_STAMP): $(srcdir)/esx/esx_vi_generator.input \
1212
                         $(srcdir)/esx/esx_vi_generator.py
1213 1214 1215 1216 1217
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/esx/esx_vi_generator.py \
	  && touch $@

MAINTAINERCLEANFILES += $(ESX_DRIVER_GENERATED) $(ESX_GENERATED_STAMP)

D
Daniel Veillard 已提交
1218

1219 1220
if WITH_ESX
noinst_LTLIBRARIES += libvirt_driver_esx.la
1221
libvirt_la_BUILT_LIBADD += libvirt_driver_esx.la
1222
libvirt_driver_esx_la_CFLAGS = $(CURL_CFLAGS) \
1223
		-I$(top_srcdir)/src/conf -I$(top_srcdir)/src/vmx $(AM_CFLAGS)
1224
libvirt_driver_esx_la_LDFLAGS = $(AM_LDFLAGS)
1225
libvirt_driver_esx_la_LIBADD = $(CURL_LIBS)
1226
libvirt_driver_esx_la_SOURCES = $(ESX_DRIVER_SOURCES)
1227
libvirt_driver_esx_la_DEPENDENCIES = $(ESX_DRIVER_GENERATED)
1228 1229
endif

M
Matthias Bolte 已提交
1230

1231 1232
BUILT_SOURCES += $(HYPERV_DRIVER_GENERATED)

1233 1234
HYPERV_GENERATED_STAMP = .hyperv_wmi_generator.stamp

E
Eric Blake 已提交
1235 1236
EXTRA_DIST += $(HYPERV_GENERATED_STAMP)

1237 1238 1239
$(HYPERV_DRIVER_GENERATED): $(HYPERV_GENERATED_STAMP)

$(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \
1240
                            $(srcdir)/hyperv/hyperv_wmi_generator.py
1241 1242
	$(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) \
	  $(srcdir)/hyperv/hyperv_wmi_generator.py \
1243 1244 1245
	  && touch $@

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

M
Matthias Bolte 已提交
1247 1248 1249 1250
if WITH_HYPERV
noinst_LTLIBRARIES += libvirt_driver_hyperv.la
libvirt_la_BUILT_LIBADD += libvirt_driver_hyperv.la
libvirt_driver_hyperv_la_CFLAGS = $(OPENWSMAN_CFLAGS) \
1251
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
M
Matthias Bolte 已提交
1252 1253 1254 1255 1256
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 已提交
1257 1258 1259 1260 1261 1262 1263 1264
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

1265
if WITH_NETWORK
E
Eric Blake 已提交
1266 1267 1268
noinst_LTLIBRARIES += libvirt_driver_network_impl.la
libvirt_driver_network_la_SOURCES =
libvirt_driver_network_la_LIBADD = libvirt_driver_network_impl.la
1269 1270
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_network.la
1271 1272 1273 1274
libvirt_driver_network_la_LIBADD += ../gnulib/lib/libgnu.la \
	$(LIBNL_LIBS) \
	$(DBUS_LIBS) \
	$(NULL)
E
Eric Blake 已提交
1275
libvirt_driver_network_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1276
else
1277
noinst_LTLIBRARIES += libvirt_driver_network.la
1278
# Stateful, so linked to daemon instead
1279
#libvirt_la_BUILT_LIBADD += libvirt_driver_network.la
1280
endif
E
Eric Blake 已提交
1281 1282

libvirt_driver_network_impl_la_CFLAGS = \
1283 1284 1285 1286 1287
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
		-I$(top_srcdir)/src/access \
		-I$(top_srcdir)/src/conf \
		$(AM_CFLAGS)
E
Eric Blake 已提交
1288
libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
1289
libvirt_driver_network_impl_la_LIBADD  = $(DBUS_LIBS)
1290
endif
1291 1292 1293
EXTRA_DIST += network/default.xml


1294
if WITH_INTERFACE
1295 1296 1297 1298
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_interface.la
else
noinst_LTLIBRARIES += libvirt_driver_interface.la
1299 1300
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_interface.la
1301
endif
1302 1303 1304 1305
libvirt_driver_interface_la_CFLAGS = \
		-I$(top_srcdir)/src/access \
		-I$(top_srcdir)/src/conf \
		$(AM_CFLAGS)
1306
libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS)
1307 1308 1309 1310
libvirt_driver_interface_la_LIBADD =
if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
1311
else
1312
if WITH_UDEV
1313 1314 1315
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
endif
1316
endif
1317
if WITH_DRIVER_MODULES
1318
libvirt_driver_interface_la_LIBADD += ../gnulib/lib/libgnu.la
1319 1320 1321
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
endif
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
D
Daniel Veillard 已提交
1322 1323
endif

D
Daniel P. Berrange 已提交
1324
if WITH_SECRETS
1325 1326 1327 1328
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_secret.la
else
noinst_LTLIBRARIES += libvirt_driver_secret.la
1329
# Stateful, so linked to daemon instead
1330
#libvirt_la_BUILT_LIBADD += libvirt_driver_secret.la
1331
endif
1332
libvirt_driver_secret_la_CFLAGS = \
1333 1334 1335
		-I$(top_srcdir)/src/access \
		-I$(top_srcdir)/src/conf \
		$(AM_CFLAGS)
1336
if WITH_DRIVER_MODULES
1337
libvirt_driver_secret_la_LIBADD = ../gnulib/lib/libgnu.la
1338
libvirt_driver_secret_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
1339 1340
endif
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
D
Daniel P. Berrange 已提交
1341
endif
1342

1343
# Needed to keep automake quiet about conditionals
1344 1345
libvirt_driver_storage_impl_la_SOURCES =
libvirt_driver_storage_impl_la_CFLAGS = \
1346 1347 1348
		-I$(top_srcdir)/src/access \
		-I$(top_srcdir)/src/conf \
		$(AM_CFLAGS)
1349 1350
libvirt_driver_storage_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_storage_impl_la_LIBADD =
1351
libvirt_driver_storage_impl_la_LIBADD += $(SECDRIVER_LIBS)
1352
if WITH_BLKID
1353 1354
libvirt_driver_storage_impl_la_CFLAGS += $(BLKID_CFLAGS)
libvirt_driver_storage_impl_la_LIBADD += $(BLKID_LIBS)
O
Osier Yang 已提交
1355
endif
1356
if WITH_STORAGE
1357 1358 1359
noinst_LTLIBRARIES += libvirt_driver_storage_impl.la
libvirt_driver_storage_la_SOURCES =
libvirt_driver_storage_la_LIBADD = libvirt_driver_storage_impl.la
1360 1361
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_storage.la
1362
libvirt_driver_storage_la_LIBADD += ../gnulib/lib/libgnu.la
1363
libvirt_driver_storage_la_LDFLAGS = -module -avoid-version
1364
else
1365
noinst_LTLIBRARIES += libvirt_driver_storage.la
1366
# Stateful, so linked to daemon instead
1367
#libvirt_la_BUILT_LIBADD += libvirt_driver_storage.la
1368
endif
1369 1370
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_FS_SOURCES)
1371 1372
endif

1373
if WITH_STORAGE_LVM
1374
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_LVM_SOURCES)
1375 1376
endif

1377
if WITH_STORAGE_ISCSI
1378
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_ISCSI_SOURCES)
1379 1380
endif

1381
if WITH_STORAGE_SCSI
1382
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SCSI_SOURCES)
1383 1384
endif

D
Dave Allan 已提交
1385
if WITH_STORAGE_MPATH
1386 1387 1388
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 已提交
1389 1390
endif

1391
if WITH_STORAGE_DISK
1392
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_DISK_SOURCES)
1393
endif
1394

1395
if WITH_STORAGE_RBD
1396 1397
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_RBD_SOURCES)
libvirt_driver_storage_impl_la_LIBADD += $(LIBRBD_LIBS)
1398 1399
endif

1400
if WITH_STORAGE_SHEEPDOG
1401
libvirt_driver_storage_impl_la_SOURCES += $(STORAGE_DRIVER_SHEEPDOG_SOURCES)
1402 1403
endif

1404 1405 1406 1407 1408 1409 1410
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
1411
#libvirt_la_BUILT_LIBADD += libvirt_driver_nodedev.la
1412 1413 1414
endif
libvirt_driver_nodedev_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES)

1415
libvirt_driver_nodedev_la_CFLAGS = \
1416 1417 1418
		-I$(top_srcdir)/src/access \
		-I$(top_srcdir)/src/conf \
		$(AM_CFLAGS)
1419
libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS)
1420
libvirt_driver_nodedev_la_LIBADD =
1421

D
Doug Goldstein 已提交
1422
if WITH_LIBVIRTD
1423
if WITH_HAL
1424 1425
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS)
1426
libvirt_driver_nodedev_la_LIBADD += $(HAL_LIBS)
1427
endif
1428
if WITH_UDEV
1429
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES)
1430
libvirt_driver_nodedev_la_CFLAGS += $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS)
1431
libvirt_driver_nodedev_la_LIBADD += $(UDEV_LIBS) $(PCIACCESS_LIBS)
1432
endif
D
Doug Goldstein 已提交
1433
endif
1434 1435

if WITH_DRIVER_MODULES
1436
libvirt_driver_nodedev_la_LIBADD += ../gnulib/lib/libgnu.la
1437 1438 1439 1440 1441
libvirt_driver_nodedev_la_LDFLAGS += -module -avoid-version
endif
endif


1442 1443 1444 1445 1446
if WITH_NWFILTER
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_nwfilter.la
else
noinst_LTLIBRARIES += libvirt_driver_nwfilter.la
1447 1448
# Stateful, so linked to daemon instead
#libvirt_la_BUILT_LIBADD += libvirt_driver_nwfilter.la
1449
endif
1450 1451 1452 1453 1454 1455 1456
libvirt_driver_nwfilter_la_CFLAGS = \
		$(LIBPCAP_CFLAGS) \
		$(LIBNL_CFLAGS) \
		$(DBUS_CFLAGS) \
		-I$(top_srcdir)/src/access \
		-I$(top_srcdir)/src/conf \
		$(AM_CFLAGS)
1457
libvirt_driver_nwfilter_la_LDFLAGS = $(LD_AMFLAGS)
1458
libvirt_driver_nwfilter_la_LIBADD = $(LIBPCAP_LIBS) $(LIBNL_LIBS) $(DBUS_LIBS)
1459
if WITH_DRIVER_MODULES
1460
libvirt_driver_nwfilter_la_LIBADD += ../gnulib/lib/libgnu.la
1461
libvirt_driver_nwfilter_la_LDFLAGS += -module -avoid-version
1462 1463 1464 1465 1466
endif
libvirt_driver_nwfilter_la_SOURCES = $(NWFILTER_DRIVER_SOURCES)
endif


1467 1468 1469 1470
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 = \
1471
		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
1472
libvirt_security_manager_la_LDFLAGS = $(AM_LDFLAGS)
1473
libvirt_security_manager_la_LIBADD = $(SECDRIVER_LIBS)
1474
if WITH_SECDRIVER_SELINUX
1475 1476
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
libvirt_security_manager_la_CFLAGS += $(SELINUX_CFLAGS)
1477
endif
J
Jamie Strandboge 已提交
1478
if WITH_SECDRIVER_APPARMOR
1479 1480
libvirt_security_manager_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES)
libvirt_security_manager_la_CFLAGS += $(APPARMOR_CFLAGS)
J
Jamie Strandboge 已提交
1481
endif
1482

1483 1484
libvirt_driver_access_la_SOURCES = \
	$(ACCESS_DRIVER_SOURCES) $(ACCESS_DRIVER_GENERATED)
1485 1486 1487 1488 1489 1490 1491
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 =

1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509
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

1510

1511 1512
BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_API_FILES)
1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526

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

1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539
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) > $@

1540
$(srcdir)/access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
1541 1542 1543
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
	  remote REMOTE $(REMOTE_PROTOCOL) > $@
1544
$(srcdir)/access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
1545 1546 1547 1548
			$(REMOTE_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
	  remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h > $@

1549
$(srcdir)/access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
1550 1551 1552
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
	  qemu QEMU $(QEMU_PROTOCOL) > $@
1553
$(srcdir)/access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
1554 1555 1556 1557
			$(QEMU_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
	  qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h > $@

1558
$(srcdir)/access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
1559 1560 1561
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
	  lxc LXC $(LXC_PROTOCOL) > $@
1562
$(srcdir)/access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
1563 1564 1565 1566
			$(LXC_PROTOCOL) Makefile.am
	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
	  lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h > $@

1567 1568 1569 1570 1571 1572 1573
# Add all conditional sources just in case...
EXTRA_DIST +=							\
		$(TEST_DRIVER_SOURCES)				\
		$(REMOTE_DRIVER_SOURCES)			\
		$(XEN_DRIVER_SOURCES)				\
		$(QEMU_DRIVER_SOURCES)				\
		$(LXC_DRIVER_SOURCES)				\
1574
		$(UML_DRIVER_SOURCES)				\
1575
		$(OPENVZ_DRIVER_SOURCES)			\
1576
		$(PHYP_DRIVER_SOURCES)				\
1577
		$(VBOX_DRIVER_SOURCES)				\
1578
		$(XENAPI_DRIVER_SOURCES)			\
O
Osier Yang 已提交
1579
		$(LIBXL_DRIVER_SOURCES)				\
1580
		$(ESX_DRIVER_SOURCES)				\
1581
		$(ESX_DRIVER_EXTRA_DIST)			\
M
Matthias Bolte 已提交
1582
		$(HYPERV_DRIVER_SOURCES)			\
1583
		$(HYPERV_DRIVER_EXTRA_DIST)			\
O
Osier Yang 已提交
1584
		$(PARALLELS_DRIVER_SOURCES)			\
1585
		$(NETWORK_DRIVER_SOURCES)			\
1586
		$(INTERFACE_DRIVER_SOURCES)			\
1587 1588 1589 1590
		$(STORAGE_DRIVER_SOURCES)			\
		$(STORAGE_DRIVER_FS_SOURCES)			\
		$(STORAGE_DRIVER_LVM_SOURCES)			\
		$(STORAGE_DRIVER_ISCSI_SOURCES)			\
1591
		$(STORAGE_DRIVER_SCSI_SOURCES)			\
D
Dave Allan 已提交
1592
		$(STORAGE_DRIVER_MPATH_SOURCES)			\
1593
		$(STORAGE_DRIVER_DISK_SOURCES)			\
1594
		$(STORAGE_DRIVER_RBD_SOURCES)			\
1595
		$(STORAGE_DRIVER_SHEEPDOG_SOURCES)		\
1596 1597
		$(NODE_DEVICE_DRIVER_SOURCES)			\
		$(NODE_DEVICE_DRIVER_HAL_SOURCES)		\
1598
		$(NODE_DEVICE_DRIVER_UDEV_SOURCES)		\
1599
		$(NWFILTER_DRIVER_SOURCES)			\
1600
		$(SECURITY_DRIVER_SELINUX_SOURCES)		\
J
Jamie Strandboge 已提交
1601
		$(SECURITY_DRIVER_APPARMOR_SOURCES)		\
D
Daniel P. Berrange 已提交
1602
		$(SECRET_DRIVER_SOURCES)			\
1603
		$(VBOX_DRIVER_EXTRA_DIST)			\
1604
		$(VMWARE_DRIVER_SOURCES)			\
1605 1606
		$(XENXS_SOURCES)				\
		$(ACCESS_DRIVER_POLKIT_POLICY)
1607

1608 1609
check-local: check-augeas

1610 1611 1612 1613 1614 1615
.PHONY: check-augeas \
	check-augeas-qemu \
	check-augeas-lxc \
	check-augeas-sanlock \
	check-augeas-lockd \
	$(NULL)
1616

1617
check-augeas: check-augeas-qemu check-augeas-lxc check-augeas-sanlock \
1618
	check-augeas-lockd check-augeas-virtlockd
1619

1620
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
1621
EXTRA_DIST += $(top_srcdir)/build-aux/augeas-gentest.pl
1622

1623
if WITH_QEMU
1624 1625
test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
		$(srcdir)/qemu/qemu.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1626
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
1627

1628
check-augeas-qemu: test_libvirtd_qemu.aug
1629
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1630
	    '$(AUGPARSE)' -I $(srcdir)/qemu test_libvirtd_qemu.aug; \
1631
	fi
1632 1633
else
check-augeas-qemu:
1634
endif
1635

1636
if WITH_LXC
1637 1638
test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
		$(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1639
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
1640

1641
check-augeas-lxc: test_libvirtd_lxc.aug
1642
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1643
	    '$(AUGPARSE)' -I $(srcdir)/lxc test_libvirtd_lxc.aug; \
1644
	fi
1645 1646
else
check-augeas-lxc:
1647
endif
1648

1649
if WITH_SANLOCK
1650 1651
test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
		locking/qemu-sanlock.conf $(AUG_GENTEST)
E
Eric Blake 已提交
1652
	$(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
1653

1654
check-augeas-sanlock: test_libvirt_sanlock.aug
1655
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
1656
	    '$(AUGPARSE)' -I $(srcdir)/locking test_libvirt_sanlock.aug; \
1657
	fi
1658 1659 1660
else
check-augeas-sanlock:
endif
1661

1662 1663 1664 1665
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 $< $@

1666 1667
test_virtlockd.aug: locking/test_virtlockd.aug.in \
		locking/virtlockd.conf $(AUG_GENTEST)
1668
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
1669

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

1675 1676 1677 1678 1679
check-augeas-virtlockd: test_virtlockd.aug
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	    '$(AUGPARSE)' -I $(srcdir)/locking test_virtlockd.aug; \
	fi

1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698
#
# 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.
#

1699
if WITH_DRIVER_MODULES
1700
USED_SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
1701 1702
else
SYM_FILES += $(srcdir)/libvirt_driver_modules.syms
1703
endif
1704

1705
if WITH_LINUX
1706
USED_SYM_FILES += $(srcdir)/libvirt_linux.syms
1707 1708
else
SYM_FILES += $(srcdir)/libvirt_linux.syms
1709
endif
1710

1711
if WITH_ESX
1712
USED_SYM_FILES += $(srcdir)/libvirt_esx.syms
1713 1714
else
SYM_FILES += $(srcdir)/libvirt_esx.syms
1715 1716
endif

1717
if WITH_LIBVIRTD
1718
USED_SYM_FILES += $(srcdir)/libvirt_daemon.syms
1719 1720
else
SYM_FILES += $(srcdir)/libvirt_daemon.syms
1721 1722
endif

1723
if WITH_OPENVZ
1724
USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms
1725 1726
else
SYM_FILES += $(srcdir)/libvirt_openvz.syms
1727 1728
endif

1729
if WITH_VMX
1730
USED_SYM_FILES += $(srcdir)/libvirt_vmx.syms
1731 1732
else
SYM_FILES += $(srcdir)/libvirt_vmx.syms
1733 1734
endif

1735
if WITH_XENXS
1736
USED_SYM_FILES += $(srcdir)/libvirt_xenxs.syms
1737 1738
else
SYM_FILES += $(srcdir)/libvirt_xenxs.syms
1739 1740
endif

1741
if WITH_SASL
1742
USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
1743 1744
else
SYM_FILES += $(srcdir)/libvirt_sasl.syms
E
Eric Blake 已提交
1745 1746
endif

1747 1748 1749 1750 1751 1752
if WITH_GNUTLS
USED_SYM_FILES += $(srcdir)/libvirt_gnutls.syms
else
SYM_FILES += $(srcdir)/libvirt_gnutls.syms
endif

1753
if WITH_SSH2
1754
USED_SYM_FILES += $(srcdir)/libvirt_libssh2.syms
1755 1756
else
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
1757 1758
endif

1759
if WITH_ATOMIC_OPS_PTHREAD
1760
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
1761 1762
else
SYM_FILES += $(srcdir)/libvirt_atomic.syms
1763 1764
endif

1765
EXTRA_DIST += \
1766 1767 1768 1769 1770
	libvirt_public.syms		\
	libvirt_lxc.syms		\
	libvirt_qemu.syms		\
	$(SYM_FILES)			\
	$(NULL)
1771

1772
BUILT_SOURCES += $(GENERATED_SYM_FILES)
1773

1774 1775
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \
		$(ACCESS_DRIVER_SYM_FILES) \
1776
		$(top_builddir)/config.status
1777 1778 1779 1780 1781 1782
	$(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 && \
1783
	cat $(USED_SYM_FILES) $(ACCESS_DRIVER_SYM_FILES) >>$@-tmp && \
1784 1785
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
	chmod a-w $@-tmp && \
1786
	mv $@-tmp libvirt.syms
1787

1788 1789 1790
libvirt.def: libvirt.syms
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
1791 1792
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d'	\
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
1793 1794 1795
	chmod a-w $@-tmp && \
	mv $@-tmp libvirt.def

1796 1797 1798
libvirt_qemu.def: $(srcdir)/libvirt_qemu.syms
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
1799 1800
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d'	\
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
1801 1802 1803
	chmod a-w $@-tmp && \
	mv $@-tmp libvirt_qemu.def

1804 1805 1806
libvirt_lxc.def: $(srcdir)/libvirt_lxc.syms
	$(AM_V_GEN)rm -f -- $@-tmp $@ ; \
	printf 'EXPORTS\n' > $@-tmp && \
1807 1808
	sed -e '/^$$/d; /#/d; /:/d; /}/d; /\*/d; /LIBVIRT_/d'	\
	    -e 's/[	 ]*\(.*\)\;/    \1/g' $^ >> $@-tmp && \
1809 1810 1811
	chmod a-w $@-tmp && \
	mv $@-tmp libvirt_lxc.def

1812 1813
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
D
Daniel P. Berrange 已提交
1814 1815 1816 1817 1818 1819 1820 1821
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)
1822
libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la
1823
libvirt_la_LIBADD += \
1824
		    $(DRIVER_MODULE_LIBS) \
1825
		    $(CYGWIN_EXTRA_LIBADD)
1826
libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
1827 1828 1829 1830 1831 1832
# 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)
1833

1834
if WITH_DTRACE_PROBES
1835
libvirt_la_BUILT_LIBADD += libvirt_probes.lo
1836
libvirt_la_DEPENDENCIES += libvirt_probes.lo libvirt_probes.o
1837
nodist_libvirt_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
1838
if WITH_REMOTE
E
Eric Blake 已提交
1839
nodist_libvirt_driver_remote_la_SOURCES = libvirt_probes.h
E
Eric Blake 已提交
1840
endif WITH_REMOTE
1841 1842 1843
if WITH_DRIVER_MODULES
DTRACE2SYSTEMTAP_FLAGS = --with-modules
endif
1844

1845 1846 1847
BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp

if WITH_QEMU
1848
libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.lo
1849
nodist_libvirt_driver_qemu_la_SOURCES = libvirt_qemu_probes.h
1850
BUILT_SOURCES += libvirt_qemu_probes.h
1851
endif
1852 1853

tapsetdir = $(datadir)/systemtap/tapset
1854
tapset_DATA = libvirt_probes.stp libvirt_qemu_probes.stp libvirt_functions.stp
1855

1856
%_probes.h: %_probes.d
1857 1858
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

E
Eric Blake 已提交
1859
.PRECIOUS: %_probes.o
1860
%_probes.o: %_probes.d
1861 1862
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

1863 1864 1865 1866 1867 1868 1869 1870 1871
%_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 已提交
1872 1873 1874
RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \
		  $(srcdir)/rpc/virkeepaliveprotocol.x \
		  $(srcdir)/remote/remote_protocol.x \
1875
		  $(srcdir)/remote/lxc_protocol.x \
1876 1877 1878
		  $(srcdir)/remote/qemu_protocol.x \
		  $(srcdir)/lxc/lxc_monitor_protocol.x \
		  $(srcdir)/locking/lock_protocol.x
1879 1880

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

1883 1884
%_probes.stp: %_probes.d $(srcdir)/dtrace2systemtap.pl \
		$(top_builddir)/config.status
1885
	$(AM_V_GEN)$(PERL) -w $(srcdir)/dtrace2systemtap.pl \
1886
	  $(DTRACE2SYSTEMTAP_FLAGS) $(bindir) $(sbindir) $(libdir) $< > $@
1887

1888
CLEANFILES += libvirt_probes.h libvirt_probes.o libvirt_probes.lo \
1889
              libvirt_qemu_probes.h libvirt_qemu_probes.o \
1890
              libvirt_qemu_probes.lo\
1891 1892
              libvirt_functions.stp libvirt_probes.stp \
              libvirt_qemu_probes.stp
1893 1894
endif

1895
EXTRA_DIST += libvirt_probes.d libvirt_qemu_probes.d
1896

C
Chris Lalancette 已提交
1897
libvirt_qemu_la_SOURCES = libvirt-qemu.c
D
Daniel P. Berrange 已提交
1898 1899 1900 1901 1902 1903 1904
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)
1905
libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
C
Chris Lalancette 已提交
1906
libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
1907

1908
libvirt_lxc_la_SOURCES = libvirt-lxc.c
D
Daniel P. Berrange 已提交
1909 1910 1911 1912 1913 1914 1915
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)
1916 1917 1918
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)

1919 1920 1921
lockdriverdir = $(libdir)/libvirt/lock-driver
lockdriver_LTLIBRARIES =

1922
if WITH_LIBVIRTD
1923 1924 1925 1926 1927
lockdriver_LTLIBRARIES += lockd.la
lockd_la_SOURCES = \
		$(LOCK_DRIVER_LOCKD_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
		$(NULL)
E
Eric Blake 已提交
1928 1929 1930
lockd_la_CFLAGS = -I$(top_srcdir)/src/conf \
		$(XDR_CFLAGS) \
		$(AM_CFLAGS)
1931
lockd_la_LDFLAGS = -module -avoid-version
1932 1933 1934 1935
lockd_la_LIBADD = ../gnulib/lib/libgnu.la \
	libvirt-net-rpc.la \
	libvirt-net-rpc-client.la \
	$(NULL)
J
Jiri Denemark 已提交
1936 1937 1938
augeas_DATA += locking/libvirt_lockd.aug
augeastest_DATA += test_libvirt_lockd.aug
CLEANFILES += test_libvirt_lockd.aug
1939 1940 1941 1942
if WITH_DTRACE_PROBES
lockd_la_LIBADD += libvirt_probes.lo
endif
if WITH_QEMU
1943
nodist_conf_DATA += locking/qemu-lockd.conf
1944 1945 1946 1947 1948 1949 1950 1951 1952
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 $< $@


1953 1954
sbin_PROGRAMS = virtlockd

1955 1956 1957
virtlockd_SOURCES = \
		$(LOCK_DAEMON_SOURCES) \
		$(LOCK_PROTOCOL_GENERATED) \
1958
		$(LOCK_DAEMON_GENERATED) \
1959
		$(NULL)
1960 1961
virtlockd_CFLAGS = \
		$(AM_CFLAGS) \
D
Daniel P. Berrange 已提交
1962
		$(PIE_CFLAGS) \
1963
		$(XDR_CFLAGS) \
1964 1965 1966
		$(NULL)
virtlockd_LDFLAGS = \
		$(AM_LDFLAGS) \
D
Daniel P. Berrange 已提交
1967
		$(PIE_LDFLAGS) \
1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982
		$(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
1983 1984
EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
              $(LOCK_DRIVER_LOCKD_SOURCES)
1985 1986
endif

J
Jiri Denemark 已提交
1987 1988 1989 1990
EXTRA_DIST += locking/virtlockd.sysconf \
	locking/lockd.conf \
	locking/libvirt_lockd.aug \
	locking/test_libvirt_lockd.aug.in
1991 1992

install-sysconfig:
E
Eric Blake 已提交
1993
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
1994 1995 1996 1997 1998
	$(INSTALL_DATA) $(srcdir)/locking/virtlockd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd

uninstall-sysconfig:
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
E
Eric Blake 已提交
1999
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
2000 2001 2002 2003 2004 2005

EXTRA_DIST += locking/virtlockd.init.in

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_RED_HAT
install-init:: virtlockd.init install-sysconfig
E
Eric Blake 已提交
2006
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
2007 2008 2009 2010
	$(INSTALL_SCRIPT) virtlockd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd

uninstall-init:: uninstall-sysconfig
E
Eric Blake 已提交
2011 2012
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/virtlockd
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
2013 2014

BUILT_SOURCES += virtlockd.init
E
Eric Blake 已提交
2015
DISTCLEANFILES += virtlockd.init
2016 2017 2018 2019 2020 2021 2022 2023 2024 2025
else
install-init::
uninstall-init::
endif
else
install-init::
uninstall-init::
endif

virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
2026 2027 2028 2029 2030 2031
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g'		\
	    < $< > $@-t &&					\
	    chmod a+x $@-t &&					\
2032 2033
	    mv $@-t $@

2034 2035
POD2MAN = pod2man -c "Virtualization Support" \
			-r "$(PACKAGE)-$(VERSION)" -s 8
2036

2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049
$(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 $@

man8_MANS = virtlockd.8

2050 2051 2052 2053 2054 2055
conf_DATA += locking/virtlockd.conf

augeas_DATA += locking/virtlockd.aug
augeastest_DATA += test_virtlockd.aug

CLEANFILES += test_virtlockd.aug
2056 2057 2058 2059 2060 2061 2062
MAINTAINERCLEANFILES += $(srcdir)/virtlockd.8.in

EXTRA_DIST += \
        locking/virtlockd.service.in \
        locking/virtlockd.socket.in \
        locking/virtlockd.pod.in \
        virtlockd.8.in \
2063 2064 2065
        locking/virtlockd.aug \
        locking/virtlockd.conf \
        locking/test_virtlockd.aug.in \
2066
        $(NULL)
2067

2068 2069 2070 2071 2072 2073 2074

if WITH_LIBVIRTD
if LIBVIRT_INIT_SCRIPT_SYSTEMD

SYSTEMD_UNIT_DIR = /lib/systemd/system

BUILT_SOURCES += virtlockd.service virtlockd.socket
E
Eric Blake 已提交
2075
DISTCLEANFILES += virtlockd.service virtlockd.socket
2076

E
Eric Blake 已提交
2077 2078
install-systemd: virtlockd.service virtlockd.socket install-sysconfig
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
2079
	$(INSTALL_DATA) virtlockd.service \
2080
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
2081
	$(INSTALL_DATA) virtlockd.socket \
2082 2083 2084
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/

uninstall-systemd: uninstall-sysconfig
E
Eric Blake 已提交
2085 2086 2087
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virtlockd.socket
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
2088 2089 2090 2091 2092 2093 2094 2095 2096 2097
else
install-systemd:
uninstall-systemd:
endif
else
install-systemd:
uninstall-systemd:
endif

virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
2098 2099 2100
	$(AM_V_GEN)sed						\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    < $< > $@-t &&					\
2101 2102 2103
	    mv $@-t $@

virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status
2104 2105 2106
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    < $< > $@-t &&					\
2107 2108 2109
	    mv $@-t $@


2110
if WITH_SANLOCK
2111
lockdriver_LTLIBRARIES += sanlock.la
2112
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
2113
sanlock_la_CFLAGS = -I$(top_srcdir)/src/conf $(AM_CFLAGS)
2114
sanlock_la_LDFLAGS = -module -avoid-version
2115
sanlock_la_LIBADD = -lsanlock_client \
2116 2117 2118
		../gnulib/lib/libgnu.la

augeas_DATA += locking/libvirt_sanlock.aug
2119 2120
augeastest_DATA += test_libvirt_sanlock.aug
CLEANFILES += test_libvirt_sanlock.aug
2121

E
Eric Blake 已提交
2122
locking/%-sanlock.conf: $(srcdir)/locking/sanlock.conf
2123
	$(AM_V_GEN)$(MKDIR_P) locking ; \
2124 2125 2126
	cp $< $@

if WITH_QEMU
2127
nodist_conf_DATA += locking/qemu-sanlock.conf
2128
BUILT_SOURCES += locking/qemu-sanlock.conf
E
Eric Blake 已提交
2129
DISTCLEANFILES += locking/qemu-sanlock.conf
2130
endif
2131
else
2132
EXTRA_DIST += $(LOCK_DRIVER_SANLOCK_SOURCES)
2133
endif
2134 2135
EXTRA_DIST += locking/sanlock.conf \
	locking/libvirt_sanlock.aug \
2136
	locking/test_libvirt_sanlock.aug.in
2137

2138 2139 2140 2141
noinst_LTLIBRARIES += \
	libvirt-net-rpc.la \
	libvirt-net-rpc-server.la \
	libvirt-net-rpc-client.la
2142

2143
EXTRA_DIST += \
E
Eric Blake 已提交
2144 2145 2146 2147
	dtrace2systemtap.pl \
	rpc/gendispatch.pl \
	rpc/genprotocol.pl \
	rpc/gensystemtap.pl \
J
Jiri Denemark 已提交
2148 2149
	rpc/virnetprotocol.x \
	rpc/virkeepaliveprotocol.x
2150

E
Eric Blake 已提交
2151 2152
VIR_NET_RPC_GENERATED = \
	$(srcdir)/rpc/virnetprotocol.h \
J
Jiri Denemark 已提交
2153 2154 2155
	$(srcdir)/rpc/virnetprotocol.c \
	$(srcdir)/rpc/virkeepaliveprotocol.h \
	$(srcdir)/rpc/virkeepaliveprotocol.c
2156

2157
BUILT_SOURCES += $(VIR_NET_RPC_GENERATED)
2158

2159
libvirt_net_rpc_la_SOURCES = \
2160
	rpc/virnetmessage.h rpc/virnetmessage.c \
2161
	rpc/virnetprotocol.h rpc/virnetprotocol.c \
2162
	rpc/virnetsocket.h rpc/virnetsocket.c \
2163 2164
	rpc/virkeepaliveprotocol.h rpc/virkeepaliveprotocol.c \
	rpc/virkeepalive.h rpc/virkeepalive.c
2165
if WITH_SSH2
2166 2167 2168 2169 2170 2171
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
else
EXTRA_DIST += \
	rpc/virnetsshsession.h rpc/virnetsshsession.c
endif
2172
if WITH_GNUTLS
2173 2174 2175 2176 2177 2178
libvirt_net_rpc_la_SOURCES += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
else
EXTRA_DIST += \
	rpc/virnettlscontext.h rpc/virnettlscontext.c
endif
2179
if WITH_SASL
2180 2181 2182 2183 2184 2185
libvirt_net_rpc_la_SOURCES += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
else
EXTRA_DIST += \
	rpc/virnetsaslcontext.h rpc/virnetsaslcontext.c
endif
2186
libvirt_net_rpc_la_CFLAGS = \
2187
			$(GNUTLS_CFLAGS) \
2188
			$(SASL_CFLAGS) \
2189
			$(SSH2_CFLAGS) \
2190
			$(XDR_CFLAGS) \
2191 2192
			$(AM_CFLAGS)
libvirt_net_rpc_la_LDFLAGS = \
2193
			$(GNUTLS_LIBS) \
2194
			$(SASL_LIBS) \
2195
			$(SSH2_LIBS)\
2196 2197 2198 2199 2200 2201
			$(AM_LDFLAGS) \
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2202 2203 2204 2205
libvirt_net_rpc_server_la_SOURCES = \
	rpc/virnetserverprogram.h rpc/virnetserverprogram.c \
	rpc/virnetserverservice.h rpc/virnetserverservice.c \
	rpc/virnetserverclient.h rpc/virnetserverclient.c \
2206
	rpc/virnetservermdns.h rpc/virnetservermdns.c \
2207 2208
	rpc/virnetserver.h rpc/virnetserver.c
libvirt_net_rpc_server_la_CFLAGS = \
2209
			$(AVAHI_CFLAGS) \
2210
			$(DBUS_CFLAGS) \
E
Eric Blake 已提交
2211
			$(XDR_CFLAGS) \
J
Jim Fehlig 已提交
2212 2213
			$(AM_CFLAGS) \
			$(POLKIT_CFLAGS)
2214 2215
libvirt_net_rpc_server_la_LDFLAGS = \
			$(AM_LDFLAGS) \
2216
			$(AVAHI_LIBS) \
2217
			$(DBUS_LIBS) \
J
Jim Fehlig 已提交
2218
			$(POLKIT_LIBS) \
2219 2220 2221 2222 2223
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_server_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)

2224 2225 2226 2227 2228
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 已提交
2229 2230
			$(AM_CFLAGS) \
			$(XDR_CFLAGS)
2231 2232 2233 2234 2235 2236
libvirt_net_rpc_client_la_LDFLAGS = \
			$(AM_LDFLAGS) \
			$(CYGWIN_EXTRA_LDFLAGS) \
			$(MINGW_EXTRA_LDFLAGS)
libvirt_net_rpc_client_la_LIBADD = \
			$(CYGWIN_EXTRA_LIBADD)
2237

2238 2239
libexec_PROGRAMS =

2240
if WITH_LIBVIRTD
2241 2242
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2243 2244 2245 2246
libvirt_iohelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2247 2248 2249
libvirt_iohelper_LDADD =		\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
2250 2251 2252
if WITH_DTRACE_PROBES
libvirt_iohelper_LDADD += libvirt_probes.lo
endif
2253

D
Daniel P. Berrange 已提交
2254 2255 2256 2257
libvirt_iohelper_CFLAGS = \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
2258
endif
2259

2260
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
2261
if WITH_LIBVIRTD
2262
libexec_PROGRAMS += libvirt_parthelper
2263

2264
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
D
Daniel P. Berrange 已提交
2265 2266 2267 2268
libvirt_parthelper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2269 2270 2271 2272
libvirt_parthelper_LDADD =		\
		$(LIBPARTED_LIBS)	\
		libvirt_util.la		\
		../gnulib/lib/libgnu.la
2273 2274 2275
if WITH_DTRACE_PROBES
libvirt_parthelper_LDADD += libvirt_probes.lo
endif
2276

D
Daniel P. Berrange 已提交
2277 2278 2279 2280 2281
libvirt_parthelper_CFLAGS = \
		$(LIBPARTED_CFLAGS) \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
R
Richard W.M. Jones 已提交
2282
endif
2283
endif
2284 2285
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)

2286

2287
if WITH_SANLOCK
2288 2289 2290
libexec_PROGRAMS += libvirt_sanlock_helper

libvirt_sanlock_helper_SOURCES = $(LOCK_DRIVER_SANLOCK_HELPER_SOURCES)
D
Daniel P. Berrange 已提交
2291 2292 2293 2294 2295 2296 2297 2298 2299
libvirt_sanlock_helper_CFLAGS = \
		-I$(top_srcdir)/src/conf \
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
libvirt_sanlock_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2300 2301 2302
libvirt_sanlock_helper_LDADD = libvirt.la
endif

2303 2304 2305 2306 2307 2308
if WITH_LXC
if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_lxc

libvirt_lxc_SOURCES =						\
		$(LXC_CONTROLLER_SOURCES)			\
O
Osier Yang 已提交
2309 2310
		$(NODE_INFO_SOURCES)				\
		$(DATATYPES_SOURCES)
D
Daniel P. Berrange 已提交
2311 2312 2313 2314
libvirt_lxc_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
2315
libvirt_lxc_LDADD =			\
G
Gao feng 已提交
2316
		$(FUSE_LIBS) \
2317 2318
		libvirt-net-rpc-server.la \
		libvirt-net-rpc.la \
2319
		libvirt_security_manager.la \
2320 2321
		libvirt_conf.la \
		libvirt_util.la \
2322
		../gnulib/lib/libgnu.la
2323
if WITH_DTRACE_PROBES
2324
libvirt_lxc_LDADD += libvirt_probes.lo
2325
endif
2326
libvirt_lxc_LDADD += $(SECDRIVER_LIBS)
2327
libvirt_lxc_CFLAGS =				\
2328
		-I$(top_srcdir)/src/conf	\
2329
		$(AM_CFLAGS)                    \
D
Daniel P. Berrange 已提交
2330
		$(PIE_CFLAGS)			\
G
Gao feng 已提交
2331
		$(LIBNL_CFLAGS)			\
D
Daniel P. Berrange 已提交
2332 2333
		$(FUSE_CFLAGS)			\
		$(NULL)
2334
if WITH_BLKID
2335 2336 2337
libvirt_lxc_CFLAGS += $(BLKID_CFLAGS)
libvirt_lxc_LDADD += $(BLKID_LIBS)
endif
2338 2339 2340
if WITH_SECDRIVER_SELINUX
libvirt_lxc_CFLAGS += $(SELINUX_CFLAGS)
endif
J
Jiri Denemark 已提交
2341 2342 2343
if WITH_SECDRIVER_APPARMOR
libvirt_lxc_CFLAGS += $(APPARMOR_CFLAGS)
endif
2344 2345 2346 2347
endif
endif
EXTRA_DIST += $(LXC_CONTROLLER_SOURCES)

J
Jamie Strandboge 已提交
2348 2349 2350 2351 2352 2353
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 已提交
2354 2355 2356 2357
virt_aa_helper_LDFLAGS = \
		$(AM_LDFLAGS) \
		$(PIE_LDFLAGS) \
		$(NULL)
J
Jamie Strandboge 已提交
2358
virt_aa_helper_LDADD =						\
C
Chris Lalancette 已提交
2359 2360 2361
		libvirt_conf.la					\
		libvirt_util.la					\
		../gnulib/lib/libgnu.la
2362
if WITH_DTRACE_PROBES
2363
virt_aa_helper_LDADD += libvirt_probes.lo
2364
endif
J
Jamie Strandboge 已提交
2365
virt_aa_helper_CFLAGS =						\
2366 2367
		-I$(top_srcdir)/src/conf			\
		-I$(top_srcdir)/src/security			\
D
Daniel P. Berrange 已提交
2368 2369 2370
		$(AM_CFLAGS) \
		$(PIE_CFLAGS) \
		$(NULL)
J
Jamie Strandboge 已提交
2371 2372 2373 2374
endif
endif
EXTRA_DIST += $(SECURITY_DRIVER_APPARMOR_HELPER_SOURCES)

2375
install-data-local: install-init install-systemd
2376 2377
if WITH_LIBVIRTD
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
2378
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
2379 2380
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd"
endif
2381 2382
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
2383
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems"
2384
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
2385
if WITH_SANLOCK
2386 2387
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock"
endif
2388 2389
if WITH_QEMU
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu"
2390
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu/channel/target"
2391
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu"
2392
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu"
2393
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu"
2394 2395 2396 2397 2398
endif
if WITH_LXC
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lxc"
endif
J
Jim Fehlig 已提交
2399 2400 2401
if WITH_LIBXL
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/libxl"
J
Jim Fehlig 已提交
2402
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl"
J
Jim Fehlig 已提交
2403
endif
2404 2405 2406 2407
if WITH_UML
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/uml"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/uml"
endif
2408 2409 2410
if WITH_XEN
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/xen"
endif
2411 2412
if WITH_NETWORK
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network"
2413
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq"
2414
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/network"
2415
	$(MKDIR_P) "$(DESTDIR)$(confdir)/qemu/networks/autostart"
2416
	$(INSTALL_DATA) $(srcdir)/network/default.xml \
2417
	  $(DESTDIR)$(confdir)/qemu/networks/default.xml
2418
	test -z "$(UUID)" || \
E
Eric Blake 已提交
2419
	  { sed -e "s,</name>,</name>\n  <uuid>$(UUID)</uuid>," \
2420 2421 2422 2423 2424 2425
	      $(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 已提交
2426
	   ln -s ../default.xml \
2427
	    $(DESTDIR)$(confdir)/qemu/networks/autostart/default.xml
2428 2429
endif

2430
uninstall-local:: uninstall-init uninstall-systemd
2431
if WITH_LIBVIRTD
2432
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
2433 2434 2435
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||:
endif
2436 2437
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
2438
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/filesystems" ||:
2439
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
2440
if WITH_SANLOCK
2441 2442
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||:
endif
2443 2444 2445 2446 2447
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" ||:
2448
endif
2449 2450 2451 2452
if WITH_LXC
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||:
endif
J
Jim Fehlig 已提交
2453 2454 2455
if WITH_LIBXL
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||:
J
Jim Fehlig 已提交
2456
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||:
J
Jim Fehlig 已提交
2457
endif
2458 2459 2460 2461
if WITH_UML
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/uml" ||:
endif
2462 2463 2464
if WITH_XEN
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/xen" ||:
endif
2465
if WITH_NETWORK
2466 2467 2468 2469
	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" || :
2470 2471 2472 2473
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||:
endif
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
2474

2475 2476
CLEANFILES += *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
DISTCLEANFILES += $(GENERATED_SYM_FILES)
2477
MAINTAINERCLEANFILES += $(REMOTE_DRIVER_GENERATED) $(VIR_NET_RPC_GENERATED)