diff --git a/Makefile b/Makefile index f372179..60e5c27 100644 --- a/Makefile +++ b/Makefile @@ -19,11 +19,11 @@ else endif ifeq ($(FUSE_VERSION),FUSE3) - FUSE_CFLAGS := $(shell pkg-config --cflags fuse3) + FUSE_CFLAGS := $(shell pkg-config --cflags fuse3 2>/dev/null || echo "-I/usr/include/fuse3 -D_FILE_OFFSET_BITS=64") FUSE_LIBS := -lfuse3 FUSE_USE_VERSION := 30 else ifeq ($(FUSE_VERSION),FUSE2) - FUSE_CFLAGS := $(shell pkg-config --cflags fuse) + FUSE_CFLAGS := $(shell pkg-config --cflags fuse 2>/dev/null || echo "-I/usr/include/fuse -D_FILE_OFFSET_BITS=64") FUSE_LIBS := -lfuse FUSE_USE_VERSION := 26 else diff --git a/detect_fuse.sh b/detect_fuse.sh index 3f051d0..07d8e9c 100755 --- a/detect_fuse.sh +++ b/detect_fuse.sh @@ -1,9 +1,24 @@ #!/bin/bash # Detect FUSE version and set appropriate flags -if pkg-config --exists fuse3; then +# Check if pkg-config is available +if ! command -v pkg-config >/dev/null 2>&1; then + # Fallback: check for header files + if [ -f /usr/include/fuse3/fuse.h ] || [ -f /usr/local/include/fuse3/fuse.h ]; then + echo "FUSE3" + elif [ -f /usr/include/fuse/fuse.h ] || [ -f /usr/local/include/fuse/fuse.h ]; then + echo "FUSE2" + else + echo "NONE" + exit 1 + fi + exit 0 +fi + +# Use pkg-config if available +if pkg-config --exists fuse3 2>/dev/null; then echo "FUSE3" -elif pkg-config --exists fuse; then +elif pkg-config --exists fuse 2>/dev/null; then echo "FUSE2" else echo "NONE"