Add --enable-static-(openssl|libevent) options
[tor/rransom.git] / doc / tor-win32-mingw-creation.txt
blobf31d2741c4e6235dde733f4d146194547faec341
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.1.4.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 Download the mingw autoconf-2.59 update:
17 http://prdownloads.sf.net/mingw/msys-autoconf-2.59.tar.bz2?download
19 Install mingw, msys and mingw-dtk.  Extract msys-autoconf-2.59.tar.bz2 into
20 your mingw install location.  For example, if you installed mingw into
21 /c/mingw/1.0/ you want to extract msys-autoconf-2.59.tar.bz2 into this
22 directory.
24 Create a directory called "tor-mingw".
26 Stage Two:  Download, extract, compile openssl
27 ----------------------------------------------
29 Download openssl:
30 http://www.openssl.org/source/openssl-0.9.8k.tar.gz
32 Extract openssl:
33 Copy the openssl tarball into the "tor-mingw" directory.
34 Type "cd tor-mingw/"
35 Type "tar zxf openssl-0.9.8k.tar.gz"
36 (Note:  There are many symlink errors because Windows doesn't support
37 symlinks.  You can ignore these errors.)
39 Make openssl libraries:
40 Type "cd tor-mingw/openssl-0.9.8k/"
41 Type "./Configure -no-idea -no-rc5 -no-mdc2 mingw"
42 Edit Makefile and remove the "test:" and "tests:" sections.
43 Type "rm -rf ./test"
44 Type "cd crypto/"
45 Type "find ./ -name "*.h" -exec cp {} ../include/openssl/ \;"
46 Type "cd ../ssl/"
47 Type "find ./ -name "*.h" -exec cp {} ../include/openssl/ \;"
48 Type "cd .."
49 Type "cp *.h include/openssl/"
50 Type "cp fips/fips.h include/openssl/"
51 # The next steps can take up to 30 minutes to complete.
52 Type "make"
53 Type "make install"
55 Alternatively:
56 Download the pre-compiled openssl for win32 from 
57 http://gnuwin32.sourceforge.net/packages/openssl.htm
58 Install and proceed.
61 Stage Three:  Download, extract, compile zlib
62 ---------------------------------------------
64 Download zlib source:
65 http://www.zlib.net/zlib-1.2.3.tar.gz
67 Extract zlib:
68 Copy the zlib tarball into the "tor-mingw" directory
69 Type "cd tor-mingw/"
70 Type "tar zxf zlib-1.2.3.tar.gz"
72 CHOICE:
74 Make zlib.a:
75 Type "cd tor-mingw/zlib-1.2.3/"
76 Type "./configure"
77 Type "make"
78 Type "make install"
80 OR 
82 Make zlib1.dll:
83 Type "cd tor-mingw/zlib-1.2.3/"
84 Type "./configure"
85 Type "make -f win32/Makefile.gcc"
87 Done.
90 Stage Four: Download, extract, and compile libevent
91 ------------------------------------------------------
93 Download the latest libevent release:
94 http://www.monkey.org/~provos/libevent/
96 Copy the libevent tarball into the "tor-mingw" directory.
97 Type "cd tor-mingw"
99 Extract libevent.
101 Type "./configure --enable-static --disable-shared"
102 Type "make"
103 Type "make install"
105 Stage Five:  Build Tor
106 ----------------------
108 Download the current Tor alpha release source code from https://torproject.org/download.html.
109 Copy the Tor tarball into the "tor-mingw" directory.
110 Extract Tor:
111 Type "tar zxf latest-tor-alpha.tar.gz"
113 cd tor-<version>
114 Type "./configure"
115 Type "make"
117 You now have a tor.exe in src/or/.  This is Tor.
118 You now have a tor-resolve.exe in src/tools/.
120 Stage Six:  Build the installer
121 -------------------------------
123 Install the latest NSIS:
124 http://nsis.sourceforge.net/Download
126 Run the package script in contrib:
127 From the Tor build directory above, run:
128 "./contrib/package_nsis-mingw.sh"
130 The resulting Tor installer executable is in ./win_tmp/.