Ticket #13081: building-tor-windows.txt

File building-tor-windows.txt, 3.4 KB (added by NewEraCracker, 5 years ago)
Line 
1Build Tor in Windows
2
3Requirements:
4 * Visual Studio 2010
5    http://go.microsoft.com/fwlink/?LinkId=323467
6 * CMake 2.8.12.2
7    http://www.cmake.org/download/
8 * Perl 5.16
9    http://www.activestate.com/activeperl/downloads
10 * OpenSSL 1.0.1 tarball
11    https://www.openssl.org/source/
12 * Zlib 1.2.8 tarball
13    http://zlib.net/
14 * Libevent 2.1 tarball
15    https://github.com/libevent/libevent/releases
16
17Building OpenSSL from source as a shared library:
18
19 cd <openssl source dir>
20 perl Configure VC-WIN32
21 perl util\mkfiles.pl >MINFO
22 perl util\mk1mf.pl no-asm dll VC-WIN32 >32dll.mak
23 perl util\mkdef.pl 32 libeay > ms\libeay32.def
24 perl util\mkdef.pl 32 ssleay > ms\ssleay32.def
25 nmake -f 32dll.mak
26
27Making OpenSSL final package:
28
29 Create <openssl final package dir>, I'd recommend using a name like <openssl source dir>-vc10.
30
31 Copy the following directories and files to their respective locations
32  <openssl source dir>\inc32\openssl => <openssl final package dir>\include\openssl
33  <openssl source dir>\out32dll\libeay32.lib => <openssl final package dir>\lib\libeay32.lib
34  <openssl source dir>\out32dll\ssleay32.lib => <openssl final package dir>\lib\ssleay32.lib
35  <openssl source dir>\out32dll\libeay32.dll => <openssl final package dir>\bin\libeay32.dll
36  <openssl source dir>\out32dll\openssl.exe => <openssl final package dir>\bin\openssl.exe
37  <openssl source dir>\out32dll\ssleay32.dll => <openssl final package dir>\bin\ssleay32.dll
38
39Building Zlib from source:
40
41 cd <zlib source dir>
42 nmake -f win32/Makefile.msc
43
44Building libevent:
45
46 cd <libevent source dir>
47 mkdir build && cd build
48 SET OPENSSL_ROOT_DIR=<openssl final package dir>
49 cmake -G "NMake Makefiles" .. -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING="/MT /Zi /O2 /Ob1 /D NDEBUG" -DZLIB_LIBRARY:FILEPATH="<zlib source dir>\zdll.lib" -DZLIB_INCLUDE_DIR:PATH="<zlib source dir>"
50 nmake event
51
52Building Tor:
53
54 Create a dir above tor source dir named build-alpha and two subdirs include and lib.
55
56 Your build tree should now be similar to this one:
57  * build-alpha
58    - include
59    - lib
60  * <libevent source dir>
61    - build
62    - cmake
63    - ...
64  * <openssl source dir>
65    - ...
66    - ms
67    - util
68    - ...
69  * <openssl final package dir>
70    - bin
71    - include
72    - lib
73  * <tor source dir>
74    - ...
75    - src
76    - ...
77  * <zlib source dir>
78    - ...
79    - win32
80    - ...
81
82 Copy the following dirs and files to the following locations:
83  <openssl final package dir>\include\openssl => build-alpha\include\openssl
84  <libevent source dir>\include => build-alpha\include
85  <libevent source dir>\WIN32-Code\nmake\event2 => build-alpha\include\event2
86  <zlib source dir>\z*.h => build-alpha\include\z*.h
87
88 Now copy the following files to the followin locations:
89
90  <libevent source dir>\build\lib\event.lib => build-alpha\lib\libevent.lib
91  <openssl final package dir>\lib\libeay32.lib => build-alpha\lib\libcrypto.lib
92  <openssl final package dir>\lib\ssleay32.lib => build-alpha\lib\libssl.lib
93  <zlib source dir>\zdll.lib => build-alpha\lib\libz.lib
94
95 And we are now ready for the build process:
96
97  cd <tor source dir>
98  nmake -f Makefile.nmake
99
100 After the above process is completed there should be a tor.exe in <tor source dir>\src\or
101
102 Copy tor.exe to desired location and also copy zlib1.dll, libeay32.dll and ssleay32.dll from built zlib and openssl packages