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

3
## Copyright (C) 2005-2015 Red Hat, Inc.
E
Eric Blake 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16 17
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library.  If not, see
## <http://www.gnu.org/licenses/>.
18

19
INCLUDES = \
20
	-I$(top_builddir)/gnulib/lib -I$(top_srcdir)/gnulib/lib \
21
	-I$(top_srcdir) \
22 23
	-I$(top_builddir)/include -I$(top_srcdir)/include \
	-I$(top_builddir)/src -I$(top_srcdir)/src \
24 25 26 27
	-I$(top_srcdir)/src/util \
	-I$(top_srcdir)/src/conf \
	-I$(top_srcdir)/src/rpc \
	-I$(top_srcdir)/src/remote \
28
	-I$(top_srcdir)/src/admin \
29
	-I$(top_srcdir)/src/access \
30 31
	$(GETTEXT_CPPFLAGS)

32 33
CLEANFILES =

E
Eric Blake 已提交
34 35 36 37
DAEMON_GENERATED =			\
		remote_dispatch.h	\
		lxc_dispatch.h		\
		qemu_dispatch.h		\
38
		admin_dispatch.h	\
39
		$(NULL)
40 41 42 43 44 45

DAEMON_SOURCES =					\
		libvirtd.c libvirtd.h			\
		remote.c remote.h			\
		stream.c stream.h			\
		$(DAEMON_GENERATED)
46

47 48
LIBVIRTD_CONF_SOURCES = libvirtd-config.c libvirtd-config.h

49
DISTCLEANFILES =
50
EXTRA_DIST =						\
51
	remote_dispatch.h				\
52
	lxc_dispatch.h					\
53
	qemu_dispatch.h					\
54
	admin_dispatch.h				\
55 56
	libvirtd.conf					\
	libvirtd.init.in				\
A
Alan Pevec 已提交
57
	libvirtd.upstart				\
C
Cole Robinson 已提交
58
	libvirtd.policy.in				\
59
	libvirt.rules					\
60
	libvirtd.sasl					\
61
	libvirtd.service.in				\
62
	libvirtd.socket.in				\
63
	libvirtd.sysconf				\
E
Eric Blake 已提交
64
	libvirtd.sysctl					\
65
	libvirtd.aug                                    \
66
	libvirtd.logrotate.in                           \
67 68
	libvirtd.qemu.logrotate.in                      \
	libvirtd.lxc.logrotate.in                       \
J
Jim Fehlig 已提交
69
	libvirtd.libxl.logrotate.in                     \
70
	libvirtd.uml.logrotate.in                       \
71
	test_libvirtd.aug.in                             \
72
	THREADS.txt					\
73
	libvirtd.pod.in					\
74
	libvirtd.8.in					\
75 76 77
	$(DAEMON_SOURCES)				\
	$(LIBVIRTD_CONF_SOURCES)			\
	$(NULL)
78

79
BUILT_SOURCES =
80

81
REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x
82
LXC_PROTOCOL = $(top_srcdir)/src/remote/lxc_protocol.x
83
QEMU_PROTOCOL = $(top_srcdir)/src/remote/qemu_protocol.x
84
ADMIN_PROTOCOL = $(top_srcdir)/src/admin/admin_protocol.x
85

M
Michal Privoznik 已提交
86
remote_dispatch.h: $(top_srcdir)/src/rpc/gendispatch.pl \
87
		$(REMOTE_PROTOCOL)
M
Michal Privoznik 已提交
88
	$(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
E
Eric Blake 已提交
89 90
	  --mode=server remote REMOTE $(REMOTE_PROTOCOL) \
	  > $(srcdir)/remote_dispatch.h
91

M
Michal Privoznik 已提交
92
lxc_dispatch.h: $(top_srcdir)/src/rpc/gendispatch.pl \
93
		$(LXC_PROTOCOL)
M
Michal Privoznik 已提交
94
	$(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
E
Eric Blake 已提交
95 96
	  --mode=server lxc LXC $(LXC_PROTOCOL) \
	  > $(srcdir)/lxc_dispatch.h
97

M
Michal Privoznik 已提交
98
qemu_dispatch.h: $(top_srcdir)/src/rpc/gendispatch.pl \
99
		$(QEMU_PROTOCOL)
M
Michal Privoznik 已提交
100
	$(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
E
Eric Blake 已提交
101 102
	  --mode=server qemu QEMU $(QEMU_PROTOCOL) \
	  > $(srcdir)/qemu_dispatch.h
103

M
Martin Kletzander 已提交
104
admin_dispatch.h: $(top_srcdir)/src/rpc/gendispatch.pl \
105
		$(ADMIN_PROTOCOL)
M
Martin Kletzander 已提交
106
	$(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
107 108 109
	  --mode=server admin ADMIN $(ADMIN_PROTOCOL) \
	  > $(srcdir)/admin_dispatch.h

110 111
if WITH_LIBVIRTD

112 113 114 115 116
# Build a convenience library, for reuse in tests/libvirtdconftest
noinst_LTLIBRARIES = libvirtd_conf.la
libvirtd_conf_la_SOURCES = $(LIBVIRTD_CONF_SOURCES)
libvirtd_conf_la_CFLAGS = \
	$(LIBXML_CFLAGS) \
E
Eric Blake 已提交
117
	$(XDR_CFLAGS) \
118 119 120 121 122 123 124 125 126 127 128
	$(WARN_CFLAGS) $(PIE_CFLAGS) \
	$(COVERAGE_CFLAGS) \
	$(NULL)
libvirtd_conf_la_LDFLAGS =				\
	$(RELRO_LDFLAGS)				\
	$(PIE_LDFLAGS)					\
	$(COVERAGE_LDFLAGS)				\
	$(NO_INDIRECT_LDFLAGS)				\
	$(NULL)
libvirtd_conf_la_LIBADD = $(LIBXML_LIBS)

129 130
noinst_LTLIBRARIES += libvirtd_admin.la
libvirtd_admin_la_SOURCES = \
131
		admin_server.c admin_server.h
132 133 134 135 136 137 138

libvirtd_admin_la_CFLAGS = \
		$(AM_CFLAGS)		\
		$(XDR_CFLAGS)		\
		$(PIE_CFLAGS)		\
		$(WARN_CFLAGS)		\
		$(LIBXML_CFLAGS)	\
139 140
		$(COVERAGE_CFLAGS)	\
		$(NULL)
141 142 143 144
libvirtd_admin_la_LDFLAGS = \
		$(PIE_LDFLAGS)		\
		$(RELRO_LDFLAGS)	\
		$(COVERAGE_LDFLAGS)	\
145 146
		$(NO_INDIRECT_LDFLAGS)  \
		$(NULL)
147 148 149
libvirtd_admin_la_LIBADD =	\
		../src/libvirt-admin.la

150
man8_MANS = libvirtd.8
151

152 153 154 155
sbin_PROGRAMS = libvirtd

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

157
augeasdir = $(datadir)/augeas/lenses
158
augeas_DATA = libvirtd.aug
159 160

augeastestsdir = $(datadir)/augeas/lenses/tests
161
augeastests_DATA = test_libvirtd.aug
162

163 164
CLEANFILES += test_libvirtd.aug

165
libvirtd.8: $(srcdir)/libvirtd.8.in
166
	$(AM_V_GEN)sed \
167 168
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
169
	    < $< > $@-t && \
170 171
	mv $@-t $@

172
libvirtd_SOURCES = $(DAEMON_SOURCES)
173

D
Daniel P. Berrange 已提交
174
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
175
libvirtd_CFLAGS = \
176
	$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
177
	$(XDR_CFLAGS) $(DBUS_CFLAGS) $(LIBNL_CFLAGS) \
D
Daniel P. Berrange 已提交
178
	$(WARN_CFLAGS) $(PIE_CFLAGS) \
179
	$(COVERAGE_CFLAGS) \
180
	-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\""
181

E
Eric Blake 已提交
182
libvirtd_LDFLAGS =					\
G
Guido Günther 已提交
183
	$(RELRO_LDFLAGS)				\
D
Daniel P. Berrange 已提交
184
	$(PIE_LDFLAGS)					\
G
Guido Günther 已提交
185
	$(COVERAGE_LDFLAGS)				\
186
	$(NO_INDIRECT_LDFLAGS)				\
G
Guido Günther 已提交
187
	$(NULL)
188

189
libvirtd_LDADD =					\
190 191 192
	$(LIBXML_LIBS)					\
	$(GNUTLS_LIBS)					\
	$(SASL_LIBS)					\
193
	$(DBUS_LIBS)					\
D
Doug Goldstein 已提交
194
	$(LIBNL_LIBS)
195

196
if WITH_DTRACE_PROBES
197
libvirtd_LDADD += ../src/libvirt_probes.lo
198
endif WITH_DTRACE_PROBES
199

200
libvirtd_LDADD += \
201
	libvirtd_conf.la \
202
	libvirtd_admin.la \
203
	../src/libvirt-lxc.la \
204 205 206
	../src/libvirt-qemu.la \
	../src/libvirt_driver_remote.la \
	$(NULL)
C
Chris Lalancette 已提交
207

208
if ! WITH_DRIVER_MODULES
209
if WITH_QEMU
210
    libvirtd_LDADD += ../src/libvirt_driver_qemu.la
211
if WITH_DTRACE_PROBES
212
    libvirtd_LDADD += ../src/libvirt_qemu_probes.lo
213 214
endif WITH_DTRACE_PROBES
endif WITH_QEMU
215

216
if WITH_LXC
217
    libvirtd_LDADD += ../src/libvirt_driver_lxc.la
218
endif WITH_LXC
219

220 221
if WITH_XEN
    libvirtd_LDADD += ../src/libvirt_driver_xen.la
222
endif WITH_XEN
223

J
Jim Fehlig 已提交
224 225
if WITH_LIBXL
    libvirtd_LDADD += ../src/libvirt_driver_libxl.la
226
endif WITH_LIBXL
J
Jim Fehlig 已提交
227

228
if WITH_UML
229
    libvirtd_LDADD += ../src/libvirt_driver_uml.la
230
endif WITH_UML
231

J
Jiri Denemark 已提交
232 233
if WITH_VBOX
    libvirtd_LDADD += ../src/libvirt_driver_vbox.la
234
endif WITH_VBOX
J
Jiri Denemark 已提交
235

236
if WITH_STORAGE
237
    libvirtd_LDADD += ../src/libvirt_driver_storage.la
238
endif WITH_STORAGE
239

240
if WITH_NETWORK
241
    libvirtd_LDADD += ../src/libvirt_driver_network.la
242
endif WITH_NETWORK
243

244
if WITH_INTERFACE
245
    libvirtd_LDADD += ../src/libvirt_driver_interface.la
246
endif WITH_INTERFACE
247

248
if WITH_NODE_DEVICES
249
    libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
250
endif WITH_NODE_DEVICES
251 252 253

if WITH_SECRETS
    libvirtd_LDADD += ../src/libvirt_driver_secret.la
254
endif WITH_SECRETS
255 256 257

if WITH_NWFILTER
    libvirtd_LDADD += ../src/libvirt_driver_nwfilter.la
258 259
endif WITH_NWFILTER
endif ! WITH_DRIVER_MODULES
260 261

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

263 264
if WITH_POLKIT
if WITH_POLKIT0
265
policydir = $(datadir)/PolicyKit/policy
C
Cole Robinson 已提交
266
policyauth = auth_admin_keep_session
267
else ! WITH_POLKIT0
268
policydir = $(datadir)/polkit-1/actions
C
Cole Robinson 已提交
269
policyauth = auth_admin_keep
270 271
rulesdir = $(datadir)/polkit-1/rules.d
rulesfile = libvirt.rules
272 273
endif ! WITH_POLKIT0
endif WITH_POLKIT
274

C
Cole Robinson 已提交
275 276
libvirtd.policy: libvirtd.policy.in $(top_builddir)/config.status
	$(AM_V_GEN) sed \
277
	    -e 's|[@]authaction[@]|$(policyauth)|g' \
C
Cole Robinson 已提交
278 279 280 281
	    < $< > $@-t && \
	mv $@-t $@
BUILT_SOURCES += libvirtd.policy

282 283
install-data-local: install-init-redhat install-init-systemd \
		install-init-upstart \
284 285
		install-data-sasl install-data-polkit \
		install-logrotate install-sysctl
286 287 288
	$(MKDIR_P) $(DESTDIR)$(localstatedir)/log/libvirt \
		   $(DESTDIR)$(localstatedir)/run/libvirt \
		   $(DESTDIR)$(localstatedir)/lib/libvirt
289

290 291
uninstall-local:: uninstall-init-redhat uninstall-init-systemd \
		uninstall-init-upstart \
292
		uninstall-data-sasl uninstall-data-polkit \
293
		uninstall-logrotate uninstall-sysctl
294
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
295
	rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
296
	rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
297

298
if WITH_POLKIT
299
install-data-polkit::
300
	$(MKDIR_P) $(DESTDIR)$(policydir)
C
Cole Robinson 已提交
301
	$(INSTALL_DATA) libvirtd.policy $(DESTDIR)$(policydir)/org.libvirt.unix.policy
302 303 304 305 306
if ! WITH_POLKIT0
	$(MKDIR_P) $(DESTDIR)$(rulesdir)
	$(INSTALL_DATA) $(srcdir)/$(rulesfile) $(DESTDIR)$(rulesdir)/50-libvirt.rules
endif ! WITH_POLKIT0

307
uninstall-data-polkit::
308
	rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
309
	rmdir $(DESTDIR)$(policydir) || :
310 311 312 313 314
if ! WITH_POLKIT0
	rm -f $(DESTDIR)$(rulesdir)/50-libvirt.rules
	rmdir $(DESTDIR)$(rulesdir) || :
endif ! WITH_POLKIT0

315
else ! WITH_POLKIT
316 317
install-data-polkit::
uninstall-data-polkit::
318
endif ! WITH_POLKIT
319

320 321
remote.c: $(DAEMON_GENERATED)
remote.h: $(DAEMON_GENERATED)
322
admin_server.c: $(DAEMON_GENERATED)
323

324
LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
J
Jim Fehlig 已提交
325 326
		  libvirtd.libxl.logrotate libvirtd.uml.logrotate \
		  libvirtd.logrotate
327

328 329
BUILT_SOURCES += $(LOGROTATE_CONFS)

330
libvirtd.logrotate: libvirtd.logrotate.in
331
	$(AM_V_GEN)sed						\
332
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
333
	    < $< > $@-t && \
334 335
	mv $@-t $@

336
libvirtd.qemu.logrotate: libvirtd.qemu.logrotate.in
337
	$(AM_V_GEN)sed						\
338
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
339
	    < $< > $@-t && \
340 341 342
	mv $@-t $@

libvirtd.lxc.logrotate: libvirtd.lxc.logrotate.in
343
	$(AM_V_GEN)sed						\
344
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
345 346
	    < $< > $@-t &&					\
	    mv $@-t $@
347

J
Jim Fehlig 已提交
348 349 350 351 352 353
libvirtd.libxl.logrotate: libvirtd.libxl.logrotate.in
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    < $< > $@-t &&					\
	    mv $@-t $@

354
libvirtd.uml.logrotate: libvirtd.uml.logrotate.in
355
	$(AM_V_GEN)sed						\
356
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
357 358
	    < $< > $@-t &&					\
	    mv $@-t $@
G
Guido Günther 已提交
359

360
install-logrotate: $(LOGROTATE_CONFS)
361 362 363 364
	$(MKDIR_P) $(DESTDIR)$(localstatedir)/log/libvirt/qemu/ \
		   $(DESTDIR)$(localstatedir)/log/libvirt/lxc/ \
		   $(DESTDIR)$(localstatedir)/log/libvirt/uml/ \
		   $(DESTDIR)$(sysconfdir)/logrotate.d/
365 366 367 368 369 370
	$(INSTALL_DATA) libvirtd.logrotate \
		$(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd
	$(INSTALL_DATA) libvirtd.qemu.logrotate \
		$(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.qemu
	$(INSTALL_DATA) libvirtd.lxc.logrotate \
		$(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.lxc
J
Jim Fehlig 已提交
371 372
	$(INSTALL_DATA) libvirtd.libxl.logrotate \
		$(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.libxl
373 374
	$(INSTALL_DATA) libvirtd.uml.logrotate \
		$(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.uml
G
Guido Günther 已提交
375

376 377 378 379
uninstall-logrotate:
	rm -f $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd \
	      $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.qemu \
	      $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.lxc \
J
Jim Fehlig 已提交
380
	      $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.libxl \
381 382 383 384 385 386
	      $(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 || :

387
install-sysconfig:
388
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
389
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysconf \
J
Jim Meyering 已提交
390
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
391 392
uninstall-sysconfig:
	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
393
	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
394

395
if WITH_SYSCTL
396 397
# Use $(prefix)/lib rather than $(libdir), since man sysctl.d insists on
# /usr/lib/sysctl.d/ even when libdir is /usr/lib64
398
install-sysctl:
399
	$(MKDIR_P) $(DESTDIR)$(prefix)/lib/sysctl.d
E
Eric Blake 已提交
400
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \
401
	  $(DESTDIR)$(prefix)/lib/sysctl.d/60-libvirtd.conf
402

403
uninstall-sysctl:
404
	rm -f $(DESTDIR)$(prefix)/lib/sysctl.d/60-libvirtd.conf
405
	rmdir $(DESTDIR)$(prefix)/lib/sysctl.d || :
406
else ! WITH_SYSCTL
407 408
install-sysctl:
uninstall-sysctl:
409
endif ! WITH_SYSCTL
410 411

if LIBVIRT_INIT_SCRIPT_RED_HAT
D
Daniel P. Berrange 已提交
412

413
BUILT_SOURCES += libvirtd.init
414

415
install-init-redhat: install-sysconfig libvirtd.init
416
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
417 418 419 420 421
	$(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
422
	rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
423
else ! LIBVIRT_INIT_SCRIPT_RED_HAT
424 425
install-init-redhat:
uninstall-init-redhat:
426
endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
427 428 429 430 431


if LIBVIRT_INIT_SCRIPT_UPSTART

install-init-upstart: install-sysconfig
432
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/event.d
433 434 435 436 437
	$(INSTALL_SCRIPT) libvirtd.upstart \
	  $(DESTDIR)$(sysconfdir)/event.d/libvirtd

uninstall-init-upstart: uninstall-sysconfig
	rm -f $(DESTDIR)$(sysconfdir)/event.d/libvirtd
438
	rmdir $(DESTDIR)$(sysconfdir)/event.d || :
439
else ! LIBVIRT_INIT_SCRIPT_UPSTART
440 441
install-init-upstart:
uninstall-init-upstart:
442
endif ! LIBVIRT_INIT_SCRIPT_UPSTART
443 444 445 446


if LIBVIRT_INIT_SCRIPT_SYSTEMD

447
SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
448
BUILT_SOURCES += libvirtd.service libvirtd.socket
449

450
install-init-systemd: install-sysconfig libvirtd.service libvirtd.socket
451
	$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
452
	$(INSTALL_DATA) libvirtd.service \
453
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service
454 455
	$(INSTALL_DATA) libvirtd.socket \
	  $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.socket
456 457 458

uninstall-init-systemd: uninstall-sysconfig
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service
459
	rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.socket
460
	rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
461
else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
462 463
install-init-systemd:
uninstall-init-systemd:
464
endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
465

466
libvirtd.init: libvirtd.init.in $(top_builddir)/config.status
467 468 469 470 471 472
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g'		\
	    < $< > $@-t &&					\
	    chmod a+x $@-t &&					\
473
	    mv $@-t $@
D
Daniel P. Berrange 已提交
474

475
libvirtd.service: libvirtd.service.in $(top_builddir)/config.status
476 477 478 479 480
	$(AM_V_GEN)sed						\
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g'	\
	    -e 's|[@]sbindir[@]|$(sbindir)|g'			\
	    -e 's|[@]sysconfdir[@]|$(sysconfdir)|g'		\
	    < $< > $@-t &&					\
481 482
	    mv $@-t $@

483 484 485 486 487 488
libvirtd.socket: libvirtd.socket.in $(top_builddir)/config.status
	$(AM_V_GEN)sed						\
	    -e 's|[@]runstatedir[@]|$(runstatedir)|g'		\
	    < $< > $@-t &&					\
	    mv $@-t $@

489

490 491
check-local: check-augeas

492 493 494 495
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 $< $@
496 497

check-augeas: test_libvirtd.aug
498
	$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
499
	  '$(AUGPARSE)' -I $(srcdir) test_libvirtd.aug; \
500
	fi
501

502

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

507
else ! WITH_LIBVIRTD
508 509
install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl
510
endif ! WITH_LIBVIRTD
511

512 513 514
POD2MAN = pod2man -c "Virtualization Support" \
			-r "$(PACKAGE)-$(VERSION)" -s 8

515
$(srcdir)/libvirtd.8.in: libvirtd.pod.in $(top_srcdir)/configure.ac
E
Eric Blake 已提交
516 517
	$(AM_V_GEN)$(POD2MAN) --name LIBVIRTD $< $@ \
	    && if grep 'POD ERROR' $@ ; then rm $@; exit 1; fi
518

519 520
# This is needed for clients too, so can't wrap in
# the WITH_LIBVIRTD conditional
521
if WITH_SASL
522
install-data-sasl:
523
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sasl2/
524 525
	$(INSTALL_DATA) $(srcdir)/libvirtd.sasl \
		$(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
526 527 528

uninstall-data-sasl:
	rm -f $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
D
Dave Allan 已提交
529
	rmdir $(DESTDIR)$(sysconfdir)/sasl2/ || :
530
else ! WITH_SASL
D
Daniel P. Berrange 已提交
531 532
install-data-sasl:
uninstall-data-sasl:
533
endif ! WITH_SASL
534 535


536
CLEANFILES += $(BUILT_SOURCES) $(man8_MANS)
537
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
538
MAINTAINERCLEANFILES = $(srcdir)/libvirtd.8.in $(DAEMON_GENERATED)