The upstream source checks for the ability to build against libfuse by
searching hard-coded locations for fuse.h. In the interest of multiarch
support, the Debian package instead uses the compiler to locate the header.
However, this compiler-based check was failing, not because fuse is not
available, but because of a missing cflag. I have modified the check to use
the cflags that pkg-config provides for fuse.
My modified multiarch-libc.patch is attached.
Note:
It seems to me that the check could simply be removed, since the
Debian package should probably fail to build if its dependencies are somehow
not detected, rather than silently building with reduced functionality.
However, this is my first attempt to submit a patch to the Debian BTS, so I've
instead gone with what seemed like the least drastic change.
Ben Morris
Index: wit-3.01a/setup.sh
===================================================================
--- wit-3.01a.orig/setup.sh
+++ wit-3.01a/setup.sh
@@ -18,13 +18,14 @@ revision_next=$revision_num
tim=($(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" '+%s %Y-%m-%d %T'))
defines=
+: "${CC:=cc}"
have_fuse=0
-[[ $NO_FUSE != 1 && -r /usr/include/fuse.h || -r /usr/local/include/fuse.h ]] \
+[[ $NO_FUSE != 1 ]] && echo '#include <fuse.h>' | "$CC" $(pkg-config --cflags fuse) -E - >/dev/null 2>&1 \
&& have_fuse=1
have_zlib=0
-if [[ $NO_ZLIB != 1 && -r /usr/include/zlib.h || -r /usr/local/include/zlib.h ]]
+if [[ $NO_ZLIB != 1 ]] && echo '#include <zlib.h>' | "$CC" -E - >/dev/null 2>&1
then
have_zlib=1
defines="$defines -DHAVE_ZLIB=1"
@@ -41,16 +42,16 @@ else
xflags=
fi
-[[ -r /usr/include/bits/fcntl.h ]] \
- && grep -qw fallocate /usr/include/bits/fcntl.h \
+echo '#include <fcntl.h>' | "$CC" -E - >/dev/null 2>&1 \
+ && echo '#include <fcntl.h>' | "$CC" -E - 2>/dev/null | grep -qw fallocate \
&& defines="$defines -DHAVE_FALLOCATE=1"
-[[ -r /usr/include/fcntl.h ]] \
- && grep -qw posix_fallocate /usr/include/fcntl.h \
+echo '#include <fcntl.h>' | "$CC" -E - >/dev/null 2>&1 \
+ && echo '#include <fcntl.h>' | "$CC" -E - 2>/dev/null | grep -qw posix_fallocate \
&& defines="$defines -DHAVE_POSIX_FALLOCATE=1"
-[[ -r /usr/include/linux/fiemap.h ]] \
- && grep -qw fiemap_extent /usr/include/linux/fiemap.h \
+echo '#include <linux/fiemap.h>' | "$CC" -E - >/dev/null 2>&1 \
+ && echo '#include <linux/fiemap.h>' | "$CC" -E - 2>/dev/null | grep -qw fiemap_extent \
&& defines="$defines -DHAVE_FIEMAP=1"
[[ $STATIC = 1 ]] || STATIC=0