Skip to content

Instantly share code, notes, and snippets.

@matdombrock
Last active July 6, 2023 22:56
Show Gist options
  • Save matdombrock/ea3e7478b8705dbac01687147ae6120c to your computer and use it in GitHub Desktop.
Save matdombrock/ea3e7478b8705dbac01687147ae6120c to your computer and use it in GitHub Desktop.
Install openocd
#!/bin/bash
#
# Downloads builds and install openocd for m1 macs
#
#install additional brew libraries
brew install libtool automake texinfo wget gcc pkg-config libusb
# some path magic so compilers know where to look for stuff
export PATH="$(brew --prefix)/opt/texinfo/bin:$PATH"
# download openocd files with picoprobe branch
git clone https://github.com/raspberrypi/openocd.git \
--branch picoprobe --depth=1
cd openocd
./bootstrap
# this enables the picoprobe and deactivates other modules that fail to compile otherwise
#CAPSTONE_CFLAGS="-I$(brew --prefix)/include" \
# ./configure --prefix="$(brew --prefix)" \
# --enable-picoprobe --disable-presto --disable-werror --disable-openjtag
CAPSTONE_CFLAGS="-I/opt/homebrew/Cellar/capstone/4.0.2/include/capstone -I/opt/homebrew/include" ./configure \
--enable-picoprobe --disable-presto --disable-openjtag --disable-werror
make -j4
# this will probably overwrite your current installation
# and will break openjtag
make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment