tor-win32-mingw-creation.txt 2.7 KB

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