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

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

6 7 8 9 10 11 12 13 14 15
INCLUDES = \
	-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
	-I$(top_srcdir)/include -I$(top_builddir)/include \
	-I$(top_srcdir)/src \
	-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
	libvirtd.stp					\
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 \
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 \
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
libvirtd.8: $(srcdir)/libvirtd.8.in
85 86 87 88 89 90 91
	sed \
	    -e 's![@]sysconfdir[@]!$(sysconfdir)!g' \
	    -e 's![@]localstatedir[@]!$(localstatedir)!g' \
	    -e 's![@]remote_pid_file[@]!$(REMOTE_PID_FILE)!g' \
	    < $< > $@-t
	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) \
97
	$(XDR_CFLAGS) $(POLKIT_CFLAGS) \
98
	$(WARN_CFLAGS) \
99
	$(COVERAGE_CFLAGS) \
100
	-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\"" \
101
	-DREMOTE_PID_FILE="\"$(REMOTE_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
	$(POLKIT_LIBS)
112

113 114
libvirtd_LDADD += \
	../src/libvirt-qemu.la
C
Chris Lalancette 已提交
115

116
if ! WITH_DRIVER_MODULES
117
if WITH_QEMU
118
    libvirtd_LDADD += ../src/libvirt_driver_qemu.la
119
endif
120

121
if WITH_LXC
122
    libvirtd_LDADD += ../src/libvirt_driver_lxc.la
123
endif
124

J
Jim Fehlig 已提交
125 126 127 128
if WITH_LIBXL
    libvirtd_LDADD += ../src/libvirt_driver_libxl.la
endif

129
if WITH_UML
130
    libvirtd_LDADD += ../src/libvirt_driver_uml.la
131
endif
132

133
if WITH_STORAGE_DIR
134
    libvirtd_LDADD += ../src/libvirt_driver_storage.la
135
endif
136

137
if WITH_NETWORK
138
    libvirtd_LDADD += ../src/libvirt_driver_network.la
139
endif
140

141 142 143 144
if WITH_NETCF
    libvirtd_LDADD += ../src/libvirt_driver_interface.la
endif

145
if WITH_NODE_DEVICES
146
    libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
147
endif
148 149 150 151

if WITH_SECRETS
    libvirtd_LDADD += ../src/libvirt_driver_secret.la
endif
152 153 154 155

if WITH_NWFILTER
    libvirtd_LDADD += ../src/libvirt_driver_nwfilter.la
endif
156
endif
157 158

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

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

170 171
if WITH_DTRACE
libvirtd_LDADD += probes.o
172
nodist_libvirtd_SOURCES = probes.h
173 174 175

BUILT_SOURCES += probes.h

176
tapsetdir = $(datadir)/systemtap/tapset
177 178 179 180 181 182 183 184 185 186
tapset_DATA = libvirtd.stp

probes.h: probes.d
	$(AM_V_GEN)$(DTRACE) -o $@ -h -s $<

probes.o: probes.d
	$(AM_V_GEN)$(DTRACE) -o $@ -G -s $<

CLEANFILES += probes.h probes.o
endif
187

G
Guido Günther 已提交
188
install-data-local: install-init install-data-sasl install-data-polkit \
189
		    install-logrotate
190
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt
191
	mkdir -p $(DESTDIR)$(localstatedir)/run/libvirt
192
	mkdir -p $(DESTDIR)$(localstatedir)/lib/libvirt
193

194 195
uninstall-local:: uninstall-init uninstall-data-sasl uninstall-data-polkit
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
196
	rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
197
	rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
198

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

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

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

216 217
BUILT_SOURCES += $(LOGROTATE_CONFS)

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

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

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

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

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

252
if LIBVIRT_INIT_SCRIPT_RED_HAT
253
install-init: libvirtd.init
E
Eric Blake 已提交
254 255 256
	mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d \
	  $(DESTDIR)$(sysconfdir)/sysconfig \
	  $(DESTDIR)$(sysconfdir)/sysctl.d
J
Jim Meyering 已提交
257 258
	$(INSTALL_SCRIPT) libvirtd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
259
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysconf \
J
Jim Meyering 已提交
260
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
E
Eric Blake 已提交
261 262
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \
	  $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
263

D
Daniel P. Berrange 已提交
264
uninstall-init:
J
Jim Meyering 已提交
265
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd \
E
Eric Blake 已提交
266 267
		$(DESTDIR)$(sysconfdir)/sysconfig/libvirtd \
		$(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
D
Daniel P. Berrange 已提交
268

269
BUILT_SOURCES += libvirtd.init
270

271
libvirtd.init: libvirtd.init.in $(top_builddir)/config.status
272
	$(AM_V_GEN)sed					\
273 274 275
	    -e s!\@localstatedir\@!@localstatedir@!g	\
	    -e s!\@sbindir\@!@sbindir@!g		\
	    -e s!\@sysconfdir\@!@sysconfdir@!g		\
276 277 278
	    < $< > $@-t &&				\
	    chmod a+x $@-t &&				\
	    mv $@-t $@
D
Daniel P. Berrange 已提交
279

280
check-local:
281 282 283
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	  '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug; \
	fi
284

D
Daniel P. Berrange 已提交
285 286 287 288
else

install-init:
uninstall-init:
289
libvirtd.init:
290

291
endif # LIBVIRT_INIT_SCRIPT_RED_HAT
292

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

297 298 299
else # WITH_LIBVIRTD
install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl
300
endif # WITH_LIBVIRTD
301

302
# This is needed for 'make dist' too, so can't wrap in WITH_LIBVIRTD.
303 304
EXTRA_DIST += probes.d libvirtd.stp

305 306 307 308 309 310
POD2MAN = pod2man -c "Virtualization Support" \
			-r "$(PACKAGE)-$(VERSION)" -s 8

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

311 312 313 314 315 316 317 318 319 320
# This is needed for clients too, so can't wrap in
# the WITH_LIBVIRTD conditional
if HAVE_SASL
install-data-sasl:
	mkdir -p $(DESTDIR)$(sysconfdir)/sasl2/
	$(INSTALL_DATA) $(srcdir)/libvirtd.sasl $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf

uninstall-data-sasl:
	rm -f $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
	rmdir $(DESTDIR)$(sysconfdir)/sasl2/
D
Daniel P. Berrange 已提交
321 322 323
else
install-data-sasl:
uninstall-data-sasl:
324 325 326
endif


327
CLEANFILES += $(BUILT_SOURCES) $(man8_MANS)
328
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
329
MAINTAINERCLEANFILES = $(srcdir)/libvirtd.8.in $(DAEMON_GENERATED)