2006-09-12 04:58:33 +02:00
|
|
|
## Instructions for building Tor with MinGW (http://www.mingw.org/)
|
|
|
|
##
|
2006-09-11 05:46:00 +02:00
|
|
|
|
|
|
|
Stage One: Download and Install MinGW.
|
|
|
|
---------------------------------------
|
|
|
|
|
|
|
|
Download mingw:
|
2006-09-12 04:58:33 +02:00
|
|
|
http://prdownloads.sf.net/mingw/MinGW-5.0.3.exe?download
|
|
|
|
|
|
|
|
Download msys:
|
2006-09-11 05:46:00 +02:00
|
|
|
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
|
|
|
|
|
2007-03-18 14:47:08 +01:00
|
|
|
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.
|
2006-09-12 04:58:33 +02:00
|
|
|
|
2006-09-23 21:17:08 +02:00
|
|
|
Create a directory called "tor-mingw".
|
|
|
|
|
2006-09-12 04:58:33 +02:00
|
|
|
Stage Two: Download, extract, compile openssl
|
|
|
|
----------------------------------------------
|
|
|
|
|
|
|
|
Download openssl:
|
2006-10-17 04:16:04 +02:00
|
|
|
http://www.openssl.org/source/openssl-0.9.8d.tar.gz
|
2006-09-12 04:58:33 +02:00
|
|
|
|
|
|
|
Extract openssl:
|
2006-09-23 21:17:08 +02:00
|
|
|
Copy the openssl tarball into the "tor-mingw" directory.
|
|
|
|
Type "cd tor-mingw/"
|
2006-10-17 04:16:04 +02:00
|
|
|
Type "tar zxf openssl-0.9.8d.tar.gz"
|
2006-09-23 21:17:08 +02:00
|
|
|
|
|
|
|
Make openssl libraries:
|
2006-10-17 04:16:04 +02:00
|
|
|
Type "cd tor-mingw/openssl-0.9.8d/"
|
2006-09-23 21:17:08 +02:00
|
|
|
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"
|
2006-09-12 04:58:33 +02:00
|
|
|
|
|
|
|
Alternatively:
|
|
|
|
Download the pre-compiled openssl for win32.
|
|
|
|
Install and proceed.
|
|
|
|
|
2006-09-11 05:46:00 +02:00
|
|
|
|
2006-09-12 04:58:33 +02:00
|
|
|
Stage Three: Download, extract, compile zlib
|
|
|
|
---------------------------------------------
|
|
|
|
|
|
|
|
Download zlib source:
|
|
|
|
http://www.zlib.net/zlib-1.2.3.tar.gz
|
|
|
|
|
|
|
|
Extract zlib:
|
2006-09-23 21:17:08 +02:00
|
|
|
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
|
2006-09-12 04:58:33 +02:00
|
|
|
|
|
|
|
Make zlib1.dll:
|
2006-09-25 07:59:13 +02:00
|
|
|
Type "cd tor-mingw/zlib-1.2.3/"
|
2006-09-23 21:17:08 +02:00
|
|
|
Type "./configure"
|
|
|
|
Type "make -f win32/Makefile.gcc"
|
2006-09-12 04:58:33 +02:00
|
|
|
|
|
|
|
Done.
|
|
|
|
|
|
|
|
|
|
|
|
Stage Four: Download, extract, and patch libevent-1.1b.
|
2006-09-11 05:46:00 +02:00
|
|
|
------------------------------------------------------
|
|
|
|
|
2007-03-18 14:47:08 +01:00
|
|
|
Download the latest libevent release:
|
2006-09-11 05:46:00 +02:00
|
|
|
http://www.monkey.org/~provos/libevent/
|
|
|
|
|
2006-09-23 21:17:08 +02:00
|
|
|
Copy the libevent tarball into the "tor-mingw" directory.
|
|
|
|
Type "cd tor-mingw"
|
2006-09-11 05:46:00 +02:00
|
|
|
|
2007-03-18 14:47:08 +01:00
|
|
|
Extract libevent.
|
2006-09-11 05:46:00 +02:00
|
|
|
|
2006-09-23 21:17:08 +02:00
|
|
|
Type "./configure --enable-static --disable-shared"
|
2007-03-09 01:16:35 +01:00
|
|
|
--------------------libevent 1.3b only---------------------------------------
|
2007-02-26 02:40:48 +01:00
|
|
|
You need to manually edit the Makefile and remove all references to "sample".
|
2007-03-09 01:16:35 +01:00
|
|
|
libevent 1.3b won't compile in mingw currently due to issues in event_test.c.
|
2007-02-26 02:40:48 +01:00
|
|
|
Removing the "sample" directory and all references to it in Makefile create a
|
|
|
|
completely valid libevent library.
|
|
|
|
-----------------------------------------------------------------------------
|
2006-09-23 21:17:08 +02:00
|
|
|
Type "make"
|
|
|
|
Type "make install"
|
2006-09-12 04:58:33 +02:00
|
|
|
|
|
|
|
Stage Five: Build Tor
|
|
|
|
----------------------
|
|
|
|
|
2006-09-23 21:17:08 +02:00
|
|
|
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"
|
2006-09-12 04:58:33 +02:00
|
|
|
|
2006-09-23 21:17:08 +02:00
|
|
|
cd tor-<version>
|
2007-07-14 04:32:19 +02:00
|
|
|
Type "./configure --enable-eventdns --enable-static --disable-shared"
|
2006-09-23 21:17:08 +02:00
|
|
|
Type "make"
|
2006-09-11 05:46:00 +02:00
|
|
|
|
2006-09-22 17:08:05 +02:00
|
|
|
You now have a tor.exe in src/or/. This is Tor.
|
2006-09-23 21:17:08 +02:00
|
|
|
You now have a tor_resolve.exe in src/tools/.
|
2007-03-18 14:47:08 +01:00
|
|
|
|
|
|
|
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/.
|
|
|
|
|