I compiled Tor 0.2.8.1-alpha Win32 executable (single file version, no DLL runtime required)

Source: Internet
Author: User
Tags install openssl

I compiled the Tor 0.2.8.1-alpha Win32 executable file:

Https://copy.com/jCtGAv6qMnpLFPjv/tor?download=1

After downloading the exe suffix can be used (single file version, no need DLL runtime, that is, libeven,libgcc,zlib and other DLL files can be deleted)

Compiling the Windows version of Tor from source code is a very challenging task (the official version generally releases the latest version of the Tor source code, but does not release the executable, compiling the Linux version of Tor is easy, but compiling the win version of Tor is difficult), Interested users can refer to the following tutorial:

Video Tutorial: http://www.mictronics.de/2014/04/how-to-build-tor-for-win32/

My Streamlined text tutorial:

1. Install the MinGW and Msys runtime libraries:
Http://sourceforge.net/projects/mingw/files/latest/download

Note to use the SS as the global agent, otherwise the download is unsuccessful.

To the interface of MinGW Installation Manager, take care to load all packages.

Then set the system environment variable:
PATH: Added: C:\MinGW\bin
Binary_path C:\MinGW\bin
Include_path C:\MinGW\include
Library_path C:\MinGW\lib

Create a new Tor-mingw directory in C:\mingw\msys\1.0\home\[username]

Download openssl-1.0.2f, Zlib 1.2.8, Libevent 2.0.22-stable,tor v0.2.8.1-alpha These four compressed packages into the TOR-MINGW directory.

As follows:

Https://www.openssl.org/source/openssl-1.0.2f.tar.gz

Http://zlib.net/zlib-1.2.8.tar.gz

Https://github-cloud.s3.amazonaws.com/releases/1856976/b8683cb6-0519-11e5-817f-053e621a8f47.gz? X-amz-algorithm=aws4-hmac-sha256&x-amz-credential=akiaistnzfovbijmk3tq%2f20160209%2fus-east-1%2fs3%2faws4_ Request&x-amz-date=20160209t122641z&x-amz-expires=300&x-amz-signature= E93065fddeabd1cab93fb51f0bd4f765cd8eda830c0e006a7f72c247efe4c096&x-amz-signedheaders=host&actor_id= 11530991&response-content-disposition=attachment%3b%20filename%3dlibevent-2.0.22-stable.tar.gz& Response-content-type=application%2foctet-stream

Https://dist.torproject.org/tor-0.2.8.1-alpha.tar.gz

Start Msys (boot path: C:\MinGW\msys\1.0\msys.bat)

A Linux-like terminal window will appear:

Then CD TOR-MINGW

1. Compile and install OpenSSL:

Execute the following command:

Tar zxf openssl-1.0.2f.tar.gz

CD openssl-1.0.2f
./configure-no-idea-no-rc5-no-mdc2-no-shared-dopenssl_no_heartbeats-dopenssl_no_rdrand MinGW

When you are finished, edit the Makefile file and delete the test: and Tests: section:

Then continue to run:
Rm-rf./test
CD Crypto
Find./-name "*.h"-exec cp {}.. /include/openssl/\;
Cd.. /ssl/
Find./-name "*.h"-exec cp {}.. /include/openssl/\;
Cd..
CP *.h include/openssl/
Make depend
Make
Make install

20-30 minutes to complete compilation

2. Compile and install Zlib:

Cd..
Tar zxf zlib-1.2.8.tar.gz
CD zlib-1.2.8/
make-fwin32/makefile.gcc

Note that these three system environment variables must be added in advance, or the compilation will fail: Binary_path, Include_path Library_path

Continue running:
Make INSTALL-FWIN32/MAKEFILE.GCC

Zlib Compilation and Installation complete

3. Compile and install Libevent:

Cd..
Tar zxf libevent-2.0.22-stable.tar.gz
CD libevent-2.0.22-stable
./configure--enable-static--disable-shared
Make
Make install
The whole process will last about 20 minutes.

The Win32 build environment for Tor has been set up so far.


4. Start compiling Tor's Win32 EXE file:

Cd..
Tar zxf tor-0.2.8.1-alpha.tar.gz
CD Tor-0.2.8.1-alpha
./configure--disable-gcc-hardening--enable-static-libevent--enable-static-openssl--enable-static-zlib-- With-libevent-dir=. /libevent-2.0.22-stable/--with-openssl-dir=. /openssl-1.0.2f/--with-zlib-dir=. /zlib-1.2.8/
Make

The whole process will last about 30 minutes.

Once completed, the compiled Tor.exe file can be found in the src/or/directory, and it is a single-file version that does not require any DLL-dependent libraries to run independently.

At this point, Tor's Win32 file compilation is complete!

Https://groups.google.com/forum/?hl=zh-CN#!topic/fqlt/uaWV8dq9a-I

Http://www.oschina.net/p/tor

I compiled Tor 0.2.8.1-alpha Win32 executable (single file version, no DLL runtime required)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.