forked from armedbear/abcl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate-abcl-properties.bash
More file actions
129 lines (119 loc) · 3.49 KB
/
create-abcl-properties.bash
File metadata and controls
129 lines (119 loc) · 3.49 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/usr/bin/env bash
DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
jdk=$1
if [[ -z $jdk ]]; then
jdk=openjdk8
fi
root="${DIR}/.."
prop_in="${root}/abcl.properties.in"
prop_out="${root}/abcl.properties"
echo "Configuring for $jdk from <${prop_in}>."
# Unused
# zgc="-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -Xmx<size> -Xlog:gc"
opens="--add-opens java.base/sun.nio.ch=ALL-UNNAMED\
--add-opens java.base/java.io=ALL-UNNAMED\
--add-opens java.base/java.lang=ALL-UNNAMED\
--enable-native-access=ALL-UNNAMED"
# --add-opens app=ALL-UNNAMED\
# <https://wiki.openjdk.org/spaces/shenandoah/pages/25002018/Main>
# Use -Xlog:gc+ergo or -Xlog:gc+stats for diagnostics
# -XX:+UseLargePages not supported on arm64-macos-openjdk25
gc_shenandoah="-XX:+UseShenandoahGC -Xlog:gc+ergo -XX:+AlwaysPreTouch"
abcl_javac_source=1.8
case $jdk in
6|openjdk6)
options="-d64 -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=1g -XX:+UseConcMarkSweepGC"
ant_build_javac_target=1.6
ant_build_javac_source=1.6
;;
7|openjdk7)
options="-d64 -XX:+UseG1GC"
ant_build_javac_target=1.7
ant_build_javac_source=1.7
;;
8|openjdk8)
options="-XX:+UseG1GC -XX:+AggressiveOpts -XX:CompileThreshold=10"
ant_build_javac_target=1.8
ant_build_javac_source=1.8
;;
11|openjdk11)
options="-XX:CompileThreshold=10"
ant_build_javac_target=11
ant_build_javac_source=1.8
;;
# untested: weakly unsupported
12|openjdk12)
options="-XX:CompileThreshold=10"
ant_build_javac_target=12
ant_build_javac_source=1.8
;;
13|openjdk13)
options="-XX:CompileThreshold=10"
ant_build_javac_target=13
ant_build_javac_source=1.8
;;
14|openjdk14)
options="-XX:CompileThreshold=10 ${zgc}"
ant_build_javac_target=14
ant_build_javac_source=1.8
;;
15|openjdk15)
options="-XX:CompileThreshold=10 ${zgc}"
ant_build_javac_target=15
ant_build_javac_source=1.8
;;
16|openjdk16)
options="-XX:CompileThreshold=10 ${zgc}"
ant_build_javac_target=16
ant_build_javac_source=1.8
;;
17|openjdk17)
options="-XX:CompileThreshold=10 ${opens}"
ant_build_javac_target=17
ant_build_javac_source=1.8
;;
18|openjdk18)
options="-XX:CompileThreshold=10 ${opens}"
ant_build_javac_target=18
ant_build_javac_source=1.8
;;
19|openjdk19)
options="-XX:CompileThreshold=10 ${opens}"
ant_build_javac_target=19
ant_build_javac_source=1.8
;;
21|openjdk21)
options="-XX:CompileThreshold=10 ${opens}"
ant_build_javac_target=21
ant_build_javac_source=1.8
;;
22|openjdk22)
options="-XX:CompileThreshold=10 ${opens}"
ant_build_javac_target=22
ant_build_javac_source=1.8
;;
23|openjdk23)
options="-XX:CompileThreshold=10 ${opens}"
ant_build_javac_target=23
ant_build_javac_source=1.8
;;
25|openjdk25|*)
options="-XX:CompileThreshold=10 ${opens}"
ant_build_javac_target=25
ant_build_javac_source=1.8
;;
esac
cat ${root}/abcl.properties.in \
| awk -F = \
-v options="$options" \
-v source="$ant_build_javac_source" \
-f ${DIR}/create-abcl-properties.awk \
> ${root}/abcl.properties
# cat ${root}/abcl.properties.in \
# | awk -F = \
# -v options="$options" \
# -v target="$ant_build_javac_target" \
# -v source="$ant_build_javac_source" \
# -f ${DIR}/create-abcl-properties.awk \
# > ${root}/abcl.properties
echo "Finished configuring for $jdk into <${prop_out}>."