libvirt/src/access/Makefile.inc.am
Daniel P. Berrangé cfbe9f1201 build: link to glib library
Add the main glib.h to internal.h so that all common code can use it.

Historically glib allowed applications to register an alternative
memory allocator, so mixing g_malloc/g_free with malloc/free was not
safe.

This was feature was dropped in 2.46.0 with:

      commit 3be6ed60aa58095691bd697344765e715a327fc1
      Author: Alexander Larsson <alexl@redhat.com>
      Date:   Sat Jun 27 18:38:42 2015 +0200

        Deprecate and drop support for memory vtables

Applications are still encourged to match g_malloc/g_free, but it is no
longer a mandatory requirement for correctness, just stylistic. This is
explicitly clarified in

    commit 1f24b36607bf708f037396014b2cdbc08d67b275
    Author: Daniel P. Berrangé <berrange@redhat.com>
    Date:   Thu Sep 5 14:37:54 2019 +0100

        gmem: clarify that g_malloc always uses the system allocator

Applications can still use custom allocators in general, but they must
do this by linking to a library that replaces the core malloc/free
implemenentation entirely, instead of via a glib specific call.

This means that libvirt does not need to be concerned about use of
g_malloc/g_free causing an ABI change in the public libary, and can
avoid memory copying when talking to external libraries.

This patch probes for glib, which provides the foundation layer with
a collection of data structures, helper APIs, and platform portability
logic.

Later patches will introduce linkage to gobject which provides the
object type system, built on glib, and gio which providing objects
for various interesting tasks, most notably including DBus client
and server support and portable sockets APIs, but much more too.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-10-14 10:54:42 +01:00

153 lines
4.8 KiB
Makefile

# vim: filetype=automake
ACCESS_DRIVER_GENERATED = \
access/viraccessapicheck.h \
access/viraccessapicheck.c \
access/viraccessapicheckqemu.h \
access/viraccessapicheckqemu.c \
access/viraccessapichecklxc.h \
access/viraccessapichecklxc.c \
$(NULL)
ACCESS_DRIVER_SYM_FILES = \
libvirt_access.syms \
libvirt_access_qemu.syms \
libvirt_access_lxc.syms \
$(NULL)
ACCESS_DRIVER_API_FILES = \
libvirt_access.xml \
libvirt_access_qemu.xml \
libvirt_access_lxc.xml \
$(NULL)
ACCESS_DRIVER_SOURCES = \
access/viraccessperm.h \
access/viraccessperm.c \
access/viraccessmanager.h \
access/viraccessmanager.c \
access/viraccessdriver.h \
access/viraccessdrivernop.h \
access/viraccessdrivernop.c \
access/viraccessdriverstack.h \
access/viraccessdriverstack.c \
$(NULL)
ACCESS_DRIVER_POLKIT_SOURCES = \
access/viraccessdriverpolkit.h \
access/viraccessdriverpolkit.c \
$(NULL)
ACCESS_DRIVER_POLKIT_POLICY = $(srcdir)/access/org.libvirt.api.policy
GENERATED_SYM_FILES += $(ACCESS_DRIVER_SYM_FILES)
EXTRA_DIST += \
$(ACCESS_DRIVER_POLKIT_POLICY) \
access/genpolkit.pl \
$(NULL)
libvirt_driver_access_la_SOURCES = \
$(ACCESS_DRIVER_SOURCES) \
$(ACCESS_DRIVER_GENERATED) \
$(NULL)
noinst_LTLIBRARIES += libvirt_driver_access.la
libvirt_la_BUILT_LIBADD += libvirt_driver_access.la
libvirt_driver_access_la_CFLAGS = \
-I$(srcdir)/conf \
$(AM_CFLAGS) \
$(NULL)
libvirt_driver_access_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_access_la_LIBADD = \
$(GLIB_LIBS) \
$(NULL)
$(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \
$(srcdir)/access/genpolkit.pl Makefile.am
$(AM_V_GEN)$(PERL) $(srcdir)/access/genpolkit.pl < $< > $@ || rm -f $@
if WITH_POLKIT
libvirt_driver_access_la_SOURCES += $(ACCESS_DRIVER_POLKIT_SOURCES)
polkitactiondir = $(datadir)/polkit-1/actions
if WITH_LIBVIRTD
polkitaction_DATA = $(ACCESS_DRIVER_POLKIT_POLICY)
endif WITH_LIBVIRTD
CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY)
BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY)
else ! WITH_POLKIT
EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES)
endif ! WITH_POLKIT
BUILT_SOURCES += \
$(ACCESS_DRIVER_GENERATED) \
$(ACCESS_DRIVER_API_FILES) \
$(NULL)
CLEANFILES += \
$(ACCESS_DRIVER_GENERATED) \
$(ACCESS_DRIVER_API_FILES) \
$(NULL)
libvirt_access.syms: $(srcdir)/rpc/gendispatch.pl \
$(REMOTE_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclsym \
remote REMOTE $(REMOTE_PROTOCOL) > $@
libvirt_access_qemu.syms: $(srcdir)/rpc/gendispatch.pl \
$(QEMU_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclsym \
qemu QEMU $(QEMU_PROTOCOL) > $@
libvirt_access_lxc.syms: $(srcdir)/rpc/gendispatch.pl \
$(LXC_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclsym \
lxc LXC $(LXC_PROTOCOL) > $@
libvirt_access.xml: $(srcdir)/rpc/gendispatch.pl \
$(REMOTE_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclapi \
remote REMOTE $(REMOTE_PROTOCOL) > $@
libvirt_access_qemu.xml: $(srcdir)/rpc/gendispatch.pl \
$(QEMU_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclapi \
qemu QEMU $(QEMU_PROTOCOL) > $@
libvirt_access_lxc.xml: $(srcdir)/rpc/gendispatch.pl \
$(LXC_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclapi \
lxc LXC $(LXC_PROTOCOL) > $@
access/viraccessapicheck.h: $(srcdir)/rpc/gendispatch.pl \
$(REMOTE_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
remote REMOTE $(REMOTE_PROTOCOL) \
> $(srcdir)/access/viraccessapicheck.h
access/viraccessapicheck.c: $(srcdir)/rpc/gendispatch.pl \
$(REMOTE_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
remote REMOTE $(REMOTE_PROTOCOL) access/viraccessapicheck.h \
> $(srcdir)/access/viraccessapicheck.c
access/viraccessapicheckqemu.h: $(srcdir)/rpc/gendispatch.pl \
$(QEMU_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
qemu QEMU $(QEMU_PROTOCOL) \
> $(srcdir)/access/viraccessapicheckqemu.h
access/viraccessapicheckqemu.c: $(srcdir)/rpc/gendispatch.pl \
$(QEMU_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
qemu QEMU $(QEMU_PROTOCOL) access/viraccessapicheckqemu.h \
> $(srcdir)/access/viraccessapicheckqemu.c
access/viraccessapichecklxc.h: $(srcdir)/rpc/gendispatch.pl \
$(LXC_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclheader \
lxc LXC $(LXC_PROTOCOL) \
> $(srcdir)/access/viraccessapichecklxc.h
access/viraccessapichecklxc.c: $(srcdir)/rpc/gendispatch.pl \
$(LXC_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=aclbody \
lxc LXC $(LXC_PROTOCOL) access/viraccessapichecklxc.h \
> $(srcdir)/access/viraccessapichecklxc.c