This repository has been archived by the owner on Aug 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
build-openjdk9.sh
78 lines (68 loc) · 1.83 KB
/
build-openjdk9.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
#!/bin/bash
set -e
UPDATE="9.0.4"
BUILD=12
NAME="openjdk-9u${UPDATE}-b${BUILD}"
CLONE_URL=https://hg.openjdk.java.net/jdk-updates/jdk9u
TAG=tip
BOOT_JDK=/usr/lib/jvm/java-1.8.0-openjdk.x86_64/
ARCH="$(uname -m)"
if [ "${ARCH}_" == "aarch64_" ]; then
BOOT_JDK=/usr/lib/jvm/java-1.8.0-openjdk
fi
clone() {
url=$1
tag=$2
targetdir=$3
if [ -d $targetdir ]; then
echo "Target directory $targetdir already exists. Skipping clone"
return
fi
hg clone -u $tag $url $targetdir
pushd $targetdir
for i in corba hotspot jaxws jaxp jdk langtools nashorn; do
hg clone -u $tag $url/$i
done
popd
}
build() {
rm -rf build
# Add patch to be able to build on EL 6
wget https://bugs.openjdk.java.net/secure/attachment/81657/JDK-8219879.jdk9.export.patch
patch -p1 < JDK-8219879.jdk9.export.patch
bash common/autoconf/autogen.sh
for debug in release slowdebug; do
bash configure \
--with-boot-jdk="$BOOT_JDK" \
--with-debug-level="$debug" \
--with-conf-name="$debug" \
--enable-unlimited-crypto \
--with-version-build=$BUILD \
--with-version-pre="" \
--with-version-opt="" \
--with-native-debug-symbols=external \
--with-cacerts-file=/etc/pki/java/cacerts
target="bootcycle-images"
if [ "${debug}_" == "slowdebug_" ]; then
target="images"
fi
make LOG_LEVEL=debug CONF=$debug $target
# Package it up
pushd build/$debug/images
if [ "${debug}_" == "slowdebug_" ]; then
NAME="$NAME-$debug"
fi
mv jdk $NAME
tar -c -f $NAME.tar $NAME --exclude='**.debuginfo'
gzip $NAME.tar
tar -c -f $NAME-debuginfo.tar $(find ${NAME}/ -name \*.debuginfo)
gzip $NAME-debuginfo.tar
mv $NAME jdk
popd
done
find $(pwd)/build -name \*.tar.gz
}
clone $CLONE_URL $TAG jdk9u
pushd jdk9u
build
popd