-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
53 lines (46 loc) · 1.76 KB
/
entrypoint.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
#!/usr/bin/env bash
cd /home
pwd
if [[ -d /home/dragonwell8/build ]]; then
echo "already build"
else
# 更新仓库为国内源
cp /etc/apt/sources.list /etc/apt/sources.list.bak #备份
cp /sources.list /etc/apt/sources.list
# cat /etc/apt/sources.list
apt-get update
# 安装依赖
apt-get install libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev libcups2-dev libfreetype6-dev libasound2-dev -y
apt-get install build-essential -y
apt-get install zip unzip -y
# 安装ccache高速编译工具
apt install ccache -y
# 如果不存在源码,重新拉取源码
if [[ -d dragonwell8 ]]; then
echo "directory dragonwell8 already exist"
else
# 安装git
apt-get install git -y
git --version
git clone https://github.com/terwer/dragonwell8.git
# 获取子模块
chmod +x /home/dragonwell8/get_source_dragonwell.sh
/bin/bash /home/dragonwell8/get_source_dragonwell.sh -s github
# 获取bootjdk
wget https://terwer.oss-cn-qingdao.aliyuncs.com/soft/jdk/jdk-7u80-linux-x64.tar.gz
unzip jdk-7u80-linux-x64.tar.gz -d /opt/java
fi
# 编译配置
cd /home/dragonwell8
chmod +x ./configure
./configure --with-boot-jdk=/opt/java/jdk1.7.0_80 --with-freetype-include=/usr/include/freetype2 --with-freetype-lib=/usr/lib/x86_64-linux-gnu --with-debug-level=slowdebug --with-native-debug-symbols=internal --with-jvm-variants=server --with-target-bits=64 --enable-ccache --with-num-cores=4 --with-memory-size=3000
# 编译源码
sudo make images
echo "build finished"
fi
# 验证编译结果
export JAVA_HOME=/home/dragonwell8/build/linux-x86_64-normal-server-slowdebug/jdk
export PATH=$PATH:$JAVA_HOME/bin
chmod +x /home/dragonwell8/build/linux-x86_64-normal-server-slowdebug/jdk/bin/java
java -version
/bin/bash