]> git.proxmox.com Git - mirror_zfs.git/blame - lib/Makefile.am
etc/init.d: decide which variant to use at build time.
[mirror_zfs.git] / lib / Makefile.am
CommitLineData
514498fe
BB
1#
2# Shown below is a simplified dependency graph of the OpenZFS provided
3# libraries. Administrative commands (`zfs`, `zpool`, etc) interface with
4# the kernel modules using the `libzfs.so` and `libzfs_core.so` libraries.
5# These libraries provide a stable ABI across OpenZFS point releases.
6#
7# The `libzpool.so` library is a user space build of the DMU and SPA layers
8# used to implement debugging tools (zdb) and code validation tools (ztest).
9# These library interfaces are subject to change at any time.
10#
11#
a0d3fe72 12# CMDS: zhack/ztest/ zfs/zpool/zed/
514498fe
BB
13# raidz_{test,bench} zinject/zstream
14# | |
15# LIBS: | | libzfsbootenv*
a0d3fe72 16# |--libzdb--zdb | |
514498fe
BB
17# | | |
18# libzpool libzfs* ----------------+
19# | | | \ / | | |
20# libicp --/ | | \ / | | \------- libshare
21# | | \ / | |
22# libzstd ---/ | \ / | \--------- libuutil
23# | \ / \ | |
24# libunicode --/ \ / \ | |
25# \ / \ | |
26# libzutil libzfs_core* | |
27# | | | | \ | | | |
28# | | | | | | | | |
29# | | | | | | | | |
30# libtpool -------------/ | | | \---- libnvpair* | | |
31# | | | | | |
32# libefi -----------------/ | \------ libavl* --------/ |
33# | | |
34# \-------- libspl ----+------/
35#
514498fe 36#
75056283 37# NB: GNU Automake Manual, Chapter 8.3.5: Libtool Convenience Libraries
10b3c7f5 38# These nine libraries are intermediary build components.
514498fe 39#
c8970f52
AZ
40# * - A stable ABI is provided for these libraries;
41# when performing an ABI check the following options are applied:
42#
43# --no-unreferenced-symbols: Exclude symbols which are not referenced by
44# any debug information. Without this _init() and _fini() are incorrectly
45# reported on CentOS7 for libuutil.so.
46#
47# --headers-dir1: Limit ABI checks to public OpenZFS headers, otherwise
48# changes in public system headers are also reported.
49#
50# --suppressions: Honor a suppressions file for each library to provide
51# a mechanism for suppressing harmless warnings.
52#
9f0a21e6 53
c8970f52
AZ
54noinst_LTLIBRARIES =
55lib_LTLIBRARIES =
56pkgconfig_DATA =
57include $(srcdir)/%D%/libavl/Makefile.am
58include $(srcdir)/%D%/libicp/Makefile.am
59include $(srcdir)/%D%/libnvpair/Makefile.am
60include $(srcdir)/%D%/libshare/Makefile.am
61include $(srcdir)/%D%/libspl/Makefile.am
62include $(srcdir)/%D%/libtpool/Makefile.am
63include $(srcdir)/%D%/libunicode/Makefile.am
64include $(srcdir)/%D%/libuutil/Makefile.am
a0d3fe72 65include $(srcdir)/%D%/libzdb/Makefile.am
c8970f52
AZ
66include $(srcdir)/%D%/libzfs_core/Makefile.am
67include $(srcdir)/%D%/libzfs/Makefile.am
68include $(srcdir)/%D%/libzfsbootenv/Makefile.am
69include $(srcdir)/%D%/libzpool/Makefile.am
70include $(srcdir)/%D%/libzstd/Makefile.am
71include $(srcdir)/%D%/libzutil/Makefile.am
9f0a21e6 72if BUILD_LINUX
c8970f52 73include $(srcdir)/%D%/libefi/Makefile.am
9f0a21e6
MM
74endif
75
9b77c57d 76
c8970f52
AZ
77PHONY += lib
78lib: $(noinst_LTLIBRARIES) $(lib_LTLIBRARIES)
75056283 79
14c34c3d 80
c8970f52 81PHONY += checkabi storeabi check_libabi_version allow_libabi_only_for_x86_64
14c34c3d 82
c8970f52
AZ
83check_libabi_version:
84 if [ $$(abidw -v | $(SED) 's/[^0-9]//g') -lt 200 ]; then \
85 printf '%s\n' "" \
86 "*** Please use libabigail 2.0.0 version or newer;" \
87 "*** otherwise results are not consistent!" \
88 "(or see https://github.com/openzfs/libabigail-docker)"; \
89 exit 1; \
90 fi
14c34c3d 91
c8970f52
AZ
92allow_libabi_only_for_x86_64:
93 echo '*** ABI definitions provided apply only to x86_64:'
94 echo '*** not checking or storing ABI and assuming success.'
0e6c493f 95
c8970f52
AZ
96if TARGET_CPU_X86_64
97# These should depend on $(lib_LTLIBRARIES), but this breaks on CI when bound into Docker
98checkabi: check_libabi_version
99 err=0; \
100 for lib in $(lib_LTLIBRARIES); do \
101 lib=$${lib%.la}; \
102 [ -f $(srcdir)/lib/$$lib/$$lib.suppr ] || continue; \
103 echo $$lib:; \
104 abidiff --no-unreferenced-symbols \
105 --headers-dir1 include \
106 --suppressions $(srcdir)/lib/$$lib/$$lib.suppr \
107 $(srcdir)/lib/$$lib/$$lib.abi .libs/$$lib.so || err=$$((err + 1)); \
108 done; \
109 exit $$err
110
111storeabi: check_libabi_version
112 for lib in $(lib_LTLIBRARIES); do \
113 lib=$${lib%.la}; \
114 [ -f $(srcdir)/lib/$$lib/$$lib.suppr ] || continue; \
115 abidw --no-show-locs \
116 --no-corpus-path \
117 --no-comp-dir-path \
118 --type-id-style hash \
119 .libs/$$lib.so > $(srcdir)/lib/$$lib/$$lib.abi; \
0e6c493f 120 done
c8970f52
AZ
121else
122checkabi: allow_libabi_only_for_x86_64
123storeabi: allow_libabi_only_for_x86_64
124endif