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

3 4
DAEMON_SOURCES =					\
		event.c event.h				\
D
Daniel P. Berrange 已提交
5
		libvirtd.c libvirtd.h			\
6 7
		remote.c remote.h			\
		dispatch.c dispatch.h			\
8
		stream.c stream.h			\
9
		remote_dispatch_prototypes.h		\
10 11 12
		remote_dispatch_table.h			\
		remote_dispatch_args.h			\
		remote_dispatch_ret.h			\
13
		../src/remote/remote_protocol.c
14 15 16 17

AVAHI_SOURCES =						\
		mdns.c mdns.h

18
DISTCLEANFILES =
19
EXTRA_DIST =						\
20
	remote_generate_stubs.pl			\
21 22
	libvirtd.conf					\
	libvirtd.init.in				\
23 24
	libvirtd.policy-0				\
	libvirtd.policy-1				\
25 26
	libvirtd.sasl					\
	libvirtd.sysconf				\
27
	libvirtd.aug                                    \
28 29 30
	libvirtd.qemu.logrotate.in                      \
	libvirtd.lxc.logrotate.in                       \
	libvirtd.uml.logrotate.in                       \
31
	test_libvirtd.aug                               \
32
	THREADING.txt					\
33 34
	libvirt-guests.init.in				\
	libvirt-guests.sysconf				\
35
	libvirtd.pod.in					\
36 37
	$(AVAHI_SOURCES)				\
	$(DAEMON_SOURCES)
38

39 40
man_MANS = libvirtd.8

41
BUILT_SOURCES =
42

43 44 45 46 47 48
if WITH_LIBVIRTD

sbin_PROGRAMS = libvirtd

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

50
augeasdir = $(datadir)/augeas/lenses
51
augeas_DATA = libvirtd.aug
52 53

augeastestsdir = $(datadir)/augeas/lenses/tests
54
augeastests_DATA = test_libvirtd.aug
55

56 57 58 59 60 61 62 63 64 65 66 67 68 69
POD2MAN = pod2man -c "Virtualization Support" \
			-r "$(PACKAGE)-$(VERSION)" -s 8 -u

libvirtd.pod: libvirtd.pod.in
	sed \
	    -e 's![@]sysconfdir[@]!$(sysconfdir)!g' \
	    -e 's![@]localstatedir[@]!$(localstatedir)!g' \
	    -e 's![@]remote_pid_file[@]!$(REMOTE_PID_FILE)!g' \
	    < $< > $@-t
	mv $@-t $@

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

70
libvirtd_SOURCES = $(DAEMON_SOURCES)
71

D
Daniel P. Berrange 已提交
72
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
73
libvirtd_CFLAGS = \
74 75
	-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
	-I$(top_srcdir)/include -I$(top_builddir)/include \
76
	-I$(top_srcdir)/src \
77
	-I$(top_srcdir)/src/util \
78
	-I$(top_srcdir)/src/conf \
79
	-I$(top_srcdir)/src/remote \
80 81 82 83 84
	$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
	$(POLKIT_CFLAGS) \
	$(WARN_CFLAGS) -DLOCAL_STATE_DIR="\"$(localstatedir)\"" \
	$(COVERAGE_CFLAGS) \
	-DSYSCONF_DIR="\"$(sysconfdir)\"" \
85
	-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\"" \
86
	-DREMOTE_PID_FILE="\"$(REMOTE_PID_FILE)\"" \
87 88
	-DGETTEXT_PACKAGE=\"$(PACKAGE)\"

89 90 91
libvirtd_LDFLAGS = 					\
	$(WARN_CFLAGS) 					\
	$(COVERAGE_LDFLAGS)
92

93
libvirtd_LDADD =					\
94 95 96
	$(LIBXML_LIBS)					\
	$(GNUTLS_LIBS)					\
	$(SASL_LIBS)					\
97
	$(POLKIT_LIBS)
98

C
Chris Lalancette 已提交
99 100
libvirtd_LDADD += ../src/libvirt_util.la

101 102 103
if WITH_DRIVER_MODULES
  libvirtd_LDADD += ../src/libvirt_driver.la
else
104
if WITH_QEMU
105
    libvirtd_LDADD += ../src/libvirt_driver_qemu.la
106
endif
107

108
if WITH_LXC
109
    libvirtd_LDADD += ../src/libvirt_driver_lxc.la
110
endif
111

112
if WITH_UML
113
    libvirtd_LDADD += ../src/libvirt_driver_uml.la
114
endif
115

D
Daniel Veillard 已提交
116 117 118 119
if WITH_ONE
    libvirtd_LDADD += ../src/libvirt_driver_one.la
endif

120
if WITH_STORAGE_DIR
121
    libvirtd_LDADD += ../src/libvirt_driver_storage.la
122
endif
123

124
if WITH_NETWORK
125
    libvirtd_LDADD += ../src/libvirt_driver_network.la
126
endif
127

128 129 130 131
if WITH_NETCF
    libvirtd_LDADD += ../src/libvirt_driver_interface.la
endif

132
if WITH_NODE_DEVICES
133
    libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
134
endif
135 136 137 138

if WITH_SECRETS
    libvirtd_LDADD += ../src/libvirt_driver_secret.la
endif
139 140 141 142

if WITH_NWFILTER
    libvirtd_LDADD += ../src/libvirt_driver_nwfilter.la
endif
143
endif
144 145

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

147
if HAVE_POLKIT
148
if HAVE_POLKIT0
149
policydir = $(datadir)/PolicyKit/policy
150 151 152 153 154
policyfile = libvirtd.policy-0
else
policydir = $(datadir)/polkit-1/actions
policyfile = libvirtd.policy-1
endif
155 156
endif

157
if HAVE_AVAHI
158
libvirtd_SOURCES += $(AVAHI_SOURCES)
159 160 161 162
libvirtd_CFLAGS += $(AVAHI_CFLAGS)
libvirtd_LDADD += $(AVAHI_LIBS)
endif

163

G
Guido Günther 已提交
164 165
install-data-local: install-init install-data-sasl install-data-polkit \
                    install-logrotate
166
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt
167
	mkdir -p $(DESTDIR)$(localstatedir)/run/libvirt
168
	mkdir -p $(DESTDIR)$(localstatedir)/lib/libvirt
169

170 171
uninstall-local:: uninstall-init uninstall-data-sasl uninstall-data-polkit
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
172
	rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
173
	rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
174

175 176 177
if HAVE_POLKIT
install-data-polkit:: install-init
	mkdir -p $(DESTDIR)$(policydir)
178
	$(INSTALL_DATA) $(srcdir)/$(policyfile) $(DESTDIR)$(policydir)/org.libvirt.unix.policy
179 180 181 182 183 184 185 186
uninstall-data-polkit:: install-init
	rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
else
install-data-polkit::
uninstall-data-polkit::
endif


187
remote.c: remote_dispatch_prototypes.h \
188 189 190
	  remote_dispatch_table.h \
	  remote_dispatch_args.h \
	  remote_dispatch_ret.h
191

192 193 194
REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x

remote_dispatch_prototypes.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
195
	$(AM_V_GEN)perl -w $(srcdir)/remote_generate_stubs.pl -p $(REMOTE_PROTOCOL) > $@
196

197
remote_dispatch_table.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
198
	$(AM_V_GEN)perl -w $(srcdir)/remote_generate_stubs.pl -t $(REMOTE_PROTOCOL) > $@
199

200
remote_dispatch_args.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
201
	$(AM_V_GEN)perl -w $(srcdir)/remote_generate_stubs.pl -a $(REMOTE_PROTOCOL) > $@
202

203
remote_dispatch_ret.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
204
	$(AM_V_GEN)perl -w $(srcdir)/remote_generate_stubs.pl -r $(REMOTE_PROTOCOL) > $@
205

206 207
LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
                  libvirtd.uml.logrotate
208

209 210 211 212 213 214 215 216 217
BUILT_SOURCES += $(LOGROTATE_CONFS)

libvirtd.qemu.logrotate: libvirtd.qemu.logrotate.in
	sed							\
	    -e 's![@]localstatedir[@]!$(localstatedir)!g'	\
	    < $< > $@-t
	mv $@-t $@

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

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

229
install-logrotate: $(LOGROTATE_CONFS)
G
Guido Günther 已提交
230
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu/
231 232
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/lxc/
	mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/uml/
G
Guido Günther 已提交
233
	mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d/
234 235 236
	$(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 已提交
237

238
if LIBVIRT_INIT_SCRIPT_RED_HAT
239
install-init: libvirtd.init libvirt-guests.init
D
Daniel P. Berrange 已提交
240
	mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d
J
Jim Meyering 已提交
241 242
	$(INSTALL_SCRIPT) libvirtd.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
243 244
	$(INSTALL_SCRIPT) libvirt-guests.init \
	  $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests
245
	mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig
J
Jim Meyering 已提交
246 247
	$(INSTALL_SCRIPT) $(srcdir)/libvirtd.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
248 249
	$(INSTALL_SCRIPT) $(srcdir)/libvirt-guests.sysconf \
	  $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
250

D
Daniel P. Berrange 已提交
251
uninstall-init:
J
Jim Meyering 已提交
252
	rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd \
253 254 255
		$(DESTDIR)$(sysconfdir)/sysconfig/libvirtd \
		$(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests \
		$(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
D
Daniel P. Berrange 已提交
256

257
BUILT_SOURCES += libvirtd.init libvirt-guests.init
258

E
Eric Blake 已提交
259
%.init: %.init.in $(top_builddir)/config.status
260
	$(AM_V_GEN)sed					\
261 262 263
	    -e s!\@localstatedir\@!@localstatedir@!g	\
	    -e s!\@sbindir\@!@sbindir@!g		\
	    -e s!\@sysconfdir\@!@sysconfdir@!g		\
264 265 266
	    < $< > $@-t &&				\
	    chmod a+x $@-t &&				\
	    mv $@-t $@
D
Daniel P. Berrange 已提交
267

268
check-local:
J
Jim Meyering 已提交
269 270
	test -x '$(AUGPARSE)' \
	  && '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug || :
271

D
Daniel P. Berrange 已提交
272 273 274 275
else

install-init:
uninstall-init:
276
libvirtd.init:
277

278
endif # LIBVIRT_INIT_SCRIPT_RED_HAT
279

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

284 285 286
else # WITH_LIBVIRTD
install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl
287
endif # WITH_LIBVIRTD
288

289 290 291 292 293 294 295 296 297 298
# 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 已提交
299 300 301
else
install-data-sasl:
uninstall-data-sasl:
302 303 304
endif


305
CLEANFILES = $(BUILT_SOURCES) $(man_MANS) libvirtd.pod
306
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda