File tree 3 files changed +19
-6
lines changed
3 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -384,8 +384,18 @@ endif
384
384
fi;
385
385
endif
386
386
387
- # Set rpath for libjulia-internal, which is moving from `../lib` to `../lib/julia`. We only need to do this for Linux/FreeBSD
388
- ifneq (,$(findstring $(OS ) ,Linux FreeBSD) )
387
+ # Set rpath for libjulia-internal, which is moving from `../lib` to `../lib/julia`.
388
+ ifeq ($(OS ) , Darwin)
389
+ ifneq ($(DARWIN_FRAMEWORK ) ,1)
390
+ ifeq ($(JULIA_BUILD_MODE ) ,release)
391
+ install_name_tool -add_rpath @loader_path/$(reverse_private_libdir_rel)/ $(DESTDIR)$(private_libdir)/libjulia-internal.$(SHLIB_EXT)
392
+ install_name_tool -add_rpath @loader_path/$(reverse_private_libdir_rel)/ $(DESTDIR)$(private_libdir)/libjulia-codegen.$(SHLIB_EXT)
393
+ else ifeq ($(JULIA_BUILD_MODE),debug)
394
+ install_name_tool -add_rpath @loader_path/$(reverse_private_libdir_rel)/ $(DESTDIR)$(private_libdir)/libjulia-internal-debug.$(SHLIB_EXT)
395
+ install_name_tool -add_rpath @loader_path/$(reverse_private_libdir_rel)/ $(DESTDIR)$(private_libdir)/libjulia-codegen-debug.$(SHLIB_EXT)
396
+ endif
397
+ endif
398
+ else ifneq (,$(findstring $(OS),Linux FreeBSD))
389
399
ifeq ($(JULIA_BUILD_MODE ) ,release)
390
400
$(PATCHELF) --set-rpath '$$ORIGIN:$$ORIGIN/$(reverse_private_libdir_rel)' $(DESTDIR)$(private_libdir)/libjulia-internal.$(SHLIB_EXT)
391
401
$(PATCHELF) --set-rpath '$$ORIGIN:$$ORIGIN/$(reverse_private_libdir_rel)' $(DESTDIR)$(private_libdir)/libjulia-codegen.$(SHLIB_EXT)
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ endif
112
112
$(build_shlibdir ) /libjulia.$(JL_MAJOR_MINOR_SHLIB_EXT ) : $(LIB_OBJS ) $(SRCDIR ) /list_strip_symbols.h | $(build_shlibdir ) $(build_libdir )
113
113
@$(call PRINT_LINK, $(CC ) $(call IMPLIB_FLAGS,$@ .tmp) $(LOADER_CFLAGS ) -DLIBRARY_EXPORTS -shared $(SHIPFLAGS ) $(LIB_OBJS ) -o $@ \
114
114
$(JLIBLDFLAGS ) $(LOADER_LDFLAGS ) $(call SONAME_FLAGS,libjulia.$(JL_MAJOR_SHLIB_EXT ) ) )
115
- @$(INSTALL_NAME_CMD ) libjulia.$(SHLIB_EXT ) $@
115
+ @$(INSTALL_NAME_CMD ) libjulia.$(JL_MAJOR_SHLIB_EXT ) $@
116
116
ifeq ($(OS ) , WINNT)
117
117
@# Note that if the objcopy command starts getting too long, we can use `@file` to read
118
118
@# command-line options from `file` instead.
@@ -122,7 +122,7 @@ endif
122
122
$(build_shlibdir ) /libjulia-debug.$(JL_MAJOR_MINOR_SHLIB_EXT ) : $(LIB_DOBJS ) $(SRCDIR ) /list_strip_symbols.h | $(build_shlibdir ) $(build_libdir )
123
123
@$(call PRINT_LINK, $(CC ) $(call IMPLIB_FLAGS,$@ .tmp) $(LOADER_CFLAGS ) -DLIBRARY_EXPORTS -shared $(DEBUGFLAGS ) $(LIB_DOBJS ) -o $@ \
124
124
$(JLIBLDFLAGS ) $(LOADER_LDFLAGS ) $(call SONAME_FLAGS,libjulia-debug.$(JL_MAJOR_SHLIB_EXT ) ) )
125
- @$(INSTALL_NAME_CMD ) libjulia-debug.$(SHLIB_EXT ) $@
125
+ @$(INSTALL_NAME_CMD ) libjulia-debug.$(JL_MAJOR_SHLIB_EXT ) $@
126
126
ifeq ($(OS ) , WINNT)
127
127
@$(call PRINT_ANALYZE, $(OBJCOPY) $(build_libdir)/$(notdir $@).tmp.a $(STRIP_EXPORTED_FUNCS) $(build_libdir)/$(notdir $@).a && rm $(build_libdir)/$(notdir $@).tmp.a)
128
128
endif
Original file line number Diff line number Diff line change @@ -150,6 +150,9 @@ CLANG_LDFLAGS := $(LLVM_LDFLAGS)
150
150
ifeq ($(OS ) , Darwin)
151
151
CLANG_LDFLAGS += -Wl,-undefined,dynamic_lookup
152
152
OSLIBS += $(SRCDIR ) /mach_dyld_atfork.tbd
153
+ LIBJULIA_PATH_REL := @rpath/libjulia
154
+ else
155
+ LIBJULIA_PATH_REL := libjulia
153
156
endif
154
157
155
158
COMMON_LIBPATHS := -L$(build_libdir ) -L$(build_shlibdir )
@@ -174,8 +177,8 @@ SHIPFLAGS += "-DJL_SYSTEM_IMAGE_PATH=\"$(build_private_libdir_rel)/sys.$(SHLIB_
174
177
DEBUGFLAGS += "-DJL_SYSTEM_IMAGE_PATH=\"$(build_private_libdir_rel ) /sys-debug.$(SHLIB_EXT ) \""
175
178
176
179
# Add SONAME defines so we can embed proper `dlopen()` calls.
177
- SHIPFLAGS += "-DJL_LIBJULIA_SONAME=\"libjulia. $( JL_MAJOR_SHLIB_EXT ) \"" "-DJL_LIBJULIA_INTERNAL_SONAME=\"libjulia-internal .$(JL_MAJOR_SHLIB_EXT ) \""
178
- DEBUGFLAGS += "-DJL_LIBJULIA_SONAME=\"libjulia-debug. $( JL_MAJOR_SHLIB_EXT ) \"" "-DJL_LIBJULIA_INTERNAL_SONAME=\"libjulia-internal -debug.$(JL_MAJOR_SHLIB_EXT ) \""
180
+ SHIPFLAGS += "-DJL_LIBJULIA_SONAME=\"$( LIBJULIA_PATH_REL ) .$(JL_MAJOR_SHLIB_EXT ) \""
181
+ DEBUGFLAGS += "-DJL_LIBJULIA_SONAME=\"$( LIBJULIA_PATH_REL ) -debug.$(JL_MAJOR_SHLIB_EXT ) \""
179
182
180
183
ifeq ($(USE_CROSS_FLISP ) , 1)
181
184
FLISPDIR := $(BUILDDIR ) /flisp/host
You can’t perform that action at this time.
0 commit comments