You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.Win32 3.3 KiB

  1. Building OpenOCD for Windows
  2. ----------------------------
  3. For building on Windows, you have to use CygWin. Make sure that your
  4. PATH environment variable contains no other locations with Unix utilities
  5. (like UnxUtils). Those tools can't handle the CygWin paths, resulting
  6. in obscure dependency errors. This was an observation gathered from the
  7. logs of one user; please correct us if this is wrong.
  8. The following URL is a good reference if you want to build OpenOCD
  9. under CygWin:
  11. Alternatively you can build the Windows binary under Linux using
  12. MinGW cross compiler. The following documents some tips of
  13. using this cross build option.
  14. libusb-win32
  15. ------------
  16. You can choose to use the libusb-win32 binary distribution from
  17. its SourceForge page. As of this writing, the latest version
  18. is This is the recommend version to use since it fixed
  19. an issue with USB composite device and this is important for FTDI
  20. based JTAG debuggers.
  22. You need to download the libusb-win32-device-bin-
  23. package. Extract this file into a temp directory.
  24. Copy the file libusb-win32-device-bin-\include\usb.h
  25. to your MinGW include directory.
  26. Copy the library libusb-win32-device-bin-\lib\gcc\libusb.a
  27. to your MinGW library directory.
  28. Take note that different Linux distributions often have different MinGW
  29. installation directory. Some of them also put the library and include
  30. into a separate sys-root directory.
  31. When the libusb-win32 repository is more current than its release code,
  32. you could build that instead.
  33. These are the instruction from the libusb-win32 Makefile:
  34. # If you're cross-compiling and your mingw32 tools are called
  35. # i586-mingw32msvc-gcc and so on, then you can compile libusb-win32
  36. # by running
  37. # make host_prefix=i586-mingw32msvc all
  38. libftdi
  39. -------
  40. The author does not provide Windows binary. You can build it from a
  41. released source tarball or the git tree.
  42. If you are using the git tree, the following are the instructions from
  43. README.mingw. You will need to have the cmake utility installed.
  44. - Edit Toolchain-mingw32.cmake to point to the correct MinGW
  45. installation.
  46. - Create a build directory like "mkdir build-win32", e.g in ../libftdi/
  47. - cd into that directory and run
  48. "cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain-mingw32.cmake .."
  49. - Copy src/ftdi.h to your MinGW include directory.
  50. - Copy build-win32/src/*.a to your MinGW lib directory.
  51. libftd2xx
  52. ---------
  53. The Cygwin/Win32 ZIP file contains a directory named ftd2xx.win32.
  54. After being extracted, the directory does not need further preparation.
  55. Instead, its path must be provided to the --with-ftd2xx-win32-zipdir
  56. configure option, as shown in the next section.
  57. OpenOCD
  58. -------
  59. Now you can build OpenOCD under Linux using MinGW. You need to use
  60. --build and --host configure options.
  61. To use libftdi:
  62. ./configure --build=i686-pc-linux-gnu --host=i586-mingw32msvc \
  63. --enable-ft2232_libftdi \
  64. ... other options ...
  65. To use ftd2xx:
  66. ./configure --build=i686-pc-linux-gnu --host=i586-mingw32msvc \
  67. --enable-ft2232_ftd2xx \
  68. --with-ftd2xx-win32-zipdir=/path/to/libftd2xx-win32 \
  69. ... other options ...
  70. If you are using the GIT repository, see the README file for additional
  71. instructions about configuring and building OpenOCD.