2007-02-14 09:40:09 +08:00
|
|
|
## Process this file with automake to produce Makefile.in
|
|
|
|
|
2007-09-19 09:56:55 +08:00
|
|
|
# Distribute the generated files so that rpcgen isn't required on the
|
|
|
|
# target machine (although almost any Unix machine will have it).
|
|
|
|
EXTRA_DIST = libvirtd.init.in libvirtd.sysconf default-network.xml \
|
2007-11-17 19:17:48 +08:00
|
|
|
remote_protocol.x \
|
2007-09-19 09:56:55 +08:00
|
|
|
remote_protocol.c remote_protocol.h \
|
|
|
|
remote_generate_stubs.pl rpcgen_fix.pl \
|
|
|
|
remote_dispatch_prototypes.h \
|
|
|
|
remote_dispatch_localvars.h \
|
|
|
|
remote_dispatch_proc_switch.h \
|
2007-10-13 03:54:15 +08:00
|
|
|
mdns.c mdns.h \
|
2007-12-05 23:24:15 +08:00
|
|
|
libvirtd.sasl \
|
2007-12-07 00:34:48 +08:00
|
|
|
libvirtd.conf
|
|
|
|
|
|
|
|
if RPCGEN
|
|
|
|
.x.c:
|
|
|
|
rm -f $@
|
|
|
|
rpcgen -c -o $@ $<
|
|
|
|
if GLIBC_RPCGEN
|
|
|
|
mv $@ $@.bak
|
|
|
|
perl -w rpcgen_fix.pl < $@.bak > $@
|
|
|
|
endif
|
|
|
|
|
|
|
|
.x.h:
|
|
|
|
rm -f $@
|
|
|
|
rpcgen -h -o $@ $<
|
|
|
|
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 09:56:55 +08:00
|
|
|
|
2007-06-27 07:04:49 +08:00
|
|
|
libvirtd_SOURCES = \
|
2007-06-11 20:04:54 +08:00
|
|
|
qemud.c internal.h \
|
|
|
|
remote_protocol.h remote_protocol.c \
|
2007-06-27 03:11:00 +08:00
|
|
|
remote.c \
|
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
|
|
|
$(srcdir)/../src/util-lib.c \
|
2007-09-19 09:56:55 +08:00
|
|
|
event.c event.h
|
|
|
|
|
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 = \
|
Use gnulib, starting with its physmem and getaddrinfo modules.
New files go into these directories:
gnulib/lib
gnulib/m4
gnulib/tests
* bootstrap: A wrapper around gnulib-tool.
* configure.in: Invoke gl_EARLY and gl_INIT, being careful to put gl_EARLY
before any macro that uses AC_COMPILE_IFELSE.
(AC_OUTPUT): Add lib/Makefile and gl-tests/Makefile. Remove m4/Makefile.
* Makefile.am (SUBDIRS): Add gnulib/lib and remove m4. Add gnulib/tests
early enough that those tests run before any libvirt unit tests.
* m4/Makefile.am: Remove file. Not needed.
* src/Makefile.am (INCLUDES): Add -I$(top_srcdir)/gnulib/lib -I../gnulib/lib.
(LDADDS, libvirt_la_LIBADD): Add ../gnulib/lib/libgnu.la.
* src/nodeinfo.c: Include "physmem.h".
* qemud/qemud.c, src/remote_internal.c: Include "getaddrinfo.h".
(MEMINFO_PATH, linuxNodeInfoMemPopulate): Remove definitions.
(virNodeInfoPopulate): Use physmem_total, not linuxNodeInfoMemPopulate.
* tests/Makefile.am (INCLUDES): Add -I$(top_srcdir)/gnulib/lib -I../gnulib/lib.
(LDADDS): Add ../gnulib/lib/libgnu.la.
* qemud/Makefile.am (libvirtd_LDADD): Add ../gnulib/lib/libgnu.la.
* tests/nodeinfotest.c (linuxTestCompareFiles): No longer read total
memory from a file.
Update expected output not to include "Memory: NNNN"
* tests/nodeinfodata/linux-nodeinfo-1.txt:
* tests/nodeinfodata/linux-nodeinfo-2.txt:
* tests/nodeinfodata/linux-nodeinfo-3.txt:
* tests/nodeinfodata/linux-nodeinfo-4.txt:
* tests/nodeinfodata/linux-nodeinfo-5.txt:
* tests/nodeinfodata/linux-nodeinfo-6.txt:
* src/test.c [WITH_TEST]: Remove definition of _GNU_SOURCE that
would conflict with the one now in "config.h".
* autogen.sh: Add -I gnulib/m4.
* src/conf.c, src/sexpr.c: Don't define _GNU_SOURCE.
Instead, include "config.h".
* qemud/qemud.c: Remove definition of _GNU_SOURCE.
* src/openvz_driver.c: Likewise.
* src/qemu_driver.c: Likewise.
* src/remote_internal.c: Likewise.
* configure.in: Use AC_CONFIG_AUX_DIR(build-aux), so that a bunch
of gettextize-generated files go into build-aux/, rather than in
the top-level directory.
* .cvsignore: Adjust.
* build-aux/.cvsignore: New file.
Author: Jim Meyering <meyering@redhat.com>
2007-12-06 05:31:07 +08:00
|
|
|
-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
|
2007-09-20 01:42:40 +08:00
|
|
|
-I$(top_srcdir)/include -I$(top_builddir)/include \
|
2007-12-05 23:24:15 +08:00
|
|
|
$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
|
2007-12-06 02:21:27 +08:00
|
|
|
$(POLKIT_CFLAGS) \
|
2007-03-02 00:18:55 +08:00
|
|
|
$(WARN_CFLAGS) -DLOCAL_STATE_DIR="\"$(localstatedir)\"" \
|
2007-04-04 17:32:00 +08:00
|
|
|
-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)\"" \
|
|
|
|
-DGETTEXT_PACKAGE=\"$(PACKAGE)\"
|
|
|
|
|
2007-12-06 02:21:27 +08:00
|
|
|
libvirtd_LDFLAGS = $(WARN_CFLAGS) $(LIBXML_LIBS) $(GNUTLS_LIBS) $(SASL_LIBS) \
|
|
|
|
$(POLKIT_LIBS)
|
2007-06-27 07:04:49 +08:00
|
|
|
libvirtd_DEPENDENCIES = ../src/libvirt.la
|
Use gnulib, starting with its physmem and getaddrinfo modules.
New files go into these directories:
gnulib/lib
gnulib/m4
gnulib/tests
* bootstrap: A wrapper around gnulib-tool.
* configure.in: Invoke gl_EARLY and gl_INIT, being careful to put gl_EARLY
before any macro that uses AC_COMPILE_IFELSE.
(AC_OUTPUT): Add lib/Makefile and gl-tests/Makefile. Remove m4/Makefile.
* Makefile.am (SUBDIRS): Add gnulib/lib and remove m4. Add gnulib/tests
early enough that those tests run before any libvirt unit tests.
* m4/Makefile.am: Remove file. Not needed.
* src/Makefile.am (INCLUDES): Add -I$(top_srcdir)/gnulib/lib -I../gnulib/lib.
(LDADDS, libvirt_la_LIBADD): Add ../gnulib/lib/libgnu.la.
* src/nodeinfo.c: Include "physmem.h".
* qemud/qemud.c, src/remote_internal.c: Include "getaddrinfo.h".
(MEMINFO_PATH, linuxNodeInfoMemPopulate): Remove definitions.
(virNodeInfoPopulate): Use physmem_total, not linuxNodeInfoMemPopulate.
* tests/Makefile.am (INCLUDES): Add -I$(top_srcdir)/gnulib/lib -I../gnulib/lib.
(LDADDS): Add ../gnulib/lib/libgnu.la.
* qemud/Makefile.am (libvirtd_LDADD): Add ../gnulib/lib/libgnu.la.
* tests/nodeinfotest.c (linuxTestCompareFiles): No longer read total
memory from a file.
Update expected output not to include "Memory: NNNN"
* tests/nodeinfodata/linux-nodeinfo-1.txt:
* tests/nodeinfodata/linux-nodeinfo-2.txt:
* tests/nodeinfodata/linux-nodeinfo-3.txt:
* tests/nodeinfodata/linux-nodeinfo-4.txt:
* tests/nodeinfodata/linux-nodeinfo-5.txt:
* tests/nodeinfodata/linux-nodeinfo-6.txt:
* src/test.c [WITH_TEST]: Remove definition of _GNU_SOURCE that
would conflict with the one now in "config.h".
* autogen.sh: Add -I gnulib/m4.
* src/conf.c, src/sexpr.c: Don't define _GNU_SOURCE.
Instead, include "config.h".
* qemud/qemud.c: Remove definition of _GNU_SOURCE.
* src/openvz_driver.c: Likewise.
* src/qemu_driver.c: Likewise.
* src/remote_internal.c: Likewise.
* configure.in: Use AC_CONFIG_AUX_DIR(build-aux), so that a bunch
of gettextize-generated files go into build-aux/, rather than in
the top-level directory.
* .cvsignore: Adjust.
* build-aux/.cvsignore: New file.
Author: Jim Meyering <meyering@redhat.com>
2007-12-06 05:31:07 +08:00
|
|
|
libvirtd_LDADD = ../src/libvirt.la ../gnulib/lib/libgnu.la
|
2007-02-14 09:40:09 +08:00
|
|
|
|
2007-12-06 02:21:27 +08:00
|
|
|
if HAVE_POLKIT
|
|
|
|
policydir = $(datadir)/PolicyKit/policy
|
|
|
|
policy_DATA = libvirtd.policy
|
|
|
|
endif
|
|
|
|
EXTRA_DIST += libvirtd.policy
|
|
|
|
|
2007-09-19 09:56:55 +08:00
|
|
|
if HAVE_AVAHI
|
|
|
|
libvirtd_SOURCES += mdns.c mdns.h
|
|
|
|
libvirtd_CFLAGS += $(AVAHI_CFLAGS)
|
|
|
|
libvirtd_LDADD += $(AVAHI_LIBS)
|
|
|
|
endif
|
|
|
|
|
2007-11-15 21:04:28 +08:00
|
|
|
default_xml_dest = libvirt/qemu/networks/default.xml
|
2007-12-05 23:24:15 +08:00
|
|
|
install-data-local: install-init install-data-sasl
|
2007-03-07 19:54:29 +08:00
|
|
|
mkdir -p $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart
|
2007-11-15 21:04:28 +08: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 22:00:00 +08:00
|
|
|
test -e $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml || \
|
2007-11-15 21:04:28 +08:00
|
|
|
ln -s ../default.xml \
|
|
|
|
$(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml
|
2007-05-19 02:36:24 +08:00
|
|
|
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu
|
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
|
|
|
|
2007-12-05 23:24:15 +08:00
|
|
|
uninstall-local:: uninstall-init uninstall-data-sasl
|
2007-03-07 19:54:29 +08:00
|
|
|
rm -f $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml
|
2007-11-15 21:04:28 +08:00
|
|
|
rm -f $(DESTDIR)$(sysconfdir)/$(default_xml_dest)
|
2007-03-07 19:54:29 +08:00
|
|
|
rmdir $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart || :
|
2007-05-19 02:36:24 +08:00
|
|
|
rmdir $(DESTDIR)$(localstatedir)/log/libvirt/qemu || :
|
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
|
|
|
|
2007-12-05 23:24:15 +08: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 20:04:54 +08:00
|
|
|
|
|
|
|
remote.c: remote_dispatch_prototypes.h \
|
|
|
|
remote_dispatch_localvars.h \
|
|
|
|
remote_dispatch_proc_switch.h
|
|
|
|
|
2007-12-05 23:34:05 +08:00
|
|
|
remote_dispatch_prototypes.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
|
|
|
|
perl -w $(srcdir)/remote_generate_stubs.pl -i $(srcdir)/remote_protocol.x > $@
|
2007-06-11 20:04:54 +08:00
|
|
|
|
2007-12-05 23:34:05 +08:00
|
|
|
remote_dispatch_localvars.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
|
|
|
|
perl -w $(srcdir)/remote_generate_stubs.pl -v $(srcdir)/remote_protocol.x > $@
|
2007-06-11 20:04:54 +08:00
|
|
|
|
2007-12-05 23:34:05 +08:00
|
|
|
remote_dispatch_proc_switch.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
|
|
|
|
perl -w $(srcdir)/remote_generate_stubs.pl -w $(srcdir)/remote_protocol.x > $@
|
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
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
CLEANFILES = libvirtd.init
|
|
|
|
else
|
|
|
|
|
|
|
|
install-init:
|
|
|
|
uninstall-init:
|
2007-02-23 20:50:58 +08:00
|
|
|
|
|
|
|
endif # DBUS_INIT_SCRIPTS_RED_HAT
|
2007-12-07 00:34:48 +08: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 23:53:13 +08:00
|
|
|
endif # WITH_LIBVIRTD
|