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

3 4 5
INCLUDES = \
	   -I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
	   -I../include \
6
	   -I@top_srcdir@/include \
7
	   -I@top_srcdir@/daemon \
8
	   $(LIBXML_CFLAGS) \
9
	   $(LIBSSH2_CFLAGS) \
10
	   $(SELINUX_CFLAGS) \
11 12
	   $(DRIVER_MODULE_CFLAGS) \
	   -DLIBDIR=\""$(libdir)"\" \
13 14 15 16
	   -DBINDIR=\""$(libexecdir)"\" \
	   -DSBINDIR=\""$(sbindir)"\" \
	   -DSYSCONF_DIR="\"$(sysconfdir)\"" \
	   -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
D
Daniel P. Berrange 已提交
17
           -DLOCAL_STATE_DIR=\""$(localstatedir)"\" \
18
           -DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
19 20
	   $(WARN_CFLAGS) \
	   $(LOCK_CHECKING_CFLAGS)
21

22
EXTRA_DIST = $(conf_DATA)
23

24 25 26
if WITH_NETWORK
UUID=$(shell uuidgen 2>/dev/null)
endif
27

28
lib_LTLIBRARIES = libvirt.la
29

30 31 32 33
moddir = $(libdir)/libvirt/drivers
mod_LTLIBRARIES =


34 35
# These files are not related to driver APIs. Simply generic
# helper APIs for various purposes
36
UTIL_SOURCES =							\
37 38 39
		bridge.c bridge.h				\
		buf.c buf.h					\
		conf.c conf.h					\
40
		event.c event.h					\
41
		hash.c hash.h					\
42
		iptables.c iptables.h				\
43
		logging.c logging.h				\
44
		memory.c memory.h				\
45
		pci.c pci.h					\
46
		hostusb.c hostusb.h				\
47
		qparams.c qparams.h				\
48
		storage_encryption_conf.h storage_encryption_conf.c	\
49 50 51
		threads.c threads.h				\
		threads-pthread.h				\
		threads-win32.h					\
52 53
		uuid.c uuid.h					\
		util.c util.h					\
54
		virterror.c virterror_internal.h		\
55 56
		xml.c xml.h

57 58
EXTRA_DIST += threads-pthread.c threads-win32.c

59
# Internal generic driver infrastructure
60
DRIVER_SOURCES =						\
61
		driver.c driver.h				\
62 63 64 65 66 67 68
		internal.h					\
		datatypes.c datatypes.h				\
		domain_event.c domain_event.h			\
		stats_linux.c stats_linux.h			\
		libvirt.c libvirt_internal.h


69 70 71 72 73 74 75 76 77 78 79 80
# Domain driver generic impl APIs
DOMAIN_CONF_SOURCES =						\
		capabilities.c capabilities.h			\
		domain_conf.c domain_conf.h			\
		nodeinfo.h nodeinfo.c

# Network driver generic impl APIs
NETWORK_CONF_SOURCES =						\
		network_conf.c network_conf.h

# Storage driver generic impl APIs
STORAGE_CONF_SOURCES =						\
81
		storage_conf.h storage_conf.c
82

83 84 85
# Interface driver generic impl APIs
INTERFACE_CONF_SOURCES =					\
		interface_conf.c interface_conf.h
86

87 88 89 90
# Secret driver generic impl APIs
SECRET_CONF_SOURCES =						\
		secret_conf.h secret_conf.c

91 92
# The remote RPC driver, covering domains, storage, networks, etc
REMOTE_DRIVER_SOURCES =						\
93 94
		gnutls_1_0_compat.h			\
		remote/remote_driver.c remote/remote_driver.h	\
95 96
		../daemon/remote_protocol.c			\
		../daemon/remote_protocol.h
97 98 99

# Mock driver, covering domains, storage, networks, etc
TEST_DRIVER_SOURCES =						\
100
		test/test_driver.c test/test_driver.h
101 102 103 104 105



# Now the Hypervisor specific drivers
XEN_DRIVER_SOURCES =						\
106 107 108 109 110 111 112 113
		xen/proxy_internal.c xen/proxy_internal.h	\
		xen/sexpr.c xen/sexpr.h				\
		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
114
if WITH_XEN_INOTIFY
115
XEN_DRIVER_SOURCES += xen/xen_inotify.c xen/xen_inotify.h
116
endif
117 118

LXC_DRIVER_SOURCES =						\
119 120 121 122
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
		lxc/lxc_driver.c lxc/lxc_driver.h		\
		lxc/veth.c lxc/veth.h				\
D
Dan Smith 已提交
123
		cgroup.c cgroup.h
124

125
LXC_CONTROLLER_SOURCES =					\
126 127 128 129
		lxc/lxc_conf.c lxc/lxc_conf.h			\
		lxc/lxc_container.c lxc/lxc_container.h		\
		lxc/lxc_controller.c				\
		lxc/veth.c lxc/veth.h				\
D
Dan Smith 已提交
130
		cgroup.c cgroup.h
131

132 133 134
PHYP_DRIVER_SOURCES =						\
		phyp/phyp_driver.c phyp/phyp_driver.h

135
OPENVZ_DRIVER_SOURCES =						\
136 137
		openvz/openvz_conf.c openvz/openvz_conf.h	\
		openvz/openvz_driver.c openvz/openvz_driver.h
138

139 140 141
VBOX_DRIVER_SOURCES =						\
        vbox/vbox_XPCOMCGlue.c vbox/vbox_XPCOMCGlue.h		\
        vbox/vbox_driver.c vbox/vbox_driver.h			\
142 143
        vbox/vbox_V2_2.c vbox/vbox_CAPI_v2_2.h			\
        vbox/vbox_V3_0.c vbox/vbox_CAPI_v3_0.h
144

145 146
VBOX_DRIVER_EXTRA_DIST = vbox/vbox_tmpl.c vbox/README

147
QEMU_DRIVER_SOURCES =						\
148 149
		qemu/qemu_conf.c qemu/qemu_conf.h				\
		qemu/qemu_driver.c qemu/qemu_driver.h			\
150
		cgroup.c cgroup.h
R
Richard W.M. Jones 已提交
151

152
UML_DRIVER_SOURCES =						\
D
Daniel P. Berrange 已提交
153 154
		uml/uml_conf.c uml/uml_conf.h			\
		uml/uml_driver.c uml/uml_driver.h
155

156 157 158 159 160 161
ONE_DRIVER_SOURCES =						\
		./opennebula/one_conf.c				\
		./opennebula/one_conf.h				\
		./opennebula/one_driver.c			\
		./opennebula/one_driver.h			\
		./opennebula/one_client.c			\
162
		./opennebula/one_client.h
D
Daniel Veillard 已提交
163

164 165 166 167
ESX_DRIVER_SOURCES =						\
		esx/esx_driver.c esx/esx_driver.h		\
		esx/esx_util.c esx/esx_util.h			\
		esx/esx_vi.c esx/esx_vi.h			\
168 169 170 171
		esx/esx_vi_methods.c esx/esx_vi_methods.h	\
		esx/esx_vi_types.c esx/esx_vi_types.h		\
		esx/esx_vmx.c esx/esx_vmx.h

172
NETWORK_DRIVER_SOURCES =					\
173
		network/bridge_driver.h network/bridge_driver.c
174

175
INTERFACE_DRIVER_SOURCES =					\
176
		interface/netcf_driver.h interface/netcf_driver.c
177

178
SECRET_DRIVER_SOURCES =						\
179
		secret/secret_driver.h secret/secret_driver.c
180

181
# Storage backend specific impls
182
STORAGE_DRIVER_SOURCES =					\
183 184
		storage/storage_driver.h storage/storage_driver.c		\
		storage/storage_backend.h storage/storage_backend.c
185

186 187 188 189
# Network driver generic impl APIs
NODE_DEVICE_CONF_SOURCES =					\
		node_device_conf.c node_device_conf.h

190
STORAGE_DRIVER_FS_SOURCES =					\
191
		storage/storage_backend_fs.h storage/storage_backend_fs.c
R
Richard W.M. Jones 已提交
192

193
STORAGE_DRIVER_LVM_SOURCES =					\
194 195
		storage/storage_backend_logical.h			\
		storage/storage_backend_logical.c
196 197

STORAGE_DRIVER_ISCSI_SOURCES =					\
198
		storage/storage_backend_iscsi.h storage/storage_backend_iscsi.c
199

200
STORAGE_DRIVER_SCSI_SOURCES =					\
201
		storage/storage_backend_scsi.h storage/storage_backend_scsi.c
202

D
Dave Allan 已提交
203
STORAGE_DRIVER_MPATH_SOURCES =					\
204
		storage/storage_backend_mpath.h storage/storage_backend_mpath.c
D
Dave Allan 已提交
205

206
STORAGE_DRIVER_DISK_SOURCES =					\
207
		storage/storage_backend_disk.h storage/storage_backend_disk.c
208 209

STORAGE_HELPER_DISK_SOURCES =					\
210
		storage/parthelper.c
211 212


213
# Security framework and drivers for various models
214
SECURITY_DRIVER_SOURCES =					\
215
		security/security_driver.h security/security_driver.c
216

217
SECURITY_DRIVER_SELINUX_SOURCES =				\
218
		security/security_selinux.h security/security_selinux.c
219

220

221
NODE_DEVICE_DRIVER_SOURCES =					\
222
		node_device/node_device_driver.c node_device/node_device_driver.h
223 224

NODE_DEVICE_DRIVER_HAL_SOURCES =				\
225 226 227
		node_device/node_device_hal.c			\
		node_device/node_device_hal.h			\
		node_device/node_device_hal_linux.c
228

229
NODE_DEVICE_DRIVER_DEVKIT_SOURCES =				\
230
		node_device/node_device_devkit.c
231

232 233 234 235 236 237 238

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

239 240 241 242
noinst_LTLIBRARIES = libvirt_util.la
libvirt_la_LIBADD = libvirt_util.la
libvirt_util_la_SOURCES =					\
		$(UTIL_SOURCES)
243 244
libvirt_util_la_CFLAGS =  $(CAPNG_CFLAGS)
libvirt_util_la_LDFLAGS =  $(CAPNG_LIBS)
245 246 247 248 249

noinst_LTLIBRARIES += libvirt_driver.la
libvirt_la_LIBADD += libvirt_driver.la
libvirt_driver_la_SOURCES =					\
		$(DRIVER_SOURCES)				\
250 251
		$(DOMAIN_CONF_SOURCES)				\
		$(NETWORK_CONF_SOURCES)				\
252
		$(STORAGE_CONF_SOURCES)				\
253
		$(INTERFACE_CONF_SOURCES)			\
254 255
		$(NODE_DEVICE_CONF_SOURCES)			\
		$(SECRET_CONF_SOURCES)
256

257 258
libvirt_driver_la_CFLAGS = $(NUMACTL_CFLAGS)
libvirt_driver_la_LDFLAGS = $(NUMACTL_LIBS)
259

260
USED_SYM_FILES = libvirt_private.syms
261

262
if WITH_TEST
263 264 265
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_test.la
else
266 267
noinst_LTLIBRARIES += libvirt_driver_test.la
libvirt_la_LIBADD += libvirt_driver_test.la
268 269 270 271
endif
if WITH_DRIVER_MODULES
libvirt_driver_test_la_LDFLAGS = -module -avoid-version
endif
272
libvirt_driver_test_la_SOURCES = $(TEST_DRIVER_SOURCES)
273 274 275
endif

if WITH_REMOTE
276 277 278
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_remote.la
else
279 280
noinst_LTLIBRARIES += libvirt_driver_remote.la
libvirt_la_LIBADD += libvirt_driver_remote.la
281
endif
282 283 284 285 286 287
libvirt_driver_remote_la_CFLAGS =				\
		$(GNUTLS_CFLAGS)				\
		$(SASL_CFLAGS)
libvirt_driver_remote_la_LDFLAGS =				\
		$(GNUTLS_LIBS)					\
		$(SASL_LIBS)
288 289 290
if WITH_DRIVER_MODULES
libvirt_driver_remote_la_LDFLAGS += -module -avoid-version
endif
291
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
292 293 294
endif

if WITH_XEN
295 296 297
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_xen.la
else
298 299
noinst_LTLIBRARIES += libvirt_driver_xen.la
libvirt_la_LIBADD += libvirt_driver_xen.la
300
endif
301 302
libvirt_driver_xen_la_CFLAGS = $(XEN_CFLAGS)
libvirt_driver_xen_la_LDFLAGS = $(XEN_LIBS)
303 304 305
if WITH_DRIVER_MODULES
libvirt_driver_xen_la_LDFLAGS += -module -avoid-version
endif
306
libvirt_driver_xen_la_SOURCES = $(XEN_DRIVER_SOURCES)
307 308
endif

309 310 311 312 313 314 315
if WITH_PHYP
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_phyp.la
else
noinst_LTLIBRARIES += libvirt_driver_phyp.la
libvirt_la_LIBADD += libvirt_driver_phyp.la
endif
316 317
libvirt_driver_phyp_la_LDFLAGS = $(LIBSSH2_LIBS)
libvirt_driver_phyp_la_CFLAGS = $(LIBSSH2_CFLAGS)
318 319 320
libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES)
endif

321
if WITH_OPENVZ
322 323 324
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_openvz.la
else
325 326
noinst_LTLIBRARIES += libvirt_driver_openvz.la
libvirt_la_LIBADD += libvirt_driver_openvz.la
327 328 329 330
endif
if WITH_DRIVER_MODULES
libvirt_driver_openvz_la_LDFLAGS = -module -avoid-version
endif
331
libvirt_driver_openvz_la_SOURCES = $(OPENVZ_DRIVER_SOURCES)
332 333
endif

334 335 336 337 338 339 340 341 342 343 344 345 346
if WITH_VBOX
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_vbox.la
else
noinst_LTLIBRARIES += libvirt_driver_vbox.la
libvirt_la_LIBADD += libvirt_driver_vbox.la
endif
if WITH_DRIVER_MODULES
libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version
endif
libvirt_driver_vbox_la_SOURCES = $(VBOX_DRIVER_SOURCES)
endif

347
if WITH_QEMU
348 349 350
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_qemu.la
else
351
noinst_LTLIBRARIES += libvirt_driver_qemu.la
352 353
# Stateful, so linked to daemon instead
#libvirt_la_LIBADD += libvirt_driver_qemu.la
354
endif
355 356
libvirt_driver_qemu_la_CFLAGS = $(NUMACTL_CFLAGS)
libvirt_driver_qemu_la_LDFLAGS = $(NUMACTL_LIBS)
357 358 359
if WITH_DRIVER_MODULES
libvirt_driver_qemu_la_LDFLAGS += -module -avoid-version
endif
360
libvirt_driver_qemu_la_SOURCES = $(QEMU_DRIVER_SOURCES)
361 362 363 364 365 366 367 368 369 370 371 372 373 374

confdir = $(sysconfdir)/libvirt/
conf_DATA = qemu/qemu.conf

augeasdir = $(datadir)/augeas/lenses
augeas_DATA = qemu/libvirtd_qemu.aug

augeastestdir = $(datadir)/augeas/lenses/tests
augeastest_DATA = qemu/test_libvirtd_qemu.aug

check-local:
	test -x '$(AUGPARSE)' \
	  && '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd_qemu.aug || :

375
endif
376 377
EXTRA_DIST += qemu/qemu.conf qemu/libvirtd_qemu.aug qemu/test_libvirtd_qemu.aug

378 379

if WITH_LXC
380 381 382
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_lxc.la
else
383
noinst_LTLIBRARIES += libvirt_driver_lxc.la
384 385
# Stateful, so linked to daemon instead
#libvirt_la_LIBADD += libvirt_driver_lxc.la
386 387 388 389
endif
if WITH_DRIVER_MODULES
libvirt_driver_lxc_la_LDFLAGS = -module -avoid-version
endif
390
libvirt_driver_lxc_la_SOURCES = $(LXC_DRIVER_SOURCES)
391 392
endif

393
if WITH_UML
394 395 396
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_uml.la
else
397 398 399
noinst_LTLIBRARIES += libvirt_driver_uml.la
# Stateful, so linked to daemon instead
#libvirt_la_LIBADD += libvirt_driver_uml.la
400 401 402 403 404 405
endif
libvirt_driver_uml_la_CFLAGS = $(NUMACTL_CFLAGS)
libvirt_driver_uml_la_LDFLAGS = $(NUMACTL_LIBS)
if WITH_DRIVER_MODULES
libvirt_driver_uml_la_LDFLAGS += -module -avoid-version
endif
406 407
libvirt_driver_uml_la_SOURCES = $(UML_DRIVER_SOURCES)
endif
408

D
Daniel Veillard 已提交
409 410 411 412 413 414 415 416
if WITH_ONE
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_one.la
else
noinst_LTLIBRARIES += libvirt_driver_one.la
# Stateful, so linked to daemon instead
#libvirt_la_LIBADD  += libvirt_driver_one.la
endif
D
Daniel P. Berrange 已提交
417 418
libvirt_driver_one_la_CFLAGS = $(XMLRPC_CFLAGS)
libvirt_driver_one_la_LDFLAGS = $(XMLRPC_LIBS)
D
Daniel Veillard 已提交
419 420 421 422 423 424 425 426 427 428
#libvirt_driver_one_la_CFLAGS  = "-DWITH_ONE"
if WITH_DRIVER_MODULES
libvirt_driver_one_la_LDFLAGS += -module -avoid-version
endif
libvirt_driver_one_la_SOURCES = $(ONE_DRIVER_SOURCES)
endif




429 430 431 432 433 434 435 436 437 438 439 440 441 442 443
if WITH_ESX
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_esx.la
else
noinst_LTLIBRARIES += libvirt_driver_esx.la
libvirt_la_LIBADD += libvirt_driver_esx.la
endif
libvirt_driver_esx_la_CFLAGS = $(LIBCURL_CFLAGS)
libvirt_driver_esx_la_LDFLAGS = $(LIBCURL_LIBS)
if WITH_DRIVER_MODULES
libvirt_driver_esx_la_LDFLAGS += -module -avoid-version
endif
libvirt_driver_esx_la_SOURCES = $(ESX_DRIVER_SOURCES)
endif

444
if WITH_NETWORK
445 446 447
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_network.la
else
448
noinst_LTLIBRARIES += libvirt_driver_network.la
449 450
# Stateful, so linked to daemon instead
#libvirt_la_LIBADD += libvirt_driver_network.la
451 452 453 454
endif
if WITH_DRIVER_MODULES
libvirt_driver_network_la_LDFLAGS = -module -avoid-version
endif
455
libvirt_driver_network_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
456
endif
457 458 459 460
EXTRA_DIST += network/default.xml



461

D
Daniel Veillard 已提交
462 463
if WITH_NETCF
libvirt_driver_interface_la_LDFLAGS = $(NETCF_LIBS)
464 465 466 467 468 469 470 471 472 473 474
libvirt_driver_interface_la_CFLAGS = $(NETCF_CFLAGS)
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_interface.la
else
noinst_LTLIBRARIES += libvirt_driver_interface.la
libvirt_la_LIBADD += libvirt_driver_interface.la
endif
if WITH_DRIVER_MODULES
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
endif
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
D
Daniel Veillard 已提交
475 476
endif

D
Daniel P. Berrange 已提交
477
if WITH_SECRETS
478 479 480 481 482 483 484
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_secret.la
else
noinst_LTLIBRARIES += libvirt_driver_secret.la
libvirt_la_LIBADD += libvirt_driver_secret.la
endif
if WITH_DRIVER_MODULES
485
libvirt_driver_secret_la_LDFLAGS = -module -avoid-version ../gnulib/lib/libgnu.la
486 487
endif
libvirt_driver_secret_la_SOURCES = $(SECRET_DRIVER_SOURCES)
D
Daniel P. Berrange 已提交
488
endif
489

490 491
# Needed to keep automake quiet about conditionals
libvirt_driver_storage_la_SOURCES =
D
Dave Allan 已提交
492
libvirt_driver_storage_la_CFLAGS =
493
if WITH_STORAGE_DIR
494 495 496
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_storage.la
else
497
noinst_LTLIBRARIES += libvirt_driver_storage.la
498 499
# Stateful, so linked to daemon instead
#libvirt_la_LIBADD += libvirt_driver_storage.la
500 501 502 503
endif
if WITH_DRIVER_MODULES
libvirt_driver_storage_la_LDFLAGS = -module -avoid-version
endif
504 505
libvirt_driver_storage_la_SOURCES += $(STORAGE_DRIVER_SOURCES)
libvirt_driver_storage_la_SOURCES += $(STORAGE_DRIVER_FS_SOURCES)
506 507
endif

508
if WITH_STORAGE_LVM
509
libvirt_driver_storage_la_SOURCES += $(STORAGE_DRIVER_LVM_SOURCES)
510 511
endif

512
if WITH_STORAGE_ISCSI
513
libvirt_driver_storage_la_SOURCES += $(STORAGE_DRIVER_ISCSI_SOURCES)
514 515
endif

516 517 518 519
if WITH_STORAGE_SCSI
libvirt_driver_storage_la_SOURCES += $(STORAGE_DRIVER_SCSI_SOURCES)
endif

D
Dave Allan 已提交
520 521 522 523 524
if WITH_STORAGE_MPATH
libvirt_driver_storage_la_SOURCES += $(STORAGE_DRIVER_MPATH_SOURCES)
libvirt_driver_storage_la_CFLAGS += $(DEVMAPPER_CFLAGS)
endif

525
if WITH_STORAGE_DISK
526
libvirt_driver_storage_la_SOURCES += $(STORAGE_DRIVER_DISK_SOURCES)
527
endif
528

529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558
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
#libvirt_la_LIBADD += libvirt_driver_nodedev.la
endif
libvirt_driver_nodedev_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES)

libvirt_driver_nodedev_la_CFLAGS =
libvirt_driver_nodedev_la_LDFLAGS =
if HAVE_HAL
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS)
libvirt_driver_nodedev_la_LDFLAGS += $(HAL_LIBS)
endif
if HAVE_DEVKIT
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_DEVKIT_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(DEVKIT_CFLAGS)
libvirt_driver_nodedev_la_LDFLAGS += $(DEVKIT_LIBS)
endif

if WITH_DRIVER_MODULES
libvirt_driver_nodedev_la_LDFLAGS += -module -avoid-version
endif
endif


559 560 561
libvirt_driver_security_la_SOURCES = $(SECURITY_DRIVER_SOURCES)
noinst_LTLIBRARIES += libvirt_driver_security.la
libvirt_la_LIBADD += libvirt_driver_security.la
562 563 564
if WITH_SECDRIVER_SELINUX
libvirt_driver_security_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES)
endif
565

566 567 568 569 570 571 572
# Add all conditional sources just in case...
EXTRA_DIST +=							\
		$(TEST_DRIVER_SOURCES)				\
		$(REMOTE_DRIVER_SOURCES)			\
		$(XEN_DRIVER_SOURCES)				\
		$(QEMU_DRIVER_SOURCES)				\
		$(LXC_DRIVER_SOURCES)				\
573
		$(UML_DRIVER_SOURCES)				\
D
Daniel Veillard 已提交
574
		$(ONE_DRIVER_SOURCES)				\
575
		$(OPENVZ_DRIVER_SOURCES)			\
576
		$(PHYP_DRIVER_SOURCES)				\
577
		$(VBOX_DRIVER_SOURCES)				\
578
		$(ESX_DRIVER_SOURCES)				\
579
		$(NETWORK_DRIVER_SOURCES)			\
580
		$(INTERFACE_DRIVER_SOURCES)			\
581 582 583 584
		$(STORAGE_DRIVER_SOURCES)			\
		$(STORAGE_DRIVER_FS_SOURCES)			\
		$(STORAGE_DRIVER_LVM_SOURCES)			\
		$(STORAGE_DRIVER_ISCSI_SOURCES)			\
585
		$(STORAGE_DRIVER_SCSI_SOURCES)			\
D
Dave Allan 已提交
586
		$(STORAGE_DRIVER_MPATH_SOURCES)			\
587 588 589
		$(STORAGE_DRIVER_DISK_SOURCES)			\
		$(NODE_DEVICE_DRIVER_SOURCES)			\
		$(NODE_DEVICE_DRIVER_HAL_SOURCES)		\
590
		$(NODE_DEVICE_DRIVER_DEVKIT_SOURCES)		\
591
		$(SECURITY_DRIVER_SELINUX_SOURCES)		\
D
Daniel P. Berrange 已提交
592
		$(SECRET_DRIVER_SOURCES)			\
593
		$(VBOX_DRIVER_EXTRA_DIST)
594

595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613
#
# 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.
#

614
if WITH_DRIVER_MODULES
615
USED_SYM_FILES += libvirt_driver_modules.syms
616
endif
617 618

if WITH_BRIDGE
619
USED_SYM_FILES += libvirt_bridge.syms
620
endif
621 622

if WITH_LINUX
623
USED_SYM_FILES += libvirt_linux.syms
624
endif
625

626 627 628 629 630 631
EXTRA_DIST += \
  libvirt_public.syms		\
  libvirt_private.syms		\
  libvirt_driver_modules.syms	\
  libvirt_bridge.syms		\
  libvirt_linux.syms
632

633 634
BUILT_SOURCES = libvirt.syms

635
libvirt.syms: libvirt_public.syms $(USED_SYM_FILES)
636 637 638 639 640 641
	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
642
	for file in $(USED_SYM_FILES); do \
643 644 645 646 647
	    cat $(srcdir)/$$file >>$@-tmp; \
	done
	printf '\n\nlocal:\n*;\n\n};' >>$@-tmp
	chmod a-w $@-tmp
	mv $@-tmp libvirt.syms
648

649 650
# Empty source list - it merely links a bunch of convenience libs together
libvirt_la_SOURCES =
651
libvirt_la_LIBADD += \
652
		    @CYGWIN_EXTRA_LIBADD@ ../gnulib/lib/libgnu.la
653
libvirt_la_LDFLAGS = $(VERSION_SCRIPT_FLAGS)libvirt.syms \
654 655
                     -version-info @LIBVIRT_VERSION_INFO@ \
                    $(COVERAGE_CFLAGS:-f%=-Wc,-f%) \
656
                    $(LIBXML_LIBS) $(SELINUX_LIBS) \
657
		    $(XEN_LIBS) $(DRIVER_MODULE_LIBS) \
D
Dave Allan 已提交
658
		    $(DEVMAPPER_LIBS) \
659
		    @CYGWIN_EXTRA_LDFLAGS@ @MINGW_EXTRA_LDFLAGS@
660
libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) -DIN_LIBVIRT
661
libvirt_la_DEPENDENCIES = $(libvirt_la_LIBADD) libvirt.syms
662

663 664 665
# Create an automake "convenience library" version of libvirt_la,
# just for testing, since the test harness requires access to internal
# bits and pieces that we don't want to make publicly accessible.
666
noinst_LTLIBRARIES += libvirt_test.la
667

668
# Remove version script from convenience library
669 670
test_LDFLAGS =						\
  $$(echo '$(libvirt_la_LDFLAGS)'			\
671
     |sed 's!@VERSION_SCRIPT_FLAGS@libvirt.syms!!'	\
672 673 674 675 676 677 678 679
     |sed 's!-version-info @LIBVIRT_VERSION_INFO@!!')

# Just like the above, but with a slightly different set of public symbols.
libvirt_test_la_SOURCES = $(libvirt_la_SOURCES)
libvirt_test_la_LIBADD = $(libvirt_la_LIBADD)
libvirt_test_la_LDFLAGS = $(test_LDFLAGS)
libvirt_test_la_CFLAGS = $(COVERAGE_CFLAGS)

680

681 682
libexec_PROGRAMS =

683
if WITH_STORAGE_DISK
R
Richard W.M. Jones 已提交
684
if WITH_LIBVIRTD
685
libexec_PROGRAMS += libvirt_parthelper
686

687
libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
688 689 690
libvirt_parthelper_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDCFLAGS)
libvirt_parthelper_LDADD = $(LIBPARTED_LIBS)
libvirt_parthelper_CFLAGS =  $(LIBPARTED_CFLAGS)
R
Richard W.M. Jones 已提交
691
endif
692
endif
693 694
EXTRA_DIST += $(STORAGE_HELPER_DISK_SOURCES)

695

696 697 698 699 700 701
if WITH_LXC
if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_lxc

libvirt_lxc_SOURCES =						\
		$(LXC_CONTROLLER_SOURCES)			\
702
		$(UTIL_SOURCES)					\
703
		$(DOMAIN_CONF_SOURCES)
704
libvirt_lxc_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDCFLAGS) $(CAPNG_LIBS)
705
libvirt_lxc_LDADD = $(LIBXML_LIBS) $(NUMACTL_LIBS) ../gnulib/lib/libgnu.la
706
libvirt_lxc_CFLAGS =  $(LIBPARTED_CFLAGS) $(NUMACTL_CFLAGS) $(CAPNG_CFLAGS)
707 708 709 710
endif
endif
EXTRA_DIST += $(LXC_CONTROLLER_SOURCES)

711
install-data-local:
712 713 714 715 716 717
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
if WITH_QEMU
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu"
718
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu"
719
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu"
720 721 722 723 724 725 726 727 728 729 730 731 732 733
endif
if WITH_LXC
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lxc"
endif
if WITH_UML
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/uml"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/uml"
endif
if WITH_NETWORK
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/iptables/filter"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/iptables/nat"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/network"
734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753
	$(MKDIR_P) "$(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart"
	$(INSTALL_DATA) $(srcdir)/network/default.xml \
	  $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/default.xml
	test -z "$(UUID)" || \
	  sed -i -e "s,</name>,</name>\n  <uuid>$(UUID)</uuid>," \
	    $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/default.xml
	test -e $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml || \
           ln -s ../default.xml \
	    $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml
endif

uninstall-local::
	rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||:
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" ||:
754
endif
755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773
if WITH_LXC
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||:
endif
if WITH_UML
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/uml" ||:
endif
if WITH_NETWORK
	rm -f $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml
	rm -f $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/default.xml
	rmdir "$(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart" || :
	rmdir "$(DESTDIR)$(sysconfdir)/libvirt/qemu/networks" || :
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/iptables/filter" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/iptables/nat" ||:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||:
endif
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt" ||:
R
Richard W.M. Jones 已提交
774

775
CLEANFILES = *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.i *.s
776
DISTCLEANFILES = $(BUILT_SOURCES)