From 171bfd5f8ab048a0d79755d1ab342774dc977791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Boh=C3=A1=C4=8Dek?= Date: Fri, 18 Jun 2021 00:31:25 +0200 Subject: [PATCH] fix: use rpath instead of ld library path --- Makefile | 2 +- image-viewer/Makefile | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 630ffda11fd1bd8e078d27e26946fcf273e76012..593e448bee6758a73867c13e683443cc20b0c6a1 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ copy-executable: all ssh $(SSH_OPTIONS) $(TARGET_USER)@$(TARGET_IP) mv $(TARGET_DIR)/bin/* $(TARGET_DIR) run-image-viewer: copy-executable all - ssh $(SSH_OPTIONS) -t $(TARGET_USER)@$(TARGET_IP) LD_LIBRARY_PATH=$(TARGET_DIR) $(TARGET_DIR)/image-viewer $(ARG) + ssh $(SSH_OPTIONS) -t $(TARGET_USER)@$(TARGET_IP) $(TARGET_DIR)/image-viewer $(ARG) clean: @make -C image-viewer clean diff --git a/image-viewer/Makefile b/image-viewer/Makefile index 6a2d2c262cb8754c0606d2946242746187092350..1da6ba959005f4c3300c9a06138937ad9f44c7d9 100644 --- a/image-viewer/Makefile +++ b/image-viewer/Makefile @@ -16,11 +16,12 @@ CFLAGS =-g -std=gnu99 -O1 -Wall -D ILI9481 CXXFLAGS = -g -std=gnu++11 -O1 -Wall ifdef COMPUTER -LDFLAGS = $(LIB_DIR) -lrt -lmzapo_pheripherals -lpthread -lmagic -ljpeg -lpng $(shell sdl2-config --libs) -lSDL2_image +LDFLAGS = -lrt -lmzapo_pheripherals -lpthread -lmagic -ljpeg -lpng $(shell sdl2-config --libs) -lSDL2_image CFLAGS += -DCOMPUTER $(shell sdl2-config --cflags) else -LDFLAGS = $(LIB_DIR) -lrt -lmzapo_pheripherals -lpthread -l :libmagic.so.1 -l :libjpeg.so.62 -l :libz.so -l :libpng16.so.16 +LDFLAGS = -lrt -lmzapo_pheripherals -lpthread -l :libmagic.so.1 -l :libjpeg.so.62 -l :libz.so -l :libpng16.so.16 endif +LDFLAGS += -Wl,-rpath,'$${ORIGIN}' $(LIB_DIR) NAME=image-viewer BINARY=$(BIN_DIR)/$(NAME)