8139653: Freetype bundled on macosx, but not correctly linked

Reviewed-by: tbell, prr
This commit is contained in:
Erik Joelsson 2017-11-30 13:29:50 -08:00
parent 7501a2168a
commit f6fe5ff445
6 changed files with 1013 additions and 214 deletions

View File

@ -1092,10 +1092,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
# We can build without it.
LDD="true"
fi
BASIC_PATH_PROGS(OTOOL, otool)
if test "x$OTOOL" = "x"; then
OTOOL="true"
fi
BASIC_PATH_PROGS(READELF, [greadelf readelf])
BASIC_PATH_PROGS(DOT, dot)
BASIC_PATH_PROGS(HG, hg)

File diff suppressed because it is too large Load Diff

View File

@ -471,6 +471,7 @@ GNM:=@GNM@
STRIP:=@STRIP@
LIPO:=@LIPO@
INSTALL_NAME_TOOL:=@INSTALL_NAME_TOOL@
# Options to linker to specify a mapfile.
# (Note absence of := assignment, because we do not want to evaluate the macro body here)

View File

@ -628,6 +628,10 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA],
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
BASIC_PATH_PROGS(LIPO, lipo)
BASIC_FIXUP_EXECUTABLE(LIPO)
BASIC_REQUIRE_PROGS(OTOOL, otool)
BASIC_FIXUP_EXECUTABLE(OTOOL)
BASIC_REQUIRE_PROGS(INSTALL_NAME_TOOL, install_name_tool)
BASIC_FIXUP_EXECUTABLE(INSTALL_NAME_TOOL)
fi
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then

View File

@ -44,7 +44,8 @@ $(INCLUDE_DST_OS_DIR)/%.h: \
################################################################################
ifneq ($(FREETYPE_BUNDLE_LIB_PATH), )
# We need to bundle the freetype library, so it will be available at runtime as well as link time.
# We need to bundle the freetype library, so it will be available at runtime
# as well as link time.
#
# NB: Default freetype build system uses -h linker option and
# result .so contains hardcoded library name that is later
@ -61,10 +62,10 @@ ifneq ($(FREETYPE_BUNDLE_LIB_PATH), )
#
#TODO: rework this to avoid hardcoding library name in the makefile
#
ifeq ($(OPENJDK_TARGET_OS), windows)
FREETYPE_TARGET_LIB := $(LIB_DST_DIR)/$(call SHARED_LIBRARY,freetype)
else
ifneq ($(filter $(OPENJDK_TARGET_OS), linux solaris), )
FREETYPE_TARGET_LIB := $(LIB_DST_DIR)/$(call SHARED_LIBRARY,freetype).6
else
FREETYPE_TARGET_LIB := $(LIB_DST_DIR)/$(call SHARED_LIBRARY,freetype)
endif
# We can't use $(install-file) in this rule because it preserves symbolic links and

View File

@ -658,7 +658,7 @@ endif
$(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
LIBRARY := fontmanager, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfontmanager, \
SRC := $(LIBFONTMANAGER_SRC), \
EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
AccelGlyphCache.c, \
@ -708,7 +708,20 @@ ifneq (, $(findstring $(OPENJDK_TARGET_OS), solaris aix))
$(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_HEADLESS)
endif
TARGETS += $(BUILD_LIBFONTMANAGER)
$(INSTALL_LIBRARIES_HERE)/$(call SHARED_LIBRARY,fontmanager): $(BUILD_LIBFONTMANAGER_TARGET)
$(install-file)
ifneq ($(FREETYPE_BUNDLE_LIB_PATH), )
ifeq ($(OPENJDK_TARGET_OS), macosx)
# If bundling freetype on macosx, we need to rewrite the rpath location
# in the libfontmanager library to point to the bundled location
$(INSTALL_NAME_TOOL) -change \
`$(OTOOL) -D $(FREETYPE_BUNDLE_LIB_PATH)/$(call SHARED_LIBRARY,freetype) | $(TAIL) -n1` \
'@rpath/$(call SHARED_LIBRARY,freetype)' \
$@
endif
endif
TARGETS += $(INSTALL_LIBRARIES_HERE)/$(call SHARED_LIBRARY,fontmanager)
################################################################################