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

3
## Copyright (C) 2005-2012 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 40
	libvirtd.sasl					\
	libvirtd.sysconf				\
E
Eric Blake 已提交
41
	libvirtd.sysctl					\
42
	libvirtd.aug                                    \
43
	libvirtd.logrotate.in                           \
44 45 46
	libvirtd.qemu.logrotate.in                      \
	libvirtd.lxc.logrotate.in                       \
	libvirtd.uml.logrotate.in                       \
47
	test_libvirtd.aug.in                             \
48
	THREADS.txt					\
49
	libvirtd.pod.in					\
50
	libvirtd.8.in					\
51
	$(DAEMON_SOURCES)
52

53
BUILT_SOURCES =
54

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

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

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

68 69
if WITH_LIBVIRTD

70
man8_MANS = libvirtd.8
71

72 73 74 75
sbin_PROGRAMS = libvirtd

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

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

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

83 84
CLEANFILES += test_libvirtd.aug

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

92
libvirtd_SOURCES = $(DAEMON_SOURCES)
93

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

221 222
BUILT_SOURCES += $(LOGROTATE_CONFS)

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

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

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

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

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

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

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

275
if WITH_SYSCTL
276
install-sysctl:
277
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysctl.d
E
Eric Blake 已提交
278 279
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \
	  $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
280

281 282
uninstall-sysctl:
	rm -f $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
283
	rmdir $(DESTDIR)$(sysconfdir)/sysctl.d || :
284 285 286 287
else
install-sysctl:
uninstall-sysctl:
endif
288 289

if LIBVIRT_INIT_SCRIPT_RED_HAT
D
Daniel P. Berrange 已提交
290

291
BUILT_SOURCES += libvirtd.init
292

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


if LIBVIRT_INIT_SCRIPT_UPSTART

install-init-upstart: install-sysconfig
310
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/event.d
311 312 313 314 315
	$(INSTALL_SCRIPT) libvirtd.upstart \
	  $(DESTDIR)$(sysconfdir)/event.d/libvirtd

uninstall-init-upstart: uninstall-sysconfig
	rm -f $(DESTDIR)$(sysconfdir)/event.d/libvirtd
316
	rmdir $(DESTDIR)$(sysconfdir)/event.d || :
317 318 319 320 321 322 323 324 325 326 327 328 329
else
install-init-upstart:
uninstall-init-upstart:
endif # LIBVIRT_INIT_SCRIPT_UPSTART


EXTRA_DIST += libvirtd.service.in
if LIBVIRT_INIT_SCRIPT_SYSTEMD

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

install-init-systemd: install-sysconfig libvirtd.service
330
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
331
	$(INSTALL_DATA) libvirtd.service \
332 333 334 335
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service

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

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

351 352
libvirtd.service: libvirtd.service.in $(top_builddir)/config.status
	$(AM_V_GEN)sed					\
353 354 355
	    -e s!\@localstatedir\@!$(localstatedir)!g	\
	    -e s!\@sbindir\@!$(sbindir)!g		\
	    -e s!\@sysconfdir\@!$(sysconfdir)!g		\
356 357 358 359 360
	    < $< > $@-t &&				\
	    chmod a+x $@-t &&				\
	    mv $@-t $@


361 362
check-local: check-augeas

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

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

373

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

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

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

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

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

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


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