HomeFreeBSD

Fix up FIND_SYSTEM_LIBRARY to work with cross-compiling

Description

Fix up FIND_SYSTEM_LIBRARY to work with cross-compiling

Make FIND_SYSTEM_LIBRARY respect a configured sysroot, otherwise it
might find headers from the build machine and assume the library is
available on the host/target.

Tighten up error checking: if pkg-config or the user specified _CFLAGS
or _LIBS but we can't find the header/library, issue a fatal error.

Fix the -L flag to /usr/local/lib instead of just /usr/local.

Clean out the _CFLAGS and _LIBS if we located something that we later
find doesn't work.

Rename FIND_SYSTEM_LIBRARY into the ZFS_AC_ scope.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Closes #10538

Details

Provenance
Arvind Sankar <nivedita@alum.mit.edu>Authored on Jul 9 2020, 8:31 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jul 10 2020, 9:26 PM
Parents
rG3e597dee1128: Use abs_top_builddir when referencing libraries
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGf040a7b0f8ba: Fix up FIND_SYSTEM_LIBRARY to work with cross-compiling (authored by Arvind Sankar <nivedita@alum.mit.edu>).Jul 10 2020, 9:26 PM