Ads 468x60px


19 12月, 2014

cross compile wget 1.16 and openssl with ssl for mips

下載 wget

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

因為 ssl 需用到 openssl

所以下載 openssl

這次下載的是 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- CXX=/usr/local/msdk-4.3.6-mips-EL- ./Configure linux-mips -DB_ENDIAN linux:'  mips_lexra_fp_be-gcc'


在 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



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



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

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 ();


    case secure_protocol_tlsv1_2:

      meth = TLSv1_2_client_method ();




opensslv.h 裡說明 #define OPENSSL_VERSION_NUMBER    0x1000004fL

所以 0x1000004fL >= 0x01001000

所以會呼到到 TLSv1_2_client_method'

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

再 make  一次應該就過了

0 意見:


Blogger Templates