2021-01-23 04:54:04 -06:00
|
|
|
Building OpenOCD for macOS
|
|
|
|
--------------------------
|
2013-09-11 16:05:16 -05:00
|
|
|
|
|
|
|
There are a few prerequisites you will need first:
|
|
|
|
|
2021-01-23 04:54:04 -06:00
|
|
|
- Xcode (install from the AppStore)
|
|
|
|
- Command Line Tools (install from Xcode -> Preferences -> Downloads)
|
2014-05-17 03:46:06 -05:00
|
|
|
- Gentoo Prefix (http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap.xml)
|
2013-09-11 16:05:16 -05:00
|
|
|
or
|
|
|
|
- Homebrew (http://mxcl.github.io/homebrew/)
|
2014-05-17 03:46:06 -05:00
|
|
|
or
|
|
|
|
- MacPorts (http://www.macports.org/install.php)
|
|
|
|
|
|
|
|
|
2021-01-23 04:54:04 -06:00
|
|
|
If you're building manually you need Texinfo version 5.0 or later. The
|
|
|
|
simplest way to get it is to use Homebrew (brew install texinfo) and
|
|
|
|
then ``export PATH=/usr/local/opt/texinfo/bin:$PATH``.
|
|
|
|
|
|
|
|
|
2014-05-17 03:46:06 -05:00
|
|
|
With Gentoo Prefix you can build the release version or the latest
|
|
|
|
devel version (-9999) the usual way described in the Gentoo
|
|
|
|
documentation. Alternatively, install the prerequisites and build
|
|
|
|
manually from the sources.
|
|
|
|
|
|
|
|
|
|
|
|
With Homebrew you can either run:
|
|
|
|
brew install [--HEAD] openocd (where optional --HEAD asks brew to
|
|
|
|
install the current git version)
|
|
|
|
or
|
2020-12-29 15:07:41 -06:00
|
|
|
brew install libtool automake libusb [hidapi] [libftdi]
|
2014-05-17 03:46:06 -05:00
|
|
|
(to install the needed dependencies and then proceed with the
|
|
|
|
manual building procedure)
|
|
|
|
|
2013-09-11 16:05:16 -05:00
|
|
|
|
2014-05-17 03:46:06 -05:00
|
|
|
For building with MacPorts you need to run:
|
|
|
|
sudo port install libtool automake autoconf pkgconfig \
|
2020-12-29 15:07:41 -06:00
|
|
|
libusb [libftdi1]
|
2013-09-11 16:05:16 -05:00
|
|
|
|
|
|
|
You should also specify LDFLAGS and CPPFLAGS to allow configure to use
|
|
|
|
MacPorts' libraries, so run configure like this:
|
|
|
|
LDFLAGS=-L/opt/local/lib CPPFLAGS=-I/opt/local/include ./configure [options]
|
|
|
|
|
|
|
|
|
|
|
|
See README for the generic building instructions.
|
|
|
|
|
2014-03-31 12:23:22 -05:00
|
|
|
If you're using a USB adapter and have a driver kext matched to it,
|
|
|
|
you will need to unload it prior to running OpenOCD. E.g. with Apple
|
|
|
|
driver (OS X 10.9 or later) for FTDI run:
|
|
|
|
sudo kextunload -b com.apple.driver.AppleUSBFTDI
|
|
|
|
for FTDI vendor driver use:
|
2013-09-11 16:05:16 -05:00
|
|
|
sudo kextunload FTDIUSBSerialDriver.kext
|
2014-03-31 12:23:22 -05:00
|
|
|
|
|
|
|
To learn more on the topic please refer to the official libusb FAQ:
|
|
|
|
https://github.com/libusb/libusb/wiki/FAQ
|