linux中,安装程序,指定路径./configure --prefix=/ABC

本文详细解释了Linux中源代码编译程序如何通过`--prefix`参数进行安装,以及安装后目录结构如何影响程序的使用。强调了`--prefix /usr`作为默认值的优势,并对比了Windows与Linux在程序安装目录管理上的差异。
在LINUX中的源代码编译程序都遵守一个规则,就是以指定的目录为相对目录,安装程序,例如,安装前./configure --prefix=/ABC

那么,安装后,在/ABC下就有对于这个程序的/ABC/include该程序的头文件目录 /ABC/etc该程序的配置目录,/ABC/bin该程序应用目录等,这时,我们直接打应用程序名就不可能运行得起来,因为PATH变量里没有指向/ABC/bin应用目录,所以运行要用绝对路径/ABC/bin/application_name

所以通常我们./configure的时候,默认是--prefix=/usr,这样的话,本程序的配置文件就会装到/usr/etc,应用文件就会安装到/usr/bin,本程序的私有库也会安装到/usr/lib等等,,我们也不用设置PATH就可以直接用了,,

 

注意:windows下,我们一般是把应用程序装到自己的目录,在卸载程序不能用的时候,可以能过强制删除应用目录来节省空间。

在LINUX下,--prefix=/ABC,以后,也实现了这个功能,,以后我们要删除,就直接删得比WINDOWS更彻底,

因为windows把所有程序的配置文件都放到注册表管理,要是在直接删目录的情况下,是删不干净的,,而LINUX的驱动程序则不同,他每个程序的配置文件都几乎是放在安装目录下的/etc子文件夹,应用文件都是安装在安装目录下的/bin子文件夹,库文件也是安装在安装目录下的/lib文件夹,这样一删就全删了,,可以说是绿色。。

正是LINUX的这种规定,使得目录存放得更加清楚,简便。

./configure --prefix=/usr/local/nginx checking for OS Linux 3.10.0-1160.71.1.el7.x86_64 x86_64 checking for C compiler ... found using GNU C compiler gcc version: 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) checking for gcc -pipe switch ... found checking for -Wl,-E switch ... found checking for gcc builtin atomic operations ... found checking for C99 variadic macros ... found checking for gcc variadic macros ... found checking for gcc builtin 64 bit byteswap ... found checking for unistd.h ... found checking for inttypes.h ... found checking for limits.h ... found checking for sys/filio.h ... not found checking for sys/param.h ... found checking for sys/mount.h ... found checking for sys/statvfs.h ... found checking for crypt.h ... found checking for Linux specific features checking for epoll ... found checking for EPOLLRDHUP ... found checking for EPOLLEXCLUSIVE ... not found checking for eventfd() ... found checking for O_PATH ... found checking for sendfile() ... found checking for sendfile64() ... found checking for sys/prctl.h ... found checking for prctl(PR_SET_DUMPABLE) ... found checking for prctl(PR_SET_KEEPCAPS) ... found checking for capabilities ... found checking for crypt_r() ... found checking for sys/vfs.h ... found checking for BPF sockhash ... not found checking for SO_COOKIE ... not found checking for UDP_SEGMENT ... not found checking for nobody group ... found checking for poll() ... found checking for /dev/poll ... not found checking for kqueue ... not found checking for crypt() ... not found checking for crypt() in libcrypt ... found checking for F_READAHEAD ... not found checking for posix_fadvise() ... found checking for O_DIRECT ... found checking for F_NOCACHE ... not found checking for directio() ... not found checking for statfs() ... found checking for statvfs() ... found checking for dlopen() ... not found checking for dlopen() in libdl ... found checking for sched_yield() ... found checking for sched_setaffinity() ... found che
最新发布
09-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值