2007-02-14 04:40:09 +03:00
## Process this file with automake to produce Makefile.in
2008-08-21 00:48:35 +04:00
DAEMON_SOURCES = \
event.c event.h \
2009-09-16 15:37:26 +04:00
libvirtd.c libvirtd.h \
2009-07-10 15:20:03 +04:00
remote.c remote.h \
dispatch.c dispatch.h \
2009-07-10 16:06:36 +04:00
stream.c stream.h \
2008-08-21 00:48:35 +04:00
remote_dispatch_prototypes.h \
2008-12-05 01:03:24 +03:00
remote_dispatch_table.h \
remote_dispatch_args.h \
remote_dispatch_ret.h \
2009-09-16 19:55:16 +04:00
../src/remote/remote_protocol.c
2008-08-21 00:48:35 +04:00
AVAHI_SOURCES = \
mdns.c mdns.h
2008-12-10 22:21:00 +03:00
DISTCLEANFILES =
2008-08-21 00:48:35 +04:00
EXTRA_DIST = \
2009-09-16 19:55:16 +04:00
remote_generate_stubs.pl \
2008-08-21 00:48:35 +04:00
libvirtd.conf \
libvirtd.init.in \
2009-08-06 16:54:08 +04:00
libvirtd.policy-0 \
libvirtd.policy-1 \
2008-08-21 00:48:35 +04:00
libvirtd.sasl \
libvirtd.sysconf \
2008-09-04 14:44:23 +04:00
libvirtd.aug \
2008-12-10 22:21:00 +03:00
libvirtd.logrotate.in \
2008-09-04 14:44:23 +04:00
test_libvirtd.aug \
2008-08-21 00:48:35 +04:00
$( AVAHI_SOURCES) \
$( DAEMON_SOURCES)
2007-12-06 19:34:48 +03:00
2009-05-29 18:29:22 +04:00
BUILT_SOURCES =
2009-05-19 17:22:00 +04:00
2007-12-06 19:34:48 +03:00
i f W I T H _ L I B V I R T D
sbin_PROGRAMS = libvirtd
confdir = $( sysconfdir) /libvirt/
conf_DATA = libvirtd.conf
2007-09-19 05:56:55 +04:00
2008-09-04 14:44:23 +04:00
augeasdir = $( datadir) /augeas/lenses
2009-09-16 15:31:13 +04:00
augeas_DATA = libvirtd.aug
2008-09-04 14:44:23 +04:00
augeastestsdir = $( datadir) /augeas/lenses/tests
2009-09-16 15:31:13 +04:00
augeastests_DATA = test_libvirtd.aug
2008-09-04 14:44:23 +04:00
2008-08-21 00:48:35 +04:00
libvirtd_SOURCES = $( DAEMON_SOURCES)
2007-09-19 05:56:55 +04:00
2007-02-14 04:40:09 +03:00
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
2007-06-27 03:04:49 +04:00
libvirtd_CFLAGS = \
2008-02-28 20:06:32 +03: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 12:24:41 +04:00
-I$( top_srcdir) /src \
Move all shared utility files to src/util/
* src/bridge.c, src/bridge.h, src/buf.c, src/buf.h, src/cgroup.c,
src/cgroup.h, src/conf.c, src/conf.h, src/event.c, src/event.h,
src/hash.c, src/hash.h, src/hostusb.c, src/hostusb.h,
src/iptables.c, src/iptables.h, src/logging.c, src/logging.h,
src/memory.c, src/memory.h, src/pci.c, src/pci.h, src/qparams.c,
src/qparams.h, src/stats_linux.c, src/stats_linux.h,
src/threads-pthread.c, src/threads-pthread.h, src/threads-win32.c,
src/threads-win32.h, src/threads.c, src/threads.h, src/util.c,
src/util.h, src/uuid.c, src/uuid.h, src/virterror.c,
src/virterror_internal.h, src/xml.c, src/xml.h: Move all files
into src/util/
* daemon/Makefile.am: Add -Isrc/util/ to build flags
* src/Makefile.am: Add -Isrc/util/ to build flags and update for
moved files
* src/libvirt_private.syms: Export cgroup APIs since they're now
in util rather than linking directly to drivers
* src/xen/xs_internal.c: Disable bogus virEventRemoveHandle call
when built under PROXY
* proxy/Makefile.am: Update for changed file locations. Remove
bogus build of event.c
* tools/Makefile.am, tests/Makefile.am: Add -Isrc/util/ to build flags
2009-09-16 19:28:46 +04:00
-I$( top_srcdir) /src/util \
Move all XML configuration handling to src/conf/
* src/capabilities.c, src/capabilities.h, src/domain_conf.c,
src/domain_conf.h, src/domain_event.c, src/domain_event.h,
src/interface_conf.c, src/interface_conf.h,
src/network_conf.c, src/network_conf.h, src/node_device_conf.c,
src/node_device_conf.h, src/secret_conf.c, src/secret_conf.h,
src/storage_conf.c, src/storage_conf.h, src/storage_encryption_conf.c,
src/storage_encryption_conf.h: Move to src/conf/
* src/Makefile.am: Add -Isrc/conf to the individual build targets
which need to use XML config APIs. Remove LIBXML_CFLAGS, LIBSSH2_CFLAGS
and SELINUX_CFLAGS from global INCLUDES and only have them in build
targets which actually need them. Create a libvirt_conf.la
convenience library for all config parsers
* src/hostusb.h: Remove bogus include of domain_conf.h
* tests/Makefile.am: Add -Isrc/conf. Remove bogus -I$builddir/src
since it never has any generated header files
* daemon/Makefile.am: Add -Isrc/conf
* proxy/Makefile.am: Add -Isrc/conf and cope with renamed files
* src/hash.c: Remove bogus include of libxml/threads.h
2009-09-16 18:39:12 +04:00
-I$( top_srcdir) /src/conf \
2009-09-16 19:55:16 +04:00
-I$( top_srcdir) /src/remote \
2008-02-28 20:06:32 +03:00
$( LIBXML_CFLAGS) $( GNUTLS_CFLAGS) $( SASL_CFLAGS) \
$( POLKIT_CFLAGS) \
$( WARN_CFLAGS) -DLOCAL_STATE_DIR= " \" $( localstatedir) \" " \
$( COVERAGE_CFLAGS) \
-DSYSCONF_DIR= " \" $( sysconfdir) \" " \
2007-06-11 16:04:54 +04:00
-DQEMUD_PID_FILE= " \" $( QEMUD_PID_FILE) \" " \
2007-06-27 00:51:00 +04:00
-DREMOTE_PID_FILE= " \" $( REMOTE_PID_FILE) \" " \
2008-02-28 20:06:32 +03:00
-DGETTEXT_PACKAGE= \" $( PACKAGE) \"
2008-12-08 15:04:27 +03:00
libvirtd_LDFLAGS = \
$( WARN_CFLAGS) \
$( COVERAGE_LDFLAGS)
2007-06-27 00:51:00 +04:00
2008-11-17 15:18:18 +03:00
libvirtd_LDADD = \
2008-12-08 15:04:27 +03:00
$( LIBXML_LIBS) \
$( GNUTLS_LIBS) \
$( SASL_LIBS) \
2008-12-11 21:11:41 +03:00
$( POLKIT_LIBS)
2008-11-17 15:18:18 +03:00
2009-08-03 16:37:44 +04:00
libvirtd_LDADD += ../src/libvirt_util.la
2009-02-17 13:34:30 +03:00
i f W I T H _ D R I V E R _ M O D U L E S
libvirtd_LDADD += ../src/libvirt_driver.la
e l s e
2009-02-17 17:46:21 +03:00
i f W I T H _ Q E M U
2009-02-17 13:34:30 +03:00
libvirtd_LDADD += ../src/libvirt_driver_qemu.la
2009-02-17 17:46:21 +03:00
e n d i f
2008-11-17 15:18:18 +03:00
2009-02-17 17:46:21 +03:00
i f W I T H _ L X C
2009-02-17 13:34:30 +03:00
libvirtd_LDADD += ../src/libvirt_driver_lxc.la
2009-02-17 17:46:21 +03:00
e n d i f
2008-11-17 15:18:18 +03:00
2009-02-17 17:46:21 +03:00
i f W I T H _ U M L
2009-02-17 13:34:30 +03:00
libvirtd_LDADD += ../src/libvirt_driver_uml.la
2009-02-17 17:46:21 +03:00
e n d i f
2008-11-19 19:58:23 +03:00
2009-05-25 15:56:00 +04:00
i f W I T H _ O N E
libvirtd_LDADD += ../src/libvirt_driver_one.la
e n d i f
2009-02-17 17:46:21 +03:00
i f W I T H _ S T O R A G E _ D I R
2009-02-17 13:34:30 +03:00
libvirtd_LDADD += ../src/libvirt_driver_storage.la
2009-02-17 17:46:21 +03:00
e n d i f
2008-11-17 15:18:18 +03:00
2009-02-17 17:46:21 +03:00
i f W I T H _ N E T W O R K
2009-02-17 13:34:30 +03:00
libvirtd_LDADD += ../src/libvirt_driver_network.la
2009-02-17 17:46:21 +03:00
e n d i f
2008-11-21 15:27:11 +03:00
2009-07-21 18:02:16 +04:00
i f W I T H _ N E T C F
libvirtd_LDADD += ../src/libvirt_driver_interface.la
e n d i f
2009-02-17 17:46:21 +03:00
i f W I T H _ N O D E _ D E V I C E S
2009-02-17 13:34:30 +03:00
libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
2009-02-17 17:46:21 +03:00
e n d i f
2008-11-21 15:16:08 +03:00
e n d i f
2008-11-17 15:18:18 +03:00
libvirtd_LDADD += ../src/libvirt.la
2007-02-14 04:40:09 +03:00
2007-12-05 21:21:27 +03:00
i f H A V E _ P O L K I T
2009-08-06 16:54:08 +04:00
i f H A V E _ P O L K I T 0
2007-12-05 21:21:27 +03:00
policydir = $( datadir) /PolicyKit/policy
2009-08-06 16:54:08 +04:00
policyfile = libvirtd.policy-0
e l s e
policydir = $( datadir) /polkit-1/actions
policyfile = libvirtd.policy-1
e n d i f
2007-12-05 21:21:27 +03:00
e n d i f
2007-09-19 05:56:55 +04:00
i f H A V E _ A V A H I
2008-08-21 00:48:35 +04:00
libvirtd_SOURCES += $( AVAHI_SOURCES)
2007-09-19 05:56:55 +04:00
libvirtd_CFLAGS += $( AVAHI_CFLAGS)
libvirtd_LDADD += $( AVAHI_LIBS)
e n d i f
2008-11-28 14:20:27 +03:00
2008-12-09 23:22:39 +03:00
install-data-local : install -init install -data -sasl install -data -polkit \
install-logrotate
2009-09-16 15:31:13 +04:00
mkdir -p $( DESTDIR) $( localstatedir) /log/libvirt
2007-03-09 02:31:28 +03:00
mkdir -p $( DESTDIR) $( localstatedir) /run/libvirt
2007-03-14 01:43:22 +03:00
mkdir -p $( DESTDIR) $( localstatedir) /lib/libvirt
2007-03-07 14:54:29 +03:00
2009-09-16 15:31:13 +04:00
uninstall-local :: uninstall -init uninstall -data -sasl uninstall -data -polkit
rmdir $( DESTDIR) $( localstatedir) /log/libvirt || :
2007-03-09 02:31:28 +03:00
rmdir $( DESTDIR) $( localstatedir) /run/libvirt || :
2007-03-14 01:43:22 +03:00
rmdir $( DESTDIR) $( localstatedir) /lib/libvirt || :
2007-03-07 14:54:29 +03:00
2008-07-11 13:51:25 +04:00
i f H A V E _ P O L K I T
install-data-polkit :: install -init
mkdir -p $( DESTDIR) $( policydir)
2009-08-06 16:54:08 +04:00
$( INSTALL_DATA) $( srcdir) /$( policyfile) $( DESTDIR) $( policydir) /org.libvirt.unix.policy
2008-07-11 13:51:25 +04:00
uninstall-data-polkit :: install -init
rm -f $( DESTDIR) $( policydir) /org.libvirt.unix.policy
e l s e
install-data-polkit ::
uninstall-data-polkit ::
e n d i f
2007-06-11 16:04:54 +04:00
remote.c : remote_dispatch_prototypes .h \
2008-12-05 01:03:24 +03:00
remote_dispatch_table.h \
remote_dispatch_args.h \
remote_dispatch_ret.h
2007-06-11 16:04:54 +04:00
2009-09-16 19:55:16 +04:00
REMOTE_PROTOCOL = $( top_srcdir) /src/remote/remote_protocol.x
remote_dispatch_prototypes.h : $( srcdir ) /remote_generate_stubs .pl $( REMOTE_PROTOCOL )
perl -w $( srcdir) /remote_generate_stubs.pl -p $( REMOTE_PROTOCOL) > $@
2007-06-11 16:04:54 +04:00
2009-09-16 19:55:16 +04:00
remote_dispatch_table.h : $( srcdir ) /remote_generate_stubs .pl $( REMOTE_PROTOCOL )
perl -w $( srcdir) /remote_generate_stubs.pl -t $( REMOTE_PROTOCOL) > $@
2008-12-05 01:03:24 +03:00
2009-09-16 19:55:16 +04:00
remote_dispatch_args.h : $( srcdir ) /remote_generate_stubs .pl $( REMOTE_PROTOCOL )
perl -w $( srcdir) /remote_generate_stubs.pl -a $( REMOTE_PROTOCOL) > $@
2008-12-05 01:03:24 +03:00
2009-09-16 19:55:16 +04:00
remote_dispatch_ret.h : $( srcdir ) /remote_generate_stubs .pl $( REMOTE_PROTOCOL )
perl -w $( srcdir) /remote_generate_stubs.pl -r $( REMOTE_PROTOCOL) > $@
2007-06-11 16:04:54 +04:00
2009-05-29 18:29:22 +04:00
BUILT_SOURCES += libvirtd.logrotate
2008-12-09 23:22:39 +03: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/
2009-10-06 15:33:17 +04:00
mkdir -p $( DESTDIR) $( localstatedir) /log/libvirt/lxc/
mkdir -p $( DESTDIR) $( localstatedir) /log/libvirt/uml/
2008-12-09 23:22:39 +03:00
mkdir -p $( DESTDIR) $( sysconfdir) /logrotate.d/
$( INSTALL_DATA) $< $( DESTDIR) $( sysconfdir) /logrotate.d/libvirtd
2007-02-23 15:50:58 +03:00
i f L I B V I R T _ I N I T _ S C R I P T S _ R E D _ H A T
2007-06-27 03:03:48 +04:00
install-init : libvirtd .init
mkdir -p $( DESTDIR) $( sysconfdir) /rc.d/init.d
2007-11-15 16:04:28 +03:00
$( INSTALL_SCRIPT) libvirtd.init \
$( DESTDIR) $( sysconfdir) /rc.d/init.d/libvirtd
2007-06-27 03:48:46 +04:00
mkdir -p $( DESTDIR) $( sysconfdir) /sysconfig
2007-11-15 16:04:28 +03:00
$( INSTALL_SCRIPT) $( srcdir) /libvirtd.sysconf \
$( DESTDIR) $( sysconfdir) /sysconfig/libvirtd
2007-02-23 15:50:58 +03:00
2007-06-27 03:03:48 +04:00
uninstall-init :
2007-11-15 16:04:28 +03:00
rm -f $( DESTDIR) $( sysconfdir) /rc.d/init.d/libvirtd \
$( DESTDIR) $( sysconfdir) /sysconfig/libvirtd
2007-06-27 03:03:48 +04:00
2009-05-29 18:29:22 +04:00
BUILT_SOURCES += libvirtd.init
2007-06-27 03:03:48 +04:00
libvirtd.init : libvirtd .init .in
2007-02-23 15:50:58 +03:00
sed \
2007-06-27 04:12:29 +04:00
-e s!\@ localstatedir\@ !@localstatedir@!g \
-e s!\@ sbindir\@ !@sbindir@!g \
-e s!\@ sysconfdir\@ !@sysconfdir@!g \
2007-11-15 16:04:28 +03:00
< $< > $@ -t
chmod a+x $@ -t
mv $@ -t $@
2007-06-27 03:03:48 +04:00
2008-09-04 14:44:23 +04:00
check-local :
2009-01-12 21:21:49 +03:00
test -x '$(AUGPARSE)' \
&& '$(AUGPARSE)' -I $( srcdir) $( srcdir) /test_libvirtd.aug || :
2008-09-04 14:44:23 +04:00
2007-06-27 03:03:48 +04:00
e l s e
install-init :
uninstall-init :
2009-05-19 17:22:00 +04:00
libvirtd.init :
2007-02-23 15:50:58 +03:00
e n d i f # DBUS_INIT_SCRIPTS_RED_HAT
2007-12-06 19:34:48 +03:00
2008-12-11 21:11:41 +03:00
# This must be added last, since functions it provides/replaces
# are used by nearly every other library.
2009-01-08 23:42:01 +03:00
libvirtd_LDADD += ../gnulib/lib/libgnu.la $( LIBSOCKET)
2008-12-11 21:11:41 +03:00
2009-09-16 19:02:38 +04:00
e l s e # 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 18:53:13 +03:00
e n d i f # WITH_LIBVIRTD
2008-02-28 20:06:32 +03:00
2009-09-16 19:02:38 +04:00
# This is needed for clients too, so can't wrap in
# the WITH_LIBVIRTD conditional
i f H A V E _ S A S L
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/
2009-10-07 14:18:31 +04:00
e l s e
install-data-sasl :
uninstall-data-sasl :
2009-09-16 19:02:38 +04:00
e n d i f
2009-05-19 17:22:00 +04:00
CLEANFILES = $( BUILT_SOURCES)
2008-02-28 20:06:32 +03:00
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda