r12000@catbus: nickm | 2007-02-28 15:12:21 -0500
[tor.git] / doc / tor-win32-mingw-creation.txt
blob65a0eab334c3b212363475ec68df8018c2b52fb9
1 ## Instructions for building Tor with MinGW (http://www.mingw.org/)
2 ##
4 Stage One:  Download and Install MinGW.
5 ---------------------------------------
7 Download mingw:
8 http://prdownloads.sf.net/mingw/MinGW-5.0.3.exe?download
10 Download msys:
11 http://prdownloads.sf.net/mingw/MSYS-1.0.10.exe?download
13 Download the mingw developer tool kit:
14 http://prdownloads.sf.net/mingw/msysDTK-1.0.1.exe?download
16 Install mingw, msys and mingw-dtk.
18 Create a directory called "tor-mingw".
20 Stage Two:  Download, extract, compile openssl
21 ----------------------------------------------
23 Download openssl:
24 http://www.openssl.org/source/openssl-0.9.8d.tar.gz
26 Extract openssl:
27 Copy the openssl tarball into the "tor-mingw" directory.
28 Type "cd tor-mingw/"
29 Type "tar zxf openssl-0.9.8d.tar.gz"
31 Make openssl libraries:
32 Type "cd tor-mingw/openssl-0.9.8d/"
33 Type "./Configure mingw"
34 Edit Makefile and remove the "test:" and "tests:" sections.
35 Type "rm -rf ./test"
36 Type "cd crypto/"
37 Type "find ./ -name "*.h" -exec cp {} ../include/openssl/ \;"
38 Type "cd ../ssl/"
39 Type "find ./ -name "*.h" -exec cp {} ../include/openssl/ \;
40 Type "cd .."
41 Type "cp *.h include/openssl/"
42 # The next steps can take up to 30 minutes to complete.
43 Type "make"
44 Type "make install"
46 Alternatively:
47 Download the pre-compiled openssl for win32.
48 Install and proceed.
51 Stage Three:  Download, extract, compile zlib
52 ---------------------------------------------
54 Download zlib source:
55 http://www.zlib.net/zlib-1.2.3.tar.gz
57 Extract zlib:
58 Copy the zlib tarball into the "tor-mingw" directory
59 Type "cd tor-mingw/"
60 Type "tar zxf zlib-1.2.3.tar.gz"
62 CHOICE:
64 Make zlib.a:
65 Type "cd tor-mingw/zlib-1.2.3/"
66 Type "./configure"
67 Type "make"
68 Type "make install"
70 OR 
72 Make zlib1.dll:
73 Type "cd tor-mingw/zlib-1.2.3/"
74 Type "./configure"
75 Type "make -f win32/Makefile.gcc"
77 Done.
80 Stage Four: Download, extract, and patch libevent-1.1b.
81 ------------------------------------------------------
83 Download libevent-1.3a:
84 http://www.monkey.org/~provos/libevent/
86 Copy the libevent tarball into the "tor-mingw" directory.
87 Type "cd tor-mingw"
89 Extract libevent: 
90 Type "tar zxf libevent-1.3a.tar.gz"
92 Type "./configure --enable-static --disable-shared"
93 --------------------libevent 1.3a only---------------------------------------
94 You need to manually edit the Makefile and remove all references to "sample".
95 libevent 1.3a won't compile in mingw currently due to issues in event_test.c.
96 Removing the "sample" directory and all references to it in Makefile create a
97 completely valid libevent library.
98 -----------------------------------------------------------------------------
99 Type "make"
100 Type "make install"
102 Stage Five:  Build Tor
103 ----------------------
105 Download the current Tor alpha release from http://tor.eff.org/download.html.
106 Copy the Tor tarball into the "tor-mingw" directory.
107 Extract Tor:
108 Type "tar zxf latest-tor-alpha.tar.gz"
110 cd tor-<version>
111 Type "./configure --enable-static --disable-shared"
112 Type "make"
114 You now have a tor.exe in src/or/.  This is Tor.
115 You now have a tor_resolve.exe in src/tools/.