diff --git a/NEWS.md b/NEWS.md index da9eb98..6bdd438 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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. diff --git a/configure b/configure index 1a8a350..356f9f3 100755 --- a/configure +++ b/configure @@ -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 -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