macos: tcc searches for libtcc.dyln in the same directory as its executable
This commit is contained in:
parent
1ea425811a
commit
b5a89c8c93
2 changed files with 11 additions and 3 deletions
7
Makefile
7
Makefile
|
@ -42,7 +42,11 @@ else
|
||||||
LIBTCC=libtcc$(DLLSUF)
|
LIBTCC=libtcc$(DLLSUF)
|
||||||
export LD_LIBRARY_PATH := $(CURDIR)/$(TOP)
|
export LD_LIBRARY_PATH := $(CURDIR)/$(TOP)
|
||||||
ifneq ($(CONFIG_rpath),no)
|
ifneq ($(CONFIG_rpath),no)
|
||||||
|
ifndef CONFIG_OSX
|
||||||
LINK_LIBTCC += -Wl,-rpath,"$(libdir)"
|
LINK_LIBTCC += -Wl,-rpath,"$(libdir)"
|
||||||
|
else
|
||||||
|
LINK_LIBTCC += -Wl,-rpath,"@executable_path/$(TOP)"
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
NATIVE_TARGET = $(ARCH)
|
NATIVE_TARGET = $(ARCH)
|
||||||
|
@ -52,7 +56,6 @@ else
|
||||||
LDFLAGS += -flat_namespace -undefined warning
|
LDFLAGS += -flat_namespace -undefined warning
|
||||||
endif
|
endif
|
||||||
export MACOSX_DEPLOYMENT_TARGET := 10.6
|
export MACOSX_DEPLOYMENT_TARGET := 10.6
|
||||||
export DYLD_LIBRARY_PATH := $(CURDIR)/$(TOP)
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -240,7 +243,7 @@ libtcc.so: LDFLAGS+=-fPIC
|
||||||
|
|
||||||
# OSX dynamic libtcc library
|
# OSX dynamic libtcc library
|
||||||
libtcc.dylib: $(LIBTCC_OBJ)
|
libtcc.dylib: $(LIBTCC_OBJ)
|
||||||
$S$(CC) -shared -o $@ $^ $(LDFLAGS)
|
$S$(CC) -shared -install_name @rpath/$@ -o $@ $^ $(LDFLAGS)
|
||||||
|
|
||||||
# windows dynamic libtcc library
|
# windows dynamic libtcc library
|
||||||
libtcc.dll : $(LIBTCC_OBJ)
|
libtcc.dll : $(LIBTCC_OBJ)
|
||||||
|
|
|
@ -62,6 +62,11 @@ ifeq ($(OS),Windows_NT) # for libtcc_test to find libtcc.dll
|
||||||
PATH := $(CURDIR)/$(TOP)$(if $(findstring ;,$(PATH)),;,:)$(PATH)
|
PATH := $(CURDIR)/$(TOP)$(if $(findstring ;,$(PATH)),;,:)$(PATH)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef CONFIG_OSX
|
||||||
|
LIBS += $(LINK_LIBTCC)
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
ifeq ($(ARCH),arm)
|
ifeq ($(ARCH),arm)
|
||||||
# tcctest refers to the alignment of functions, and with thumb mode
|
# tcctest refers to the alignment of functions, and with thumb mode
|
||||||
# the low bit of code addresses selects the mode, so the "alignment"
|
# the low bit of code addresses selects the mode, so the "alignment"
|
||||||
|
|
Loading…
Add table
Reference in a new issue