Ticket #4260: tor-win32-mingw-creation.txt

File tor-win32-mingw-creation.txt, 3.0 KB (added by Tey', 8 years ago)
Line 
1##
2## Instructions for building Tor with MinGW (http://www.mingw.org/)
3##
4
5Stage One:  Download and Install MinGW.
6---------------------------------------
7
8Download mingw autoinstaller:
9http://prdownloads.sf.net/mingw/mingw-get-inst-20110802.exe?download
10
11The following packages needs to be installed:
12MinGW Compiler Suite
13- C Compiler
14MSYS Basic System
15MinGW Developer Toolkit
16
17Once MinGW is installed, start the MinGW Shell from the start menu.
18
19Create a directory called "tor-mingw" this way:
20mkdir tor-mingw
21
22Stage Two:  Download, extract, compile openssl
23----------------------------------------------
24
25Download openssl:
26http://www.openssl.org/source/openssl-1.0.0e.tar.gz
27
28Extract openssl:
29Copy the openssl tarball into the "tor-mingw" directory.
30Type "cd $HOME/tor-mingw/"
31Type "tar zxf openssl-1.0.0e.tar.gz"
32
33Make openssl libraries:
34Type "cd $HOME/tor-mingw/openssl-1.0.0e/"
35Type "./Configure mingw"
36# The next steps can take up to 30 minutes to complete.
37Type "make"
38Type "make test" if you want to check that the compiled library works
39as expected.
40Type "make install"
41
42
43Stage Three:  Download, extract, compile zlib
44---------------------------------------------
45
46Download zlib source:
47http://zlib.net/zlib-1.2.5.tar.gz
48
49Extract zlib:
50Copy the zlib tarball into the "tor-mingw" directory
51Type "cd $HOME/tor-mingw/"
52Type "tar zxf zlib-1.2.5.tar.gz"
53
54Make zlib:
55Type "cd $HOME/tor-mingw/zlib-1.2.5/"
56Type "make -f win32/Makefile.gcc"
57Type "make -f win32/Makefile.gcc test" if you want to check that the compiled
58library works as expected.
59Type "export LIBRARY_PATH=/local/lib/ INCLUDE_PATH=/local/include/"
60Type "export BINARY_PATH=/local/bin/"
61Type "make -f win32/Makefile.gcc install"
62
63Done.
64
65
66Stage Four: Download, extract, and compile libevent
67------------------------------------------------------
68
69Download the latest stable libevent release:
70http://libevent.org/
71
72Copy the libevent tarball into the "tor-mingw" directory.
73Type "cd $HOME/tor-mingw"
74
75Extract libevent, and go to the newly created directory:
76tar zxf libevent-x.y.z-stable.tar.gz
77cd $HOME/tor-mingw/libevent-x.y.z-stable
78
79Type "./configure --enable-static --disable-shared"
80Type "make"
81Type "make check" if you want to check that the compiled library works
82as expected.
83Type "make install"
84
85Stage Five:  Build Tor
86----------------------
87
88Download the latest Tor (stable or alpha) release source code from:
89https://www.torproject.org/download/download.html
90Copy the Tor tarball into the "tor-mingw" directory.
91Type "cd $HOME/tor-mingw"
92Extract Tor:
93Type "tar zxf tor-<version>.tar.gz"
94
95Type "cd $HOME/tor_mingw/tor-<version>"
96Type "./configure"
97Type "make"
98Type "make test" if you want to check that the compiled TOR works as expected.
99
100You now have a tor.exe in src/or/.  This is Tor.
101You now have a tor-resolve.exe in src/tools/.
102
103Stage Six:  Build the installer
104-------------------------------
105
106Install the latest NSIS:
107http://nsis.sourceforge.net/Download
108
109Run the package script in contrib:
110From the Tor build directory above, run:
111"./contrib/package_nsis-mingw.sh"
112
113The resulting Tor installer executable is in ./win_tmp/.