tor-win32-mingw-creation.txt 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. cd crypto/
  25. find ./ -name "*.h" -exec cp {} ../include/openssl/ \;
  26. find ./crypto/ -type f -name "*.c" -exec cp {} test/ \
  27. cd ../ssl/
  28. find ./ -name "*.h" -exec cp {} ../include/openssl/ \;
  29. cp *.h ./include/openssl/
  30. cp ssl/ssltest.c test/
  31. ./Configure mingw
  32. make
  33. Note: this fails in test due to:
  34. make[1]: *** No rule to make target `sha256t.o', needed by `sha256t.exe'. Stop.
  35. --need to research this - phobos
  36. Alternatively:
  37. Download the pre-compiled openssl for win32.
  38. Install and proceed.
  39. Stage Three: Download, extract, compile zlib
  40. ---------------------------------------------
  41. Download zlib source:
  42. http://www.zlib.net/zlib-1.2.3.tar.gz
  43. Extract zlib:
  44. cp zlib-1.2.3.tar.gz tor-mingw/
  45. cd tor-mingw/
  46. tar zxf zlib-1.2.3.tar.gz
  47. Make zlib1.dll:
  48. cd tor-mingw/zlib-1.2.3/
  49. make -f win32/Makefile.gcc
  50. Done.
  51. Stage Four: Download, extract, and patch libevent-1.1b.
  52. ------------------------------------------------------
  53. Download libevent-1.1b:
  54. http://www.monkey.org/~provos/libevent/
  55. Start up MSYS:
  56. Start -> Programs -> MinGW -> MSYS -> msys
  57. Create a directory to work within, for example, /c/tor-mingw.
  58. Copy libevent and tor tarballs into this working dir:
  59. cp /path/to/libevent-1.1b.tar.gz /c/tor-mingw/
  60. cp /patch/to/tor-alpha.tar.gz /c/tor-mingw/
  61. cd /c/tor-mingw/
  62. Extract libevent: tar zxf libevent-1.1b.tar.gz
  63. Extract tor: tar zxf tor-alpha.tar.gz
  64. Copy the libevent-1.1b diff into libevent-1.1b:
  65. cp /c/tor-mingw/tor/Win32Build/mingw/libevent-1.1b-mingw-custom.diff /c/tor-mingw/libevent-1.1b/
  66. patch -i libevent-1.1b-mingw-custom.diff
  67. --This is a complete hack right now:
  68. remove from event.c and log.c:
  69. #ifdef __GNUC__
  70. #include "WIN32-Code/misc.h"
  71. #else
  72. #include "misc.h"
  73. #endif
  74. Run "aclocal && autoheader && automake && autoconf".
  75. There may be WARNING messages. There will be no output if all runs successfuly.
  76. Run "./configure"
  77. Run "make"
  78. Run "make install"
  79. Stage Five: Build Tor
  80. ----------------------
  81. Extract the latest tor from svn in tor-mingw dir:
  82. tar zxf latest-tor-alpha.tar.gz
  83. cd tor-alpha
  84. ./autogen.sh
  85. ./configure
  86. (less magic happens here and a complete tor-alpha.exe is created)