Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix macosx runpath dynamic library issue freetype lib - JDK8 #225

Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker/jdk8/x86_64/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ CMD ["images"]
ARG OPENJDK_CORE_VERSION
ENV OPENJDK_CORE_VERSION=$OPENJDK_CORE_VERSION
ENV JDK_PATH=j2sdk-image
ENV JRE_PATH=j2re-image
11 changes: 11 additions & 0 deletions makejdk-any-platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,22 @@ for i in "$@"; do
esac
done

export COPY_MACOSX_FREE_FONT_LIB_FOR_JDK_FLAG="false"
export COPY_MACOSX_FREE_FONT_LIB_FOR_JRE_FLAG="false"
if [ "$OPENJDK_CORE_VERSION" == "jdk9" ] || [ "$OPENJDK_CORE_VERSION" == "jdk10" ]; then
if [ "$OPENJDK_CORE_VERSION" == "jdk9" ]; then
export COPY_MACOSX_FREE_FONT_LIB_FOR_JDK_FLAG="true"
export COPY_MACOSX_FREE_FONT_LIB_FOR_JRE_FLAG="true"
fi

export JDK_PATH="jdk"
export JRE_PATH="jre"
export CONFIGURE_ARGS_FOR_ANY_PLATFORM=${CONFIGURE_ARGS_FOR_ANY_PLATFORM:-"--disable-warnings-as-errors"}
elif [ "$OPENJDK_CORE_VERSION" == "jdk8" ]; then
export COPY_MACOSX_FREE_FONT_LIB_FOR_JDK_FLAG="false"
export COPY_MACOSX_FREE_FONT_LIB_FOR_JRE_FLAG="true"
export JDK_PATH="j2sdk-image"
export JRE_PATH="j2re-image"
else
echo "Please specify a version with --version or -v , either jdk9, jdk10 or jdk8, with or without a \'u\' suffix."
man ./makejdk-any-platform.1
Expand Down
30 changes: 26 additions & 4 deletions sbin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ if [ "$JVM_VARIANT" == "--run-jtreg-tests-only" ]; then
JVM_VARIANT="server"
fi

echo "${JDK_PATH}"
echo "JDK Image folder name: ${JDK_PATH}"
echo "JRE Image folder name: ${JRE_PATH}"
echo "[debug] COPY_MACOSX_FREE_FONT_LIB_FOR_JDK_FLAG=${COPY_MACOSX_FREE_FONT_LIB_FOR_JDK_FLAG}"
echo "[debug] COPY_MACOSX_FREE_FONT_LIB_FOR_JRE_FLAG=${COPY_MACOSX_FREE_FONT_LIB_FOR_JRE_FLAG}"

MAKE_COMMAND_NAME=${MAKE_COMMAND_NAME:-"make"}
MAKE_ARGS_FOR_ANY_PLATFORM=${MAKE_ARGS_FOR_ANY_PLATFORM:-"images"}
Expand Down Expand Up @@ -281,8 +284,21 @@ removingUnnecessaryFiles()

makeACopyOfLibFreeFontForMacOSX() {
IMAGE_DIRECTORY=$1
PERFORM_COPYING=$2

if [[ "$OS_KERNEL_NAME" == "darwin" ]]; then
echo "PERFORM_COPYING=${PERFORM_COPYING}"
if [ "${PERFORM_COPYING}" == "false" ]; then
echo "${info} Skipping copying of the free font library to ${IMAGE_DIRECTORY}, does not apply for this version of the JDK. ${normal}"
return
fi

echo "${info} Performing copying of the free font library to ${IMAGE_DIRECTORY}, applicable for this version of the JDK. ${normal}"
SOURCE_LIB_NAME="${IMAGE_DIRECTORY}/lib/libfreetype.dylib.6"
if [ ! -f "${SOURCE_LIB_NAME}" ]; then
echo "${error}[Error] ${SOURCE_LIB_NAME} does not exist in the ${IMAGE_DIRECTORY} folder, please check if this is the right folder to refer to, aborting copy process...${normal}"
exit -1
fi
TARGET_LIB_NAME="${IMAGE_DIRECTORY}/lib/libfreetype.6.dylib"

INVOKED_BY_FONT_MANAGER="${IMAGE_DIRECTORY}/lib/libfontmanager.dylib"
Expand All @@ -293,7 +309,13 @@ makeACopyOfLibFreeFontForMacOSX() {

set -x
cp "${SOURCE_LIB_NAME}" "${TARGET_LIB_NAME}"
otool -L "${INVOKED_BY_FONT_MANAGER}"
if [ -f "${INVOKED_BY_FONT_MANAGER}" ]; then
otool -L "${INVOKED_BY_FONT_MANAGER}"
else
# shellcheck disable=SC2154
echo "${warning}[Warning] ${INVOKED_BY_FONT_MANAGER} does not exist in the ${IMAGE_DIRECTORY} folder, please check if this is the right folder to refer to, this may cause runtime issues, please beware...${normal}"
fi

otool -L "${TARGET_LIB_NAME}"
set +x

Expand Down Expand Up @@ -373,8 +395,8 @@ runTheOpenJDKConfigureCommandAndUseThePrebuiltConfigParams
buildOpenJDK
printJavaVersionString
removingUnnecessaryFiles
makeACopyOfLibFreeFontForMacOSX "${OPENJDK_REPO_TAG}"
makeACopyOfLibFreeFontForMacOSX "jre"
makeACopyOfLibFreeFontForMacOSX "${OPENJDK_REPO_TAG}" "${COPY_MACOSX_FREE_FONT_LIB_FOR_JDK_FLAG}"
makeACopyOfLibFreeFontForMacOSX "${JRE_PATH}" "${COPY_MACOSX_FREE_FONT_LIB_FOR_JRE_FLAG}"
signRelease
createOpenJDKTarArchive
showCompletionMessage
2 changes: 2 additions & 0 deletions sbin/colour-codes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ esc=$(echo -en "\033")
# shellcheck disable=SC2034
error="${esc}[0;31m"
# shellcheck disable=SC2034
warning="${esc}[0;33m" #yellow
# shellcheck disable=SC2034
good="${esc}[0;32m"
# shellcheck disable=SC2034
info="${esc}[0;33m"
Expand Down
2 changes: 1 addition & 1 deletion sbin/signalhandler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# For terminal colors
esc=$(echo -en "\033")
error="${esc}[0;31m"
error="${esc}[0;31m" #red
normal=$(echo -en "${esc}[m\017")


Expand Down