2022-04-09 02:09:55 +00:00
|
|
|
zpool_CFLAGS = $(AM_CFLAGS)
|
|
|
|
zpool_CFLAGS += $(LIBBLKID_CFLAGS) $(LIBUUID_CFLAGS)
|
2010-08-26 18:22:58 +00:00
|
|
|
|
2022-04-09 02:09:55 +00:00
|
|
|
zpool_CPPFLAGS = $(AM_CPPFLAGS)
|
|
|
|
zpool_CPPFLAGS += -I$(srcdir)/%D%
|
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 <behlendorf1@llnl.gov>
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Closes #10538
2020-06-30 17:10:41 +00:00
|
|
|
|
2022-04-09 02:09:55 +00:00
|
|
|
sbin_PROGRAMS += zpool
|
|
|
|
CPPCHECKTARGETS += zpool
|
2010-08-26 18:22:58 +00:00
|
|
|
|
|
|
|
zpool_SOURCES = \
|
2022-04-09 02:09:55 +00:00
|
|
|
%D%/zpool_iter.c \
|
|
|
|
%D%/zpool_main.c \
|
|
|
|
%D%/zpool_util.c \
|
|
|
|
%D%/zpool_util.h \
|
|
|
|
%D%/zpool_vdev.c
|
2010-08-26 18:22:58 +00:00
|
|
|
|
2020-04-14 18:36:28 +00:00
|
|
|
if BUILD_FREEBSD
|
2022-04-09 02:09:55 +00:00
|
|
|
zpool_SOURCES += \
|
|
|
|
%D%/os/freebsd/zpool_vdev_os.c
|
2020-04-14 18:36:28 +00:00
|
|
|
endif
|
|
|
|
|
2019-09-30 19:16:06 +00:00
|
|
|
if BUILD_LINUX
|
2022-04-09 02:09:55 +00:00
|
|
|
zpool_SOURCES += \
|
|
|
|
%D%/os/linux/zpool_vdev_os.c
|
2019-09-30 19:16:06 +00:00
|
|
|
endif
|
|
|
|
|
2010-08-26 18:22:58 +00:00
|
|
|
zpool_LDADD = \
|
2022-04-09 02:09:55 +00:00
|
|
|
libzfs.la \
|
|
|
|
libzfs_core.la \
|
|
|
|
libnvpair.la \
|
|
|
|
libuutil.la \
|
|
|
|
libzutil.la
|
2017-08-09 22:31:08 +00:00
|
|
|
|
2020-07-06 01:08:40 +00:00
|
|
|
zpool_LDADD += $(LTLIBINTL)
|
|
|
|
|
2020-04-14 18:36:28 +00:00
|
|
|
if BUILD_FREEBSD
|
2020-07-06 01:08:40 +00:00
|
|
|
zpool_LDADD += -lgeom
|
2020-04-14 18:36:28 +00:00
|
|
|
endif
|
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 <behlendorf1@llnl.gov>
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Closes #10538
2020-06-30 17:10:41 +00:00
|
|
|
zpool_LDADD += -lm $(LIBBLKID_LIBS) $(LIBUUID_LIBS)
|
2017-04-21 16:27:04 +00:00
|
|
|
|
2022-04-09 02:09:55 +00:00
|
|
|
EXTRA_DIST += $(addprefix %D%/,zpool.d/README compatibility.d)
|
2021-01-22 20:54:34 +00:00
|
|
|
|
2022-04-09 02:09:55 +00:00
|
|
|
SHELLCHECKSCRIPTS += $(dist_zpoolexec_SCRIPTS)
|
2018-06-07 16:59:59 +00:00
|
|
|
zpoolexecdir = $(zfsexecdir)/zpool.d
|
2017-04-21 16:27:04 +00:00
|
|
|
dist_zpoolexec_SCRIPTS = \
|
2022-04-09 02:09:55 +00:00
|
|
|
%D%/zpool.d/ata_err \
|
|
|
|
%D%/zpool.d/cmd_to \
|
|
|
|
%D%/zpool.d/defect \
|
|
|
|
%D%/zpool.d/dm-deps \
|
|
|
|
%D%/zpool.d/enc \
|
|
|
|
%D%/zpool.d/encdev \
|
|
|
|
%D%/zpool.d/fault_led \
|
|
|
|
%D%/zpool.d/health \
|
|
|
|
%D%/zpool.d/hours_on \
|
|
|
|
%D%/zpool.d/iostat \
|
|
|
|
%D%/zpool.d/iostat-10s \
|
|
|
|
%D%/zpool.d/iostat-1s \
|
|
|
|
%D%/zpool.d/label \
|
|
|
|
%D%/zpool.d/locate_led \
|
|
|
|
%D%/zpool.d/lsblk \
|
|
|
|
%D%/zpool.d/media \
|
|
|
|
%D%/zpool.d/model \
|
|
|
|
%D%/zpool.d/nonmed \
|
|
|
|
%D%/zpool.d/nvme_err \
|
|
|
|
%D%/zpool.d/off_ucor \
|
|
|
|
%D%/zpool.d/pend_sec \
|
|
|
|
%D%/zpool.d/pwr_cyc \
|
|
|
|
%D%/zpool.d/r_proc \
|
|
|
|
%D%/zpool.d/r_ucor \
|
|
|
|
%D%/zpool.d/realloc \
|
|
|
|
%D%/zpool.d/rep_ucor \
|
|
|
|
%D%/zpool.d/serial \
|
|
|
|
%D%/zpool.d/ses \
|
|
|
|
%D%/zpool.d/size \
|
|
|
|
%D%/zpool.d/slot \
|
|
|
|
%D%/zpool.d/smart \
|
|
|
|
%D%/zpool.d/smart_test \
|
|
|
|
%D%/zpool.d/smartx \
|
|
|
|
%D%/zpool.d/temp \
|
|
|
|
%D%/zpool.d/test_ended \
|
|
|
|
%D%/zpool.d/test_progress \
|
|
|
|
%D%/zpool.d/test_status \
|
|
|
|
%D%/zpool.d/test_type \
|
|
|
|
%D%/zpool.d/upath \
|
|
|
|
%D%/zpool.d/vendor \
|
|
|
|
%D%/zpool.d/w_proc \
|
|
|
|
%D%/zpool.d/w_ucor
|
2017-04-21 16:27:04 +00:00
|
|
|
|
|
|
|
zpoolconfdefaults = \
|
2020-06-11 00:07:59 +00:00
|
|
|
dm-deps \
|
2017-04-21 16:27:04 +00:00
|
|
|
enc \
|
|
|
|
encdev \
|
|
|
|
fault_led \
|
|
|
|
iostat \
|
|
|
|
iostat-1s \
|
|
|
|
iostat-10s \
|
|
|
|
label \
|
|
|
|
locate_led \
|
|
|
|
lsblk \
|
2017-06-05 17:52:15 +00:00
|
|
|
media \
|
2017-04-21 16:27:04 +00:00
|
|
|
model \
|
|
|
|
serial \
|
|
|
|
ses \
|
|
|
|
size \
|
|
|
|
slot \
|
2017-06-05 17:52:15 +00:00
|
|
|
smart \
|
|
|
|
smartx \
|
|
|
|
temp \
|
|
|
|
health \
|
|
|
|
r_proc \
|
|
|
|
w_proc \
|
|
|
|
r_ucor \
|
|
|
|
w_ucor \
|
|
|
|
nonmed \
|
|
|
|
defect \
|
|
|
|
hours_on \
|
|
|
|
realloc \
|
|
|
|
rep_ucor \
|
|
|
|
cmd_to \
|
|
|
|
pend_sec \
|
|
|
|
off_ucor \
|
|
|
|
ata_err \
|
2018-02-21 21:52:47 +00:00
|
|
|
nvme_err \
|
2017-06-05 17:52:15 +00:00
|
|
|
pwr_cyc \
|
2017-04-21 16:27:04 +00:00
|
|
|
upath \
|
2018-02-27 17:31:27 +00:00
|
|
|
vendor \
|
|
|
|
smart_test \
|
|
|
|
test_type \
|
|
|
|
test_status \
|
|
|
|
test_progress \
|
|
|
|
test_ended
|
2017-04-21 16:27:04 +00:00
|
|
|
|
2021-02-18 05:30:45 +00:00
|
|
|
zpoolcompatdir = $(pkgdatadir)/compatibility.d
|
|
|
|
dist_zpoolcompat_DATA = \
|
2022-04-09 02:09:55 +00:00
|
|
|
%D%/compatibility.d/compat-2018 \
|
|
|
|
%D%/compatibility.d/compat-2019 \
|
|
|
|
%D%/compatibility.d/compat-2020 \
|
|
|
|
%D%/compatibility.d/compat-2021 \
|
|
|
|
%D%/compatibility.d/freebsd-11.0 \
|
|
|
|
%D%/compatibility.d/freebsd-11.2 \
|
|
|
|
%D%/compatibility.d/freebsd-11.3 \
|
|
|
|
%D%/compatibility.d/freenas-9.10.2 \
|
|
|
|
%D%/compatibility.d/grub2 \
|
|
|
|
%D%/compatibility.d/openzfs-2.0-freebsd \
|
|
|
|
%D%/compatibility.d/openzfs-2.0-linux \
|
|
|
|
%D%/compatibility.d/openzfs-2.1-freebsd \
|
|
|
|
%D%/compatibility.d/openzfs-2.1-linux \
|
|
|
|
%D%/compatibility.d/openzfsonosx-1.7.0 \
|
|
|
|
%D%/compatibility.d/openzfsonosx-1.8.1 \
|
|
|
|
%D%/compatibility.d/openzfsonosx-1.9.3 \
|
|
|
|
%D%/compatibility.d/zol-0.6.1 \
|
|
|
|
%D%/compatibility.d/zol-0.6.4 \
|
|
|
|
%D%/compatibility.d/zol-0.6.5 \
|
|
|
|
%D%/compatibility.d/zol-0.7 \
|
|
|
|
%D%/compatibility.d/zol-0.8
|
2021-02-18 05:30:45 +00:00
|
|
|
|
|
|
|
# canonical <- alias symbolic link pairs
|
|
|
|
# eg: "2018" is a link to "compat-2018"
|
|
|
|
zpoolcompatlinks = \
|
|
|
|
"compat-2018 2018" \
|
|
|
|
"compat-2019 2019" \
|
|
|
|
"compat-2020 2020" \
|
|
|
|
"compat-2021 2021" \
|
|
|
|
"freebsd-11.0 freebsd-11.1" \
|
|
|
|
"freebsd-11.0 freenas-11.0" \
|
|
|
|
"freebsd-11.2 freenas-11.2" \
|
|
|
|
"freebsd-11.3 freebsd-11.4" \
|
|
|
|
"freebsd-11.3 freebsd-12.0" \
|
|
|
|
"freebsd-11.3 freebsd-12.1" \
|
|
|
|
"freebsd-11.3 freebsd-12.2" \
|
|
|
|
"freebsd-11.3 freenas-11.3" \
|
|
|
|
"freenas-11.0 freenas-11.1" \
|
|
|
|
"openzfsonosx-1.9.3 openzfsonosx-1.9.4" \
|
|
|
|
"openzfs-2.0-freebsd truenas-12.0" \
|
|
|
|
"zol-0.7 ubuntu-18.04" \
|
|
|
|
"zol-0.8 ubuntu-20.04"
|
|
|
|
|
2022-04-09 02:09:55 +00:00
|
|
|
zpoolconfdir = $(sysconfdir)/zfs/zpool.d
|
|
|
|
INSTALL_DATA_HOOKS += zpool-install-data-hook
|
|
|
|
zpool-install-data-hook:
|
2017-04-21 16:27:04 +00:00
|
|
|
$(MKDIR_P) "$(DESTDIR)$(zpoolconfdir)"
|
2022-04-09 02:09:55 +00:00
|
|
|
set -x; for f in $(zpoolconfdefaults); do \
|
|
|
|
[ -f "$(DESTDIR)$(zpoolconfdir)/$${f}" ] || \
|
|
|
|
[ -L "$(DESTDIR)$(zpoolconfdir)/$${f}" ] || \
|
|
|
|
$(LN_S) "$(zpoolexecdir)/$${f}" "$(DESTDIR)$(zpoolconfdir)"; \
|
2017-04-21 16:27:04 +00:00
|
|
|
done
|
2022-04-09 02:09:55 +00:00
|
|
|
set -x; printf '%s\n' $(zpoolcompatlinks) | \
|
|
|
|
while read -r canon alias; do \
|
|
|
|
$(LN_S) -f "$${canon}" "$(DESTDIR)$(zpoolcompatdir)/$${alias}"; \
|
2021-02-18 05:30:45 +00:00
|
|
|
done
|