Skip to content

Commit

Permalink
Spruce up pkg-config files for libzfs/libzfs_core
Browse files Browse the repository at this point in the history
Several of the listed library dependencies are not relevant on FreeBSD.
Have ./configure save libraries that are found via pkg-config as
${LIB}_PC and use the configured automake variables instead of hard
coded names so we only get what was actually needed.

While here, update the URL to point at the OpenZFS Github repo.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes openzfs#10869
  • Loading branch information
Ryan Moeller authored and jsai20 committed Mar 30, 2021
1 parent 42d1fc8 commit 3fae1b4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions config/find_system_library.m4
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ AC_DEFUN([ZFS_AC_FIND_SYSTEM_LIBRARY], [
_header_found=
_library_found=
_pc_found=
AS_IF([test -n "$2"], [PKG_CHECK_MODULES([$1], [$2], [
_header_found=1
_library_found=1
_pc_found=1
], [:])])
# set _header_found/_library_found if the user passed in CFLAGS/LIBS
Expand Down Expand Up @@ -82,6 +84,9 @@ AC_DEFUN([ZFS_AC_FIND_SYSTEM_LIBRARY], [
AS_IF([test "x$_header_found" = "x1" && test "x$_library_found" = "x1"], [
AC_SUBST([$1]_CFLAGS)
AC_SUBST([$1]_LIBS)
AS_IF([test "x$_pc_found" = "x1"], [
AC_SUBST([$1]_PC, [$2])
])
AC_DEFINE([HAVE_][$1], [1], [Define if you have [$5]])
$7
],[dnl ELSE
Expand Down
4 changes: 2 additions & 2 deletions lib/libzfs/libzfs.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ includedir=@includedir@
Name: libzfs
Description: LibZFS library
Version: @VERSION@
URL: https://zfsonlinux.org
URL: https://github.com/openzfs/zfs
Requires: libzfs_core
Requires.private: libcrypto zlib
Requires.private: @LIBCRYPTO_PC@ @ZLIB_PC@
Cflags: -I${includedir}/libzfs -I${includedir}/libspl
Libs: -L${libdir} -lzfs -lnvpair
Libs.private: -luutil -lm -pthread
4 changes: 2 additions & 2 deletions lib/libzfs_core/libzfs_core.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ includedir=@includedir@
Name: libzfs_core
Description: LibZFS core library
Version: @VERSION@
URL: https://zfsonlinux.org
Requires.private: blkid uuid libtirpc zlib
URL: https://github.com/openzfs/zfs
Requires.private: @LIBBLKID_PC@ @LIBUUID_PC@ @LIBTIRPC_PC@ @ZLIB_PC@
Cflags: -I${includedir}/libzfs -I${includedir}/libspl
Libs: -L${libdir} -lzfs_core -lnvpair
Libs.private: @LIBCLOCK_GETTIME@ @LIBUDEV_LIBS@ -lm -pthread

0 comments on commit 3fae1b4

Please sign in to comment.