From 672fd94c0823a98ca1da894c240e02beeb455b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 28 Sep 2012 14:53:48 +0200 Subject: [PATCH] Use rpath on linux for FUSE We should perhaps check if PKG_CONFIG_PATH has been set, which would indicate that the FUSE libraries are in a non-default location, but for now this is okey. --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b5dffc5..506f40d 100644 --- a/Makefile +++ b/Makefile @@ -7,12 +7,14 @@ DEFINES = -DFUSE_USE_VERSION=26 ifeq ($(shell uname), Darwin) # Pick up OSXFUSE, even with pkg-config from MacPorts PKG_CONFIG := PKG_CONFIG_PATH=/usr/local/lib/pkgconfig $(PKG_CONFIG) +else ifeq ($(shell uname), Linux) + LFLAGS += -Wl,-rpath=$(shell $(PKG_CONFIG) fuse --variable=libdir) endif FUSE_FLAGS := $(shell $(PKG_CONFIG) fuse --cflags --libs) $(TARGET): sparsebundlefs.cpp - $(CXX) $(CFLAGS) $(FUSE_FLAGS) $(DEFINES) $< -o $@ + $(CXX) $(CFLAGS) $(FUSE_FLAGS) $(LFLAGS) $(DEFINES) $< -o $@ all: $(TARGET)