Linux中通过源代码编译安装程序的过程可以简单描述为:
% ./configure
% make
% make install
其中./configure
配置脚本功能就是对你的系统做很多的测试,以用来检测出你的安装平台的目标特征,比如它会检测你是不是有CC或GCC,它是个shell脚本,是autoconf的工具的基本应用,它会产生一个输出文件./Makefiles
,接下来make程序通过该文件来实现编译。configure脚本有大量的命令行选项,对不同的软件包来说,这些选项可能会有变化,但是许多基本的选项是不会改变的。configure脚本位于待安装程序源码根目录下面,会有一个configure可执行文件,使用./configure --help
命令就可以看到可用的所有选项,尽管许多选项是很少用到的,但是当你为了特殊的需求而configure一个包时,知道他们的存在是很有益处的。
1. 配置区【Configuration】
这块内容主要是对./configure脚本本身运行的过程进行配置,如是否显示运行结果给用户,是否创建cache文件等。
-h, --help #display this help and exit
--help=short #display options specific to this package
--help=recursive #display the short help of all the included packages
-V, --version #display version information and exit
-q, --quiet, --silent #do not print 'checking...' messages
--cache-file=FILE #cache test results in FILE [disabled]
-C, --config-cache #alias for '--cache-file=config.cache'
-n, --no-create #do not create output files