Skip to content

Commit

Permalink
Undo symlink fix for Julia_debug library
Browse files Browse the repository at this point in the history
  • Loading branch information
slarew authored and staticfloat committed Apr 16, 2019
1 parent e40273c commit e25ad9a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
29 changes: 13 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,7 @@ else
@$(DSYMUTIL) -o $(DESTDIR)$(prefix)/$(framework_resources)/$(FRAMEWORK_NAME).dSYM $(DESTDIR)$(prefix)/$(framework_dylib)
@$(DSYMUTIL) -o $(DESTDIR)$(prefix)/$(framework_resources)/sys.dylib.dSYM $(build_private_libdir)/sys.dylib
ifeq ($(BUNDLE_DEBUG_LIBS),1)
# Codesign fails if Julia_debug is at root of framework next to Julia dylib.
# Solution: Move Julia_debug inside Frameworks and symlink to it.
$(INSTALL_M) $(build_libdir)/libjulia-debug.$(SOMAJOR).$(SOMINOR).dylib $(DESTDIR)$(prefix)/$(framework_frameworks)/$(FRAMEWORK_NAME)_debug
-ln -s Frameworks/$(FRAMEWORK_NAME)_debug $(DESTDIR)$(prefix)/$(framework_dylib)_debug
$(INSTALL_M) $(build_libdir)/libjulia-debug.$(SOMAJOR).$(SOMINOR).dylib $(DESTDIR)$(prefix)/$(framework_dylib)_debug
@$(DSYMUTIL) -o $(DESTDIR)$(prefix)/$(framework_resources)/$(FRAMEWORK_NAME)_debug.dSYM $(DESTDIR)$(prefix)/$(framework_dylib)_debug
@$(DSYMUTIL) -o $(DESTDIR)$(prefix)/$(framework_resources)/sys-debug.dylib.dSYM $(build_private_libdir)/sys-debug.dylib
endif
Expand All @@ -347,7 +344,7 @@ ifeq ($(BUNDLE_DEBUG_LIBS),1)
endif

# Copy in all .jl sources as well
mkdir -p $(DESTDIR)$(datarootdir)/julia/{base,test}
mkdir -p $(DESTDIR)$(datarootdir)/julia/base $(DESTDIR)$(datarootdir)/julia/test
cp -R -L $(JULIAHOME)/base/* $(DESTDIR)$(datarootdir)/julia/base
cp -R -L $(JULIAHOME)/test/* $(DESTDIR)$(datarootdir)/julia/test
cp -R -L $(build_datarootdir)/julia/* $(DESTDIR)$(datarootdir)/julia
Expand Down Expand Up @@ -389,17 +386,17 @@ else ifneq (,$(findstring $(OS),Linux FreeBSD))
endif

# Overwrite JL_SYSTEM_IMAGE_PATH in julia library
ifneq ($(DARWIN_FRAMEWORK),1)
$(call stringreplace,$(DESTDIR)$(libdir)/libjulia.$(SHLIB_EXT),sys.$(SHLIB_EXT)$$,$(private_libdir_rel)/sys.$(SHLIB_EXT))
ifeq ($(BUNDLE_DEBUG_LIBS),1)
$(call stringreplace,$(DESTDIR)$(libdir)/libjulia-debug.$(SHLIB_EXT),sys-debug.$(SHLIB_EXT)$$,$(private_libdir_rel)/sys-debug.$(SHLIB_EXT))
endif
else
$(call stringreplace,$(DESTDIR)$(prefix)/$(framework_dylib),sys.$(SHLIB_EXT)$$,$(private_libdir_rel)/sys.$(SHLIB_EXT))
ifeq ($(BUNDLE_DEBUG_LIBS),1)
$(call stringreplace,$(DESTDIR)$(prefix)/$(framework_dylib)_debug,sys-debug.$(SHLIB_EXT)$$,$(private_libdir_rel)/sys-debug.$(SHLIB_EXT))
endif
endif
if [ $(DARWIN_FRAMEWORK) == 0 ]; then \
RELEASE_TARGET=$(DESTDIR)$(libdir)/libjulia.$(SHLIB_EXT); \
DEBUG_TARGET=$(DESTDIR)$(libdir)/libjulia-debug.$(SHLIB_EXT); \
else \
RELEASE_TARGET=$(DESTDIR)$(prefix)/$(framework_dylib); \
DEBUG_TARGET=$(DESTDIR)$(prefix)/$(framework_dylib)_debug; \
fi; \
$(call stringreplace,$${RELEASE_TARGET},sys.$(SHLIB_EXT)$$,$(private_libdir_rel)/sys.$(SHLIB_EXT)); \
if [ $(BUNDLE_DEBUG_LIBS) == 1 ]; then \
$(call stringreplace,$${DEBUG_TARGET},sys-debug.$(SHLIB_EXT)$$,$(private_libdir_rel)/sys-debug.$(SHLIB_EXT)); \
fi;

endif
# On FreeBSD, remove the build's libdir from each library's RPATH
Expand Down
14 changes: 7 additions & 7 deletions contrib/mac/framework/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,20 @@ frameworknoinstall: $(DESTDIR)$(prefix)/$(framework_infoplist) | $(framework_cur
ifeq ($(BUNDLE_DEBUG_LIBS),1)
$(INSTALL_NAME_CHANGE_CMD) @rpath/libjulia-debug.dylib @rpath/$(FRAMEWORK_NAME)_debug $(DESTDIR)$(bindir)/julia-debug
$(JULIAHOME)/contrib/mac/framework/delete-all-rpaths.sh $(DESTDIR)$(bindir)/julia-debug
install_name_tool -add_rpath @executable_path/$(private_libdir_rel) $(DESTDIR)$(bindir)/julia-debug
install_name_tool -add_rpath @executable_path/$(libdir_rel) $(DESTDIR)$(bindir)/julia-debug
endif

# fix libjulia paths
$(INSTALL_NAME_CMD)$(framework_dylib) $(DESTDIR)$(prefix)/$(framework_dylib)
$(JULIAHOME)/contrib/mac/framework/delete-all-rpaths.sh $(DESTDIR)$(prefix)/$(framework_dylib)
install_name_tool -add_rpath @loader_path/Frameworks $(DESTDIR)$(prefix)/$(framework_dylib)
ifeq ($(BUNDLE_DEBUG_LIBS),1)
# Julia_debug is inside Frameworks subdirectory.
# Install name should be the non-debug variant as above and rpath should drop
# the Frameworks component since Julia_debug is already in Frameworks.
# Install name should be the non-debug variant.
# Julia_debug variant is selected with DYLD_IMAGE_SUFFIX (man 1 dyld).
# julia-debug explicitly links to Julia_debug so no need to manipulate DYLD_IMAGE_SUFFIX for it.
$(INSTALL_NAME_CMD)$(framework_dylib) $(DESTDIR)$(prefix)/$(framework_dylib)_debug
$(JULIAHOME)/contrib/mac/framework/delete-all-rpaths.sh $(DESTDIR)$(prefix)/$(framework_frameworks)/$(FRAMEWORK_NAME)_debug
install_name_tool -add_rpath @loader_path/ $(DESTDIR)$(prefix)/$(framework_dylib)_debug
$(JULIAHOME)/contrib/mac/framework/delete-all-rpaths.sh $(DESTDIR)$(prefix)/$(framework_dylib)_debug
install_name_tool -add_rpath @loader_path/Frameworks $(DESTDIR)$(prefix)/$(framework_dylib)_debug
endif

$(INSTALL_NAME_CHANGE_CMD) @rpath/libjulia.dylib @rpath/$(FRAMEWORK_NAME) $(DESTDIR)$(prefix)/$(framework_frameworks)/sys.dylib
Expand Down Expand Up @@ -167,7 +167,7 @@ endif
ifeq ($(BUNDLE_DEBUG_LIBS),1)
# Don't forget to sign Frameworks/Julia_debug
codesign -s "$(DARWIN_CODESIGN_KEYCHAIN_IDENTITY)" -v -i $(DARWIN_CODESIGN_ID_BASE).lib -f \
$(DESTDIR)$(prefix)/$(framework_frameworks)/$(FRAMEWORK_NAME)_debug
$(DESTDIR)$(prefix)/$(framework_dylib)_debug
endif
codesign -s "$(DARWIN_CODESIGN_KEYCHAIN_IDENTITY)" -v $(DESTDIR)$(prefix)/$(framework_currver)

Expand Down

0 comments on commit e25ad9a

Please sign in to comment.