tor-win32-mingw-creation.txt 3.04 KB
Newer Older
1
2
## Instructions for building Tor with MinGW (http://www.mingw.org/)
##
3
4
5
6
7

Stage One:  Download and Install MinGW.
---------------------------------------

Download mingw:
8
9
10
http://prdownloads.sf.net/mingw/MinGW-5.0.3.exe?download

Download msys:
11
12
13
14
15
http://prdownloads.sf.net/mingw/MSYS-1.0.10.exe?download

Download the mingw developer tool kit:
http://prdownloads.sf.net/mingw/msysDTK-1.0.1.exe?download

16
17
18
19
20
Download the mingw win32api:
http://prdownloads.sf.net/mingw/w32api-3.6.tar.gz?download

Install mingw, msys and mingw-dtk.

21
22
Create a directory called "tor-mingw".

23
24
25
26
27
28
29
Stage Two:  Download, extract, compile openssl
----------------------------------------------

Download openssl:
http://www.openssl.org/source/openssl-0.9.8c.tar.gz

Extract openssl:
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Copy the openssl tarball into the "tor-mingw" directory.
Type "cd tor-mingw/"
Type "tar zxf openssl-0.9.8c.tar.gz"

Make openssl libraries:
Type "cd tor-mingw/openssl-0.9.8c/"
Type "./Configure mingw"
Edit Makefile and remove the "test:" and "tests:" sections.
Type "rm -rf ./test"
Type "cd crypto/"
Type "find ./ -name "*.h" -exec cp {} ../include/openssl/ \;"
Type "cd ../ssl/"
Type "find ./ -name "*.h" -exec cp {} ../include/openssl/ \;
Type "cd .."
Type "cp *.h include/openssl/"
# The next steps can take up to 30 minutes to complete.
Type "make"
Type "make install"
48
49
50
51
52

Alternatively:
Download the pre-compiled openssl for win32.
Install and proceed.

53

54
55
56
57
58
59
60
Stage Three:  Download, extract, compile zlib
---------------------------------------------

Download zlib source:
http://www.zlib.net/zlib-1.2.3.tar.gz

Extract zlib:
61
62
63
64
65
66
67
68
69
70
71
72
73
Copy the zlib tarball into the "tor-mingw" directory
Type "cd tor-mingw/"
Type "tar zxf zlib-1.2.3.tar.gz"

CHOICE:

Make zlib.a:
Type "cd tor-mingw/zlib-1.2.3/"
Type "./configure"
Type "make"
Type "make install"

OR 
74
75

Make zlib1.dll:
76
Type "cd tor-mingw/zlib-1.2.3/"
77
78
Type "./configure"
Type "make -f win32/Makefile.gcc"
79
80
81
82
83

Done.


Stage Four: Download, extract, and patch libevent-1.1b.
84
85
86
87
88
------------------------------------------------------

Download libevent-1.1b:
http://www.monkey.org/~provos/libevent/

89
90
Copy the libevent tarball into the "tor-mingw" directory.
Type "cd tor-mingw"
91

92
93
Extract libevent: 
Type "tar zxf libevent-1.1b.tar.gz"
94

95
Download the libevent-1.1b-mingw.diff from 
96
http://cvs.seul.org/viewcvs/viewcvs.cgi/tor/trunk/Win32Build/mingw/libevent-1.1b-mingw.diff?rev=8456&root=tor&view=log
97
98
Copy the libevent-1.1b diff into the libevent-1.1b directory.
Type "patch -p0 < libevent-1.1b-mingw.diff"
99

100
Type "aclocal && autoheader && automake && autoconf".
101
102
There may be WARNING messages.  There will be no output if all runs successfuly.

103
104
105
Type "./configure --enable-static --disable-shared"
Type "make"
Type "make install"
106
107
108
109

Stage Five:  Build Tor
----------------------

110
111
112
113
Download the current Tor alpha release from http://tor.eff.org/download.html.
Copy the Tor tarball into the "tor-mingw" directory.
Extract Tor:
Type "tar zxf latest-tor-alpha.tar.gz"
114

115
116
117
cd tor-<version>
Type "./configure --enable-static --disable-shared"
Type "make"
118

119
You now have a tor.exe in src/or/.  This is Tor.
120
You now have a tor_resolve.exe in src/tools/.