Skip to content

Commit

Permalink
add cross compilation config arg for all jdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Haroon-Khel committed Oct 13, 2023
1 parent 40b4b12 commit 240a36b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion build-farm/platform-specific-configurations/mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,17 @@ export BUILD_ARGS="${BUILD_ARGS}"
## is x64 then we need to add the cross compilation option --openjdk-target=x86_64-apple-darwin
MACHINEARCHITECTURE=$(uname -m)

if [[ "${MACHINEARCHITECTURE}" == "arm64" ]] && [[ "${ARCHITECTURE}" == "x64" ]]; then
# Adds cross compilation arg if building x64 binary on arm64
export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --openjdk-target=x86_64-apple-darwin"
fi

if [ "${JAVA_TO_BUILD}" == "${JDK8_VERSION}" ]
then
XCODE_SWITCH_PATH="/Applications/Xcode-11.7.app"
export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-toolchain-type=clang"
if [[ "${MACHINEARCHITECTURE}" == "arm64" ]] && [[ "${ARCHITECTURE}" == "x64" ]]; then
export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --openjdk-target=x86_64-apple-darwin"
# Cross compilation config needed only for jdk8
export MAC_ROSETTA_PREFIX="arch -x86_64"
export PATH=/opt/homebrew/bin:/usr/local/bin:$PATH
fi
Expand Down

0 comments on commit 240a36b

Please sign in to comment.