Fix CI/CD: Add fallback for systems without pkg-config

- detect_fuse.sh now checks for pkg-config availability first
- Falls back to checking for header files in standard locations
- Makefile provides default CFLAGS when pkg-config unavailable
- Fixes build on minimal CI/CD environments

Fallback locations checked:
- /usr/include/fuse3/fuse.h (FUSE 3)
- /usr/local/include/fuse3/fuse.h (FUSE 3)
- /usr/include/fuse/fuse.h (FUSE 2)
- /usr/local/include/fuse/fuse.h (FUSE 2)
This commit is contained in:
Levi Neely 2026-03-04 20:15:32 +01:00
parent a47db80789
commit 071f5aec85
2 changed files with 19 additions and 4 deletions

View File

@ -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

View File

@ -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"