Merge branch 'maint-0.2.3' into release-0.2.3
[tor.git] / doc / tor-win32-mingw-creation.txt
blob4a25e47a8582ceaa460f73e69f87e5e26528e1dd
1 ##
2 ## Instructions for building Tor with MinGW (http://www.mingw.org/)
3 ##
5 Stage One:  Download and Install MinGW.
6 ---------------------------------------
8 Download mingw:
9 http://prdownloads.sf.net/mingw/MinGW-5.1.6.exe?download
11 Download msys:
12 http://prdownloads.sf.net/ming/MSYS-1.0.11.exe?download
14 Download msysDTK:
15 http://sourceforge.net/projects/mingw/files/MSYS%20Supplementary%20Tools/msysDTK-1.0.1/msysDTK-1.0.1.exe/download
17 Install MinGW, msysDTK, and MSYS in that order.  
19 Make sure your PATH includes C:\MinGW\bin.  You can verify this by right
20 clicking on "My Computer", choose "Properties", choose "Advanced",
21 choose "Environment Variables", select PATH.
23 Start MSYS(rxvt).
25 Create a directory called "tor-mingw".
27 Stage Two:  Download, extract, compile openssl
28 ----------------------------------------------
30 Download openssl:
31 http://www.openssl.org/source/openssl-0.9.8l.tar.gz
33 Extract openssl:
34 Copy the openssl tarball into the "tor-mingw" directory.
35 Type "cd tor-mingw/"
36 Type "tar zxf openssl-0.9.8l.tar.gz"
37 (Note:  There are many symlink errors because Windows doesn't support
38 symlinks.  You can ignore these errors.)
40 Make openssl libraries:
41 Type "cd tor-mingw/openssl-0.9.8l/"
42 Type "./Configure -no-idea -no-rc5 -no-mdc2 mingw"
43 Edit Makefile and remove the "test:" and "tests:" sections.
44 Type "rm -rf ./test"
45 Type "cd crypto/"
46 Type "find ./ -name "*.h" -exec cp {} ../include/openssl/ \;"
47 Type "cd ../ssl/"
48 Type "find ./ -name "*.h" -exec cp {} ../include/openssl/ \;"
49 Type "cd .."
50 Type "cp *.h include/openssl/"
51 Type "find ./fips -type f -name "*.h" -exec cp {} include/openssl/ \;"
52 # The next steps can take up to 30 minutes to complete.
53 Type "make"
54 Type "make install"
57 Stage Three:  Download, extract, compile zlib
58 ---------------------------------------------
60 Download zlib source:
61 http://www.zlib.net/zlib-1.2.3.tar.gz
63 Extract zlib:
64 Copy the zlib tarball into the "tor-mingw" directory
65 Type "cd tor-mingw/"
66 Type "tar zxf zlib-1.2.3.tar.gz"
68 CHOICE:
70 Make zlib.a:
71 Type "cd tor-mingw/zlib-1.2.3/"
72 Type "./configure"
73 Type "make"
74 Type "make install"
76 Done.
79 Stage Four: Download, extract, and compile libevent
80 ------------------------------------------------------
82 Download the latest libevent release:
83 http://www.monkey.org/~provos/libevent/
85 Copy the libevent tarball into the "tor-mingw" directory.
86 Type "cd tor-mingw"
88 Extract libevent.
90 Type "./configure --enable-static --disable-shared"
91 Type "make"
92 Type "make install"
94 Stage Five:  Build Tor
95 ----------------------
97 Download the current Tor alpha release source code from https://torproject.org/download.html.
98 Copy the Tor tarball into the "tor-mingw" directory.
99 Extract Tor:
100 Type "tar zxf latest-tor-alpha.tar.gz"
102 cd tor-<version>
103 Type "./configure"
104 Type "make"
106 You now have a tor.exe in src/or/.  This is Tor.
107 You now have a tor-resolve.exe in src/tools/.
109 Stage Six:  Build the installer
110 -------------------------------
112 Install the latest NSIS:
113 http://nsis.sourceforge.net/Download
115 Run the package script in contrib:
116 From the Tor build directory above, run:
117 "./contrib/package_nsis-mingw.sh"
119 The resulting Tor installer executable is in ./win_tmp/.