build: link test runner with -rpath

Link the test runner with -rpath=/path/to/libuv.so, don't muck around with
LD_LIBRARY_PATH.
This commit is contained in:
Ben Noordhuis 2012-11-09 02:15:17 +01:00
parent 2d1f17fecb
commit 20eaa84c4f
2 changed files with 3 additions and 9 deletions

View File

@ -50,16 +50,10 @@ test/echo.o: test/echo.c test/echo.h
test: test/run-tests$(E)
LD_LIBRARY_PATH="$(LD_LIBRARY_PATH):." test/run-tests
#test-%: test/run-tests$(E)
# test/run-tests $(@:test-%=%)
$<
bench: test/run-benchmarks$(E)
test/run-benchmarks
#bench-%: test/run-benchmarks$(E)
# test/run-benchmarks $(@:bench-%=%)
$<
clean: clean-platform
$(RM) -f src/*.o *.a test/run-tests$(E) test/run-benchmarks$(E)

View File

@ -121,7 +121,7 @@ endif
# Need _GNU_SOURCE for strdup?
RUNNER_CFLAGS=$(CFLAGS) -D_GNU_SOURCE -Itest
RUNNER_LINKFLAGS=$(LINKFLAGS) -L"$(PWD)" -luv
RUNNER_LINKFLAGS=$(LINKFLAGS) -Wl,-rpath="$(PWD)" -L"$(PWD)" -luv
ifeq (SunOS,$(uname_S))
RUNNER_LINKFLAGS += -pthreads