Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# watcher (development version)

* Fixes installation failing on systems with a partial or broken system 'libfswatch', now falling back to the bundled build.

# watcher 0.2.0

* Building the bundled 'libfswatch' from source no longer requires 'cmake', now directly using the R C/C++ toolchain.
Expand Down
11 changes: 6 additions & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ else
FSWATCH_CFLAGS="$LIB_CFLAGS"
FSWATCH_LIBS="$LIB_LIBS"

# The probe must LINK, not just compile: a header-only check passes on a
# broken partial install (headers present, library missing) and the real
# link of watcher.so then fails with 'cannot find -lfswatch'.
echo "#include <libfswatch/c/libfswatch.h>
int main() {
#if FSW_OK
*(void *) 0 = 0;
#endif
}" | ${CC} ${FSWATCH_CFLAGS} -xc - -o /dev/null > /dev/null 2>&1
int main(void) {
return fsw_init_library();
}" | ${CC} ${CFLAGS} ${CPPFLAGS} ${FSWATCH_CFLAGS} -xc - -o /dev/null ${LDFLAGS} ${FSWATCH_LIBS} > /dev/null 2>&1
if [ $? -ne 0 ]; then
compile_fswatch=1
else
Expand Down
Loading