Makefile.am 11.3 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 20
		$(srcdir)/remote_dispatch.h		\
		$(srcdir)/qemu_dispatch.h
21 22 23

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

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

54
BUILT_SOURCES =
55

56 57 58
REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x
QEMU_PROTOCOL = $(top_srcdir)/src/remote/qemu_protocol.x

59
$(srcdir)/remote_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
60
		$(REMOTE_PROTOCOL)
61
	$(AM_V_GEN)$(PERL) -w $(srcdir)/../src/rpc/gendispatch.pl -b remote REMOTE \
62 63
	  $(REMOTE_PROTOCOL) > $@

64
$(srcdir)/qemu_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
65
		$(QEMU_PROTOCOL)
66
	$(AM_V_GEN)$(PERL) -w $(srcdir)/../src/rpc/gendispatch.pl -b qemu QEMU \
67 68
	  $(QEMU_PROTOCOL) > $@

69 70
if WITH_LIBVIRTD

71
man8_MANS = libvirtd.8
72

73 74 75 76
sbin_PROGRAMS = libvirtd

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

78
augeasdir = $(datadir)/augeas/lenses
79
augeas_DATA = libvirtd.aug
80 81

augeastestsdir = $(datadir)/augeas/lenses/tests
82
augeastests_DATA = test_libvirtd.aug
83

84 85
CLEANFILES += test_libvirtd.aug

86
libvirtd.8: $(srcdir)/libvirtd.8.in
87
	$(AM_V_GEN)sed \
88 89
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
90
	    < $< > $@-t && \
91 92
	mv $@-t $@

93
libvirtd_SOURCES = $(DAEMON_SOURCES)
94

D
Daniel P. Berrange 已提交
95
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
96
libvirtd_CFLAGS = \
97
	$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
D
Doug Goldstein 已提交
98
	$(XDR_CFLAGS) $(POLKIT_CFLAGS) $(DBUS_CFLAGS) $(LIBNL_CFLAGS) \
99
	$(WARN_CFLAGS) \
100
	$(COVERAGE_CFLAGS) \
101
	-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\""
102

E
Eric Blake 已提交
103 104
libvirtd_LDFLAGS =					\
	$(WARN_CFLAGS)					\
105
	$(COVERAGE_LDFLAGS)
106

107
libvirtd_LDADD =					\
108 109 110
	$(LIBXML_LIBS)					\
	$(GNUTLS_LIBS)					\
	$(SASL_LIBS)					\
111
	$(DBUS_LIBS)					\
D
Doug Goldstein 已提交
112 113
	$(POLKIT_LIBS)					\
	$(LIBNL_LIBS)
114

115
if WITH_DTRACE_PROBES
116
libvirtd_LDADD += ../src/libvirt_probes.lo
117 118
endif

119 120
libvirtd_LDADD += \
	../src/libvirt-qemu.la
C
Chris Lalancette 已提交
121

122
if ! WITH_DRIVER_MODULES
123
if WITH_QEMU
124
    libvirtd_LDADD += ../src/libvirt_driver_qemu.la
125
if WITH_DTRACE_PROBES
126
    libvirtd_LDADD += ../src/libvirt_qemu_probes.lo
127
endif
128
endif
129

130
if WITH_LXC
131
    libvirtd_LDADD += ../src/libvirt_driver_lxc.la
132
endif
133

134 135 136 137
if WITH_XEN
    libvirtd_LDADD += ../src/libvirt_driver_xen.la
endif

J
Jim Fehlig 已提交
138 139 140 141
if WITH_LIBXL
    libvirtd_LDADD += ../src/libvirt_driver_libxl.la
endif

142
if WITH_UML
143
    libvirtd_LDADD += ../src/libvirt_driver_uml.la
144
endif
145

146
if WITH_STORAGE
147
    libvirtd_LDADD += ../src/libvirt_driver_storage.la
148
endif
149

150
if WITH_NETWORK
151
    libvirtd_LDADD += ../src/libvirt_driver_network.la
152
endif
153

154
if WITH_INTERFACE
155 156 157
    libvirtd_LDADD += ../src/libvirt_driver_interface.la
endif

158
if WITH_NODE_DEVICES
159
    libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
160
endif
161 162 163 164

if WITH_SECRETS
    libvirtd_LDADD += ../src/libvirt_driver_secret.la
endif
165 166 167 168

if WITH_NWFILTER
    libvirtd_LDADD += ../src/libvirt_driver_nwfilter.la
endif
169
endif
170 171

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

173 174
if WITH_POLKIT
if WITH_POLKIT0
175
policydir = $(datadir)/PolicyKit/policy
C
Cole Robinson 已提交
176
policyauth = auth_admin_keep_session
177 178
else
policydir = $(datadir)/polkit-1/actions
C
Cole Robinson 已提交
179
policyauth = auth_admin_keep
180
endif
181 182
endif

C
Cole Robinson 已提交
183 184
libvirtd.policy: libvirtd.policy.in $(top_builddir)/config.status
	$(AM_V_GEN) sed \
185
	    -e 's|[@]authaction[@]|$(policyauth)|g' \
C
Cole Robinson 已提交
186 187 188 189
	    < $< > $@-t && \
	mv $@-t $@
BUILT_SOURCES += libvirtd.policy

190 191 192
install-data-local: install-init-redhat install-init-systemd install-init-upstart \
		install-data-sasl install-data-polkit \
		install-logrotate install-sysctl
193 194 195
	$(MKDIR_P) $(DESTDIR)$(localstatedir)/log/libvirt \
		   $(DESTDIR)$(localstatedir)/run/libvirt \
		   $(DESTDIR)$(localstatedir)/lib/libvirt
196

197 198
uninstall-local:: uninstall-init-redhat uninstall-init-systemd uninstall-init-upstart \
		uninstall-data-sasl uninstall-data-polkit \
199
		uninstall-logrotate uninstall-sysctl
200
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
201
	rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
202
	rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
203

204
if WITH_POLKIT
205
install-data-polkit::
206
	$(MKDIR_P) $(DESTDIR)$(policydir)
C
Cole Robinson 已提交
207
	$(INSTALL_DATA) libvirtd.policy $(DESTDIR)$(policydir)/org.libvirt.unix.policy
208
uninstall-data-polkit::
209
	rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
210
	rmdir $(DESTDIR)$(policydir) || :
211 212 213 214 215
else
install-data-polkit::
uninstall-data-polkit::
endif

216 217
remote.c: $(DAEMON_GENERATED)
remote.h: $(DAEMON_GENERATED)
218

219
LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
220
		  libvirtd.uml.logrotate libvirtd.logrotate
221

222 223
BUILT_SOURCES += $(LOGROTATE_CONFS)

224
libvirtd.logrotate: libvirtd.logrotate.in
225
	$(AM_V_GEN)sed						\
226
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
227
	    < $< > $@-t && \
228 229
	mv $@-t $@

230
libvirtd.qemu.logrotate: libvirtd.qemu.logrotate.in
231
	$(AM_V_GEN)sed						\
232
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
233
	    < $< > $@-t && \
234 235 236
	mv $@-t $@

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

libvirtd.uml.logrotate: libvirtd.uml.logrotate.in
243
	$(AM_V_GEN)sed						\
244
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
245 246
	    < $< > $@-t &&					\
	    mv $@-t $@
G
Guido Günther 已提交
247

248
install-logrotate: $(LOGROTATE_CONFS)
249 250 251 252
	$(MKDIR_P) $(DESTDIR)$(localstatedir)/log/libvirt/qemu/ \
		   $(DESTDIR)$(localstatedir)/log/libvirt/lxc/ \
		   $(DESTDIR)$(localstatedir)/log/libvirt/uml/ \
		   $(DESTDIR)$(sysconfdir)/logrotate.d/
253
	$(INSTALL_DATA) libvirtd.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd
254 255 256
	$(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 已提交
257

258 259 260 261 262 263 264 265 266 267
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 || :

268
install-sysconfig:
269
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
270
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysconf \
J
Jim Meyering 已提交
271
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
272 273
uninstall-sysconfig:
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
274
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
275

276
if WITH_SYSCTL
277 278
# Use $(prefix)/lib rather than $(libdir), since man sysctl.d insists on
# /usr/lib/sysctl.d/ even when libdir is /usr/lib64
279
install-sysctl:
280
	$(MKDIR_P) $(DESTDIR)$(prefix)/lib/sysctl.d
E
Eric Blake 已提交
281
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \
282
	  $(DESTDIR)$(prefix)/lib/sysctl.d/libvirtd.conf
283

284
uninstall-sysctl:
285 286
	rm -f $(DESTDIR)$(prefix)/lib/sysctl.d/libvirtd.conf
	rmdir $(DESTDIR)$(prefix)/lib/sysctl.d || :
287 288 289 290
else
install-sysctl:
uninstall-sysctl:
endif
291 292

if LIBVIRT_INIT_SCRIPT_RED_HAT
D
Daniel P. Berrange 已提交
293

294
BUILT_SOURCES += libvirtd.init
295

296
install-init-redhat: install-sysconfig libvirtd.init
297
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
298 299 300 301 302
	$(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
303
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
304 305 306 307 308 309 310 311 312
else
install-init-redhat:
uninstall-init-redhat:
endif # LIBVIRT_INIT_SCRIPT_RED_HAT


if LIBVIRT_INIT_SCRIPT_UPSTART

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

uninstall-init-upstart: uninstall-sysconfig
	rm -f $(DESTDIR)$(sysconfdir)/event.d/libvirtd
319
	rmdir $(DESTDIR)$(sysconfdir)/event.d || :
320 321 322 323 324 325 326 327 328 329 330 331
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
332
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
333
	$(INSTALL_DATA) libvirtd.service \
334 335 336 337
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service

uninstall-init-systemd: uninstall-sysconfig
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service
338
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
339 340 341 342 343
else
install-init-systemd:
uninstall-init-systemd:
endif # LIBVIRT_INIT_SCRIPT_SYSTEMD

344
libvirtd.init: libvirtd.init.in $(top_builddir)/config.status
345 346 347 348 349 350
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g'		\
	    < $< > $@-t &&					\
	    chmod a+x $@-t &&					\
351
	    mv $@-t $@
D
Daniel P. Berrange 已提交
352

353
libvirtd.service: libvirtd.service.in $(top_builddir)/config.status
354 355 356 357 358
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g'		\
	    < $< > $@-t &&					\
359 360 361
	    mv $@-t $@


362 363
check-local: check-augeas

364 365 366 367
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 $< $@
368 369

check-augeas: test_libvirtd.aug
370
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
371
	  '$(AUGPARSE)' -I $(srcdir) test_libvirtd.aug; \
372
	fi
373

374

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

379 380 381
else # WITH_LIBVIRTD
install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl
382
endif # WITH_LIBVIRTD
383

384 385 386 387
POD2MAN = pod2man -c "Virtualization Support" \
			-r "$(PACKAGE)-$(VERSION)" -s 8

$(srcdir)/libvirtd.8.in: libvirtd.pod.in
E
Eric Blake 已提交
388 389
	$(AM_V_GEN)$(POD2MAN) --name LIBVIRTD $< $@ \
	    && if grep 'POD ERROR' $@ ; then rm $@; exit 1; fi
390

391 392
# This is needed for clients too, so can't wrap in
# the WITH_LIBVIRTD conditional
393
if WITH_SASL
394
install-data-sasl:
395
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sasl2/
396 397 398 399
	$(INSTALL_DATA) $(srcdir)/libvirtd.sasl $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf

uninstall-data-sasl:
	rm -f $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
D
Dave Allan 已提交
400
	rmdir $(DESTDIR)$(sysconfdir)/sasl2/ || :
D
Daniel P. Berrange 已提交
401 402 403
else
install-data-sasl:
uninstall-data-sasl:
404 405 406
endif


407
CLEANFILES += $(BUILT_SOURCES) $(man8_MANS)
408
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
409
MAINTAINERCLEANFILES = $(srcdir)/libvirtd.8.in $(DAEMON_GENERATED)