2007-02-14 01:40:09 +00:00
|
|
|
## Process this file with automake to produce Makefile.in
|
|
|
|
|
2008-08-20 20:48:35 +00:00
|
|
|
DAEMON_SOURCES = \
|
|
|
|
event.c event.h \
|
|
|
|
qemud.c qemud.h \
|
|
|
|
remote.c \
|
|
|
|
remote_dispatch_prototypes.h \
|
2008-12-04 22:03:24 +00:00
|
|
|
remote_dispatch_table.h \
|
|
|
|
remote_dispatch_args.h \
|
|
|
|
remote_dispatch_ret.h \
|
2008-11-17 11:03:25 +00:00
|
|
|
remote_protocol.h remote_protocol.c
|
2008-08-20 20:48:35 +00:00
|
|
|
|
|
|
|
AVAHI_SOURCES = \
|
|
|
|
mdns.c mdns.h
|
|
|
|
|
|
|
|
EXTRA_DIST = \
|
|
|
|
default-network.xml \
|
|
|
|
remote_generate_stubs.pl rpcgen_fix.pl \
|
|
|
|
remote_protocol.x \
|
|
|
|
libvirtd.conf \
|
|
|
|
libvirtd.init.in \
|
|
|
|
libvirtd.policy \
|
|
|
|
libvirtd.sasl \
|
|
|
|
libvirtd.sysconf \
|
2008-09-04 10:44:23 +00:00
|
|
|
libvirtd.aug \
|
|
|
|
libvirtd_qemu.aug \
|
|
|
|
test_libvirtd.aug \
|
|
|
|
test_libvirtd_qemu.aug \
|
2008-08-20 20:48:35 +00:00
|
|
|
$(AVAHI_SOURCES) \
|
|
|
|
$(DAEMON_SOURCES)
|
2007-12-06 16:34:48 +00:00
|
|
|
|
|
|
|
if RPCGEN
|
2008-02-27 19:12:58 +00:00
|
|
|
SUFFIXES = .x
|
2007-12-06 16:34:48 +00:00
|
|
|
.x.c:
|
2008-10-28 17:48:11 +00:00
|
|
|
rm -f $@ $@-t $@-t2
|
|
|
|
rpcgen -c -o $@-t $<
|
2007-12-06 16:34:48 +00:00
|
|
|
if GLIBC_RPCGEN
|
2008-10-28 17:48:11 +00:00
|
|
|
perl -w rpcgen_fix.pl $@-t > $@-t2
|
|
|
|
chmod 444 $@-t2
|
|
|
|
mv $@-t2 $@
|
2007-12-06 16:34:48 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
.x.h:
|
2008-10-28 17:48:11 +00:00
|
|
|
rm -f $@ $@-t
|
|
|
|
rpcgen -h -o $@-t $<
|
2008-05-22 15:20:25 +00:00
|
|
|
if GLIBC_RPCGEN
|
2008-10-28 17:48:11 +00:00
|
|
|
perl -pi -e 's/\t/ /g' $@-t
|
|
|
|
chmod 444 $@-t
|
|
|
|
mv $@-t $@
|
2008-05-22 15:20:25 +00:00
|
|
|
endif
|
2007-12-06 16:34:48 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
remote_protocol.c: remote_protocol.h
|
|
|
|
|
|
|
|
if WITH_LIBVIRTD
|
|
|
|
|
|
|
|
UUID=$(shell uuidgen)
|
|
|
|
|
|
|
|
sbin_PROGRAMS = libvirtd
|
|
|
|
|
|
|
|
confdir = $(sysconfdir)/libvirt/
|
|
|
|
conf_DATA = libvirtd.conf
|
2007-09-19 01:56:55 +00:00
|
|
|
|
2008-09-04 10:44:23 +00:00
|
|
|
augeasdir = $(datadir)/augeas/lenses
|
|
|
|
augeas_DATA = libvirtd.aug libvirtd_qemu.aug
|
|
|
|
|
|
|
|
augeastestsdir = $(datadir)/augeas/lenses/tests
|
|
|
|
augeastests_DATA = test_libvirtd.aug test_libvirtd_qemu.aug
|
|
|
|
|
2008-08-20 20:48:35 +00:00
|
|
|
libvirtd_SOURCES = $(DAEMON_SOURCES)
|
2007-09-19 01:56:55 +00:00
|
|
|
|
2007-02-14 01:40:09 +00:00
|
|
|
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
|
2007-06-26 23:04:49 +00:00
|
|
|
libvirtd_CFLAGS = \
|
2008-02-28 17:06:32 +00:00
|
|
|
-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
|
|
|
|
-I$(top_srcdir)/include -I$(top_builddir)/include \
|
Standardize use of header files, making internal.h primary.
* qemud/internal.h, qemud/qemud.h: Rename this file so it
doesn't conflict with src/internal.h.
* HACKING: Document how header files should be used.
* qemud/Makefile.am: Add src/ directory to includes.
* qemud/event.c, qemud/mdns.c, qemud/qemud.c, qemud/remote.c,
qemud/remote_protocol.c, qemud/remote_protocol.h,
qemud/remote_protocol.x, src/buf.c, src/libvirt.c,
src/nodeinfo.c, src/qemu_conf.c, src/qemu_driver.c,
src/stats_linux.c, src/storage_backend.c, src/storage_backend_fs.c,
src/storage_backend_iscsi.c, src/storage_backend_logical.c,
src/storage_conf.c, src/storage_driver.c, src/util.c,
src/util.h, src/virsh.c, src/virterror.c, src/xend_internal.c,
src/xml.c, tests/reconnect.c, tests/xmlrpctest.c,
tests/qparamtest.c: Standardize use of header files.
* docs/*, po/*: Rebuild docs.
2008-05-23 08:24:41 +00:00
|
|
|
-I$(top_srcdir)/src \
|
2008-02-28 17:06:32 +00:00
|
|
|
$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
|
|
|
|
$(POLKIT_CFLAGS) \
|
|
|
|
$(WARN_CFLAGS) -DLOCAL_STATE_DIR="\"$(localstatedir)\"" \
|
|
|
|
$(COVERAGE_CFLAGS) \
|
|
|
|
-DSYSCONF_DIR="\"$(sysconfdir)\"" \
|
2007-06-11 12:04:54 +00:00
|
|
|
-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\"" \
|
2007-06-26 20:51:00 +00:00
|
|
|
-DREMOTE_PID_FILE="\"$(REMOTE_PID_FILE)\"" \
|
2008-02-28 17:06:32 +00:00
|
|
|
-DGETTEXT_PACKAGE=\"$(PACKAGE)\"
|
|
|
|
|
|
|
|
libvirtd_LDFLAGS = \
|
|
|
|
$(WARN_CFLAGS) $(LIBXML_LIBS) $(GNUTLS_LIBS) $(SASL_LIBS) \
|
2008-02-29 17:02:41 +00:00
|
|
|
$(COVERAGE_LDFLAGS) \
|
2008-02-28 17:06:32 +00:00
|
|
|
$(POLKIT_LIBS)
|
2007-06-26 20:51:00 +00:00
|
|
|
|
2008-11-17 12:18:18 +00:00
|
|
|
libvirtd_LDADD = \
|
|
|
|
../gnulib/lib/libgnu.la
|
|
|
|
|
2008-11-21 12:16:08 +00:00
|
|
|
if ! WITH_DRIVER_MODULES
|
2008-11-17 12:18:18 +00:00
|
|
|
if WITH_QEMU
|
|
|
|
libvirtd_LDADD += ../src/libvirt_driver_qemu.la
|
|
|
|
endif
|
|
|
|
|
|
|
|
if WITH_LXC
|
|
|
|
libvirtd_LDADD += ../src/libvirt_driver_lxc.la
|
|
|
|
endif
|
|
|
|
|
2008-11-19 16:58:23 +00:00
|
|
|
if WITH_UML
|
|
|
|
libvirtd_LDADD += ../src/libvirt_driver_uml.la
|
|
|
|
endif
|
|
|
|
|
2008-11-17 12:18:18 +00:00
|
|
|
if WITH_STORAGE_DIR
|
|
|
|
libvirtd_LDADD += ../src/libvirt_driver_storage.la
|
|
|
|
endif
|
|
|
|
|
|
|
|
if WITH_NETWORK
|
|
|
|
libvirtd_LDADD += ../src/libvirt_driver_network.la
|
|
|
|
endif
|
2008-11-21 12:27:11 +00:00
|
|
|
|
|
|
|
if WITH_NODE_DEVICES
|
|
|
|
libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
|
|
|
|
endif
|
2008-11-21 12:16:08 +00:00
|
|
|
endif
|
2008-11-17 12:18:18 +00:00
|
|
|
|
|
|
|
libvirtd_LDADD += ../src/libvirt.la
|
2007-02-14 01:40:09 +00:00
|
|
|
|
2007-12-05 18:21:27 +00:00
|
|
|
if HAVE_POLKIT
|
|
|
|
policydir = $(datadir)/PolicyKit/policy
|
|
|
|
endif
|
|
|
|
|
2007-09-19 01:56:55 +00:00
|
|
|
if HAVE_AVAHI
|
2008-08-20 20:48:35 +00:00
|
|
|
libvirtd_SOURCES += $(AVAHI_SOURCES)
|
2007-09-19 01:56:55 +00:00
|
|
|
libvirtd_CFLAGS += $(AVAHI_CFLAGS)
|
|
|
|
libvirtd_LDADD += $(AVAHI_LIBS)
|
|
|
|
endif
|
|
|
|
|
2008-11-28 11:20:27 +00:00
|
|
|
libvirtd_DEPENDENCIES = $(libvirtd_LDADD)
|
|
|
|
|
|
|
|
|
2007-11-15 13:04:28 +00:00
|
|
|
default_xml_dest = libvirt/qemu/networks/default.xml
|
2008-07-11 09:51:25 +00:00
|
|
|
install-data-local: install-init install-data-sasl install-data-polkit
|
2007-03-07 11:54:29 +00:00
|
|
|
mkdir -p $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart
|
2007-11-15 13:04:28 +00:00
|
|
|
$(INSTALL_DATA) $(srcdir)/default-network.xml \
|
|
|
|
$(DESTDIR)$(sysconfdir)/$(default_xml_dest)
|
|
|
|
sed -i -e "s,</name>,</name>\n <uuid>$(UUID)</uuid>," \
|
|
|
|
$(DESTDIR)$(sysconfdir)/$(default_xml_dest)
|
2007-03-08 14:00:00 +00:00
|
|
|
test -e $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml || \
|
2007-11-15 13:04:28 +00:00
|
|
|
ln -s ../default.xml \
|
|
|
|
$(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml
|
2007-05-18 18:36:24 +00:00
|
|
|
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu
|
2007-03-08 23:31:28 +00:00
|
|
|
mkdir -p $(DESTDIR)$(localstatedir)/run/libvirt
|
2007-03-13 22:43:22 +00:00
|
|
|
mkdir -p $(DESTDIR)$(localstatedir)/lib/libvirt
|
2007-03-07 11:54:29 +00:00
|
|
|
|
2008-07-11 09:51:25 +00:00
|
|
|
uninstall-local:: uninstall-init uninstall-data-sasl install-data-polkit
|
2007-03-07 11:54:29 +00:00
|
|
|
rm -f $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml
|
2007-11-15 13:04:28 +00:00
|
|
|
rm -f $(DESTDIR)$(sysconfdir)/$(default_xml_dest)
|
2007-03-07 11:54:29 +00:00
|
|
|
rmdir $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart || :
|
2007-05-18 18:36:24 +00:00
|
|
|
rmdir $(DESTDIR)$(localstatedir)/log/libvirt/qemu || :
|
2007-03-08 23:31:28 +00:00
|
|
|
rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
|
2007-03-13 22:43:22 +00:00
|
|
|
rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
|
2007-03-07 11:54:29 +00:00
|
|
|
|
2007-12-05 15:24:15 +00:00
|
|
|
if HAVE_SASL
|
|
|
|
install-data-sasl:: install-init
|
|
|
|
mkdir -p $(DESTDIR)$(sysconfdir)/sasl2/
|
|
|
|
$(INSTALL_DATA) $(srcdir)/libvirtd.sasl $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
|
|
|
|
|
|
|
|
uninstall-data-sasl:: install-init
|
|
|
|
rm -f $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
|
|
|
|
rmdir $(DESTDIR)$(sysconfdir)/sasl2/
|
|
|
|
else
|
|
|
|
install-data-sasl:
|
|
|
|
uninstall-data-sasl:
|
|
|
|
endif
|
2007-06-11 12:04:54 +00:00
|
|
|
|
2008-07-11 09:51:25 +00:00
|
|
|
if HAVE_POLKIT
|
|
|
|
install-data-polkit:: install-init
|
|
|
|
mkdir -p $(DESTDIR)$(policydir)
|
2008-10-06 10:24:31 +00:00
|
|
|
$(INSTALL_DATA) $(srcdir)/libvirtd.policy $(DESTDIR)$(policydir)/org.libvirt.unix.policy
|
2008-07-11 09:51:25 +00:00
|
|
|
uninstall-data-polkit:: install-init
|
|
|
|
rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
|
|
|
|
else
|
|
|
|
install-data-polkit::
|
|
|
|
uninstall-data-polkit::
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2007-06-11 12:04:54 +00:00
|
|
|
remote.c: remote_dispatch_prototypes.h \
|
2008-12-04 22:03:24 +00:00
|
|
|
remote_dispatch_table.h \
|
|
|
|
remote_dispatch_args.h \
|
|
|
|
remote_dispatch_ret.h
|
2007-06-11 12:04:54 +00:00
|
|
|
|
2007-12-05 15:34:05 +00:00
|
|
|
remote_dispatch_prototypes.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
|
2008-12-04 22:03:24 +00:00
|
|
|
perl -w $(srcdir)/remote_generate_stubs.pl -p $(srcdir)/remote_protocol.x > $@
|
2007-06-11 12:04:54 +00:00
|
|
|
|
2008-12-04 22:03:24 +00:00
|
|
|
remote_dispatch_table.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
|
|
|
|
perl -w $(srcdir)/remote_generate_stubs.pl -t $(srcdir)/remote_protocol.x > $@
|
|
|
|
|
|
|
|
remote_dispatch_args.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
|
|
|
|
perl -w $(srcdir)/remote_generate_stubs.pl -a $(srcdir)/remote_protocol.x > $@
|
|
|
|
|
|
|
|
remote_dispatch_ret.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
|
|
|
|
perl -w $(srcdir)/remote_generate_stubs.pl -r $(srcdir)/remote_protocol.x > $@
|
2007-06-11 12:04:54 +00:00
|
|
|
|
2007-02-23 12:50:58 +00:00
|
|
|
|
|
|
|
if LIBVIRT_INIT_SCRIPTS_RED_HAT
|
2007-06-26 23:03:48 +00:00
|
|
|
install-init: libvirtd.init
|
|
|
|
mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d
|
2007-11-15 13:04:28 +00:00
|
|
|
$(INSTALL_SCRIPT) libvirtd.init \
|
|
|
|
$(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
|
2007-06-26 23:48:46 +00:00
|
|
|
mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig
|
2007-11-15 13:04:28 +00:00
|
|
|
$(INSTALL_SCRIPT) $(srcdir)/libvirtd.sysconf \
|
|
|
|
$(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
|
2007-02-23 12:50:58 +00:00
|
|
|
|
2007-06-26 23:03:48 +00:00
|
|
|
uninstall-init:
|
2007-11-15 13:04:28 +00:00
|
|
|
rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd \
|
|
|
|
$(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
|
2007-06-26 23:03:48 +00:00
|
|
|
|
|
|
|
libvirtd.init: libvirtd.init.in
|
2007-02-23 12:50:58 +00:00
|
|
|
sed \
|
2007-06-27 00:12:29 +00:00
|
|
|
-e s!\@localstatedir\@!@localstatedir@!g \
|
|
|
|
-e s!\@sbindir\@!@sbindir@!g \
|
|
|
|
-e s!\@sysconfdir\@!@sysconfdir@!g \
|
2007-11-15 13:04:28 +00:00
|
|
|
< $< > $@-t
|
|
|
|
chmod a+x $@-t
|
|
|
|
mv $@-t $@
|
2007-06-26 23:03:48 +00:00
|
|
|
|
2008-09-04 10:44:23 +00:00
|
|
|
check-local:
|
2008-09-04 13:17:47 +00:00
|
|
|
if [ -x $(AUGPARSE) ]; then $(AUGPARSE) -I $(srcdir) test_libvirtd.aug ; fi
|
2008-09-04 10:44:23 +00:00
|
|
|
|
2007-06-26 23:03:48 +00:00
|
|
|
else
|
|
|
|
|
|
|
|
install-init:
|
|
|
|
uninstall-init:
|
2007-02-23 12:50:58 +00:00
|
|
|
|
|
|
|
endif # DBUS_INIT_SCRIPTS_RED_HAT
|
2007-12-06 16:34:48 +00:00
|
|
|
|
Move safewrite and saferead to a separate file.
We currently use safewrite from inside libvirt and don't want to publish
any such function name. However, we do want to use it in applications
like virsh, libvirtd and libvirt_proxy that link with libvirt. To that
end, this change moves that function definition (along with the nearly
identical saferead) into a new file, util-lib.c. To avoid maintaining
separate copies of even such small functions, we simply include that new
file from util.c. Then, the separate applications that need to use
safewrite simply compile and link with util-lib.c.
Of course, this does mean that each of those applications will
containing two copies of these functions. However, the functions
are so small that it's not worth worrying about that.
* src/util.c (saferead, safewrite): Move function definitions to
util-lib.c and include that .c file.
* src/util-lib.c (saferead, safewrite): New file. Functions from src/util.c
with slight change (s/int r =/ssize_t r =/) to reflect read/write return type.
* src/util-lib.h: Declare the two moved functions.
* src/util.h: Remove declarations. Include src/util-lib.h.
* proxy/Makefile.am (libvirt_proxy_SOURCES): Add src/util-lib.c.
* qemud/Makefile.am (libvirtd_SOURCES): Likewise.
* src/Makefile.am (virsh_SOURCES): Add util-lib.c. Remove some SP-before-TAB.
2008-02-22 15:53:13 +00:00
|
|
|
endif # WITH_LIBVIRTD
|
2008-02-28 17:06:32 +00:00
|
|
|
|
|
|
|
CLEANFILES = libvirtd.init
|
|
|
|
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
|