Ads 468x60px

##EasyReadMore##

19 12月, 2014

cross compile wget 1.16 and openssl with ssl for mips

下載 wget

http://ftp.gnu.org/gnu/wget/

這次下載的是 wget-1.16.tar.gz

因為 ssl 需用到 openssl

所以下載 openssl

https://www.openssl.org/source/

這次下載的是 openssl-1.0.0o.tar.gz


版本要對 不然編不過


compile openssl:


tar xvzf openssl-1.0.0o.tar.gz


cd openssl-1.0.0o


CC=/usr/local/msdk-4.3.6-mips-EL-2.6.12.6-0.9.30.3/bin/mipsel-linux-gcc CXX=/usr/local/msdk-4.3.6-mips-EL-2.6.12.6-0.9.30.3/bin/mipsel-linux-g++ ./Configure linux-mips -DB_ENDIAN linux:'  mips_lexra_fp_be-gcc'

make




在 apps 下會找到 openssl



compile wget:



tar xvzf wget-1.16.tar.gz


cd wget-1.16



可以先看看 configure –help


--with-libssl-prefix[=DIR]  search for libssl in DIR/include and DIR/lib


可以看到 openssl 下要有存有 .a 的 lib 的目錄


cd openssl-1.0.0o


mkdir lib



mv *.a lib




--with-openssl          use libcrypto hash routines. Valid ARGs are: 'yes',

                          'no', 'auto' => use if available, 'optional' => use


                          if available and warn if not available; default is


                          'no'



所以將以上兩個參數加進指令中



CC=/usr/local/msdk-4.3.6-mips-EL-2.6.12.6-0.9.30.3/bin/mips-linux-gcc CXX=/usr/local/msdk-4.3.6-mips-EL-2.6.12.6-0.9.30.3/bin/mipsel-linux-g++ ./configure --with-libssl-prefix=/home/sd10/790/trunk/web_function/wget/openssl-1.0.0o --host=mips-linux --with-ssl=openssl

make




 



若上面參數下錯 可能會出現:



configure: error: openssl development library not found for MD5



configure: error: --with-ssl=gnutls was given, but GNUTLS is not available.



configure: error: --with-ssl=openssl was given, but SSL is not available.



若出現下列錯誤:



/home/sd10/790/trunk/web_function/wget/wget-1.16/src/openssl.c:224: undefined reference to `TLSv1_2_client_method'

/home/sd10/790/trunk/web_function/wget/wget-1.16/src/openssl.c:221: undefined reference to `TLSv1_1_client_method'


collect2: ld returned 1 exit status



搜詢”TLSv1_2_client_method' “



會找到在 openssl.c 裡



因為錯誤呼到到 TLSv1_1_client_method



找到



#if OPENSSL_VERSION_NUMBER >= 0x01001000

    case secure_protocol_tlsv1_1:


      meth = TLSv1_1_client_method ();


      break;


    case secure_protocol_tlsv1_2:


      meth = TLSv1_2_client_method ();


      break;


#endif




搜尋 “OPENSSL_VERSION_NUMBER”



opensslv.h 裡說明 #define OPENSSL_VERSION_NUMBER    0x1000004fL



所以 0x1000004fL >= 0x01001000



所以會呼到到 TLSv1_2_client_method'



改成 #if OPENSSL_VERSION_NUMBER >= 0x10001000 (此問題在 wget 1.16.1 有修正)



再 make  一次應該就過了



http://goo.gl/kBKPuE

0 意見:

張貼留言

 
Blogger Templates