2007-02-14 09:40:09 +08:00
|
|
|
## Process this file with automake to produce Makefile.in
|
|
|
|
|
2008-08-21 04:48:35 +08:00
|
|
|
DAEMON_SOURCES = \
|
|
|
|
event.c event.h \
|
2009-09-16 19:37:26 +08:00
|
|
|
libvirtd.c libvirtd.h \
|
2009-07-10 19:20:03 +08:00
|
|
|
remote.c remote.h \
|
|
|
|
dispatch.c dispatch.h \
|
2008-08-21 04:48:35 +08:00
|
|
|
remote_dispatch_prototypes.h \
|
2008-12-05 06:03:24 +08:00
|
|
|
remote_dispatch_table.h \
|
|
|
|
remote_dispatch_args.h \
|
|
|
|
remote_dispatch_ret.h \
|
2008-11-17 19:03:25 +08:00
|
|
|
remote_protocol.h remote_protocol.c
|
2008-08-21 04:48:35 +08:00
|
|
|
|
|
|
|
AVAHI_SOURCES = \
|
|
|
|
mdns.c mdns.h
|
|
|
|
|
2008-12-11 03:21:00 +08:00
|
|
|
DISTCLEANFILES =
|
2008-08-21 04:48:35 +08:00
|
|
|
EXTRA_DIST = \
|
|
|
|
remote_generate_stubs.pl rpcgen_fix.pl \
|
|
|
|
remote_protocol.x \
|
|
|
|
libvirtd.conf \
|
|
|
|
libvirtd.init.in \
|
2009-08-06 20:54:08 +08:00
|
|
|
libvirtd.policy-0 \
|
|
|
|
libvirtd.policy-1 \
|
2008-08-21 04:48:35 +08:00
|
|
|
libvirtd.sasl \
|
|
|
|
libvirtd.sysconf \
|
2008-09-04 18:44:23 +08:00
|
|
|
libvirtd.aug \
|
2008-12-11 03:21:00 +08:00
|
|
|
libvirtd.logrotate.in \
|
2008-09-04 18:44:23 +08:00
|
|
|
test_libvirtd.aug \
|
2008-08-21 04:48:35 +08:00
|
|
|
$(AVAHI_SOURCES) \
|
|
|
|
$(DAEMON_SOURCES)
|
2007-12-07 00:34:48 +08:00
|
|
|
|
2009-05-29 22:29:22 +08:00
|
|
|
BUILT_SOURCES =
|
2009-05-19 21:22:00 +08:00
|
|
|
|
2009-01-29 05:33:56 +08:00
|
|
|
if HAVE_RPCGEN
|
|
|
|
#
|
|
|
|
# Maintainer-only target for re-generating the derived .c/.h source
|
|
|
|
# files, which are actually derived from the .x file.
|
|
|
|
#
|
|
|
|
# For committing protocol changes to CVS, the GLIBC rpcgen *must*
|
|
|
|
# be used.
|
|
|
|
#
|
|
|
|
# Support for non-GLIB rpcgen is here as a convenience for
|
|
|
|
# non-Linux people needing to test changes during dev.
|
|
|
|
#
|
|
|
|
rpcgen:
|
|
|
|
rm -f rp.c-t rp.h-t rp.c-t1 rp.c-t2 rp.h-t1
|
|
|
|
$(RPCGEN) -h -o rp.h-t $(srcdir)/remote_protocol.x
|
|
|
|
$(RPCGEN) -c -o rp.c-t $(srcdir)/remote_protocol.x
|
|
|
|
if HAVE_GLIBC_RPCGEN
|
|
|
|
perl -w $(srcdir)/rpcgen_fix.pl rp.h-t > rp.h-t1
|
|
|
|
perl -w $(srcdir)/rpcgen_fix.pl rp.c-t > rp.c-t1
|
|
|
|
(echo '#include <config.h>'; cat rp.c-t1) > rp.c-t2
|
|
|
|
chmod 0444 rp.c-t2 rp.h-t1
|
|
|
|
mv -f rp.h-t1 $(srcdir)/remote_protocol.h
|
|
|
|
mv -f rp.c-t2 $(srcdir)/remote_protocol.c
|
|
|
|
rm -f rp.c-t rp.h-t rp.c-t1
|
2009-01-13 03:19:22 +08:00
|
|
|
else
|
2009-01-29 05:33:56 +08:00
|
|
|
chmod 0444 rp.c-t rp.h-t
|
|
|
|
mv -f rp.h-t $(srcdir)/remote_protocol.h
|
|
|
|
mv -f rp.c-t $(srcdir)/remote_protocol.c
|
2009-01-13 03:19:22 +08:00
|
|
|
endif
|
2008-05-22 23:20:25 +08:00
|
|
|
endif
|
2007-12-07 00:34:48 +08:00
|
|
|
|
|
|
|
remote_protocol.c: remote_protocol.h
|
|
|
|
|
|
|
|
if WITH_LIBVIRTD
|
|
|
|
|
|
|
|
sbin_PROGRAMS = libvirtd
|
|
|
|
|
|
|
|
confdir = $(sysconfdir)/libvirt/
|
|
|
|
conf_DATA = libvirtd.conf
|
2007-09-19 09:56:55 +08:00
|
|
|
|
2008-09-04 18:44:23 +08:00
|
|
|
augeasdir = $(datadir)/augeas/lenses
|
2009-09-16 19:31:13 +08:00
|
|
|
augeas_DATA = libvirtd.aug
|
2008-09-04 18:44:23 +08:00
|
|
|
|
|
|
|
augeastestsdir = $(datadir)/augeas/lenses/tests
|
2009-09-16 19:31:13 +08:00
|
|
|
augeastests_DATA = test_libvirtd.aug
|
2008-09-04 18:44:23 +08:00
|
|
|
|
2008-08-21 04:48:35 +08:00
|
|
|
libvirtd_SOURCES = $(DAEMON_SOURCES)
|
2007-09-19 09:56:55 +08:00
|
|
|
|
2007-02-14 09:40:09 +08:00
|
|
|
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
|
2007-06-27 07:04:49 +08:00
|
|
|
libvirtd_CFLAGS = \
|
2008-02-29 01:06:32 +08: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 16:24:41 +08:00
|
|
|
-I$(top_srcdir)/src \
|
2008-02-29 01:06:32 +08:00
|
|
|
$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
|
|
|
|
$(POLKIT_CFLAGS) \
|
|
|
|
$(WARN_CFLAGS) -DLOCAL_STATE_DIR="\"$(localstatedir)\"" \
|
|
|
|
$(COVERAGE_CFLAGS) \
|
|
|
|
-DSYSCONF_DIR="\"$(sysconfdir)\"" \
|
2007-06-11 20:04:54 +08:00
|
|
|
-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\"" \
|
2007-06-27 04:51:00 +08:00
|
|
|
-DREMOTE_PID_FILE="\"$(REMOTE_PID_FILE)\"" \
|
2008-02-29 01:06:32 +08:00
|
|
|
-DGETTEXT_PACKAGE=\"$(PACKAGE)\"
|
|
|
|
|
2008-12-08 20:04:27 +08:00
|
|
|
libvirtd_LDFLAGS = \
|
|
|
|
$(WARN_CFLAGS) \
|
|
|
|
$(COVERAGE_LDFLAGS)
|
2007-06-27 04:51:00 +08:00
|
|
|
|
2008-11-17 20:18:18 +08:00
|
|
|
libvirtd_LDADD = \
|
2008-12-08 20:04:27 +08:00
|
|
|
$(LIBXML_LIBS) \
|
|
|
|
$(GNUTLS_LIBS) \
|
|
|
|
$(SASL_LIBS) \
|
2008-12-12 02:11:41 +08:00
|
|
|
$(POLKIT_LIBS)
|
2008-11-17 20:18:18 +08:00
|
|
|
|
2009-02-17 18:34:30 +08:00
|
|
|
if WITH_DRIVER_MODULES
|
|
|
|
libvirtd_LDADD += ../src/libvirt_driver.la
|
|
|
|
libvirtd_LDADD += ../src/libvirt_util.la
|
|
|
|
else
|
2009-02-17 22:46:21 +08:00
|
|
|
if WITH_QEMU
|
2009-02-17 18:34:30 +08:00
|
|
|
libvirtd_LDADD += ../src/libvirt_driver_qemu.la
|
2009-02-17 22:46:21 +08:00
|
|
|
endif
|
2008-11-17 20:18:18 +08:00
|
|
|
|
2009-02-17 22:46:21 +08:00
|
|
|
if WITH_LXC
|
2009-02-17 18:34:30 +08:00
|
|
|
libvirtd_LDADD += ../src/libvirt_driver_lxc.la
|
2009-02-17 22:46:21 +08:00
|
|
|
endif
|
2008-11-17 20:18:18 +08:00
|
|
|
|
2009-02-17 22:46:21 +08:00
|
|
|
if WITH_UML
|
2009-02-17 18:34:30 +08:00
|
|
|
libvirtd_LDADD += ../src/libvirt_driver_uml.la
|
2009-02-17 22:46:21 +08:00
|
|
|
endif
|
2008-11-20 00:58:23 +08:00
|
|
|
|
2009-05-25 19:56:00 +08:00
|
|
|
if WITH_ONE
|
|
|
|
libvirtd_LDADD += ../src/libvirt_driver_one.la
|
|
|
|
endif
|
|
|
|
|
2009-02-17 22:46:21 +08:00
|
|
|
if WITH_STORAGE_DIR
|
2009-02-17 18:34:30 +08:00
|
|
|
libvirtd_LDADD += ../src/libvirt_driver_storage.la
|
2009-02-17 22:46:21 +08:00
|
|
|
endif
|
2008-11-17 20:18:18 +08:00
|
|
|
|
2009-02-17 22:46:21 +08:00
|
|
|
if WITH_NETWORK
|
2009-02-17 18:34:30 +08:00
|
|
|
libvirtd_LDADD += ../src/libvirt_driver_network.la
|
2009-02-17 22:46:21 +08:00
|
|
|
endif
|
2008-11-21 20:27:11 +08:00
|
|
|
|
2009-07-21 22:02:16 +08:00
|
|
|
if WITH_NETCF
|
|
|
|
libvirtd_LDADD += ../src/libvirt_driver_interface.la
|
|
|
|
endif
|
|
|
|
|
2009-02-17 22:46:21 +08:00
|
|
|
if WITH_NODE_DEVICES
|
2009-02-17 18:34:30 +08:00
|
|
|
libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
|
2009-02-17 22:46:21 +08:00
|
|
|
endif
|
2008-11-21 20:16:08 +08:00
|
|
|
endif
|
2008-11-17 20:18:18 +08:00
|
|
|
|
|
|
|
libvirtd_LDADD += ../src/libvirt.la
|
2007-02-14 09:40:09 +08:00
|
|
|
|
2007-12-06 02:21:27 +08:00
|
|
|
if HAVE_POLKIT
|
2009-08-06 20:54:08 +08:00
|
|
|
if HAVE_POLKIT0
|
2007-12-06 02:21:27 +08:00
|
|
|
policydir = $(datadir)/PolicyKit/policy
|
2009-08-06 20:54:08 +08:00
|
|
|
policyfile = libvirtd.policy-0
|
|
|
|
else
|
|
|
|
policydir = $(datadir)/polkit-1/actions
|
|
|
|
policyfile = libvirtd.policy-1
|
|
|
|
endif
|
2007-12-06 02:21:27 +08:00
|
|
|
endif
|
|
|
|
|
2007-09-19 09:56:55 +08:00
|
|
|
if HAVE_AVAHI
|
2008-08-21 04:48:35 +08:00
|
|
|
libvirtd_SOURCES += $(AVAHI_SOURCES)
|
2007-09-19 09:56:55 +08:00
|
|
|
libvirtd_CFLAGS += $(AVAHI_CFLAGS)
|
|
|
|
libvirtd_LDADD += $(AVAHI_LIBS)
|
|
|
|
endif
|
|
|
|
|
2008-11-28 19:20:27 +08:00
|
|
|
|
2008-12-10 04:22:39 +08:00
|
|
|
install-data-local: install-init install-data-sasl install-data-polkit \
|
|
|
|
install-logrotate
|
2009-09-16 19:31:13 +08:00
|
|
|
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt
|
2007-03-09 07:31:28 +08:00
|
|
|
mkdir -p $(DESTDIR)$(localstatedir)/run/libvirt
|
2007-03-14 06:43:22 +08:00
|
|
|
mkdir -p $(DESTDIR)$(localstatedir)/lib/libvirt
|
2007-03-07 19:54:29 +08:00
|
|
|
|
2009-09-16 19:31:13 +08:00
|
|
|
uninstall-local:: uninstall-init uninstall-data-sasl uninstall-data-polkit
|
|
|
|
rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
|
2007-03-09 07:31:28 +08:00
|
|
|
rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
|
2007-03-14 06:43:22 +08:00
|
|
|
rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
|
2007-03-07 19:54:29 +08:00
|
|
|
|
2008-07-11 17:51:25 +08:00
|
|
|
if HAVE_POLKIT
|
|
|
|
install-data-polkit:: install-init
|
|
|
|
mkdir -p $(DESTDIR)$(policydir)
|
2009-08-06 20:54:08 +08:00
|
|
|
$(INSTALL_DATA) $(srcdir)/$(policyfile) $(DESTDIR)$(policydir)/org.libvirt.unix.policy
|
2008-07-11 17:51:25 +08: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 20:04:54 +08:00
|
|
|
remote.c: remote_dispatch_prototypes.h \
|
2008-12-05 06:03:24 +08:00
|
|
|
remote_dispatch_table.h \
|
|
|
|
remote_dispatch_args.h \
|
|
|
|
remote_dispatch_ret.h
|
2007-06-11 20:04:54 +08:00
|
|
|
|
2007-12-05 23:34:05 +08:00
|
|
|
remote_dispatch_prototypes.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
|
2008-12-05 06:03:24 +08:00
|
|
|
perl -w $(srcdir)/remote_generate_stubs.pl -p $(srcdir)/remote_protocol.x > $@
|
2007-06-11 20:04:54 +08:00
|
|
|
|
2008-12-05 06:03:24 +08: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 20:04:54 +08:00
|
|
|
|
2009-05-29 22:29:22 +08:00
|
|
|
BUILT_SOURCES += libvirtd.logrotate
|
|
|
|
|
2008-12-10 04:22:39 +08:00
|
|
|
libvirtd.logrotate: libvirtd.logrotate.in
|
|
|
|
sed \
|
|
|
|
-e s!\@localstatedir\@!@localstatedir@!g \
|
|
|
|
< $< > $@-t
|
|
|
|
mv $@-t $@
|
|
|
|
|
|
|
|
install-logrotate: libvirtd.logrotate
|
|
|
|
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu/
|
|
|
|
mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d/
|
|
|
|
$(INSTALL_DATA) $< $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd
|
|
|
|
|
2007-02-23 20:50:58 +08:00
|
|
|
if LIBVIRT_INIT_SCRIPTS_RED_HAT
|
2007-06-27 07:03:48 +08:00
|
|
|
install-init: libvirtd.init
|
|
|
|
mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d
|
2007-11-15 21:04:28 +08:00
|
|
|
$(INSTALL_SCRIPT) libvirtd.init \
|
|
|
|
$(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
|
2007-06-27 07:48:46 +08:00
|
|
|
mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig
|
2007-11-15 21:04:28 +08:00
|
|
|
$(INSTALL_SCRIPT) $(srcdir)/libvirtd.sysconf \
|
|
|
|
$(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
|
2007-02-23 20:50:58 +08:00
|
|
|
|
2007-06-27 07:03:48 +08:00
|
|
|
uninstall-init:
|
2007-11-15 21:04:28 +08:00
|
|
|
rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd \
|
|
|
|
$(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
|
2007-06-27 07:03:48 +08:00
|
|
|
|
2009-05-29 22:29:22 +08:00
|
|
|
BUILT_SOURCES += libvirtd.init
|
|
|
|
|
2007-06-27 07:03:48 +08:00
|
|
|
libvirtd.init: libvirtd.init.in
|
2007-02-23 20:50:58 +08:00
|
|
|
sed \
|
2007-06-27 08:12:29 +08:00
|
|
|
-e s!\@localstatedir\@!@localstatedir@!g \
|
|
|
|
-e s!\@sbindir\@!@sbindir@!g \
|
|
|
|
-e s!\@sysconfdir\@!@sysconfdir@!g \
|
2007-11-15 21:04:28 +08:00
|
|
|
< $< > $@-t
|
|
|
|
chmod a+x $@-t
|
|
|
|
mv $@-t $@
|
2007-06-27 07:03:48 +08:00
|
|
|
|
2008-09-04 18:44:23 +08:00
|
|
|
check-local:
|
2009-01-13 02:21:49 +08:00
|
|
|
test -x '$(AUGPARSE)' \
|
|
|
|
&& '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug || :
|
2008-09-04 18:44:23 +08:00
|
|
|
|
2007-06-27 07:03:48 +08:00
|
|
|
else
|
|
|
|
|
|
|
|
install-init:
|
|
|
|
uninstall-init:
|
2009-05-19 21:22:00 +08:00
|
|
|
libvirtd.init:
|
2007-02-23 20:50:58 +08:00
|
|
|
|
|
|
|
endif # DBUS_INIT_SCRIPTS_RED_HAT
|
2007-12-07 00:34:48 +08:00
|
|
|
|
2008-12-12 02:11:41 +08:00
|
|
|
# This must be added last, since functions it provides/replaces
|
|
|
|
# are used by nearly every other library.
|
2009-01-09 04:42:01 +08:00
|
|
|
libvirtd_LDADD += ../gnulib/lib/libgnu.la $(LIBSOCKET)
|
2008-12-12 02:11:41 +08:00
|
|
|
|
2009-09-16 23:02:38 +08:00
|
|
|
else # WITH_LIBVIRTD
|
|
|
|
install-data-local: install-data-sasl
|
|
|
|
uninstall-local:: uninstall-data-sasl
|
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 23:53:13 +08:00
|
|
|
endif # WITH_LIBVIRTD
|
2008-02-29 01:06:32 +08:00
|
|
|
|
2009-09-16 23:02:38 +08:00
|
|
|
# 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/
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2009-05-19 21:22:00 +08:00
|
|
|
CLEANFILES = $(BUILT_SOURCES)
|
2008-02-29 01:06:32 +08:00
|
|
|
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
|