Makefile.am 8.5 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				\
41
	libvirtd.aug                                    \
42
	libvirtd.logrotate.in                           \
43 44 45
	libvirtd.qemu.logrotate.in                      \
	libvirtd.lxc.logrotate.in                       \
	libvirtd.uml.logrotate.in                       \
46
	test_libvirtd.aug                               \
47
	THREADS.txt					\
48
	libvirtd.pod.in					\
49
	libvirtd.8.in					\
50
	libvirtd.stp					\
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
libvirtd_LDADD += \
	../src/libvirt-net-rpc-server.la \
	../src/libvirt-net-rpc.la \
	../src/libvirt-qemu.la
C
Chris Lalancette 已提交
116

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

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

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

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

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

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

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

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

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

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

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

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

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

BUILT_SOURCES += probes.h

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

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

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

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

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

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

217 218
BUILT_SOURCES += $(LOGROTATE_CONFS)

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

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

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

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

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

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

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

266
BUILT_SOURCES += libvirtd.init
267

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

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

D
Daniel P. Berrange 已提交
282 283 284 285
else

install-init:
uninstall-init:
286
libvirtd.init:
287

288
endif # LIBVIRT_INIT_SCRIPT_RED_HAT
289

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

294 295 296
else # WITH_LIBVIRTD
install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl
297
endif # WITH_LIBVIRTD
298

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

302 303 304 305 306 307
POD2MAN = pod2man -c "Virtualization Support" \
			-r "$(PACKAGE)-$(VERSION)" -s 8

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

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


324
CLEANFILES += $(BUILT_SOURCES) $(man8_MANS)
325
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
326
MAINTAINERCLEANFILES = $(srcdir)/libvirtd.8.in $(DAEMON_GENERATED)