Skip to content

Commit 9b1fbf9

Browse files
committed
Fix rpath issues
1 parent 0157f4c commit 9b1fbf9

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,23 @@ JWTCFLAGS=$(shell pkg-config --cflags libjwt)
66
SSLLDFLAGS=-lssl -lcrypto
77
SSLCFLAGS=
88
CFLAGS=-D_GNU_SOURCE $(JWTCFLAGS) $(SSLCFLAGS) -pedantic -Wall -Wno-unused-result -fpic -c
9-
LDFLAGS=$(JWTLDFLAGS) $(SSLLDFLAGS) -shared
9+
LDFLAGS=$(JWTLDFLAGS) $(SSLLDFLAGS) -shared -Wl,-rpath='$$ORIGIN'
1010

1111
LIBEXT=$(shell swipl -q -g 'current_prolog_flag(shared_object_extension, Ext), writeln(Ext)' -t halt)
1212
LIBNAME=jwt_io
13+
TARGET=lib/x86_64-linux/$(LIBNAME).$(LIBEXT)
1314

1415
testfiles := $(wildcard tests/*.plt)
1516

16-
all: $(LIBNAME).$(LIBEXT)
17+
all: $(TARGET)
1718

18-
$(LIBNAME).$(LIBEXT): src/$(LIBNAME).o
19-
swipl-ld $(LDFLAGS) -o $@ $<
19+
$(TARGET): src/$(LIBNAME).o
20+
gcc $(LDFLAGS) -o $@ $<
2021

2122
%.o: %.c
2223
swipl-ld $(CFLAGS) $<
2324

24-
check: $(LIBNAME).$(LIBEXT) $(testfiles)
25+
check: $(TARGET)$(testfiles)
2526

2627
%.plt: FORCE
2728
swipl -s $@ -g run_tests -t halt

prolog/jwt_io.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
@license BSD
6868
*/
6969

70-
:- use_foreign_library(jwt_io).
70+
:- use_foreign_library(foreign(jwt_io)).
7171

7272
:- use_module(library(http/json)).
7373
:- use_module(library(settings)).

0 commit comments

Comments
 (0)