libzip: fix musl-fts failure
authorSebastian Kemper <sebastian_ml@gmx.net>
Mon, 16 Dec 2019 22:33:30 +0000 (23:33 +0100)
committerRosen Penev <rosenp@gmail.com>
Fri, 15 Jan 2021 21:43:59 +0000 (13:43 -0800)
commit92f095b21ce43f622e741a9f0620d23e24ec8050
tree4bb70824e9b85c3dbbbb9fa5bbf424c5f48a9f38
parenta0d9d76b2310db4945089dcbbe9cc7beaeeabba1
libzip: fix musl-fts failure

musl doesn't support fts. But with the extra package musl-fts installed,
libzip picks up the fts header and fails at the linking stage:

zipcmp.c:(.text.startup+0x130): undefined reference to `fts_open'
/home/sk/tmp/openwrt/staging_dir/toolchain-mips_24kc_gcc-8.3.0_musl/lib/gcc/mips-openwrt-linux-musl/8.3.0/../../../../mips-openwrt-linux-musl/bin/ld: zipcmp.c:(.text.startup+0x172): undefined reference to `fts_read'

So with musl-fts we need to link in libfts. To address that this commits
patches the cmake setup to check if fts is available in libc itself or
in any external libfts.

So when musl-fts is installed on the system the setup will be the
following:

musl: use libfts
uclibc: use fts from libc
glibc: like uclibc

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
(cherry picked from commit 0c381f7c7a6fbd6d62632fa67671a2dd2a5051a5)
libs/libzip/Makefile
libs/libzip/patches/01-link-fts.patch [new file with mode: 0644]