summaryrefslogtreecommitdiffstats
path: root/make/scripts/make.macosx.jdk_lipo_libs.sh
blob: 5619bc53ab358d50062415ffae9729d4ec6e1626 (plain)
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
#! /bin/sh

#
# First unpack the OpenJDK (Temurin) package
# for amd64 and arm64.
# Then copy each lib-folder 'temurin-xy.jdk/Contents/Home/lib/'
# to their respective target lib-folder:
# - temurin-xy.jdk.amd64.lib/
# - temurin-xy.jdk.arm64.lib/
#
# Now we can run this script producing fat lipo dylib files,
# placed into 
# - temurin-xy.jdk.fat.lib
#

amd64_dir=$HOME/temurin-17.jdk.amd64.lib
arm64_dir=$HOME/temurin-17.jdk.arm64.lib
fat_dir=$HOME/temurin-17.jdk.fat.lib

rm -rf $fat_dir
mkdir $fat_dir

for i in $amd64_dir/*.dylib ; do
    bname=`basename $i`
    if [ -e $arm64_dir/$bname ] ; then
        lipo -create $i $arm64_dir/$bname -output $fat_dir/$bname
    else
        echo missing $arm64_dir/$bname
    fi
done