aboutsummaryrefslogtreecommitdiff
path: root/doc/tor-win32-mingw-creation.txt
blob: 23179c87e063b4ffe63914b57e62f3e07c765c82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
## Instructions for building Tor with MinGW (http://www.mingw.org/)
##

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

Download mingw:
http://prdownloads.sf.net/mingw/MinGW-5.1.3.exe?download

Download msys:
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

Download the mingw autoconf-2.59 update:
http://prdownloads.sf.net/mingw/msys-autoconf-2.59.tar.bz2?download

Install mingw, msys and mingw-dtk.  Extract msys-autoconf-2.59.tar.bz2 into
your mingw install location.  For example, if you installed mingw into
/c/mingw/1.0/ you want to extract msys-autoconf-2.59.tar.bz2 into this
directory.

Create a directory called "tor-mingw".

Stage Two:  Download, extract, compile openssl
----------------------------------------------

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

Extract openssl:
Copy the openssl tarball into the "tor-mingw" directory.
Type "cd tor-mingw/"
Type "tar zxf openssl-0.9.8e.tar.gz"

Make openssl libraries:
Type "cd tor-mingw/openssl-0.9.8e/"
Type "./Configure -no-idea -no-rc5 -no-mdc2 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"

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


Stage Three:  Download, extract, compile zlib
---------------------------------------------

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

Extract zlib:
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 

Make zlib1.dll:
Type "cd tor-mingw/zlib-1.2.3/"
Type "./configure"
Type "make -f win32/Makefile.gcc"

Done.


Stage Four: Download, extract, and compile libevent-1.3e
------------------------------------------------------

Download the libevent 1.3e release:
http://www.monkey.org/~provos/libevent/

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

Extract libevent.

Type "./configure --enable-static --disable-shared"
Type "make"
Type "make install"

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

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"

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

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

Stage Six:  Build the installer
-------------------------------

Install the latest NSIS:
http://nsis.sourceforge.net/Download

Run the package script in contrib:
From the Tor build directory above, run:
"./contrib/package_nsis-mingw.sh"

The resulting Tor installer executable is in ./win_tmp/.