Makefile.am 10.4 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 24 25

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

30
DISTCLEANFILES =
31
EXTRA_DIST =						\
32 33
	remote_dispatch.h				\
	qemu_dispatch.h					\
34 35
	libvirtd.conf					\
	libvirtd.init.in				\
A
Alan Pevec 已提交
36
	libvirtd.upstart				\
37 38
	libvirtd.policy-0				\
	libvirtd.policy-1				\
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                               \
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 \
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 \
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
libvirtd.8: $(srcdir)/libvirtd.8.in
84 85 86 87 88 89 90
	sed \
	    -e 's![@]sysconfdir[@]!$(sysconfdir)!g' \
	    -e 's![@]localstatedir[@]!$(localstatedir)!g' \
	    -e 's![@]remote_pid_file[@]!$(REMOTE_PID_FILE)!g' \
	    < $< > $@-t
	mv $@-t $@

91
libvirtd_SOURCES = $(DAEMON_SOURCES)
92

D
Daniel P. Berrange 已提交
93
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
94
libvirtd_CFLAGS = \
95
	$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
96
	$(XDR_CFLAGS) $(POLKIT_CFLAGS) \
97
	$(WARN_CFLAGS) \
98
	$(COVERAGE_CFLAGS) \
99
	-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\"" \
100
	-DREMOTE_PID_FILE="\"$(REMOTE_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
	$(POLKIT_LIBS)
111

112 113 114 115
if WITH_DTRACE
libvirtd_LDADD += ../src/probes.o
endif

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

119
if ! WITH_DRIVER_MODULES
120
if WITH_QEMU
121
    libvirtd_LDADD += ../src/libvirt_driver_qemu.la
122
endif
123

124
if WITH_LXC
125
    libvirtd_LDADD += ../src/libvirt_driver_lxc.la
126
endif
127

J
Jim Fehlig 已提交
128 129 130 131
if WITH_LIBXL
    libvirtd_LDADD += ../src/libvirt_driver_libxl.la
endif

132
if WITH_UML
133
    libvirtd_LDADD += ../src/libvirt_driver_uml.la
134
endif
135

136
if WITH_STORAGE_DIR
137
    libvirtd_LDADD += ../src/libvirt_driver_storage.la
138
endif
139

140
if WITH_NETWORK
141
    libvirtd_LDADD += ../src/libvirt_driver_network.la
142
endif
143

144 145 146 147
if WITH_NETCF
    libvirtd_LDADD += ../src/libvirt_driver_interface.la
endif

148
if WITH_NODE_DEVICES
149
    libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
150
endif
151 152 153 154

if WITH_SECRETS
    libvirtd_LDADD += ../src/libvirt_driver_secret.la
endif
155 156 157 158

if WITH_NWFILTER
    libvirtd_LDADD += ../src/libvirt_driver_nwfilter.la
endif
159
endif
160 161

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

163
if HAVE_POLKIT
164
if HAVE_POLKIT0
165
policydir = $(datadir)/PolicyKit/policy
166 167 168 169 170
policyfile = libvirtd.policy-0
else
policydir = $(datadir)/polkit-1/actions
policyfile = libvirtd.policy-1
endif
171 172
endif

173 174 175
install-data-local: install-init-redhat install-init-systemd install-init-upstart \
		install-data-sasl install-data-polkit \
		install-logrotate install-sysctl
176 177 178
	$(MKDIR_P) $(DESTDIR)$(localstatedir)/log/libvirt \
		   $(DESTDIR)$(localstatedir)/run/libvirt \
		   $(DESTDIR)$(localstatedir)/lib/libvirt
179

180 181
uninstall-local:: uninstall-init-redhat uninstall-init-systemd uninstall-init-upstart \
		uninstall-data-sasl uninstall-data-polkit \
182
		uninstall-logrotate uninstall-sysctl
183
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
184
	rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
185
	rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
186

187
if HAVE_POLKIT
188
install-data-polkit::
189
	$(MKDIR_P) $(DESTDIR)$(policydir)
190
	$(INSTALL_DATA) $(srcdir)/$(policyfile) $(DESTDIR)$(policydir)/org.libvirt.unix.policy
191
uninstall-data-polkit::
192
	rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
193
	rmdir $(DESTDIR)$(policydir) || :
194 195 196 197 198
else
install-data-polkit::
uninstall-data-polkit::
endif

199 200
remote.c: $(DAEMON_GENERATED)
remote.h: $(DAEMON_GENERATED)
201

202
LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
203
		  libvirtd.uml.logrotate libvirtd.logrotate
204

205 206
BUILT_SOURCES += $(LOGROTATE_CONFS)

207 208 209 210 211 212
libvirtd.logrotate: libvirtd.logrotate.in
	sed							\
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
	    < $< > $@-t
	mv $@-t $@

213 214 215 216 217 218 219
libvirtd.qemu.logrotate: libvirtd.qemu.logrotate.in
	sed							\
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
	    < $< > $@-t
	mv $@-t $@

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

libvirtd.uml.logrotate: libvirtd.uml.logrotate.in
226
	$(AM_V_GEN)sed						\
227
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
228 229
	    < $< > $@-t &&					\
	    mv $@-t $@
G
Guido Günther 已提交
230

231
install-logrotate: $(LOGROTATE_CONFS)
232 233 234 235
	$(MKDIR_P) $(DESTDIR)$(localstatedir)/log/libvirt/qemu/ \
		   $(DESTDIR)$(localstatedir)/log/libvirt/lxc/ \
		   $(DESTDIR)$(localstatedir)/log/libvirt/uml/ \
		   $(DESTDIR)$(sysconfdir)/logrotate.d/
236
	$(INSTALL_DATA) libvirtd.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd
237 238 239
	$(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 已提交
240

241 242 243 244 245 246 247 248 249 250
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 || :

251
install-sysconfig:
252
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
253
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysconf \
J
Jim Meyering 已提交
254
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
255 256
uninstall-sysconfig:
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
257
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
258 259

install-sysctl:
260
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysctl.d
E
Eric Blake 已提交
261 262
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \
	  $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
263

264 265
uninstall-sysctl:
	rm -f $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
266
	rmdir $(DESTDIR)$(sysconfdir)/sysctl.d || :
267 268

if LIBVIRT_INIT_SCRIPT_RED_HAT
D
Daniel P. Berrange 已提交
269

270
BUILT_SOURCES += libvirtd.init
271

272
install-init-redhat: install-sysconfig libvirtd.init
273
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
274 275 276 277 278
	$(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
279
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
280 281 282 283 284 285 286 287 288
else
install-init-redhat:
uninstall-init-redhat:
endif # LIBVIRT_INIT_SCRIPT_RED_HAT


if LIBVIRT_INIT_SCRIPT_UPSTART

install-init-upstart: install-sysconfig
289
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/event.d
290 291 292 293 294
	$(INSTALL_SCRIPT) libvirtd.upstart \
	  $(DESTDIR)$(sysconfdir)/event.d/libvirtd

uninstall-init-upstart: uninstall-sysconfig
	rm -f $(DESTDIR)$(sysconfdir)/event.d/libvirtd
295
	rmdir $(DESTDIR)$(sysconfdir)/event.d || :
296 297 298 299 300 301 302 303 304 305 306 307 308
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
309
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
310 311 312 313 314
	$(INSTALL_SCRIPT) libvirtd.service \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service

uninstall-init-systemd: uninstall-sysconfig
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service
315
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
316 317 318 319 320
else
install-init-systemd:
uninstall-init-systemd:
endif # LIBVIRT_INIT_SCRIPT_SYSTEMD

321
libvirtd.init: libvirtd.init.in $(top_builddir)/config.status
322
	$(AM_V_GEN)sed					\
323 324 325
	    -e s!\@localstatedir\@!$(localstatedir)!g	\
	    -e s!\@sbindir\@!$(sbindir)!g		\
	    -e s!\@sysconfdir\@!$(sysconfdir)!g		\
326 327 328
	    < $< > $@-t &&				\
	    chmod a+x $@-t &&				\
	    mv $@-t $@
D
Daniel P. Berrange 已提交
329

330 331
libvirtd.service: libvirtd.service.in $(top_builddir)/config.status
	$(AM_V_GEN)sed					\
332 333 334
	    -e s!\@localstatedir\@!$(localstatedir)!g	\
	    -e s!\@sbindir\@!$(sbindir)!g		\
	    -e s!\@sysconfdir\@!$(sysconfdir)!g		\
335 336 337 338 339
	    < $< > $@-t &&				\
	    chmod a+x $@-t &&				\
	    mv $@-t $@


340
check-local:
341 342 343
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	  '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug; \
	fi
344

345

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

350 351 352
else # WITH_LIBVIRTD
install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl
353
endif # WITH_LIBVIRTD
354

355 356 357 358 359 360
POD2MAN = pod2man -c "Virtualization Support" \
			-r "$(PACKAGE)-$(VERSION)" -s 8

$(srcdir)/libvirtd.8.in: libvirtd.pod.in
	$(AM_V_GEN)$(POD2MAN) $< $@

361 362 363 364
# This is needed for clients too, so can't wrap in
# the WITH_LIBVIRTD conditional
if HAVE_SASL
install-data-sasl:
365
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sasl2/
366 367 368 369
	$(INSTALL_DATA) $(srcdir)/libvirtd.sasl $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf

uninstall-data-sasl:
	rm -f $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
D
Dave Allan 已提交
370
	rmdir $(DESTDIR)$(sysconfdir)/sasl2/ || :
D
Daniel P. Berrange 已提交
371 372 373
else
install-data-sasl:
uninstall-data-sasl:
374 375 376
endif


377
CLEANFILES += $(BUILT_SOURCES) $(man8_MANS)
378
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
379
MAINTAINERCLEANFILES = $(srcdir)/libvirtd.8.in $(DAEMON_GENERATED)