tor-win32-mingw-creation.txt 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. ## Instructions for building Tor with MinGW (http://www.mingw.org/)
  2. ##
  3. Stage One: Download and Install MinGW.
  4. ---------------------------------------
  5. Download mingw:
  6. http://prdownloads.sf.net/mingw/MinGW-5.0.3.exe?download
  7. Download msys:
  8. http://prdownloads.sf.net/mingw/MSYS-1.0.10.exe?download
  9. Download the mingw developer tool kit:
  10. http://prdownloads.sf.net/mingw/msysDTK-1.0.1.exe?download
  11. Download the mingw win32api:
  12. http://prdownloads.sf.net/mingw/w32api-3.6.tar.gz?download
  13. Install mingw, msys and mingw-dtk.
  14. Stage Two: Download, extract, compile openssl
  15. ----------------------------------------------
  16. Download openssl:
  17. http://www.openssl.org/source/openssl-0.9.8c.tar.gz
  18. Extract openssl:
  19. cp openssl-0.9.8c.tar.gz tor-mingw/
  20. cd tor-mingw/
  21. tar zxf openssl-0.9.8c.tar.gz
  22. Make openssl.dll:
  23. cd tor-mingw/openssl-0.9.8c/
  24. ./Configure mingw
  25. cp crypto/*.h ./include/openssl/
  26. cp e_os2.h ./include/openssl/
  27. cp ssl/*.h ./include/openssl/
  28. make
  29. Note: this fails in test due to:
  30. make[1]: *** No rule to make target `sha256t.o', needed by `sha256t.exe'. Stop.
  31. --need to research this - phobos
  32. Alternatively:
  33. Download the pre-compiled openssl for win32.
  34. Install and proceed.
  35. Stage Three: Download, extract, compile zlib
  36. ---------------------------------------------
  37. Download zlib source:
  38. http://www.zlib.net/zlib-1.2.3.tar.gz
  39. Extract zlib:
  40. cp zlib-1.2.3.tar.gz tor-mingw/
  41. cd tor-mingw/
  42. tar zxf zlib-1.2.3.tar.gz
  43. Make zlib1.dll:
  44. cd tor-mingw/zlib-1.2.3/
  45. make -f win32/Makefile.gcc
  46. Done.
  47. Stage Four: Download, extract, and patch libevent-1.1b.
  48. ------------------------------------------------------
  49. Download libevent-1.1b:
  50. http://www.monkey.org/~provos/libevent/
  51. Start up MSYS:
  52. Start -> Programs -> MinGW -> MSYS -> msys
  53. Create a directory to work within, for example, /c/tor-mingw.
  54. Copy libevent and tor tarballs into this working dir:
  55. cp /path/to/libevent-1.1b.tar.gz /c/tor-mingw/
  56. cp /patch/to/tor-alpha.tar.gz /c/tor-mingw/
  57. cd /c/tor-mingw/
  58. Extract libevent: tar zxf libevent-1.1b.tar.gz
  59. Extract tor: tar zxf tor-alpha.tar.gz
  60. Copy the libevent-1.1b diff into libevent-1.1b:
  61. cp /c/tor-mingw/tor/Win32Build/mingw/libevent-1.1b-mingw-custom.diff /c/tor-mingw/libevent-1.1b/
  62. patch -i libevent-1.1b-mingw-custom.diff
  63. Your output of the "patch" command should be similar to:
  64. "patch -i libevent-1.1b-mingw-custom.diff
  65. patching file `Makefile.am'
  66. can't find file to patch at input line 49
  67. Perhaps you should have used the -p or --strip option?
  68. The text leading up to this was:
  69. --------------------------
  70. |Only in libevent-1.1b: Makefile.in
  71. |diff -uwr libevent-1.1b-old/WIN32-Code/misc.c libevent-1.1b/WIN32-Code/misc.c
  72. |--- libevent-1.1b-old/WIN32-Code/misc.c Wed Aug 9 21:01:14 2006
  73. |+++ libevent-1.1b/WIN32-Code/misc.c Fri Sep 1 22:21:31 2006
  74. --------------------------
  75. File to patch: WIN32-Code/misc.c
  76. patching file `WIN32-Code/misc.c'
  77. can't find file to patch at input line 65
  78. Perhaps you should have used the -p or --strip option?
  79. The text leading up to this was:
  80. --------------------------
  81. |diff -uwr libevent-1.1b-old/WIN32-Code/misc.h libevent-1.1b/WIN32-Code/misc.h
  82. |--- libevent-1.1b-old/WIN32-Code/misc.h Wed Aug 9 21:01:14 2006
  83. |+++ libevent-1.1b/WIN32-Code/misc.h Fri Sep 1 18:47:09 2006
  84. --------------------------
  85. File to patch: WIN32-Code/misc.h
  86. patching file `WIN32-Code/misc.h'
  87. can't find file to patch at input line 78
  88. Perhaps you should have used the -p or --strip option?
  89. The text leading up to this was:
  90. --------------------------
  91. |diff -uwr libevent-1.1b-old/WIN32-Code/win32.c
  92. libevent-1.1b/WIN32-Code/win32.c
  93. |--- libevent-1.1b-old/WIN32-Code/win32.c Wed Aug 9 21:25:48 2006
  94. |+++ libevent-1.1b/WIN32-Code/win32.c Sat Sep 2 00:45:55 2006
  95. --------------------------
  96. File to patch: WIN32-Code/win32.c
  97. patching file `WIN32-Code/win32.c'
  98. patching file `buffer.c'
  99. patching file `config.h.in'
  100. patching file `configure.in'
  101. patching file `evbuffer.c'
  102. patching file `event.c'
  103. patching file `log.c' "
  104. --This is a complete hack right now:
  105. remove from event.c and log.c:
  106. #ifdef __GNUC__
  107. #include "WIN32-Code/misc.h"
  108. #else
  109. #include "misc.h"
  110. #endif
  111. Run "aclocal && autoheader && automake && autoconf".
  112. There may be WARNING messages. There will be no output if all runs successfuly.
  113. Run "./configure"
  114. Run "make"
  115. Run "make install"
  116. Stage Five: Build Tor
  117. ----------------------
  118. Extract the latest tor from svn in tor-mingw dir:
  119. tar zxf latest-tor-alpha.tar.gz
  120. cd tor-alpha
  121. ./autogen.sh
  122. ./configure
  123. (less magic happens here and a complete tor-alpha.exe is created)