Skip to content

Commit

Permalink
Revert macOS changes, and uninstall libftdi instead
Browse files Browse the repository at this point in the history
  • Loading branch information
will-v-pi committed Sep 7, 2024
1 parent df87c58 commit 4cb3698
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
3 changes: 3 additions & 0 deletions build_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ SKIP_OPENOCD=${SKIP_OPENOCD-0}
# Install prerequisites
arch -x86_64 /usr/local/bin/brew install jq libtool libusb automake hidapi
arch -arm64 /opt/homebrew/bin/brew install jq libtool libusb automake hidapi
# Uninstall libftdi, as it's not required
arch -x86_64 /usr/local/bin/brew uninstall libftdi
arch -arm64 /opt/homebrew/bin/brew uninstall libftdi
# Risc-V prerequisites
echo "Listing local"
ls /usr/local/bin
Expand Down
20 changes: 10 additions & 10 deletions packages/macos/openocd/build-openocd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ sed -i -e 's/uint /unsigned int /g' ./src/flash/nor/rp2040.c
./bootstrap
# See https://github.com/raspberrypi/openocd/issues/30
# ./configure --disable-werror CAPSTONE_CFLAGS="$(pkg-config capstone --cflags | sed s/.capstone\$//)"
./configure CFLAGS=-static LDFLAGS=-static --disable-werror
./configure --disable-werror
make clean
make -j$(nproc)
INSTALLDIR="$PWD/../openocd-install/usr/local/bin"
rm -rf "$PWD/../openocd-install"
DESTDIR="$PWD/../openocd-install" make install

# libusbpath=($(otool -L $INSTALLDIR/openocd | grep libusb))
# echo ${libusbpath[0]}
# cp "${libusbpath[0]}" $INSTALLDIR/libusb-1.0.dylib
# install_name_tool -change "${libusbpath[0]}" @loader_path/libusb-1.0.dylib $INSTALLDIR/openocd
# libhidpath=($(otool -L $INSTALLDIR/openocd | grep libhidapi))
# echo ${libhidpath[0]}
# cp "${libhidpath[0]}" $INSTALLDIR/libhidapi.dylib
# install_name_tool -change "${libhidpath[0]}" @loader_path/libhidapi.dylib $INSTALLDIR/openocd
# install_name_tool -add_rpath @loader_path/ $INSTALLDIR/openocd
libusbpath=($(otool -L $INSTALLDIR/openocd | grep libusb))
echo ${libusbpath[0]}
cp "${libusbpath[0]}" $INSTALLDIR/libusb-1.0.dylib
install_name_tool -change "${libusbpath[0]}" @loader_path/libusb-1.0.dylib $INSTALLDIR/openocd
libhidpath=($(otool -L $INSTALLDIR/openocd | grep libhidapi))
echo ${libhidpath[0]}
cp "${libhidpath[0]}" $INSTALLDIR/libhidapi.dylib
install_name_tool -change "${libhidpath[0]}" @loader_path/libhidapi.dylib $INSTALLDIR/openocd
install_name_tool -add_rpath @loader_path/ $INSTALLDIR/openocd
2 changes: 1 addition & 1 deletion packages/macos/riscv/build-riscv-gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ GDB_TARGET_FLAGS_EXTRA="--with-gmp=/opt/homebrew --with-mpfr=/opt/homebrew"
export GDB_TARGET_FLAGS_EXTRA

cd riscv-gnu-toolchain
./configure CFLAGS=-static LDFLAGS=-static --prefix=$BUILDDIR/$INSTALLDIR --with-arch=rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb --with-abi=ilp32 --with-multilib-generator="rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb-ilp32--;rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb-ilp32--" --with-gcc-src=$BUILDDIR/gcc
./configure --prefix=$BUILDDIR/$INSTALLDIR --with-arch=rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb --with-abi=ilp32 --with-multilib-generator="rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb-ilp32--;rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb-ilp32--" --with-gcc-src=$BUILDDIR/gcc
# 4 threads, as 8 threads runs out of memory
make -j4

Expand Down

0 comments on commit 4cb3698

Please sign in to comment.