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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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:
  10. http://forum.sparkfun.com/viewtopic.php?t=11221
  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 0.1.12.2. 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.
  21. http://sourceforge.net/projects/libusb-win32/
  22. You need to download the libusb-win32-device-bin-0.1.12.2.tar.gz
  23. package. Extract this file into a temp directory.
  24. Copy the file libusb-win32-device-bin-0.1.12.2\include\usb.h
  25. to your MinGW include directory.
  26. Copy the library libusb-win32-device-bin-0.1.12.2\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. If there is a new svn version of libusb-win32, you can build it as well.
  32. These are the instruction from the libusb-win32 Makefile:
  33. # If you're cross-compiling and your mingw32 tools are called
  34. # i586-mingw32msvc-gcc and so on, then you can compile libusb-win32
  35. # by running
  36. # make host_prefix=i586-mingw32msvc all
  37. libftdi
  38. -------
  39. The author does not provide Windows binary. You can build it from a
  40. released source tarball or the git tree.
  41. If you are using the git tree, the following are the instructions from
  42. README.mingw. You will need to have the cmake utility installed.
  43. - Edit Toolchain-mingw32.cmake to point to the correct MinGW
  44. installation.
  45. - Create a build directory like "mkdir build-win32", e.g in ../libftdi/
  46. - cd into that directory and run
  47. "cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain-mingw32.cmake .."
  48. - Copy src/ftdi.h to your MinGW include directory.
  49. - Copy build-win32/src/*.a to your MinGW lib directory.
  50. libftd2xx
  51. ---------
  52. The Cygwin/Win32 ZIP file contains a directory named ftd2xx.win32.
  53. After being extracted, the directory does not need further preparation.
  54. Instead, its path must be provided to the --with-ftd2xx-win32-zipdir
  55. configure option, as shown in the next section.
  56. OpenOCD
  57. -------
  58. Now you can build OpenOCD under Linux using MinGW. You need to use
  59. --build and --host configure options.
  60. To use libftdi:
  61. ./configure --build=i686-pc-linux-gnu --host=i586-mingw32msvc \
  62. --enable-ft2232_libftdi \
  63. ... other options ...
  64. To use ftd2xx:
  65. ./configure --build=i686-pc-linux-gnu --host=i586-mingw32msvc \
  66. --enable-ft2232_ftd2xx \
  67. --with-ftd2xx-win32-zipdir=/path/to/libftd2xx-win32 \
  68. ... other options ...
  69. If you are using the SVN repository, see the README file for additional
  70. instructions about configuring and building OpenOCD.