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

3
## Copyright (C) 2005-2013 Red Hat, Inc.
4 5
## See COPYING.LIB for the License of this software

6
INCLUDES = \
7 8 9
	-I$(top_builddir)/gnulib/lib -I$(top_srcdir)/gnulib/lib \
	-I$(top_builddir)/include -I$(top_srcdir)/include \
	-I$(top_builddir)/src -I$(top_srcdir)/src \
10 11 12 13 14 15
	-I$(top_srcdir)/src/util \
	-I$(top_srcdir)/src/conf \
	-I$(top_srcdir)/src/rpc \
	-I$(top_srcdir)/src/remote \
	$(GETTEXT_CPPFLAGS)

16 17
CLEANFILES =

18
DAEMON_GENERATED =					\
19
		$(srcdir)/remote_dispatch.h		\
20 21 22
		$(srcdir)/lxc_dispatch.h		\
		$(srcdir)/qemu_dispatch.h		\
		$(NULL)
23 24 25

DAEMON_SOURCES =					\
		libvirtd.c libvirtd.h			\
26
		libvirtd-config.c libvirtd-config.h	\
27 28
		remote.c remote.h			\
		stream.c stream.h			\
C
Chris Lalancette 已提交
29
		../src/remote/remote_protocol.c		\
30
		../src/remote/lxc_protocol.c		\
31 32
		../src/remote/qemu_protocol.c		\
		$(DAEMON_GENERATED)
33

34
DISTCLEANFILES =
35
EXTRA_DIST =						\
36
	remote_dispatch.h				\
37
	lxc_dispatch.h					\
38
	qemu_dispatch.h					\
39 40
	libvirtd.conf					\
	libvirtd.init.in				\
A
Alan Pevec 已提交
41
	libvirtd.upstart				\
C
Cole Robinson 已提交
42
	libvirtd.policy.in				\
43
	libvirtd.sasl					\
44
	libvirtd.service.in				\
45
	libvirtd.sysconf				\
E
Eric Blake 已提交
46
	libvirtd.sysctl					\
47
	libvirtd.aug                                    \
48
	libvirtd.logrotate.in                           \
49 50 51
	libvirtd.qemu.logrotate.in                      \
	libvirtd.lxc.logrotate.in                       \
	libvirtd.uml.logrotate.in                       \
52
	test_libvirtd.aug.in                             \
53
	THREADS.txt					\
54
	libvirtd.pod.in					\
55
	libvirtd.8.in					\
56
	$(DAEMON_SOURCES)
57

58
BUILT_SOURCES =
59

60
REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x
61
LXC_PROTOCOL = $(top_srcdir)/src/remote/lxc_protocol.x
62 63
QEMU_PROTOCOL = $(top_srcdir)/src/remote/qemu_protocol.x

64
$(srcdir)/remote_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
65
		$(REMOTE_PROTOCOL)
66 67
	$(AM_V_GEN)$(PERL) -w $(srcdir)/../src/rpc/gendispatch.pl \
	  --mode=server remote REMOTE $(REMOTE_PROTOCOL) > $@
68

69 70
$(srcdir)/lxc_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
		$(LXC_PROTOCOL)
71 72
	$(AM_V_GEN)$(PERL) -w $(srcdir)/../src/rpc/gendispatch.pl \
	  --mode=server lxc LXC $(LXC_PROTOCOL) > $@
73

74
$(srcdir)/qemu_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
75
		$(QEMU_PROTOCOL)
76 77
	$(AM_V_GEN)$(PERL) -w $(srcdir)/../src/rpc/gendispatch.pl \
	  --mode=server qemu QEMU $(QEMU_PROTOCOL) > $@
78

79 80
if WITH_LIBVIRTD

81
man8_MANS = libvirtd.8
82

83 84 85 86
sbin_PROGRAMS = libvirtd

confdir = $(sysconfdir)/libvirt/
conf_DATA = libvirtd.conf
87

88
augeasdir = $(datadir)/augeas/lenses
89
augeas_DATA = libvirtd.aug
90 91

augeastestsdir = $(datadir)/augeas/lenses/tests
92
augeastests_DATA = test_libvirtd.aug
93

94 95
CLEANFILES += test_libvirtd.aug

96
libvirtd.8: $(srcdir)/libvirtd.8.in
97
	$(AM_V_GEN)sed \
98 99
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
100
	    < $< > $@-t && \
101 102
	mv $@-t $@

103
libvirtd_SOURCES = $(DAEMON_SOURCES)
104

D
Daniel P. Berrange 已提交
105
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
106
libvirtd_CFLAGS = \
107
	$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
D
Doug Goldstein 已提交
108
	$(XDR_CFLAGS) $(POLKIT_CFLAGS) $(DBUS_CFLAGS) $(LIBNL_CFLAGS) \
D
Daniel P. Berrange 已提交
109
	$(WARN_CFLAGS) $(PIE_CFLAGS) \
110
	$(COVERAGE_CFLAGS) \
111
	-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\""
112

E
Eric Blake 已提交
113
libvirtd_LDFLAGS =					\
D
Daniel P. Berrange 已提交
114
	$(PIE_LDFLAGS)					\
D
Daniel P. Berrange 已提交
115
	$(RELRO_LDFLAGS)				\
116
	$(COVERAGE_LDFLAGS)
117

118
libvirtd_LDADD =					\
119 120 121
	$(LIBXML_LIBS)					\
	$(GNUTLS_LIBS)					\
	$(SASL_LIBS)					\
122
	$(DBUS_LIBS)					\
D
Doug Goldstein 已提交
123 124
	$(POLKIT_LIBS)					\
	$(LIBNL_LIBS)
125

126
if WITH_DTRACE_PROBES
127
libvirtd_LDADD += ../src/libvirt_probes.lo
128 129
endif

130
libvirtd_LDADD += \
131
	../src/libvirt-lxc.la \
132
	../src/libvirt-qemu.la
C
Chris Lalancette 已提交
133

134
if ! WITH_DRIVER_MODULES
135
if WITH_QEMU
136
    libvirtd_LDADD += ../src/libvirt_driver_qemu.la
137
if WITH_DTRACE_PROBES
138
    libvirtd_LDADD += ../src/libvirt_qemu_probes.lo
139
endif
140
endif
141

142
if WITH_LXC
143
    libvirtd_LDADD += ../src/libvirt_driver_lxc.la
144
endif
145

146 147 148 149
if WITH_XEN
    libvirtd_LDADD += ../src/libvirt_driver_xen.la
endif

J
Jim Fehlig 已提交
150 151 152 153
if WITH_LIBXL
    libvirtd_LDADD += ../src/libvirt_driver_libxl.la
endif

154
if WITH_UML
155
    libvirtd_LDADD += ../src/libvirt_driver_uml.la
156
endif
157

J
Jiri Denemark 已提交
158 159 160 161
if WITH_VBOX
    libvirtd_LDADD += ../src/libvirt_driver_vbox.la
endif

162
if WITH_STORAGE
163
    libvirtd_LDADD += ../src/libvirt_driver_storage.la
164
endif
165

166
if WITH_NETWORK
167
    libvirtd_LDADD += ../src/libvirt_driver_network.la
168
endif
169

170
if WITH_INTERFACE
171 172 173
    libvirtd_LDADD += ../src/libvirt_driver_interface.la
endif

174
if WITH_NODE_DEVICES
175
    libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
176
endif
177 178 179 180

if WITH_SECRETS
    libvirtd_LDADD += ../src/libvirt_driver_secret.la
endif
181 182 183 184

if WITH_NWFILTER
    libvirtd_LDADD += ../src/libvirt_driver_nwfilter.la
endif
185
endif
186 187

libvirtd_LDADD += ../src/libvirt.la
D
Daniel P. Berrange 已提交
188

189 190
if WITH_POLKIT
if WITH_POLKIT0
191
policydir = $(datadir)/PolicyKit/policy
C
Cole Robinson 已提交
192
policyauth = auth_admin_keep_session
193 194
else
policydir = $(datadir)/polkit-1/actions
C
Cole Robinson 已提交
195
policyauth = auth_admin_keep
196
endif
197 198
endif

C
Cole Robinson 已提交
199 200
libvirtd.policy: libvirtd.policy.in $(top_builddir)/config.status
	$(AM_V_GEN) sed \
201
	    -e 's|[@]authaction[@]|$(policyauth)|g' \
C
Cole Robinson 已提交
202 203 204 205
	    < $< > $@-t && \
	mv $@-t $@
BUILT_SOURCES += libvirtd.policy

206 207 208
install-data-local: install-init-redhat install-init-systemd install-init-upstart \
		install-data-sasl install-data-polkit \
		install-logrotate install-sysctl
209 210 211
	$(MKDIR_P) $(DESTDIR)$(localstatedir)/log/libvirt \
		   $(DESTDIR)$(localstatedir)/run/libvirt \
		   $(DESTDIR)$(localstatedir)/lib/libvirt
212

213 214
uninstall-local:: uninstall-init-redhat uninstall-init-systemd uninstall-init-upstart \
		uninstall-data-sasl uninstall-data-polkit \
215
		uninstall-logrotate uninstall-sysctl
216
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
217
	rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
218
	rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
219

220
if WITH_POLKIT
221
install-data-polkit::
222
	$(MKDIR_P) $(DESTDIR)$(policydir)
C
Cole Robinson 已提交
223
	$(INSTALL_DATA) libvirtd.policy $(DESTDIR)$(policydir)/org.libvirt.unix.policy
224
uninstall-data-polkit::
225
	rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
226
	rmdir $(DESTDIR)$(policydir) || :
227 228 229 230 231
else
install-data-polkit::
uninstall-data-polkit::
endif

232 233
remote.c: $(DAEMON_GENERATED)
remote.h: $(DAEMON_GENERATED)
234

235
LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
236
		  libvirtd.uml.logrotate libvirtd.logrotate
237

238 239
BUILT_SOURCES += $(LOGROTATE_CONFS)

240
libvirtd.logrotate: libvirtd.logrotate.in
241
	$(AM_V_GEN)sed						\
242
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
243
	    < $< > $@-t && \
244 245
	mv $@-t $@

246
libvirtd.qemu.logrotate: libvirtd.qemu.logrotate.in
247
	$(AM_V_GEN)sed						\
248
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
249
	    < $< > $@-t && \
250 251 252
	mv $@-t $@

libvirtd.lxc.logrotate: libvirtd.lxc.logrotate.in
253
	$(AM_V_GEN)sed						\
254
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
255 256
	    < $< > $@-t &&					\
	    mv $@-t $@
257 258

libvirtd.uml.logrotate: libvirtd.uml.logrotate.in
259
	$(AM_V_GEN)sed						\
260
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
261 262
	    < $< > $@-t &&					\
	    mv $@-t $@
G
Guido Günther 已提交
263

264
install-logrotate: $(LOGROTATE_CONFS)
265 266 267 268
	$(MKDIR_P) $(DESTDIR)$(localstatedir)/log/libvirt/qemu/ \
		   $(DESTDIR)$(localstatedir)/log/libvirt/lxc/ \
		   $(DESTDIR)$(localstatedir)/log/libvirt/uml/ \
		   $(DESTDIR)$(sysconfdir)/logrotate.d/
269
	$(INSTALL_DATA) libvirtd.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd
270 271 272
	$(INSTALL_DATA) libvirtd.qemu.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.qemu
	$(INSTALL_DATA) libvirtd.lxc.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.lxc
	$(INSTALL_DATA) libvirtd.uml.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.uml
G
Guido Günther 已提交
273

274 275 276 277 278 279 280 281 282 283
uninstall-logrotate:
	rm -f $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd \
	      $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.qemu \
	      $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.lxc \
	      $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.uml
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt/qemu || :
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt/lxc || :
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt/uml || :
	rmdir $(DESTDIR)$(sysconfdir)/logrotate.d || :

284
install-sysconfig:
285
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
286
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysconf \
J
Jim Meyering 已提交
287
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
288 289
uninstall-sysconfig:
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
290
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
291

292
if WITH_SYSCTL
293 294
# Use $(prefix)/lib rather than $(libdir), since man sysctl.d insists on
# /usr/lib/sysctl.d/ even when libdir is /usr/lib64
295
install-sysctl:
296
	$(MKDIR_P) $(DESTDIR)$(prefix)/lib/sysctl.d
E
Eric Blake 已提交
297
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \
298
	  $(DESTDIR)$(prefix)/lib/sysctl.d/libvirtd.conf
299

300
uninstall-sysctl:
301 302
	rm -f $(DESTDIR)$(prefix)/lib/sysctl.d/libvirtd.conf
	rmdir $(DESTDIR)$(prefix)/lib/sysctl.d || :
303 304 305 306
else
install-sysctl:
uninstall-sysctl:
endif
307 308

if LIBVIRT_INIT_SCRIPT_RED_HAT
D
Daniel P. Berrange 已提交
309

310
BUILT_SOURCES += libvirtd.init
311

312
install-init-redhat: install-sysconfig libvirtd.init
313
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
314 315 316 317 318
	$(INSTALL_SCRIPT) libvirtd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd

uninstall-init-redhat: uninstall-sysconfig
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
319
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
320 321 322 323 324 325 326 327 328
else
install-init-redhat:
uninstall-init-redhat:
endif # LIBVIRT_INIT_SCRIPT_RED_HAT


if LIBVIRT_INIT_SCRIPT_UPSTART

install-init-upstart: install-sysconfig
329
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/event.d
330 331 332 333 334
	$(INSTALL_SCRIPT) libvirtd.upstart \
	  $(DESTDIR)$(sysconfdir)/event.d/libvirtd

uninstall-init-upstart: uninstall-sysconfig
	rm -f $(DESTDIR)$(sysconfdir)/event.d/libvirtd
335
	rmdir $(DESTDIR)$(sysconfdir)/event.d || :
336 337 338 339 340 341 342 343 344 345 346 347
else
install-init-upstart:
uninstall-init-upstart:
endif # LIBVIRT_INIT_SCRIPT_UPSTART


if LIBVIRT_INIT_SCRIPT_SYSTEMD

SYSTEMD_UNIT_DIR = /lib/systemd/system
BUILT_SOURCES += libvirtd.service

install-init-systemd: install-sysconfig libvirtd.service
348
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
349
	$(INSTALL_DATA) libvirtd.service \
350 351 352 353
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service

uninstall-init-systemd: uninstall-sysconfig
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service
354
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
355 356 357 358 359
else
install-init-systemd:
uninstall-init-systemd:
endif # LIBVIRT_INIT_SCRIPT_SYSTEMD

360
libvirtd.init: libvirtd.init.in $(top_builddir)/config.status
361 362 363 364 365 366
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g'		\
	    < $< > $@-t &&					\
	    chmod a+x $@-t &&					\
367
	    mv $@-t $@
D
Daniel P. Berrange 已提交
368

369
libvirtd.service: libvirtd.service.in $(top_builddir)/config.status
370 371 372 373 374
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g'		\
	    < $< > $@-t &&					\
375 376 377
	    mv $@-t $@


378 379
check-local: check-augeas

380 381 382 383
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl

test_libvirtd.aug: test_libvirtd.aug.in $(srcdir)/libvirtd.conf
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/libvirtd.conf $< $@
384 385

check-augeas: test_libvirtd.aug
386
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
387
	  '$(AUGPARSE)' -I $(srcdir) test_libvirtd.aug; \
388
	fi
389

390

391 392
# This must be added last, since functions it provides/replaces
# are used by nearly every other library.
J
John Levon 已提交
393
libvirtd_LDADD += ../gnulib/lib/libgnu.la $(LIBSOCKET)
394

395 396 397
else # WITH_LIBVIRTD
install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl
398
endif # WITH_LIBVIRTD
399

400 401 402
POD2MAN = pod2man -c "Virtualization Support" \
			-r "$(PACKAGE)-$(VERSION)" -s 8

403
$(srcdir)/libvirtd.8.in: libvirtd.pod.in $(top_srcdir)/configure.ac
E
Eric Blake 已提交
404 405
	$(AM_V_GEN)$(POD2MAN) --name LIBVIRTD $< $@ \
	    && if grep 'POD ERROR' $@ ; then rm $@; exit 1; fi
406

407 408
# This is needed for clients too, so can't wrap in
# the WITH_LIBVIRTD conditional
409
if WITH_SASL
410
install-data-sasl:
411
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sasl2/
412 413 414 415
	$(INSTALL_DATA) $(srcdir)/libvirtd.sasl $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf

uninstall-data-sasl:
	rm -f $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
D
Dave Allan 已提交
416
	rmdir $(DESTDIR)$(sysconfdir)/sasl2/ || :
D
Daniel P. Berrange 已提交
417 418 419
else
install-data-sasl:
uninstall-data-sasl:
420 421 422
endif


423
CLEANFILES += $(BUILT_SOURCES) $(man8_MANS)
424
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
425
MAINTAINERCLEANFILES = $(srcdir)/libvirtd.8.in $(DAEMON_GENERATED)