summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorArvind Sankar <[email protected]>2020-06-30 13:10:41 -0400
committerBrian Behlendorf <[email protected]>2020-07-10 14:26:00 -0700
commit4d61ade1a317606dc899e38b516410a0c2fdae0e (patch)
treed6c2003638fe28b2fe341515aaded236d6c1320f /tests
parentb6437ea41c7611481925d72d294677434639b847 (diff)
Clean up lib dependencies
libzutil is currently statically linked into libzfs, libzfs_core and libzpool. Avoid the unnecessary duplication by removing it from libzfs and libzpool, and adding libzfs_core to libzpool. Remove a few unnecessary dependencies: - libuutil from libzfs_core - libtirpc from libspl - keep only libcrypto in libzfs, as we don't use any functions from libssl - librt is only used for clock_gettime, however on modern systems that's in libc rather than librt. Add a configure check to see if we actually need librt - libdl from raidz_test Add a few missing dependencies: - zlib to libefi and libzfs - libuuid to zpool, and libuuid and libudev to zed - libnvpair uses assertions, so add assert.c to provide aok and libspl_assertf Sort the LDADD for programs so that libraries that satisfy dependencies come at the end rather than the beginning of the linker command line. Revamp the configure tests for libaries to use FIND_SYSTEM_LIBRARY instead. This can take advantage of pkg-config, and it also avoids polluting LIBS. List all the required dependencies in the pkgconfig files, and move the one for libzfs_core into the latter's directory. Install pkgconfig files in $(libdir)/pkgconfig on linux and $(prefix)/libdata/pkgconfig on FreeBSD, instead of /usr/share/pkgconfig, as the more correct location for library .pc files. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Arvind Sankar <[email protected]> Closes #10538
Diffstat (limited to 'tests')
-rw-r--r--tests/zfs-tests/cmd/btree_test/Makefile.am5
-rw-r--r--tests/zfs-tests/cmd/libzfs_input_check/Makefile.am5
-rw-r--r--tests/zfs-tests/cmd/mmap_libaio/Makefile.am3
-rw-r--r--tests/zfs-tests/cmd/nvlist_to_lua/Makefile.am4
-rw-r--r--tests/zfs-tests/tests/functional/checksum/Makefile.am3
-rw-r--r--tests/zfs-tests/tests/functional/hkdf/Makefile.am8
-rw-r--r--tests/zfs-tests/tests/functional/libzfs/Makefile.am2
7 files changed, 10 insertions, 20 deletions
diff --git a/tests/zfs-tests/cmd/btree_test/Makefile.am b/tests/zfs-tests/cmd/btree_test/Makefile.am
index bf09cdb82..55c40e3f5 100644
--- a/tests/zfs-tests/cmd/btree_test/Makefile.am
+++ b/tests/zfs-tests/cmd/btree_test/Makefile.am
@@ -28,6 +28,5 @@ pkgexec_PROGRAMS = btree_test
btree_test_SOURCES = btree_test.c
btree_test_LDADD = \
- $(top_builddir)/lib/libavl/libavl.la \
- $(top_builddir)/lib/libnvpair/libnvpair.la \
- $(top_builddir)/lib/libzpool/libzpool.la
+ $(top_builddir)/lib/libzpool/libzpool.la \
+ $(top_builddir)/lib/libzfs_core/libzfs_core.la
diff --git a/tests/zfs-tests/cmd/libzfs_input_check/Makefile.am b/tests/zfs-tests/cmd/libzfs_input_check/Makefile.am
index 32cc46561..67fa98886 100644
--- a/tests/zfs-tests/cmd/libzfs_input_check/Makefile.am
+++ b/tests/zfs-tests/cmd/libzfs_input_check/Makefile.am
@@ -6,6 +6,5 @@ pkgexec_PROGRAMS = libzfs_input_check
libzfs_input_check_SOURCES = libzfs_input_check.c
libzfs_input_check_LDADD = \
- $(top_builddir)/lib/libspl/libspl.la \
- $(top_builddir)/lib/libnvpair/libnvpair.la \
- $(top_builddir)/lib/libzfs_core/libzfs_core.la
+ $(top_builddir)/lib/libzfs_core/libzfs_core.la \
+ $(top_builddir)/lib/libnvpair/libnvpair.la
diff --git a/tests/zfs-tests/cmd/mmap_libaio/Makefile.am b/tests/zfs-tests/cmd/mmap_libaio/Makefile.am
index 67d0f0ece..25f9dda2b 100644
--- a/tests/zfs-tests/cmd/mmap_libaio/Makefile.am
+++ b/tests/zfs-tests/cmd/mmap_libaio/Makefile.am
@@ -5,5 +5,6 @@ pkgexecdir = $(datadir)/@PACKAGE@/zfs-tests/bin
if WANT_MMAP_LIBAIO
pkgexec_PROGRAMS = mmap_libaio
mmap_libaio_SOURCES = mmap_libaio.c
-mmap_libaio_LDADD = $(LIBAIO)
+mmap_libaio_CFLAGS = $(AM_CFLAGS) $(LIBAIO_CFLAGS)
+mmap_libaio_LDADD = $(LIBAIO_LIBS)
endif
diff --git a/tests/zfs-tests/cmd/nvlist_to_lua/Makefile.am b/tests/zfs-tests/cmd/nvlist_to_lua/Makefile.am
index 7d60c2482..c98e032e1 100644
--- a/tests/zfs-tests/cmd/nvlist_to_lua/Makefile.am
+++ b/tests/zfs-tests/cmd/nvlist_to_lua/Makefile.am
@@ -6,5 +6,5 @@ pkgexec_PROGRAMS = nvlist_to_lua
nvlist_to_lua_SOURCES = nvlist_to_lua.c
nvlist_to_lua_LDADD = \
- $(top_builddir)/lib/libnvpair/libnvpair.la \
- $(top_builddir)/lib/libzfs_core/libzfs_core.la
+ $(top_builddir)/lib/libzfs_core/libzfs_core.la \
+ $(top_builddir)/lib/libnvpair/libnvpair.la
diff --git a/tests/zfs-tests/tests/functional/checksum/Makefile.am b/tests/zfs-tests/tests/functional/checksum/Makefile.am
index 7cd15324e..265a4b16e 100644
--- a/tests/zfs-tests/tests/functional/checksum/Makefile.am
+++ b/tests/zfs-tests/tests/functional/checksum/Makefile.am
@@ -1,12 +1,9 @@
include $(top_srcdir)/config/Rules.am
-AM_CPPFLAGS += -I$(top_srcdir)/include
LDADD = \
$(top_builddir)/lib/libicp/libicp.la \
$(top_builddir)/lib/libspl/libspl_assert.la
-AUTOMAKE_OPTIONS = subdir-objects
-
pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/checksum
dist_pkgdata_SCRIPTS = \
diff --git a/tests/zfs-tests/tests/functional/hkdf/Makefile.am b/tests/zfs-tests/tests/functional/hkdf/Makefile.am
index 378bcf531..be65f8c0e 100644
--- a/tests/zfs-tests/tests/functional/hkdf/Makefile.am
+++ b/tests/zfs-tests/tests/functional/hkdf/Makefile.am
@@ -1,11 +1,5 @@
include $(top_srcdir)/config/Rules.am
-LDADD = \
- $(top_builddir)/lib/libnvpair/libnvpair.la \
- $(top_builddir)/lib/libzpool/libzpool.la
-
-AUTOMAKE_OPTIONS = subdir-objects
-
pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/hkdf
dist_pkgdata_SCRIPTS = \
@@ -19,3 +13,5 @@ pkgexec_PROGRAMS = \
hkdf_test
hkdf_test_SOURCES = hkdf_test.c
+hkdf_test_LDADD = \
+ $(top_builddir)/lib/libzpool/libzpool.la
diff --git a/tests/zfs-tests/tests/functional/libzfs/Makefile.am b/tests/zfs-tests/tests/functional/libzfs/Makefile.am
index 545af77e7..e9a703f49 100644
--- a/tests/zfs-tests/tests/functional/libzfs/Makefile.am
+++ b/tests/zfs-tests/tests/functional/libzfs/Makefile.am
@@ -10,8 +10,6 @@ dist_pkgdata_SCRIPTS = \
libzfs_input.ksh
many_fds_LDADD = \
- $(top_builddir)/lib/libnvpair/libnvpair.la \
- $(top_builddir)/lib/libzfs_core/libzfs_core.la \
$(top_builddir)/lib/libzfs/libzfs.la
pkgexec_PROGRAMS = many_fds