Skip to content

Commit b3bd65b

Browse files
committed
[script] Refactor paths to config file
1 parent ce8a947 commit b3bd65b

File tree

4 files changed

+50
-34
lines changed

4 files changed

+50
-34
lines changed

build/build.sh

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,14 @@
11
#!/bin/bash
22
set -e
33

4-
pushd /build/jdk9u
4+
cd "$(dirname ${BASH_SOURCE[0]})"
5+
source config.sh
6+
7+
cd "$JDKDIR"
58

69
# refresh patched build system
710
bash ./common/autoconf/autogen.sh
811

9-
# configure the build
10-
bash ./configure --with-boot-jdk=/opt/jdkcross/jdk-9.0.1 \
11-
--openjdk-target=arm-linux-gnueabi \
12-
--with-abi-profile=arm-ev3 \
13-
--enable-headless-only \
14-
--with-freetype-lib=/usr/lib/arm-linux-gnueabi \
15-
--with-freetype-include=/usr/include \
16-
--with-jvm-variants=client \
17-
--with-extra-cflags="-Wno-maybe-uninitialized -D__SOFTFP__" \
18-
AR="arm-linux-gnueabi-gcc-ar" \
19-
NM="arm-linux-gnueabi-gcc-nm" \
20-
BUILD_AR="gcc-ar" \
21-
BUILD_NM="gcc-nm"
22-
2312
## Description ##
2413
# Use the downloaded JDK: --with-boot-jdk=/opt/jdkcross/jdk-9.0.1
2514
# Cross-compiling for ARM: --openjdk-target=arm-linux-gnueabi
@@ -31,12 +20,26 @@ bash ./configure --with-boot-jdk=/opt/jdkcross/jdk-9.0.1 \
3120
# Add extra build flags: --with-extra-cflags="-Wno-maybe-uninitialized -D__SOFTFP__"
3221
# - Fix the build on new GCC: -Wno-maybe-uninitialized
3322
# - Force softfloat runtime: -D__SOFTFP__
34-
# Fix the "internal" string: --with-version-string="9.0.1"
23+
# Fix the "internal" string: --with-version-string="9.0.1+11"
3524
# Fix for GCC and LTO objects: AR="arm-linux-gnueabi-gcc-ar"
3625
# NM="arm-linux-gnueabi-gcc-nm"
3726
# BUILD_AR="gcc-ar"
3827
# BUILD_NM="gcc-nm"
3928

29+
# configure the build
30+
bash ./configure --with-boot-jdk="$SCRIPTDIR/jdk-9.0.1" \
31+
--openjdk-target=arm-linux-gnueabi \
32+
--with-abi-profile=arm-ev3 \
33+
--enable-headless-only \
34+
--with-freetype-lib=/usr/lib/arm-linux-gnueabi \
35+
--with-freetype-include=/usr/include \
36+
--with-jvm-variants=client \
37+
--with-extra-cflags="-Wno-maybe-uninitialized -D__SOFTFP__" \
38+
--with-version-string="$JAVA_VERSION" \
39+
AR="arm-linux-gnueabi-gcc-ar" \
40+
NM="arm-linux-gnueabi-gcc-nm" \
41+
BUILD_AR="gcc-ar" \
42+
BUILD_NM="gcc-nm"
4043

4144
# start the build
4245
make clean images

build/config.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
JAVA_VERSION="9.0.1+11"
4+
JAVA_REPO="http://hg.openjdk.java.net/jdk-updates/jdk9u/"
5+
SCRIPTDIR="/opt/jdkcross"
6+
7+
BUILDDIR="/build"
8+
JDKDIR="/build/jdk"
9+
IMAGEDIR="/build/jdk/build/linux-arm-normal-client-release/images"

build/fetch.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
#!/usr/bin/env bash
1+
#!/bin/bash
22
set -e
33

4+
cd "$(dirname ${BASH_SOURCE[0]})"
5+
source config.sh
6+
47
# clone the root project
5-
pushd /build
6-
hg clone http://hg.openjdk.java.net/jdk-updates/jdk9u/
7-
pushd jdk9u
8+
hg clone "$JAVA_REPO" "$JDKDIR"
89

910
# clone the rest of the tree
11+
cd "$JDKDIR"
1012
bash ./get_source.sh
1113

1214
# apply the EV3-specific patches
1315
# - build flags for arm926ej-s
14-
patch -p1 < /opt/jdkcross/ev3.patch
16+
patch -p1 < "$SCRIPTDIR/ev3.patch"
1517
# - use the system-provided floating point implementation
16-
patch -p1 -d hotspot < /opt/jdkcross/float.patch
18+
patch -p1 -d hotspot < "$SCRIPTDIR/float.patch"
1719

build/zip.sh

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#!/bin/bash
2-
32
set -e
43

4+
cd "$(dirname ${BASH_SOURCE[0]})"
5+
source config.sh
6+
57
# enter images directory
6-
pushd /build/jdk9u/build/linux-arm-normal-client-release/images
8+
cd "$IMAGEDIR"
79

810
# clean destinations
911
rm -rf ./jre-ev3
@@ -12,7 +14,7 @@ rm -rf ./jshell-support
1214
rm ./jdk-ev3
1315

1416
# build ev3 runtime image
15-
/opt/jdkcross/jdk-9.0.1/bin/jlink \
17+
"$SCRIPTDIR/jdk-9.0.1/bin/jlink" \
1618
--module-path ./jmods/ \
1719
--endian little \
1820
--compress 0 \
@@ -23,8 +25,8 @@ rm ./jdk-ev3
2325
--output ./jre-ev3
2426

2527
# build microjdk
26-
/opt/jdkcross/jdk-9.0.1/bin/jlink \
27-
--module-path /opt/jdkcross/jdk-9.0.1/jmods \
28+
"$SCRIPTDIR/jdk-9.0.1/bin/jlink" \
29+
--module-path "$SCRIPTDIR/jdk-9.0.1/jmods" \
2830
--compress 2 \
2931
--strip-debug \
3032
--no-header-files \
@@ -39,14 +41,14 @@ ln -s ./jdk ./jdk-ev3
3941

4042
# JShell hack
4143
mkdir jshell-support
42-
/opt/jdkcross/jdk-9.0.1/bin/javac -d ./jshell-support /opt/jdkcross/jshellhack/DumpPort.java
43-
/opt/jdkcross/jdk-9.0.1/bin/jar cf ./jshellhack.jar -C ./jshell-support jshellhack/DumpPort.class
44-
cp ./jshellhack.jar ./jdk-pc/bin
45-
cp /opt/jdkcross/jshell-launch.sh ./jdk-pc/bin
44+
"$SCRIPTDIR/jdk-9.0.1/bin/javac" -d ./jshell-support "$SCRIPTDIR/jshellhack/DumpPort.java"
45+
"$SCRIPTDIR/jdk-9.0.1/bin/jar" cf ./jshellhack.jar -C ./jshell-support jshellhack/DumpPort.class
46+
cp ./jshellhack.jar ./jdk-pc/bin
47+
cp "$SCRIPTDIR/jshell-launch.sh" ./jdk-pc/bin
4648

4749
# create zip files
48-
zip -9r /build/jdk-ev3.zip jdk-ev3
49-
zip -9r /build/jre-ev3.zip jre-ev3
50-
zip -9r /build/jdk-pc.zip jdk-pc
50+
zip -9r "$BUILDDIR/jdk-ev3.zip" jdk-ev3
51+
zip -9r "$BUILDDIR/jre-ev3.zip" jre-ev3
52+
zip -9r "$BUILDDIR/jdk-pc.zip" jdk-pc
5153

5254
popd

0 commit comments

Comments
 (0)