常用C/C++库文件交叉编译步骤

## openssl
setarch i386 ./config no-asm shared no-async --prefix=$(pwd)/install --cross-compile-prefix=mipsel-openwrt-linux-uclibc-
# 打开Makefile,删除里面所有的-m64和-m32编译选项。
make
make install

## zlib
export CC=mipsel-openwrt-linux-uclibc-gcc
./configure --prefix=$(pwd)/install
make
make install

## curl 1
./configure --host=mipsel-openwrt-linux-uclibc --target=mipsel-openwrt-linux-uclibc CC=mipsel-openwrt-linux-uclibc-gcc --with-zlib=/home/moore/toolchain/OpenWrt-Toolchain-ramips-mt7688/3th-party/zlib-1.2.11/install --with-ssl=/home/moore/toolchain/OpenWrt-Toolchain-ramips-mt7688/3th-party/openssl-1.1.1g/install --enable-shared --enable-static --disable-threaded-resolver --prefix=$(pwd)/install
## curl 2
./configure --host=mipsel-openwrt-linux-uclibc --target=mipsel-openwrt-linux-uclibc CC=mipsel-openwrt-linux-uclibc-gcc --with-ssl=/home/moore/toolchain/OpenWrt-Toolchain-ramips-mt7688/3th-party/openssl-1.1.1g/install --enable-shared --enable-static --disable-threaded-resolver --prefix=$(pwd)/install
make
make install

你可能感兴趣的:(embedded,C/Cpp)