# vim: filetype=automake
-REMOTE_DRIVER_GENERATED = \
- remote/remote_protocol.c \
- remote/remote_protocol.h \
- remote/remote_client_bodies.h \
- remote/lxc_protocol.c \
- remote/lxc_protocol.h \
- remote/lxc_client_bodies.h \
- remote/qemu_protocol.c \
- remote/qemu_protocol.h \
- remote/qemu_client_bodies.h \
- $(NULL)
-
-REMOTE_DRIVER_SOURCES = \
- remote/remote_driver.c \
- remote/remote_driver.h \
- $(NULL)
-
REMOTE_DAEMON_GENERATED = \
remote/remote_daemon_dispatch_stubs.h \
remote/lxc_daemon_dispatch_stubs.h \
$(LXC_PROTOCOL) \
$(NULL)
-DRIVER_SOURCE_FILES += \
- $(REMOTE_DRIVER_GENERATED) \
- $(addprefix $(srcdir)/,$(REMOTE_DRIVER_SOURCES))
-
# Needed to build libvirt.pot, so must be listed outside
# the WITH_REMOTE/WITH_LIBVIRTD conditionals
BUILT_SOURCES += \
- $(REMOTE_DRIVER_GENERATED) \
$(REMOTE_DAEMON_GENERATED) \
$(NULL)
-if WITH_REMOTE
-noinst_LTLIBRARIES += libvirt_driver_remote.la
-libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
-libvirt_driver_remote_la_CFLAGS = \
- $(XDR_CFLAGS) \
- -I$(srcdir)/conf \
- -I$(srcdir)/rpc \
- -I$(builddir)/rpc \
- -I$(builddir)/remote \
- $(AM_CFLAGS) \
- $(NULL)
-libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
-libvirt_driver_remote_la_SOURCES = \
- $(REMOTE_DRIVER_SOURCES)
-nodist_libvirt_driver_remote_la_SOURCES = \
- $(REMOTE_DRIVER_GENERATED)
-
-if WITH_DTRACE_PROBES
-nodist_libvirt_driver_remote_la_SOURCES += libvirt_probes.h
-endif WITH_DTRACE_PROBES
-
-if WITH_SASL
-libvirt_driver_remote_la_CFLAGS += \
- $(SASL_CFLAGS) \
- $(NULL)
-endif WITH_SASL
-
-endif WITH_REMOTE
-
if WITH_REMOTE
USED_SYM_FILES += $(srcdir)/libvirt_remote.syms
else ! WITH_REMOTE
$(AM_V_GEN)cp $< $@
-remote/remote_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
- $(REMOTE_PROTOCOL) Makefile.am
- $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
- remote REMOTE $(REMOTE_PROTOCOL) \
- > remote/remote_client_bodies.h
-
-remote/lxc_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
- $(LXC_PROTOCOL) Makefile.am
- $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
- lxc LXC $(LXC_PROTOCOL) \
- > remote/lxc_client_bodies.h
-
-remote/qemu_client_bodies.h: $(srcdir)/rpc/gendispatch.pl \
- $(QEMU_PROTOCOL) Makefile.am
- $(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
- qemu QEMU $(QEMU_PROTOCOL) \
- > remote/qemu_client_bodies.h
-
remote/remote_daemon_dispatch_stubs.h: $(srcdir)/rpc/gendispatch.pl \
$(REMOTE_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(top_srcdir)/src/rpc/gendispatch.pl \
--- /dev/null
+remote_driver_sources = [
+ 'remote_driver.c',
+]
+
+remote_driver_generated = []
+
+foreach name : [ 'remote', 'qemu', 'lxc' ]
+ client_bodies_h = '@0@_client_bodies.h'.format(name)
+ protocol_c = '@0@_protocol.c'.format(name)
+ protocol_h = '@0@_protocol.h'.format(name)
+ protocol_x = '@0@_protocol.x'.format(name)
+
+ remote_driver_generated += custom_target(
+ client_bodies_h,
+ input: protocol_x,
+ output: client_bodies_h,
+ command: [
+ gendispatch_prog, '--mode=client', name, name.to_upper(), '@INPUT@',
+ ],
+ capture: true,
+ )
+
+ remote_driver_generated += custom_target(
+ protocol_h,
+ input: protocol_x,
+ output: protocol_h,
+ command: [
+ genprotocol_prog, rpcgen_prog, '-h', '@INPUT@', '@OUTPUT@',
+ ],
+ )
+
+ remote_driver_generated += custom_target(
+ protocol_c,
+ input: protocol_x,
+ output: protocol_c,
+ command: [
+ genprotocol_prog, rpcgen_prog, '-c', '@INPUT@', '@OUTPUT@',
+ ],
+ )
+endforeach
+
+if conf.has('WITH_REMOTE')
+ remote_driver_lib = static_library(
+ 'virt_remote_driver',
+ [
+ remote_driver_sources,
+ remote_driver_generated,
+ ],
+ dependencies: [
+ rpc_dep,
+ sasl_dep,
+ src_dep,
+ xdr_dep,
+ ],
+ include_directories: [
+ conf_inc_dir,
+ ],
+ )
+endif