1:简单的软件直接打开Make 或者编译过程包含的配置文件修改工具链和编译选项,链接选项即可
2:带configure 脚本的可以./configure --help 支持那些选项配置比如如下带openssl 的curl库的编译
./configure --enable-shared --enable-static --prefix=/home/binbin/workspace/curl-7.62.0/output --host=mips-linux-gnu --with-pic --with-ssl=/home/binbin/workspace/openssl-1.0.2p/output CFLAGS="-muclibc -march=mips32r2" LDFLAGS="-muclibc -L/home/binbin/workspace/openssl-1.0.2p/output/lib"
--prefix 是安装目录配置
--host 是交叉编译工具链平台 cross-compile to build programs to run on HOST
一般还可以设置以下变量
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
LT_SYS_LIBRARY_PATH
User-defined run-time library search path.
一般需要如下基础软件配置包
sudo apt-get install autoconf
sudo apt-get install automake
sudo apt-get install libtool