1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

meson: src: build libvirt-admin.so library

We have to compile the libvirt-admin.so outside of src/admin directory
because it depends on libvirt.so.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Pavel Hrdina 2020-07-27 08:41:59 +02:00
parent 4bb4faf977
commit 1657b5d77f
7 changed files with 93 additions and 110 deletions

View File

@ -91,7 +91,6 @@ PKG_PROG_PKG_CONFIG
dnl MinGW checks
LIBVIRT_WIN_CHECK_SYMBOLS
LIBVIRT_WIN_CHECK_WINDRES

View File

@ -1,31 +0,0 @@
dnl The MinGW symbols checks
dnl
dnl Copyright (C) 2016 Red Hat, Inc.
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
dnl
AC_DEFUN([LIBVIRT_WIN_CHECK_SYMBOLS], [
LIBVIRT_ADMIN_SYMBOL_FILE=admin/libvirt_admin.syms
case "$host" in
*-*-mingw* )
# Also set the symbol file to .def, so src/Makefile generates libvirt.def
# from libvirt.syms and passes libvirt.def instead of libvirt.syms to the
# linker
LIBVIRT_ADMIN_SYMBOL_FILE=admin/libvirt_admin.def
;;
esac
AC_SUBST([LIBVIRT_ADMIN_SYMBOL_FILE])
])

View File

@ -30,7 +30,6 @@ BUILT_SOURCES =
nodist_conf_DATA =
DRIVER_SOURCE_FILES =
STATEFUL_DRIVER_SOURCE_FILES =
lib_LTLIBRARIES =
noinst_LTLIBRARIES =
mod_LTLIBRARIES =
INSTALL_DATA_DIRS =

View File

@ -1,67 +1,9 @@
# vim: filetype=automake
ADMIN_PROTOCOL = $(srcdir)/admin/admin_protocol.x
ADMIN_PROTOCOL_GENERATED = \
admin/admin_client.h \
$(NULL)
BUILT_SOURCES += $(ADMIN_PROTOCOL_GENERATED)
GENERATED_SYM_FILES += admin/libvirt_admin.syms admin/libvirt_admin.def
ADMIN_SYM_FILES = $(srcdir)/admin/libvirt_admin_private.syms
conf_DATA += admin/libvirt-admin.conf
lib_LTLIBRARIES += libvirt-admin.la
libvirt_admin_la_SOURCES = \
admin/libvirt-admin.c \
$(DATATYPES_SOURCES)
nodist_libvirt_admin_la_SOURCES = \
$(ADMIN_PROTOCOL_GENERATED)
libvirt_admin_la_LDFLAGS = \
$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_ADMIN_SYMBOL_FILE) \
-version-info $(LIBVIRT_VERSION_INFO) \
$(LIBVIRT_NODELETE) \
$(AM_LDFLAGS) \
$(NULL)
libvirt_admin_la_LIBADD = \
libvirt.la \
$(XDR_LIBS) \
$(CAPNG_LIBS) \
$(YAJL_LIBS) \
$(DEVMAPPER_LIBS) \
$(LIBXML_LIBS) \
$(GLIB_LIBS) \
$(SSH2_LIBS) \
$(SASL_LIBS) \
$(GNUTLS_LIBS) \
$(LIBSSH_LIBS)
if WITH_DTRACE_PROBES
libvirt_admin_la_LIBADD += libvirt_probes.lo
endif WITH_DTRACE_PROBES
libvirt_admin_la_CFLAGS = \
$(AM_CFLAGS) \
-I$(builddir)/admin \
-I$(builddir)/access \
-I$(srcdir)/remote \
-I$(srcdir)/rpc \
-I$(builddir)/rpc \
$(XDR_CFLAGS) \
$(CAPNG_CFLAGS) \
$(YAJL_CFLAGS) \
$(SSH2_CFLAGS) \
$(SASL_CFLAGS) \
$(GNUTLS_CFLAGS) \
$(LIBSSH_CFLAGS)
if WITH_LINUX
check-admin-symfile: admin/libvirt_admin.syms libvirt-admin.la
$(AM_V_GEN)$(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/check-symfile.py \
@ -79,22 +21,3 @@ check-admin-drivername:
$(srcdir)/admin/libvirt_admin_public.syms
check-admin: check-admin-symfile check-admin-symsorting check-admin-drivername
admin/admin_client.h: $(srcdir)/rpc/gendispatch.pl \
$(ADMIN_PROTOCOL) Makefile.am
$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/gendispatch.pl --mode=client \
admin ADMIN $(ADMIN_PROTOCOL) \
> admin/admin_client.h
admin/libvirt_admin.syms: admin/libvirt_admin_public.syms $(ADMIN_SYM_FILES) \
$(top_builddir)/config.status
$(AM_V_GEN)rm -f $@-tmp $@ ; \
printf '# WARNING: generated from the following:\n# $^\n\n' >$@-tmp && \
cat $(srcdir)/admin/libvirt_admin_public.syms >>$@-tmp && \
printf '\n\n# Private symbols\n\n' >>$@-tmp && \
printf 'LIBVIRT_ADMIN_PRIVATE_$(VERSION) {\n\n' >>$@-tmp && \
printf 'global:\n\n' >>$@-tmp && \
cat $(ADMIN_SYM_FILES) >>$@-tmp && \
printf '\n\nlocal:\n*;\n\n};' >>$@-tmp && \
chmod a-w $@-tmp && \
mv $@-tmp admin/libvirt_admin.syms

View File

@ -35,6 +35,51 @@ admin_driver_generated += custom_target(
capture: true,
)
admin_sources = files(
'libvirt-admin.c',
)
admin_client_generated = custom_target(
'admin_client.h',
input: admin_driver_protocol,
output: 'admin_client.h',
command: [
gendispatch_prog, '--mode=client', 'admin', 'ADMIN', '@INPUT@',
],
capture: true,
)
libvirt_admin_syms = custom_target(
'libvirt_admin.syms',
input: [
'libvirt_admin_public.syms',
'libvirt_admin_private.syms',
],
output: 'libvirt_admin.syms',
command: [
meson_python_prog, python3_prog.path(), meson_gen_sym_prog.path(),
'@OUTPUT@', 'LIBVIRT_ADMIN_PRIVATE_' + meson.project_version(), '@INPUT@',
],
)
libvirt_admin_syms_file = libvirt_admin_syms
if host_machine.system() == 'windows'
libvirt_admin_def = custom_target(
'libvirt_admin.def',
input: libvirt_admin_syms,
output: 'libvirt_admin.def',
command: [
meson_python_prog, python3_prog.path(), meson_gen_def_prog.path(),
'@INPUT@', '@OUTPUT@',
],
)
libvirt_admin_syms_file = libvirt_admin_def
endif
libvirt_admin_syms_flags = '@0@@1@'.format(
version_script_flags,
libvirt_admin_syms_file.full_path(),
)
admin_driver_lib = static_library(
'virt_admin_driver',
[
@ -48,3 +93,5 @@ admin_driver_lib = static_library(
xdr_dep,
],
)
admin_inc_dir = include_directories('.')

View File

@ -373,3 +373,47 @@ libvirt_lxc_lib = shared_library(
version: libvirt_lib_version,
soversion: libvirt_so_version,
)
# libvirt-admin.so
libvirt_admin_lib = shared_library(
'virt-admin',
[
admin_sources,
admin_client_generated,
admin_driver_generated,
datatypes_sources,
dtrace_gen_objects,
],
dependencies: [
capng_dep,
devmapper_dep,
gnutls_dep,
libssh2_dep,
libssh_dep,
sasl_dep,
src_dep,
rpc_dep,
xdr_dep,
yajl_dep,
],
include_directories: [
admin_inc_dir,
remote_inc_dir,
],
link_args: [
libvirt_admin_syms_flags,
libvirt_nodelete,
],
link_with: [
libvirt_lib,
],
link_depends: [
libvirt_admin_syms_file,
],
install: true,
install_rpath: libdir,
version: libvirt_lib_version,
soversion: libvirt_so_version,
)

View File

@ -65,3 +65,5 @@ if conf.has('WITH_REMOTE')
else
sym_files += 'libvirt_remote.syms'
endif
remote_inc_dir = include_directories('.')