tor-win32-mingw-creation.txt 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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 autoconf-2.59 update:
  12. http://prdownloads.sf.net/mingw/msys-autoconf-2.59.tar.bz2?download
  13. Install mingw, msys and mingw-dtk. Extract msys-autoconf-2.59.tar.bz2 into
  14. your mingw install location. For example, if you installed mingw into
  15. /c/mingw/1.0/ you want to extract msys-autoconf-2.59.tar.bz2 into this
  16. directory.
  17. Create a directory called "tor-mingw".
  18. Stage Two: Download, extract, compile openssl
  19. ----------------------------------------------
  20. Download openssl:
  21. http://www.openssl.org/source/openssl-0.9.8d.tar.gz
  22. Extract openssl:
  23. Copy the openssl tarball into the "tor-mingw" directory.
  24. Type "cd tor-mingw/"
  25. Type "tar zxf openssl-0.9.8d.tar.gz"
  26. Make openssl libraries:
  27. Type "cd tor-mingw/openssl-0.9.8d/"
  28. Type "./Configure mingw"
  29. Edit Makefile and remove the "test:" and "tests:" sections.
  30. Type "rm -rf ./test"
  31. Type "cd crypto/"
  32. Type "find ./ -name "*.h" -exec cp {} ../include/openssl/ \;"
  33. Type "cd ../ssl/"
  34. Type "find ./ -name "*.h" -exec cp {} ../include/openssl/ \;
  35. Type "cd .."
  36. Type "cp *.h include/openssl/"
  37. # The next steps can take up to 30 minutes to complete.
  38. Type "make"
  39. Type "make install"
  40. Alternatively:
  41. Download the pre-compiled openssl for win32.
  42. Install and proceed.
  43. Stage Three: Download, extract, compile zlib
  44. ---------------------------------------------
  45. Download zlib source:
  46. http://www.zlib.net/zlib-1.2.3.tar.gz
  47. Extract zlib:
  48. Copy the zlib tarball into the "tor-mingw" directory
  49. Type "cd tor-mingw/"
  50. Type "tar zxf zlib-1.2.3.tar.gz"
  51. CHOICE:
  52. Make zlib.a:
  53. Type "cd tor-mingw/zlib-1.2.3/"
  54. Type "./configure"
  55. Type "make"
  56. Type "make install"
  57. OR
  58. Make zlib1.dll:
  59. Type "cd tor-mingw/zlib-1.2.3/"
  60. Type "./configure"
  61. Type "make -f win32/Makefile.gcc"
  62. Done.
  63. Stage Four: Download, extract, and patch libevent-1.1b.
  64. ------------------------------------------------------
  65. Download the latest libevent release:
  66. http://www.monkey.org/~provos/libevent/
  67. Copy the libevent tarball into the "tor-mingw" directory.
  68. Type "cd tor-mingw"
  69. Extract libevent.
  70. Type "./configure --enable-static --disable-shared"
  71. --------------------libevent 1.3b only---------------------------------------
  72. You need to manually edit the Makefile and remove all references to "sample".
  73. libevent 1.3b won't compile in mingw currently due to issues in event_test.c.
  74. Removing the "sample" directory and all references to it in Makefile create a
  75. completely valid libevent library.
  76. -----------------------------------------------------------------------------
  77. Type "make"
  78. Type "make install"
  79. Stage Five: Build Tor
  80. ----------------------
  81. Download the current Tor alpha release from http://tor.eff.org/download.html.
  82. Copy the Tor tarball into the "tor-mingw" directory.
  83. Extract Tor:
  84. Type "tar zxf latest-tor-alpha.tar.gz"
  85. cd tor-<version>
  86. Type "./configure --enable-eventdns --enable-static --disable-shared"
  87. Type "make"
  88. You now have a tor.exe in src/or/. This is Tor.
  89. You now have a tor_resolve.exe in src/tools/.
  90. Stage Six: Build the installer
  91. -------------------------------
  92. Install the latest NSIS:
  93. http://nsis.sourceforge.net/Download
  94. Run the package script in contrib:
  95. From the Tor build directory above, run:
  96. "./contrib/package_nsis-mingw.sh"
  97. The resulting Tor installer executable is in ./win_tmp/.