tor-win32-mingw-creation.txt 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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.1.4.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.8j.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.8j.tar.gz"
  26. (Note: There are many symlink errors because Windows doesn't support
  27. symlinks. You can ignore these errors.)
  28. Make openssl libraries:
  29. Type "cd tor-mingw/openssl-0.9.8j/"
  30. Type "./Configure -no-idea -no-rc5 -no-mdc2 mingw"
  31. Edit Makefile and remove the "test:" and "tests:" sections.
  32. Type "rm -rf ./test"
  33. Type "cd crypto/"
  34. Type "find ./ -name "*.h" -exec cp {} ../include/openssl/ \;"
  35. Type "cd ../ssl/"
  36. Type "find ./ -name "*.h" -exec cp {} ../include/openssl/ \;"
  37. Type "cd .."
  38. Type "cp *.h include/openssl/"
  39. Type "cp fips/fips.h include/openssl/"
  40. # The next steps can take up to 30 minutes to complete.
  41. Type "make"
  42. Type "make install"
  43. Alternatively:
  44. Download the pre-compiled openssl for win32 from
  45. http://gnuwin32.sourceforge.net/packages/openssl.htm
  46. Install and proceed.
  47. Stage Three: Download, extract, compile zlib
  48. ---------------------------------------------
  49. Download zlib source:
  50. http://www.zlib.net/zlib-1.2.3.tar.gz
  51. Extract zlib:
  52. Copy the zlib tarball into the "tor-mingw" directory
  53. Type "cd tor-mingw/"
  54. Type "tar zxf zlib-1.2.3.tar.gz"
  55. CHOICE:
  56. Make zlib.a:
  57. Type "cd tor-mingw/zlib-1.2.3/"
  58. Type "./configure"
  59. Type "make"
  60. Type "make install"
  61. OR
  62. Make zlib1.dll:
  63. Type "cd tor-mingw/zlib-1.2.3/"
  64. Type "./configure"
  65. Type "make -f win32/Makefile.gcc"
  66. Done.
  67. Stage Four: Download, extract, and compile libevent
  68. ------------------------------------------------------
  69. Download the latest libevent release:
  70. http://www.monkey.org/~provos/libevent/
  71. Copy the libevent tarball into the "tor-mingw" directory.
  72. Type "cd tor-mingw"
  73. Extract libevent.
  74. Type "./configure --enable-static --disable-shared"
  75. Type "make"
  76. Type "make install"
  77. Stage Five: Build Tor
  78. ----------------------
  79. Download the current Tor alpha release source code from https://torproject.org/download.html.
  80. Copy the Tor tarball into the "tor-mingw" directory.
  81. Extract Tor:
  82. Type "tar zxf latest-tor-alpha.tar.gz"
  83. cd tor-<version>
  84. Type "./configure"
  85. Type "make"
  86. You now have a tor.exe in src/or/. This is Tor.
  87. You now have a tor-resolve.exe in src/tools/.
  88. Stage Six: Build the installer
  89. -------------------------------
  90. Install the latest NSIS:
  91. http://nsis.sourceforge.net/Download
  92. Run the package script in contrib:
  93. From the Tor build directory above, run:
  94. "./contrib/package_nsis-mingw.sh"
  95. The resulting Tor installer executable is in ./win_tmp/.