From 26636eec9404533d987bbe7d3ef5df04b53c0a7a Mon Sep 17 00:00:00 2001 From: Sven Gestegard Robertz <sven.robertz@cs.lth.se> Date: Mon, 22 Jun 2015 15:06:59 +0200 Subject: [PATCH] hacked (DY)LD_LIBRARY_PATH into os_compat.mk --- examples/user_types/Makefile | 18 +++++++++--------- lib/c/os_compat.mk | 2 ++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/examples/user_types/Makefile b/examples/user_types/Makefile index e1ab9a2..d999b89 100644 --- a/examples/user_types/Makefile +++ b/examples/user_types/Makefile @@ -76,19 +76,19 @@ run: @java -cp .:${LCDIR}/lib/java/labcomm2014.jar:${GENDIR} Decoder encoded_data_j @echo "************ running C decoder: *****************" - @LD_LIBRARY_PATH=${LCDIR}/lib/c/ ./example_decoder encoded_data_j + @${LD_LIBRARY_PATH_NAME}=${LCDIR}/lib/c/ ./example_decoder encoded_data_j @echo "************ running python decoder (from wiki_example):" @PYTHONPATH=${LCDIR}/lib/python ../wiki_example/example_decoder.py encoded_data_j LabComm2014 @echo "************ running C encoder: *****************" - @LD_LIBRARY_PATH=${LCDIR}/lib/c/ ./example_encoder encoded_data_c + @${LD_LIBRARY_PATH_NAME}=${LCDIR}/lib/c/ ./example_encoder encoded_data_c @echo "************ running Java decoder: *****************" @java -cp .:${LCDIR}/lib/java/labcomm2014.jar:${GENDIR} Decoder encoded_data_c @echo "************ running C decoder: *****************" - @LD_LIBRARY_PATH=${LCDIR}/lib/c/ ./example_decoder encoded_data_c + @${LD_LIBRARY_PATH_NAME}=${LCDIR}/lib/c/ ./example_decoder encoded_data_c @echo "************ running python decoder (from wiki_example):" @PYTHONPATH=${LCDIR}/lib/python ../wiki_example/example_decoder.py encoded_data_c LabComm2014 @@ -100,7 +100,7 @@ run: @java -cp .:${LCDIR}/lib/java/labcomm2014.jar:${GENDIR} Decoder encoded_data_p @echo "************ running C decoder: *****************" - @LD_LIBRARY_PATH=${LCDIR}/lib/c/ ./example_decoder encoded_data_p + @${LD_LIBRARY_PATH_NAME}=${LCDIR}/lib/c/ ./example_decoder encoded_data_p @echo "************ running python decoder (from wiki_example):" PYTHONPATH=${LCDIR}/lib/python ../wiki_example/example_decoder.py encoded_data_p LabComm2014 @@ -118,22 +118,22 @@ runwcs: build ExampleEncoder.exe ExampleDecoder.exe @java -cp .:${LCDIR}/lib/java/labcomm2014.jar:${GENDIR} Decoder encoded_data_j @echo "************ running C decoder: *****************" - @LD_LIBRARY_PATH=${LCDIR}/lib/c/ ./example_decoder encoded_data_j + @${LD_LIBRARY_PATH_NAME}=${LCDIR}/lib/c/ ./example_decoder encoded_data_j @echo "************ running python decoder (from wiki_example):" @PYTHONPATH=${LCDIR}/lib/python ../wiki_example/example_decoder.py encoded_data_j LabComm2014 @echo "************ running C# decoder: *****************" - @LD_LIBRARY_PATH=${LCDIR}/lib/c/ mono ./ExampleDecoder.exe encoded_data_j + @${LD_LIBRARY_PATH_NAME}=${LCDIR}/lib/c/ mono ./ExampleDecoder.exe encoded_data_j @echo "************ running C encoder: *****************" - @LD_LIBRARY_PATH=${LCDIR}/lib/c/ ./example_encoder encoded_data_c + @${LD_LIBRARY_PATH_NAME}=${LCDIR}/lib/c/ ./example_encoder encoded_data_c @echo "************ running Java decoder: *****************" @java -cp .:${LCDIR}/lib/java/labcomm2014.jar:${GENDIR} Decoder encoded_data_c @echo "************ running C decoder: *****************" - @LD_LIBRARY_PATH=${LCDIR}/lib/c/ ./example_decoder encoded_data_c + @${LD_LIBRARY_PATH_NAME}=${LCDIR}/lib/c/ ./example_decoder encoded_data_c @echo "************ running python decoder (from wiki_example):" @PYTHONPATH=${LCDIR}/lib/python ../wiki_example/example_decoder.py encoded_data_c LabComm2014 @@ -148,7 +148,7 @@ runwcs: build ExampleEncoder.exe ExampleDecoder.exe @java -cp .:${LCDIR}/lib/java/labcomm2014.jar:${GENDIR} Decoder encoded_data_p @echo "************ running C decoder: *****************" - @LD_LIBRARY_PATH=${LCDIR}/lib/c/ ./example_decoder encoded_data_p + @${LD_LIBRARY_PATH_NAME}=${LCDIR}/lib/c/ ./example_decoder encoded_data_p @echo "************ running C# decoder: *****************" @mono ./ExampleDecoder.exe encoded_data_p diff --git a/lib/c/os_compat.mk b/lib/c/os_compat.mk index 505c7a2..4f1774a 100644 --- a/lib/c/os_compat.mk +++ b/lib/c/os_compat.mk @@ -10,6 +10,7 @@ ifeq ($(UNAME_S),Linux) CFLAGS_TEST=$(CFLAGS) -Itest LDFLAGS=-L.. LDLIBS=-llabcomm$(LIBVERSION) -lrt + LD_LIBRARY_PATH_NAME=LD_LIBRARY_PATH MAKESHARED=gcc -o $1 -shared -Wl,-soname,$2 $3 -lc -lrt else ifeq ($(UNAME_S),Darwin) #CC=$(CROSS_COMPILE)clang @@ -24,6 +25,7 @@ else ifeq ($(UNAME_S),Darwin) CFLAGS+=-std=c99 LDFLAGS=-L.. LDLIBS=-llabcomm$(LIBVERSION) + LD_LIBRARY_PATH_NAME=DYLD_LIBRARY_PATH MAKESHARED=clang -o $1 -shared -Wl,-install_name,$2 $3 -lc else ifneq ($(findstring CYGWIN,$(UNAME_S)),) CC=$(CROSS_COMPILE)gcc -- GitLab