| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 | ## 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.0.3.exe?downloadDownload msys:http://prdownloads.sf.net/mingw/MSYS-1.0.10.exe?downloadDownload the mingw developer tool kit:http://prdownloads.sf.net/mingw/msysDTK-1.0.1.exe?downloadDownload the mingw autoconf-2.59 update:http://prdownloads.sf.net/mingw/msys-autoconf-2.59.tar.bz2?downloadInstall mingw, msys and mingw-dtk.  Extract msys-autoconf-2.59.tar.bz2 intoyour 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 thisdirectory.Create a directory called "tor-mingw".Stage Two:  Download, extract, compile openssl----------------------------------------------Download openssl:http://www.openssl.org/source/openssl-0.9.8e.tar.gzExtract 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.gzExtract zlib:Copy the zlib tarball into the "tor-mingw" directoryType "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 patch libevent-1.3b------------------------------------------------------Download the libevent 1.3b 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"--------------------libevent 1.3b only-------------------------------------You need to manually edit the Makefile and remove all references to "sample".libevent 1.3b won't compile in mingw currently due to issues in event_test.c.Removing the "sample" directory and all references to it in Makefile create acompletely valid libevent library.  Libevent 1.3e and later should (withluck) not have this problem.  Libevent 1.3c and 1.3d won't work at all.-----------------------------------------------------------------------------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/DownloadRun 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/.
 |