Linux下源码安装的配置(configure)步骤之--prefix
2017-12-06 15:37
435 查看
Linux下源码的安装一般由3个步骤组成:配置(configure)、编译(make)、安装(make install)。具体的安装方法一般作者都会给出文档,这里主要讨论配置(configure)。
-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(指定安装目录)选项。
--prefix=/usr/local/nagios执行成功后再编译、安装(make,make install。
安装完成将自动生成目录 /usr/local/nagios,而且该软件所有的文件都被复制到这个目录。
为什么要指定这个安装目录?
①维护方便,如果没有用这个选项,安装过程结束后,该软件所需的软件被复制到不同的系统目录下,很难弄清楚到底复制了那些文件、都复制到哪里去了。
②方便卸载软件或移植软件。当某个安装的软件不再需要时,只须简单的删除该安装目录,就可以把软件卸载得干干净净;移植软件只需拷贝整个目录到另外一个机器即可(相同的操作系统)。
当然要卸载程序,也可以在原来的make目录下用一次make uninstall,但前提是make文件指定过uninstall。
配置(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(指定安装目录)选项。
--prefix(指定安装目录)选项
这里以安装nagios-3.4.3为例,将它安装到目录 /usr/local/nagios下,就在nagios-3.4.3目录执行带选项的脚本./configure--prefix=/usr/local/nagios执行成功后再编译、安装(make,make install。
安装完成将自动生成目录 /usr/local/nagios,而且该软件所有的文件都被复制到这个目录。
为什么要指定这个安装目录?
①维护方便,如果没有用这个选项,安装过程结束后,该软件所需的软件被复制到不同的系统目录下,很难弄清楚到底复制了那些文件、都复制到哪里去了。
②方便卸载软件或移植软件。当某个安装的软件不再需要时,只须简单的删除该安装目录,就可以把软件卸载得干干净净;移植软件只需拷贝整个目录到另外一个机器即可(相同的操作系统)。
当然要卸载程序,也可以在原来的make目录下用一次make uninstall,但前提是make文件指定过uninstall。
相关文章推荐
- Linux程序源码编译安装的configure配置详解
- linux环境下go1.8安装配置具体步骤(二进制部署和源码编译部署)
- Linux程序源码编译安装的configure配置详解
- Linux程序源码编译安装的configure配置详解
- Linux下软件源码编译安装的configure配置详解
- Linux下源码编译安装配置SVN服务器的步骤分享
- Linux程序源码编译安装的configure配置详解
- Linux程序源码编译安装的configure配置详解
- (转)Linux源码安装过程中选项—prefix的作用
- Linux 安装oracle10g 配置dataguard 介绍和步骤
- linux 配置及安装jdk,tomcat 详细步骤。
- php源码安装时configure配置参数
- Linux 源码安装软件之 configure 参数解释
- linux笔记—-mysql 数据库安装与配置(源码)
- Linux的配置安装步骤
- arm-linux-gcc-4.3.2.tgz 安装配置步骤
- Linux源码安装过程中选项prefix
- Linux源码安装过程中选项—prefix的作用
- linux下安装配置svn独立服务器的步骤分享
- Linux下利用makefile.am和configure.in产生可安装源码包过程整理