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:
parent
a47db80789
commit
071f5aec85
4
Makefile
4
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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue