2012-03-22 219 views
2

我試圖編譯wget與靜態鏈接,但我遇到了與ssl的問題。 我的設置沒有安裝SSL,所以我不得不編譯它自己,它似乎去確定,這是/ usr /本地/ SSH/lib目錄的上市:編譯wget與靜態鏈接,自我編譯(打開)ssl庫鏈接問題

/usr/local/ssl/lib> ls -la 
total 2000 
drwxr-xr-x 3 root root 4096 2012-03-22 14:28 . 
drwxr-xr-x 9 root root 4096 2012-03-22 14:28 .. 
-rw-r--r-- 1 root root 1752954 2012-03-22 14:28 libcrypto.a 
-rw-r--r-- 1 root root 272388 2012-03-22 14:28 libssl.a 
drw-r--r-- 2 root root 4096 2012-03-22 14:28 pkgconfig 

嘗試配置彙編:

wget-1.13> env LDFLAGS="-L/usr/local/ssh/lib" ./configure --with-ssl=openssl 
..... 
configure: error. openssl development libraries not found 

任何提示可能是什麼錯?我編譯了openssl for linux-elf

回答

2

好吧,看起來它是經典的「不能讀自己的寫作」的問題。 上面我試圖鏈接到ssh庫,而不是ssl O_o。

供將來參考,正確的程序鏈接和編譯OpenSSL的靜態wget的是:

$>env CPPFLAGS="-I/dir/to/openssl/include" LDFLAGS="-L/dir/to/ssl/lib" ./configure --with-ssl=openssl 

包括可以是即: 〜/ OpenSSL的/ OpenSSL的-0.9.8u /包括(頭用於在OpenSSL這是編譯) 庫可以在IE中: USR /本地/ SSL/lib目錄(文件夾包含libssl.a)

然後編譯:

$>make CPPFLAGS="-I/dir/to/openssl/include" LDFLAGS="-L/dir/to/ssl/lib -all-static" 

二進制文件將位於src文件夾中。

請注意,在某些系統上,-all-static選項應該是-static。

+0

你可以檢查https://stackoverflow.com/questions/44716613/compiling-wget-with-static-linking? TNX。 – 2017-06-23 08:27:46