mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 11:47:43 +03:00
autoconf: use include directives instead of recursing down lib
As a bonus, this also adds zfs-mount-generator (previously undescended down) and libzstd (not included) to CppCheck As a bonus bonus, abigail rules work out-of-tree, too Against current trunk: $ diff -U0 ./destdir.listing ~/store/code/zfs/destdir.listing -destdir/usr/local/include/libspl/sscanf.h $ diff --color -U0 ./zfs-2.1.99.tar.gz.listing ../oot/zfs-2.1.99.tar.gz.listing | grep -v @@ | grep -v /Makefile -zfs-2.1.99/config/Abigail.am -zfs-2.1.99/lib/libspl/include/util/ -zfs-2.1.99/lib/libspl/include/util/sscanf.h $ diff --color -U0 ./zfs-2.1.99.tar.gz.listing ../oot/zfs-2.1.99.tar.gz.listing | grep -v @@ | grep /Makefile -zfs-2.1.99/lib/libavl/Makefile.in -zfs-2.1.99/lib/libefi/Makefile.in -zfs-2.1.99/lib/libicp/Makefile.in -zfs-2.1.99/lib/libnvpair/Makefile.in -zfs-2.1.99/lib/libshare/Makefile.in -zfs-2.1.99/lib/libspl/include/Makefile.in -zfs-2.1.99/lib/libspl/include/os/freebsd/Makefile.am -zfs-2.1.99/lib/libspl/include/os/freebsd/Makefile.in -zfs-2.1.99/lib/libspl/include/os/freebsd/sys/Makefile.am -zfs-2.1.99/lib/libspl/include/os/freebsd/sys/Makefile.in -zfs-2.1.99/lib/libspl/include/os/linux/Makefile.am -zfs-2.1.99/lib/libspl/include/os/linux/Makefile.in -zfs-2.1.99/lib/libspl/include/os/linux/sys/Makefile.am -zfs-2.1.99/lib/libspl/include/os/linux/sys/Makefile.in -zfs-2.1.99/lib/libspl/include/os/Makefile.am -zfs-2.1.99/lib/libspl/include/os/Makefile.in -zfs-2.1.99/lib/libspl/include/rpc/Makefile.am -zfs-2.1.99/lib/libspl/include/rpc/Makefile.in -zfs-2.1.99/lib/libspl/include/sys/dktp/Makefile.am -zfs-2.1.99/lib/libspl/include/sys/dktp/Makefile.in -zfs-2.1.99/lib/libspl/include/sys/Makefile.am -zfs-2.1.99/lib/libspl/include/sys/Makefile.in -zfs-2.1.99/lib/libspl/include/util/Makefile.am -zfs-2.1.99/lib/libspl/include/util/Makefile.in -zfs-2.1.99/lib/libspl/Makefile.in -zfs-2.1.99/lib/libtpool/Makefile.in -zfs-2.1.99/lib/libunicode/Makefile.in -zfs-2.1.99/lib/libuutil/Makefile.in -zfs-2.1.99/lib/libzfsbootenv/Makefile.in -zfs-2.1.99/lib/libzfs_core/Makefile.in -zfs-2.1.99/lib/libzfs/Makefile.in -zfs-2.1.99/lib/libzpool/Makefile.in -zfs-2.1.99/lib/libzstd/Makefile.in -zfs-2.1.99/lib/libzutil/Makefile.in -zfs-2.1.99/lib/Makefile.in Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #13316
This commit is contained in:
+75
-34
@@ -33,50 +33,91 @@
|
||||
# | | |
|
||||
# \-------- libspl ----+------/
|
||||
#
|
||||
# * - A stable ABI is provided for these libraries
|
||||
#
|
||||
#
|
||||
# NB: GNU Automake Manual, Chapter 8.3.5: Libtool Convenience Libraries
|
||||
# These nine libraries are intermediary build components.
|
||||
#
|
||||
SUBDIRS = libavl libicp libshare libspl libtpool libzstd
|
||||
CPPCHECKDIRS = libavl libicp libnvpair libshare libspl libtpool libunicode
|
||||
CPPCHECKDIRS += libuutil libzfs libzfs_core libzfsbootenv libzpool libzutil
|
||||
# * - A stable ABI is provided for these libraries;
|
||||
# when performing an ABI check the following options are applied:
|
||||
#
|
||||
# --no-unreferenced-symbols: Exclude symbols which are not referenced by
|
||||
# any debug information. Without this _init() and _fini() are incorrectly
|
||||
# reported on CentOS7 for libuutil.so.
|
||||
#
|
||||
# --headers-dir1: Limit ABI checks to public OpenZFS headers, otherwise
|
||||
# changes in public system headers are also reported.
|
||||
#
|
||||
# --suppressions: Honor a suppressions file for each library to provide
|
||||
# a mechanism for suppressing harmless warnings.
|
||||
#
|
||||
|
||||
noinst_LTLIBRARIES =
|
||||
lib_LTLIBRARIES =
|
||||
pkgconfig_DATA =
|
||||
include $(srcdir)/%D%/libavl/Makefile.am
|
||||
include $(srcdir)/%D%/libicp/Makefile.am
|
||||
include $(srcdir)/%D%/libnvpair/Makefile.am
|
||||
include $(srcdir)/%D%/libshare/Makefile.am
|
||||
include $(srcdir)/%D%/libspl/Makefile.am
|
||||
include $(srcdir)/%D%/libtpool/Makefile.am
|
||||
include $(srcdir)/%D%/libunicode/Makefile.am
|
||||
include $(srcdir)/%D%/libuutil/Makefile.am
|
||||
include $(srcdir)/%D%/libzfs_core/Makefile.am
|
||||
include $(srcdir)/%D%/libzfs/Makefile.am
|
||||
include $(srcdir)/%D%/libzfsbootenv/Makefile.am
|
||||
include $(srcdir)/%D%/libzpool/Makefile.am
|
||||
include $(srcdir)/%D%/libzstd/Makefile.am
|
||||
include $(srcdir)/%D%/libzutil/Makefile.am
|
||||
if BUILD_LINUX
|
||||
SUBDIRS += libefi
|
||||
CPPCHECKDIRS += libefi
|
||||
include $(srcdir)/%D%/libefi/Makefile.am
|
||||
endif
|
||||
|
||||
# libnvpair is installed as part of the final build product
|
||||
# libzutil depends on it, so it must be compiled before libzutil
|
||||
SUBDIRS += libnvpair
|
||||
|
||||
# libzutil depends on libefi if present
|
||||
SUBDIRS += libzutil libunicode
|
||||
PHONY += lib
|
||||
lib: $(noinst_LTLIBRARIES) $(lib_LTLIBRARIES)
|
||||
|
||||
# These five libraries, which are installed as the final build product,
|
||||
# incorporate the eight convenience libraries given above.
|
||||
DISTLIBS = libuutil libzfs_core libzfs libzpool libzfsbootenv
|
||||
SUBDIRS += $(DISTLIBS)
|
||||
DISTLIBS += libnvpair
|
||||
|
||||
# An ABI is stored for each of these libraries. Note that libzpool.so
|
||||
# is only linked against by ztest and zdb and no stable ABI is provided.
|
||||
ABILIBS = libnvpair libuutil libzfs_core libzfs libzfsbootenv
|
||||
PHONY += checkabi storeabi check_libabi_version allow_libabi_only_for_x86_64
|
||||
|
||||
PHONY = checkabi storeabi cppcheck
|
||||
checkabi: $(ABILIBS)
|
||||
set -e ; for dir in $(ABILIBS) ; do \
|
||||
$(MAKE) -C $$dir checkabi ; \
|
||||
done
|
||||
|
||||
storeabi: $(ABILIBS)
|
||||
set -e ; for dir in $(ABILIBS) ; do \
|
||||
$(MAKE) -C $$dir storeabi ; \
|
||||
done
|
||||
|
||||
cppcheck: $(CPPCHECKDIRS)
|
||||
set -e ; for dir in $(CPPCHECKDIRS) ; do \
|
||||
$(MAKE) -C $$dir cppcheck ; \
|
||||
check_libabi_version:
|
||||
if [ $$(abidw -v | $(SED) 's/[^0-9]//g') -lt 200 ]; then \
|
||||
printf '%s\n' "" \
|
||||
"*** Please use libabigail 2.0.0 version or newer;" \
|
||||
"*** otherwise results are not consistent!" \
|
||||
"(or see https://github.com/openzfs/libabigail-docker)"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
allow_libabi_only_for_x86_64:
|
||||
echo '*** ABI definitions provided apply only to x86_64:'
|
||||
echo '*** not checking or storing ABI and assuming success.'
|
||||
|
||||
if TARGET_CPU_X86_64
|
||||
# These should depend on $(lib_LTLIBRARIES), but this breaks on CI when bound into Docker
|
||||
checkabi: check_libabi_version
|
||||
err=0; \
|
||||
for lib in $(lib_LTLIBRARIES); do \
|
||||
lib=$${lib%.la}; \
|
||||
[ -f $(srcdir)/lib/$$lib/$$lib.suppr ] || continue; \
|
||||
echo $$lib:; \
|
||||
abidiff --no-unreferenced-symbols \
|
||||
--headers-dir1 include \
|
||||
--suppressions $(srcdir)/lib/$$lib/$$lib.suppr \
|
||||
$(srcdir)/lib/$$lib/$$lib.abi .libs/$$lib.so || err=$$((err + 1)); \
|
||||
done; \
|
||||
exit $$err
|
||||
|
||||
storeabi: check_libabi_version
|
||||
for lib in $(lib_LTLIBRARIES); do \
|
||||
lib=$${lib%.la}; \
|
||||
[ -f $(srcdir)/lib/$$lib/$$lib.suppr ] || continue; \
|
||||
abidw --no-show-locs \
|
||||
--no-corpus-path \
|
||||
--no-comp-dir-path \
|
||||
--type-id-style hash \
|
||||
.libs/$$lib.so > $(srcdir)/lib/$$lib/$$lib.abi; \
|
||||
done
|
||||
else
|
||||
checkabi: allow_libabi_only_for_x86_64
|
||||
storeabi: allow_libabi_only_for_x86_64
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user