Makefile.inc.am 4.3 KB
Newer Older
1 2
# vim: filetype=automake

3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
LIBXL_DRIVER_SOURCES = \
	libxl/libxl_conf.c \
	libxl/libxl_conf.h \
	libxl/libxl_capabilities.c \
	libxl/libxl_capabilities.h \
	libxl/libxl_domain.c \
	libxl/libxl_domain.h \
	libxl/libxl_driver.c \
	libxl/libxl_driver.h \
	libxl/libxl_logger.c \
	libxl/libxl_logger.h \
	libxl/libxl_migration.c \
	libxl/libxl_migration.h \
	$(NULL)

XENCONFIG_LIBXL_SOURCES = \
	$(XENCONFIG_SOURCES) \
	xenconfig/xen_xl.c \
	xenconfig/xen_xl.h \
	$(NULL)

DRIVER_SOURCE_FILES += $(LIBXL_DRIVER_SOURCES)
STATEFUL_DRIVER_SOURCE_FILES += $(LIBXL_DRIVER_SOURCES)
EXTRA_DIST += \
	$(LIBXL_DRIVER_SOURCES) \
	$(XENCONFIG_LIBXL_SOURCES) \
	$(NULL)

if WITH_LIBXL
noinst_LTLIBRARIES += libvirt_xenconfig_libxl.la
libvirt_xenconfig_libxl_la_LIBADD = $(LIBXL_LIBS)
libvirt_xenconfig_libxl_la_CFLAGS = \
	-I$(srcdir)/conf \
	-I$(srcdir)/libxl \
	$(AM_CFLAGS) \
	$(NULL)
libvirt_xenconfig_libxl_la_SOURCES = $(XENCONFIG_LIBXL_SOURCES)

noinst_LTLIBRARIES += libvirt_driver_libxl_impl.la
libvirt_driver_libxl_la_SOURCES =
libvirt_driver_libxl_la_LIBADD = \
	libvirt_driver_libxl_impl.la \
	libvirt.la \
	../gnulib/lib/libgnu.la \
	$(NULL)
mod_LTLIBRARIES += libvirt_driver_libxl.la
libvirt_driver_libxl_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)

libvirt_driver_libxl_impl_la_CFLAGS = \
	$(LIBXL_CFLAGS) \
	$(LIBXML_CFLAGS) \
	-I$(srcdir)/access \
	-I$(srcdir)/conf \
	-I$(srcdir)/secret \
	-I$(srcdir)/xenconfig \
	$(AM_CFLAGS) \
	$(NULL)
libvirt_driver_libxl_impl_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_libxl_impl_la_LIBADD = \
	$(LIBXL_LIBS) \
	$(LIBXML_LIBS) \
	libvirt_xenconfig_libxl.la \
	$(NULL)
libvirt_driver_libxl_impl_la_SOURCES = $(LIBXL_DRIVER_SOURCES)

68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
sbin_PROGRAMS += virtxend

nodist_conf_DATA += libxl/virtxend.conf
augeas_DATA += libxl/virtxend.aug
augeastest_DATA += libxl/test_virtxend.aug
CLEANFILES += libxl/virtxend.aug

virtxend_SOURCES = $(REMOTE_DAEMON_SOURCES)
virtxend_CFLAGS = \
       $(REMOTE_DAEMON_CFLAGS) \
       -DDAEMON_NAME="\"virtxend\"" \
       -DMODULE_NAME="\"libxl\"" \
       $(NULL)
virtxend_LDFLAGS = $(REMOTE_DAEMON_LD_FLAGS)
virtxend_LDADD = $(REMOTE_DAEMON_LD_ADD)

SYSTEMD_UNIT_FILES += \
	virtxend.service \
	virtxend.socket \
	virtxend-ro.socket \
	virtxend-admin.socket \
	$(NULL)
SYSTEMD_UNIT_FILES_IN += \
	libxl/virtxend.service.in \
	$(NULL)

VIRTXEND_UNIT_VARS = \
	$(COMMON_UNIT_VARS) \
	-e 's|[@]deps[@]|Conflicts=$(LIBVIRTD_SOCKET_UNIT_FILES)\nConditionPathExists=/proc/xen/capabilities|g' \
	-e 's|[@]name[@]|Libvirt libxl|g' \
	-e 's|[@]service[@]|virtxend|g' \
	-e 's|[@]sockprefix[@]|virtxend|g' \
	$(NULL)

virtxend.service: libxl/virtxend.service.in $(top_builddir)/config.status
	$(AM_V_GEN)$(SED) $(VIRTXEND_UNIT_VARS) $< > $@-t && mv $@-t $@

virtxen%.socket: remote/libvirt%.socket.in $(top_builddir)/config.status
	$(AM_V_GEN)$(SED) $(VIRTXEND_UNIT_VARS) $< > $@-t && mv $@-t $@

libxl/virtxend.conf: remote/libvirtd.conf.in
	$(AM_V_GEN)$(SED) \
		-e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \
		-e 's/[@]DAEMON_NAME[@]/virtxend/' \
		$< > $@

libxl/virtxend.aug: remote/libvirtd.aug.in
	$(AM_V_GEN)$(SED) \
		-e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \
		-e 's/[@]DAEMON_NAME[@]/virtxend/' \
		-e 's/[@]DAEMON_NAME_UC[@]/Virtxend/' \
		$< > $@

libxl/test_virtxend.aug: remote/test_libvirtd.aug.in \
		libxl/virtxend.conf $(AUG_GENTEST)
	$(AM_V_GEN)$(AUG_GENTEST) libxl/virtxend.conf \
		$(srcdir)/remote/test_libvirtd.aug.in | \
		$(SED) \
		-e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \
		-e 's/[@]DAEMON_NAME[@]/virtxend/' \
		-e 's/[@]DAEMON_NAME_UC[@]/Virtxend/' \
		> $@ || rm -f $@

131 132
conf_DATA += libxl/libxl.conf
augeas_DATA += libxl/libvirtd_libxl.aug
133
augeastest_DATA += libxl/test_libvirtd_libxl.aug
134

135
libxl/test_libvirtd_libxl.aug: libxl/test_libvirtd_libxl.aug.in \
136
		$(srcdir)/libxl/libxl.conf $(AUG_GENTEST)
137
	$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/libxl/libxl.conf $< > $@
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157

INSTALL_DATA_DIRS += libxl

install-data-libxl:
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/libxl"
	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl"

uninstall-data-libxl:
	rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||:
	rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||:
	rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||:

endif WITH_LIBXL

EXTRA_DIST += \
	libxl/libxl.conf \
	libxl/libvirtd_libxl.aug \
	libxl/test_libvirtd_libxl.aug.in \
	$(NULL)