forked from adoptium/temurin-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makejdk-any-platform.sh
executable file
·100 lines (84 loc) · 3.06 KB
/
makejdk-any-platform.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/bin/bash
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Script to clone the OpenJDK source then build it
# Optionally uses Docker, otherwise you can provide two arguments:
# the area to build the JDK e.g. $HOME/mybuilddir as -s or --source
# and the target destination for the tar.gz e.g. -d or --destination $HOME/mytargetdir
# Both must be absolute paths! You can use $PWD/mytargetdir
# A simple way to install dependencies persistently is to use our Ansible playbooks
# You can set the JDK boot directory with the JDK_BOOT_DIR environment variable
export OS_KERNEL_NAME=""
OS_KERNEL_NAME=$(uname | awk '{print tolower($0)}')
export OS_MACHINE_NAME=""
OS_MACHINE_NAME=$(uname -m)
export OPENJDK_VERSION=""
export REPOSITORY=""
counter=0
for i in "$@"; do
let counter++
case "$i" in
"--version" | "-v")
let counter++
string="\$$counter"
OPENJDK_VERSION=$(echo "$@" | awk "{print $string}")
;;
esac
done
if [ "$OPENJDK_VERSION" == "jdk9" ]; then
export JDK_PATH="jdk"
export CONFIGURE_ARGS_FOR_ANY_PLATFORM=${CONFIGURE_ARGS_FOR_ANY_PLATFORM:-"--disable-warnings-as-errors"}
elif [ "$OPENJDK_VERSION" == "jdk8u" ]; then
export JDK_PATH="j2sdk-image"
else
echo "Please specify a version with --version or -v , either jdk9 or jdk8u"
man ./makejdk-any-platform.1
exit 1
fi
REPOSITORY="${REPOSITORY:-adoptopenjdk/openjdk-$OPENJDK_VERSION}";
REPOSITORY="$(echo "${REPOSITORY}" | awk '{print tolower($0)}')";
case "$OS_MACHINE_NAME" in
"s390x")
case "$OPENJDK_VERSION" in
"jdk9")
export JVM_VARIANT=${JVM_VARIANT:-server}
;;
"jdk8u")
export JVM_VARIANT=${JVM_VARIANT:-zero} ;;
esac
export BUILD_FULL_NAME=${BUILD_FULL_NAME:-linux-s390x-normal-${JVM_VARIANT}-release}
S390X_MAKE_ARGS="CONF=${BUILD_FULL_NAME} DEBUG_BINARIES=true images"
export MAKE_ARGS_FOR_ANY_PLATFORM=${MAKE_ARGS_FOR_ANY_PLATFORM:-$S390X_MAKE_ARGS}
;;
"ppc64le")
export JVM_VARIANT=${JVM_VARIANT:-server}
export BUILD_FULL_NAME=${BUILD_FULL_NAME:-linux-ppc64-normal-${JVM_VARIANT}-release}
# shellcheck disable=SC1083
export FREETYPE_FONT_BUILD_TYPE_PARAM=${FREETYPE_FONT_BUILD_TYPE_PARAM:="--build=$(rpm --eval %{_host})"}
;;
"armv7l")
export JVM_VARIANT=${JVM_VARIANT:-zero}
export MAKE_ARGS_FOR_ANY_PLATFORM=${MAKE_ARGS_FOR_ANY_PLATFORM:-"DEBUG_BINARIES=true images"}
export CONFIGURE_ARGS_FOR_ANY_PLATFORM=${CONFIGURE_ARGS_FOR_ANY_PLATFORM:-"--with-jobs=${NUM_PROCESSORS}"}
;;
"aarch64")
export FREETYPE_FONT_VERSION="2.5.2"
;;
esac
case "$OS_KERNEL_NAME" in
"aix")
export MAKE_COMMAND_NAME=${MAKE_COMMAND_NAME:-"gmake"}
;;
esac
./makejdk.sh "$@"