Linux下./configure --prefix命令用法
时间:2014-11-29 05:29 来源:linux.it.net.cn 作者:IT
在linux系统下,源码的安装一般由3个步骤组成:
配置(configure)、编译(make)、安装(make install)。
具体安装方法一般作者都会给出文档,这里主要讨论配置(configure)。
Configure是一个可执行脚本,它有很多选项,使用命令./configure –help输出详细的选项列表,如下:
代码示例:
-bash-3.00# ./configure --help
Usage: configure [options] [host]
Options: [defaults in brackets after descriptions]
Configuration:
--cache-file=FILE cache test results in FILE
--help print this message
--no-create do not create output files
--quiet, --silent do not print `checking...' messages
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[same as prefix]
--bindir=DIR user executables in DIR [EPREFIX/bin]
……….(省略若干)
很多的选项,个人认为,可以忽略其他的一切,但请把—prefix加上。
这里以安装supersparrow-0.0.0为例,打算把它安装到目录 /usr/local/supersparrow,于是在supersparrow-0.0.0目录执行带选项的脚本:
代码示例:
./configure --prefix=/usr/local/supersparrow
执行成功后再编译、安装(make,make install);
安装完成将自动生成目录supersparrow,而且该软件所有的文件都被复制到这个目录。
为什么要指定这个安装目录?
是为了以后的维护方便,如果没有用这个选项,安装过程结束后,该软件所需的软件被复制到不同的系统目录下,很难弄清楚到底复制了那些文件、都复制到哪里去了—基本上是一塌糊涂。
用了—prefix选项的另一个好处是卸载软件或移植软件。
当某个安装的软件不再需要时,只须简单的删除该安装目录,就可以把软件卸载得干干净净;
移植软件只需拷贝整个目录到另外一个机器即可(相同的操作系统)。
一个小选项有这么方便的作用,建议在实际工作中多多使用。
在linux下,小编建议大家一直采用编译源码的方式安装软件,个中原因,日子久了你就会深有体会的。
(责任编辑:IT)
在linux系统下,源码的安装一般由3个步骤组成: 具体安装方法一般作者都会给出文档,这里主要讨论配置(configure)。
Configure是一个可执行脚本,它有很多选项,使用命令./configure –help输出详细的选项列表,如下: -bash-3.00# ./configure --help Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print `checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [/usr/local] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] ……….(省略若干) 很多的选项,个人认为,可以忽略其他的一切,但请把—prefix加上。
这里以安装supersparrow-0.0.0为例,打算把它安装到目录 /usr/local/supersparrow,于是在supersparrow-0.0.0目录执行带选项的脚本: ./configure --prefix=/usr/local/supersparrow 执行成功后再编译、安装(make,make install); 安装完成将自动生成目录supersparrow,而且该软件所有的文件都被复制到这个目录。
为什么要指定这个安装目录?
用了—prefix选项的另一个好处是卸载软件或移植软件。 一个小选项有这么方便的作用,建议在实际工作中多多使用。 在linux下,小编建议大家一直采用编译源码的方式安装软件,个中原因,日子久了你就会深有体会的。 (责任编辑:IT) |