Makefile.am 8.4 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
CLEANFILES =

8
DAEMON_GENERATED =					\
9 10
		$(srcdir)/remote_dispatch.h		\
		$(srcdir)/qemu_dispatch.h
11 12 13 14 15

DAEMON_SOURCES =					\
		libvirtd.c libvirtd.h			\
		remote.c remote.h			\
		stream.c stream.h			\
C
Chris Lalancette 已提交
16
		../src/remote/remote_protocol.c		\
17 18
		../src/remote/qemu_protocol.c		\
		$(DAEMON_GENERATED)
19

20
DISTCLEANFILES =
21
EXTRA_DIST =						\
22 23
	remote_dispatch.h				\
	qemu_dispatch.h					\
24 25
	libvirtd.conf					\
	libvirtd.init.in				\
A
Alan Pevec 已提交
26
	libvirtd.upstart				\
27 28
	libvirtd.policy-0				\
	libvirtd.policy-1				\
29 30
	libvirtd.sasl					\
	libvirtd.sysconf				\
31
	libvirtd.aug                                    \
32
	libvirtd.logrotate.in                           \
33 34 35
	libvirtd.qemu.logrotate.in                      \
	libvirtd.lxc.logrotate.in                       \
	libvirtd.uml.logrotate.in                       \
36
	test_libvirtd.aug                               \
37
	THREADS.txt					\
38
	libvirtd.pod.in					\
39
	libvirtd.8.in					\
40
	libvirtd.stp					\
41
	$(DAEMON_SOURCES)
42

43
BUILT_SOURCES =
44

45 46 47
REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x
QEMU_PROTOCOL = $(top_srcdir)/src/remote/qemu_protocol.x

48
$(srcdir)/remote_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
49
		$(REMOTE_PROTOCOL)
50
	$(AM_V_GEN)perl -w $(srcdir)/../src/rpc/gendispatch.pl -b remote \
51 52
	  $(REMOTE_PROTOCOL) > $@

53
$(srcdir)/qemu_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
54
		$(QEMU_PROTOCOL)
55
	$(AM_V_GEN)perl -w $(srcdir)/../src/rpc/gendispatch.pl -b qemu \
56 57
	  $(QEMU_PROTOCOL) > $@

58 59
if WITH_LIBVIRTD

60
man8_MANS = libvirtd.8
61

62 63 64 65
sbin_PROGRAMS = libvirtd

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

67
augeasdir = $(datadir)/augeas/lenses
68
augeas_DATA = libvirtd.aug
69 70

augeastestsdir = $(datadir)/augeas/lenses/tests
71
augeastests_DATA = test_libvirtd.aug
72

73
libvirtd.8: $(srcdir)/libvirtd.8.in
74 75 76 77 78 79 80
	sed \
	    -e 's![@]sysconfdir[@]!$(sysconfdir)!g' \
	    -e 's![@]localstatedir[@]!$(localstatedir)!g' \
	    -e 's![@]remote_pid_file[@]!$(REMOTE_PID_FILE)!g' \
	    < $< > $@-t
	mv $@-t $@

81
libvirtd_SOURCES = $(DAEMON_SOURCES)
82

D
Daniel P. Berrange 已提交
83
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
84
libvirtd_CFLAGS = \
85 86
	-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
	-I$(top_srcdir)/include -I$(top_builddir)/include \
87
	-I$(top_srcdir)/src \
88
	-I$(top_srcdir)/src/util \
89
	-I$(top_srcdir)/src/conf \
90
	-I$(top_srcdir)/src/rpc \
91
	-I$(top_srcdir)/src/remote \
92
	$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
93
	$(XDR_CFLAGS) $(POLKIT_CFLAGS) \
94
	$(WARN_CFLAGS) \
95
	$(COVERAGE_CFLAGS) \
96
	-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\"" \
97
	-DREMOTE_PID_FILE="\"$(REMOTE_PID_FILE)\""
98

E
Eric Blake 已提交
99 100
libvirtd_LDFLAGS =					\
	$(WARN_CFLAGS)					\
101
	$(COVERAGE_LDFLAGS)
102

103
libvirtd_LDADD =					\
104 105 106
	$(LIBXML_LIBS)					\
	$(GNUTLS_LIBS)					\
	$(SASL_LIBS)					\
107
	$(POLKIT_LIBS)
108

109 110 111 112
libvirtd_LDADD += \
	../src/libvirt-net-rpc-server.la \
	../src/libvirt-net-rpc.la \
	../src/libvirt-qemu.la
C
Chris Lalancette 已提交
113

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

119
if WITH_LXC
120
    libvirtd_LDADD += ../src/libvirt_driver_lxc.la
121
endif
122

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

127
if WITH_UML
128
    libvirtd_LDADD += ../src/libvirt_driver_uml.la
129
endif
130

131
if WITH_STORAGE_DIR
132
    libvirtd_LDADD += ../src/libvirt_driver_storage.la
133
endif
134

135
if WITH_NETWORK
136
    libvirtd_LDADD += ../src/libvirt_driver_network.la
137
endif
138

139 140 141 142
if WITH_NETCF
    libvirtd_LDADD += ../src/libvirt_driver_interface.la
endif

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

if WITH_SECRETS
    libvirtd_LDADD += ../src/libvirt_driver_secret.la
endif
150 151 152 153

if WITH_NWFILTER
    libvirtd_LDADD += ../src/libvirt_driver_nwfilter.la
endif
154
endif
155 156

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

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

168 169
if WITH_DTRACE
libvirtd_LDADD += probes.o
170
nodist_libvirtd_SOURCES = probes.h
171 172 173

BUILT_SOURCES += probes.h

174
tapsetdir = $(datadir)/systemtap/tapset
175 176 177 178 179 180 181 182 183 184
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
185

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

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

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

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

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

214 215
BUILT_SOURCES += $(LOGROTATE_CONFS)

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

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

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

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

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

250
if LIBVIRT_INIT_SCRIPT_RED_HAT
251
install-init: libvirtd.init
D
Daniel P. Berrange 已提交
252
	mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d
J
Jim Meyering 已提交
253 254
	$(INSTALL_SCRIPT) libvirtd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
255
	mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig
256
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysconf \
J
Jim Meyering 已提交
257
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
258

D
Daniel P. Berrange 已提交
259
uninstall-init:
J
Jim Meyering 已提交
260
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd \
261
		$(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
D
Daniel P. Berrange 已提交
262

263
BUILT_SOURCES += libvirtd.init
264

265
libvirtd.init: libvirtd.init.in $(top_builddir)/config.status
266
	$(AM_V_GEN)sed					\
267 268 269
	    -e s!\@localstatedir\@!@localstatedir@!g	\
	    -e s!\@sbindir\@!@sbindir@!g		\
	    -e s!\@sysconfdir\@!@sysconfdir@!g		\
270 271 272
	    < $< > $@-t &&				\
	    chmod a+x $@-t &&				\
	    mv $@-t $@
D
Daniel P. Berrange 已提交
273

274
check-local:
275 276 277
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
	  '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug; \
	fi
278

D
Daniel P. Berrange 已提交
279 280 281 282
else

install-init:
uninstall-init:
283
libvirtd.init:
284

285
endif # LIBVIRT_INIT_SCRIPT_RED_HAT
286

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

291 292 293
else # WITH_LIBVIRTD
install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl
294
endif # WITH_LIBVIRTD
295

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

299 300 301 302 303 304
POD2MAN = pod2man -c "Virtualization Support" \
			-r "$(PACKAGE)-$(VERSION)" -s 8

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

305 306 307 308 309 310 311 312 313 314
# 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 已提交
315 316 317
else
install-data-sasl:
uninstall-data-sasl:
318 319 320
endif


321
CLEANFILES += $(BUILT_SOURCES) $(man8_MANS)
322
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
323
MAINTAINERCLEANFILES = $(srcdir)/libvirtd.8.in $(DAEMON_GENERATED)