此隨便記錄一下編譯openssl時遇到的各種問題以及解決辦法。
點擊此處下載 OpenSSL(version-1.0.1e)
linux 64位系統編譯32位版本:
setarch i386 ./Configure linux-generic32 no-shared -m32 setarch i386 make
setarch i386 make install make test
交叉編譯 (mips),步驟如下:
1.設置環境變量
export STAGING_DIR=/path/to/toolchain
export PATH=$PATH:/path/to/toolchain/bin
2.進入openssl根目錄,執行config命令,設置參數--prefix, --cross-compile-prefix以及相關參數
.config --prefix=/path/to/you/defined/build-mips --cross-compile-prefix=mips-openwrt-linux-uclibc- no-shared no-asm no-apps
3. 編輯生成的Makefile文件:
(a) 在x86_64(uname -m)系統上,將字符串"linux-x86_64"替換成“mips”, 刪除所有的"-m64"選項
(b) 在x86系統上,將字符串“linux-elf”替換成“mips”, 刪除所有的"-march"選項
4. 執行編譯(make)和安裝(make install)