Linux编译步骤概述

  Linux,一切皆文件!

linux环境下,编译源码文件步骤总结

01、下载解压

  一遍在开源网站有download/下载页面

02、安装基本编译环境

yum install -y gcc gcc-c++ make automake autoconf    //根据编译软件的特性选择安装 go/git/python.....

03、编译,安装

./configure --help      #查看编译参数选项

./configure --prefix=/data/tengine  -q     #-q quite
make -j 4 -s && make install -j 4 -s        #-j 多线程编译(有的时候不建议) -s silent

04、修改默认库文件搜索路径

/lib
/lib64
/usr/lib
/usr/lib64

/etc/ld.so.conf.d/
tengine.conf
vim tengine.conf
/data/tengine/lib
#通知系统重新搜索库文件(重载库文件)  lddconfig
ldconfig  -v |grep xxxx 

05、添加头文件

默认: /usr/include
ls -s[vf] /data/tengine/include/*  /usr/include/ #或者,建议选择下面的比较好
ls -s /data/tengine/include /usr/include/tegine

06、man文件路径

默认: /usr/share/man
man -M /MAN_DIR COMMAND #不建议,局限性
/etc/man.config添加一条MANPATH
man command #帮助命令

猜你喜欢

转载自www.cnblogs.com/xiaochina/p/9893602.html