Makefile.am 10.9 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				\
38 39
	libvirtd.policy-0				\
	libvirtd.policy-1				\
40 41
	libvirtd.sasl					\
	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
	sed \
88 89
	    -e 's!SYSCONFDIR!$(sysconfdir)!g' \
	    -e 's!LOCALSTATEDIR!$(localstatedir)!g' \
90 91 92
	    < $< > $@-t
	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 155 156 157
if WITH_NETCF
    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
if HAVE_POLKIT
174
if HAVE_POLKIT0
175
policydir = $(datadir)/PolicyKit/policy
176 177 178 179 180
policyfile = libvirtd.policy-0
else
policydir = $(datadir)/polkit-1/actions
policyfile = libvirtd.policy-1
endif
181 182
endif

183 184 185
install-data-local: install-init-redhat install-init-systemd install-init-upstart \
		install-data-sasl install-data-polkit \
		install-logrotate install-sysctl
186 187 188
	$(MKDIR_P) $(DESTDIR)$(localstatedir)/log/libvirt \
		   $(DESTDIR)$(localstatedir)/run/libvirt \
		   $(DESTDIR)$(localstatedir)/lib/libvirt
189

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

197
if HAVE_POLKIT
198
install-data-polkit::
199
	$(MKDIR_P) $(DESTDIR)$(policydir)
200
	$(INSTALL_DATA) $(srcdir)/$(policyfile) $(DESTDIR)$(policydir)/org.libvirt.unix.policy
201
uninstall-data-polkit::
202
	rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
203
	rmdir $(DESTDIR)$(policydir) || :
204 205 206 207 208
else
install-data-polkit::
uninstall-data-polkit::
endif

209 210
remote.c: $(DAEMON_GENERATED)
remote.h: $(DAEMON_GENERATED)
211

212
LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
213
		  libvirtd.uml.logrotate libvirtd.logrotate
214

215 216
BUILT_SOURCES += $(LOGROTATE_CONFS)

217 218 219 220 221 222
libvirtd.logrotate: libvirtd.logrotate.in
	sed							\
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
	    < $< > $@-t
	mv $@-t $@

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

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

libvirtd.uml.logrotate: libvirtd.uml.logrotate.in
236
	$(AM_V_GEN)sed						\
237
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
238 239
	    < $< > $@-t &&					\
	    mv $@-t $@
G
Guido Günther 已提交
240

241
install-logrotate: $(LOGROTATE_CONFS)
242 243 244 245
	$(MKDIR_P) $(DESTDIR)$(localstatedir)/log/libvirt/qemu/ \
		   $(DESTDIR)$(localstatedir)/log/libvirt/lxc/ \
		   $(DESTDIR)$(localstatedir)/log/libvirt/uml/ \
		   $(DESTDIR)$(sysconfdir)/logrotate.d/
246
	$(INSTALL_DATA) libvirtd.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd
247 248 249
	$(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 已提交
250

251 252 253 254 255 256 257 258 259 260
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 || :

261
install-sysconfig:
262
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
263
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysconf \
J
Jim Meyering 已提交
264
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
265 266
uninstall-sysconfig:
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
267
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
268

269
if WITH_SYSCTL
270
install-sysctl:
271
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysctl.d
E
Eric Blake 已提交
272 273
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \
	  $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
274

275 276
uninstall-sysctl:
	rm -f $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
277
	rmdir $(DESTDIR)$(sysconfdir)/sysctl.d || :
278 279 280 281
else
install-sysctl:
uninstall-sysctl:
endif
282 283

if LIBVIRT_INIT_SCRIPT_RED_HAT
D
Daniel P. Berrange 已提交
284

285
BUILT_SOURCES += libvirtd.init
286

287
install-init-redhat: install-sysconfig libvirtd.init
288
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
289 290 291 292 293
	$(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
294
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
295 296 297 298 299 300 301 302 303
else
install-init-redhat:
uninstall-init-redhat:
endif # LIBVIRT_INIT_SCRIPT_RED_HAT


if LIBVIRT_INIT_SCRIPT_UPSTART

install-init-upstart: install-sysconfig
304
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/event.d
305 306 307 308 309
	$(INSTALL_SCRIPT) libvirtd.upstart \
	  $(DESTDIR)$(sysconfdir)/event.d/libvirtd

uninstall-init-upstart: uninstall-sysconfig
	rm -f $(DESTDIR)$(sysconfdir)/event.d/libvirtd
310
	rmdir $(DESTDIR)$(sysconfdir)/event.d || :
311 312 313 314 315 316 317 318 319 320 321 322 323
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
324
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
325
	$(INSTALL_DATA) libvirtd.service \
326 327 328 329
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service

uninstall-init-systemd: uninstall-sysconfig
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service
330
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
331 332 333 334 335
else
install-init-systemd:
uninstall-init-systemd:
endif # LIBVIRT_INIT_SCRIPT_SYSTEMD

336
libvirtd.init: libvirtd.init.in $(top_builddir)/config.status
337
	$(AM_V_GEN)sed					\
338 339 340
	    -e s!\@localstatedir\@!$(localstatedir)!g	\
	    -e s!\@sbindir\@!$(sbindir)!g		\
	    -e s!\@sysconfdir\@!$(sysconfdir)!g		\
341 342 343
	    < $< > $@-t &&				\
	    chmod a+x $@-t &&				\
	    mv $@-t $@
D
Daniel P. Berrange 已提交
344

345 346
libvirtd.service: libvirtd.service.in $(top_builddir)/config.status
	$(AM_V_GEN)sed					\
347 348 349
	    -e s!\@localstatedir\@!$(localstatedir)!g	\
	    -e s!\@sbindir\@!$(sbindir)!g		\
	    -e s!\@sysconfdir\@!$(sysconfdir)!g		\
350 351 352 353 354
	    < $< > $@-t &&				\
	    chmod a+x $@-t &&				\
	    mv $@-t $@


355 356
check-local: check-augeas

357 358 359 360
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 $< $@
361 362

check-augeas: test_libvirtd.aug
363
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
364
	  '$(AUGPARSE)' -I $(srcdir) test_libvirtd.aug; \
365
	fi
366

367

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

372 373 374
else # WITH_LIBVIRTD
install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl
375
endif # WITH_LIBVIRTD
376

377 378 379 380
POD2MAN = pod2man -c "Virtualization Support" \
			-r "$(PACKAGE)-$(VERSION)" -s 8

$(srcdir)/libvirtd.8.in: libvirtd.pod.in
381
	$(AM_V_GEN)$(POD2MAN) --name LIBVIRTD $< $@
382

383 384 385 386
# This is needed for clients too, so can't wrap in
# the WITH_LIBVIRTD conditional
if HAVE_SASL
install-data-sasl:
387
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sasl2/
388 389 390 391
	$(INSTALL_DATA) $(srcdir)/libvirtd.sasl $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf

uninstall-data-sasl:
	rm -f $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
D
Dave Allan 已提交
392
	rmdir $(DESTDIR)$(sysconfdir)/sasl2/ || :
D
Daniel P. Berrange 已提交
393 394 395
else
install-data-sasl:
uninstall-data-sasl:
396 397 398
endif


399
CLEANFILES += $(BUILT_SOURCES) $(man8_MANS)
400
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
401
MAINTAINERCLEANFILES = $(srcdir)/libvirtd.8.in $(DAEMON_GENERATED)