File tree Expand file tree Collapse file tree 4 files changed +46
-20
lines changed Expand file tree Collapse file tree 4 files changed +46
-20
lines changed Original file line number Diff line number Diff line change @@ -62,11 +62,18 @@ if [[ "$SKIP_OPENOCD" != 1 ]]; then
62
62
SKIP_OPENOCD=1
63
63
fi
64
64
echo " OpenOCD Build Complete"
65
+ if [[ " $SKIP_OPENOCD " != 1 ]]; then
66
+ ../packages/macos/get-dylibs.sh " openocd-install-$( uname -m) "
67
+ echo " OpenOCD dylibs copied"
68
+ fi
65
69
fi
66
70
if [[ " $SKIP_RISCV " != 1 ]]; then
67
71
# Takes ages to build
68
72
../packages/macos/riscv/build-riscv-gcc.sh
69
73
echo " RISC-V Build Complete"
74
+
75
+ ../packages/macos/get-dylibs.sh " riscv-install-$( uname -m) "
76
+ echo " RISC-V dylibs copied"
70
77
fi
71
78
if [[ " $SKIP_PICOTOOL " != 1 ]]; then
72
79
arch -x86_64 ../packages/macos/picotool/build-picotool.sh
@@ -75,6 +82,12 @@ if [[ "$SKIP_PICOTOOL" != 1 ]]; then
75
82
fi
76
83
echo " Picotool Build Complete"
77
84
85
+ ../packages/macos/get-dylibs.sh " picotool-install-x86_64"
86
+ if [[ $( uname -m) == ' arm64' ]]; then
87
+ ../packages/macos/get-dylibs.sh " picotool-install-arm64"
88
+ fi
89
+ echo " Picotool dylibs copied"
90
+
78
91
../packages/macos/make-universal.sh " pico-sdk-tools" " pioasm" " pioasm"
79
92
echo " Pioasm Universal Merge Complete"
80
93
../packages/macos/make-universal.sh " picotool-install" " picotool" " picotool"
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ INSTALLDIR=$1
4
+
5
+ EXES=$( find $INSTALLDIR -type f -perm -u+x)
6
+ LIBS=$( otool -L $EXES | grep -E " /opt/homebrew|/usr/local/opt" | grep -v python | sort | uniq | grep -o -E " /.*\.dylib" )
7
+
8
+ if [ ! $LIBS ]; then
9
+ exit 1;
10
+ fi
11
+
12
+ while IFS= read -r lib; do
13
+ echo
14
+ echo $lib
15
+ libname=$( echo $lib | grep -o -E " [^/]*\.dylib" )
16
+ echo $libname
17
+ echo
18
+ while IFS= read -r exe; do
19
+ if file $exe | grep " Mach-O 64-bit executable" > /dev/null; then
20
+ if otool -L $exe | grep -o $lib > /dev/null; then
21
+ echo " $exe $( otool -L $exe | grep -o $lib ) "
22
+ exedir=$( echo $exe | grep -o -E " .*/" )
23
+ install_name_tool -change $lib @loader_path/$libname $exe
24
+ if ! otool -l $exe | grep " LC_RPATH" -A2 | grep " @loader_path" > /dev/null; then
25
+ install_name_tool -add_rpath @loader_path/ $exe
26
+ fi
27
+ if [ ! -f $exedir$libname ]; then
28
+ cp $lib $exedir$libname
29
+ fi
30
+ fi
31
+ fi
32
+ done <<< " $EXES"
33
+ done <<< " $LIBS"
Original file line number Diff line number Diff line change 13
13
INSTALLDIR=" $PWD /../openocd-install-$( uname -m) /usr/local/bin"
14
14
rm -rf " $PWD /../openocd-install-$( uname -m) "
15
15
DESTDIR=" $PWD /../openocd-install-$( uname -m) " make install
16
-
17
- libusbpath=($( otool -L $INSTALLDIR /openocd | grep libusb) )
18
- echo ${libusbpath[0]}
19
- cp " ${libusbpath[0]} " $INSTALLDIR /libusb-1.0.dylib
20
- install_name_tool -change " ${libusbpath[0]} " @loader_path/libusb-1.0.dylib $INSTALLDIR /openocd
21
- libhidpath=($( otool -L $INSTALLDIR /openocd | grep libhidapi) )
22
- echo ${libhidpath[0]}
23
- cp " ${libhidpath[0]} " $INSTALLDIR /libhidapi.dylib
24
- install_name_tool -change " ${libhidpath[0]} " @loader_path/libhidapi.dylib $INSTALLDIR /openocd
25
- libjimpath=($( otool -L $INSTALLDIR /openocd | grep libjim) )
26
- echo ${libjimpath[0]}
27
- cp " ${libjimpath[0]} " $INSTALLDIR /libjim0.83.dylib
28
- install_name_tool -change " ${libjimpath[0]} " @loader_path/libjim0.83.dylib $INSTALLDIR /openocd
29
- install_name_tool -add_rpath @loader_path/ $INSTALLDIR /openocd
Original file line number Diff line number Diff line change @@ -35,9 +35,3 @@ rm -rf $INSTALLDIR
35
35
mkdir -p $INSTALLDIR
36
36
cmake --install picotool/build/ --prefix $INSTALLDIR
37
37
touch $INSTALLDIR /.keep
38
-
39
- libpath=($( otool -L $INSTALLDIR /picotool/picotool | grep libusb) )
40
- echo ${libpath[0]}
41
- cp " ${libpath[0]} " $INSTALLDIR /picotool/libusb-1.0.dylib
42
- install_name_tool -change " ${libpath[0]} " @loader_path/libusb-1.0.dylib $INSTALLDIR /picotool/picotool
43
- install_name_tool -add_rpath @loader_path/ $INSTALLDIR /picotool/picotool
You can’t perform that action at this time.
0 commit comments