我編譯的tor 0.2.8.1-alpha win32可執行檔(單檔案版,不需要dll運行庫)

來源:互聯網
上載者:User

標籤:設定   否則   get   執行檔案   str   完成   efi   1.2   aws   

我編譯的tor 0.2.8.1-alpha win32可執行檔:

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

下載以後加exe尾碼即可使用(單檔案版,不需要dll運行庫,也就是說libeven,libgcc,zlib等dll檔案可以全部都刪掉)

從原始碼編譯windows版的tor是一件非常有挑戰性的事情(官方版一般會釋放最新版的tor原始碼,但是不釋放可執行檔,編譯linux版的tor很容易,但是編譯win版的tor卻很難了),有興趣嘗試的網友可以參考下面的教程:

視頻教程: http://www.mictronics.de/2014/04/how-to-build-tor-for-win32/

我精簡的文字教程:

1. 安裝好MinGW和MSYS等運行庫:
http://sourceforge.net/projects/mingw/files/latest/download

注意要用SS做全域代理,否則下載不成功。

到了MinGW Installation Manager的介面,注意把All packages都裝上。

然後設定系統內容變數:
PATH:                   添加:C:\MinGW\bin
BINARY_PATH        C:\MinGW\bin
INCLUDE_PATH    C:\MinGW\include
LIBRARY_PATH    C:\MinGW\lib

在C:\MinGW\msys\1.0\home\[USERNAME] 建立 tor-mingw目錄

下載openssl-1.0.2f, Zlib 1.2.8, Libevent 2.0.22-stable,Tor v0.2.8.1-alpha這四個壓縮包放進tor-mingw目錄。

如下:

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

啟動MSYS(啟動路徑: C:\MinGW\msys\1.0\msys.bat)

會出現一個類似linux的終端視窗:

然後 cd tor-mingw

1. 編譯安裝openssl:

執行下面的命令:

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

完成以後,編輯 Makefile 檔案,刪除其中的test: 和 tests:  部分:

然後繼續運行:
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分鐘可完成編譯

2. 編譯安裝Zlib:

cd ..
tar zxf zlib-1.2.8.tar.gz
cd zlib-1.2.8/
make -fwin32/Makefile.gcc

注意這三個系統內容變數一定要提前添加,否則編譯會失敗:BINARY_PATH, INCLUDE_PATH LIBRARY_PATH

繼續運行:
make install -fwin32/Makefile.gcc

Zlib編譯安裝完成

3. 編譯安裝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
整個過程會持續20分鐘左右

至此tor的win32編譯環境已經搭建好了。


4. 開始編譯tor的win32 exe檔案:

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

整個過程會持續30分鐘左右

完成以後,在src/or/目錄下可以找到編譯出來的tor.exe檔案,而且是單檔案版,不需要任何dll依賴庫即可獨立運行。

至此, tor的win32檔案編譯全部完成!

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

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

我編譯的tor 0.2.8.1-alpha win32可執行檔(單檔案版,不需要dll運行庫)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.