2
2
3
3
SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
4
4
PROJECT_ROOT=" $( cd " $SCRIPT_DIR /../.." && pwd) "
5
-
6
- # Compile dynamic libraries for all relevant targets
7
- # and place them in the `./bindings/java/java_code/src/main/resources` directory
8
-
9
5
OUT_DIR=" $PROJECT_ROOT /bindings/java/java_code/src/main/resources"
10
6
LIB_TYPE=" dynamic"
11
7
LIB_NAME=" java_eth_kzg"
12
- $PROJECT_ROOT /scripts/compile_to_native.sh Darwin arm64 $LIB_NAME $LIB_TYPE $OUT_DIR
13
- $PROJECT_ROOT /scripts/compile_to_native.sh Darwin x86_64 $LIB_NAME $LIB_TYPE $OUT_DIR
14
- $PROJECT_ROOT /scripts/compile_to_native.sh Windows x86_64 $LIB_NAME $LIB_TYPE $OUT_DIR
15
- $PROJECT_ROOT /scripts/compile_to_native.sh Linux x86_64 $LIB_NAME $LIB_TYPE $OUT_DIR
16
- $PROJECT_ROOT /scripts/compile_to_native.sh Linux arm64 $LIB_NAME $LIB_TYPE $OUT_DIR
8
+
9
+ # Check if a target is provided
10
+ if [ $# -eq 0 ]; then
11
+ echo " Please provide a target architecture."
12
+ echo " Supported targets: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, aarch64-apple-darwin, x86_64-apple-darwin, x86_64-pc-windows-gnu"
13
+ exit 1
14
+ fi
15
+
16
+ TARGET=$1
17
+
18
+ case $TARGET in
19
+ " x86_64-unknown-linux-gnu" )
20
+ $PROJECT_ROOT /scripts/compile_to_native.sh Linux x86_64 $LIB_NAME $LIB_TYPE $OUT_DIR zigbuild
21
+ ;;
22
+ " aarch64-unknown-linux-gnu" )
23
+ $PROJECT_ROOT /scripts/compile_to_native.sh Linux arm64 $LIB_NAME $LIB_TYPE $OUT_DIR zigbuild
24
+ ;;
25
+ " aarch64-apple-darwin" )
26
+ $PROJECT_ROOT /scripts/compile_to_native.sh Darwin arm64 $LIB_NAME $LIB_TYPE $OUT_DIR zigbuild
27
+ ;;
28
+ " x86_64-apple-darwin" )
29
+ $PROJECT_ROOT /scripts/compile_to_native.sh Darwin x86_64 $LIB_NAME $LIB_TYPE $OUT_DIR zigbuild
30
+ ;;
31
+ " x86_64-pc-windows-gnu" )
32
+ $PROJECT_ROOT /scripts/compile_to_native.sh Windows x86_64 $LIB_NAME $LIB_TYPE $OUT_DIR
33
+ ;;
34
+ * )
35
+ echo " Unsupported target: $TARGET "
36
+ echo " Supported targets: x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, aarch64-apple-darwin, x86_64-apple-darwin, x86_64-pc-windows-gnu"
37
+ exit 1
38
+ ;;
39
+ esac
0 commit comments