Mercurial > hg > openjdk > lambda > jdk
changeset 10412:aabaae5de1ee
8001922: Improve freetype handling.
Reviewed-by: erikj
author | ihse |
---|---|
date | Wed, 23 Oct 2013 13:06:37 +0200 |
parents | 81431a7c17cf |
children | ab0e61a57df7 |
files | makefiles/CopyFiles.gmk makefiles/lib/Awt2dLibraries.gmk |
diffstat | 2 files changed, 25 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/makefiles/CopyFiles.gmk Tue Oct 22 16:51:37 2013 -0700 +++ b/makefiles/CopyFiles.gmk Wed Oct 23 13:06:37 2013 +0200 @@ -215,39 +215,37 @@ ########################################################################################## -# make sure freetype dll 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 -# used for adding dependencies to other objects -# (e.g. libfontmanager.so). -# -# It is not obvious how to extract that hardcoded name (libfreetype.so.6) -# without overcomplicating logic here. -# To workaround this we hardcode .6 suffix for now. -# -# Note that .so.6 library will not be found by System.loadLibrary() -# but fortunately we need to load FreeType library explicitly -# on windows only -# -#TODO: rework this to avoid hardcoding library name in the makefile -# -ifdef OPENJDK +ifneq ($(FREETYPE_BUNDLE_LIB_PATH), ) + # 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 + # used for adding dependencies to other objects + # (e.g. libfontmanager.so). + # + # It is not obvious how to extract that hardcoded name (libfreetype.so.6) + # without overcomplicating logic here. + # To workaround this we hardcode .6 suffix for now. + # + # Note that .so.6 library will not be found by System.loadLibrary() + # but fortunately we need to load FreeType library explicitly + # on windows only + # + #TODO: rework this to avoid hardcoding library name in the makefile + # ifeq ($(OPENJDK_TARGET_OS), windows) - FREETYPE_LIB = $(JDK_OUTPUTDIR)/bin/$(call SHARED_LIBRARY,freetype) + FREETYPE_TARGET_LIB = $(JDK_OUTPUTDIR)/bin/$(call SHARED_LIBRARY,freetype) else - ifeq ($(USING_SYSTEM_FT_LIB), false) - FREETYPE_LIB = $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/$(call SHARED_LIBRARY,freetype).6 - endif + FREETYPE_TARGET_LIB = $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/$(call SHARED_LIBRARY,freetype).6 endif - $(FREETYPE_LIB): $(FREETYPE2_LIB_PATH)/$(call SHARED_LIBRARY,freetype) - $(CP) $(FREETYPE2_LIB_PATH)/$(call SHARED_LIBRARY,freetype) $@ + $(FREETYPE_TARGET_LIB): $(FREETYPE_BUNDLE_LIB_PATH)/$(call SHARED_LIBRARY,freetype) + $(CP) $(FREETYPE_BUNDLE_LIB_PATH)/$(call SHARED_LIBRARY,freetype) $@ ifeq ($(OPENJDK_BUILD_OS), windows) $(CHMOD) +rx $@ endif - COPY_FILES += $(FREETYPE_LIB) + COPY_FILES += $(FREETYPE_TARGET_LIB) endif ##########################################################################################
--- a/makefiles/lib/Awt2dLibraries.gmk Tue Oct 22 16:51:37 2013 -0700 +++ b/makefiles/lib/Awt2dLibraries.gmk Wed Oct 23 13:06:37 2013 +0200 @@ -780,9 +780,9 @@ BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c else - FONT_HEADERS := $(FREETYPE2_CFLAGS) + FONT_HEADERS := $(FREETYPE_CFLAGS) BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers.openjdk - BUILD_LIBFONTMANAGER_FONTLIB := $(FREETYPE2_LIBS) + BUILD_LIBFONTMANAGER_FONTLIB := $(FREETYPE_LIBS) endif LIBFONTMANAGER_OPTIMIZATION := HIGH