Centos7从源码安装GDB (gdb-8.3.1)
参考URL: https://blog.youkuaiyun.com/chiying9447/article/details/100731156
默认情况下,Centos7自带一个低版本的GDB,使用命令# gdb -v查看
- 官网gdb源码
我们需要从官网(http://www.gnu.org/software/gdb/)下载gdb-8.3.1.tar.gz源代码:
GDB官网–>Dowload面版–>SourcesSite–>gdb-8.3.1.tar.gz
- 解压
tar -zxvf gdb-8.3.1.tar.gz
- 编译安装
cd gdb-8.3.1/
./configure
make
make install
如果make install过程中报WARNING: ‘makeinfo’ is missing on your system.错。需要先通过命令# yum install texinfo安装texinfo,删除之前make的文件(make clean)重新编译安装。
yum 安装texinfo后,make install 还是报错,如下
missing makeinfo --split-size=5000000’
configure: current value: `makeinfo --split-size=5000000’
没有安装texinfo导致的gdb安装错误
参考URL: http://blog.chinaunix.net/uid-13627944-id-4028431.html
问题分析:
查看configure代码
vi configure
可以看到如下,configure命令会执行makeinfo --version查看版本,版本不匹配,就会报missing makeinfo
case " $build_configdirs " in
*" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;;
*)
# For an installed makeinfo, we require it to be from texinfo 4.7 or
# higher, else we use the "missing" dummy.
if ${MAKEINFO} --version \
| egrep 'texinfo[^0-9]*(4\.([7-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
:
else
MAKEINFO="$MISSING makeinfo"
fi
;;
esac
查看我们版本
[root@localhost gdb-8.3.1]# makeinfo --version
makeinfo (GNU texinfo) 5.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
[root@localhost gdb-8.3.1]#
可以看到这里在configure的时候,运行makeinfo --version,if下面的判断为 texinfo的版本为4.7以上的版本才行, 小于这个版本或者没有安装texinfo,则MAKEINFO为 $MISSING makeinfo。
这里我们的版本应该是满足了。
因此,判断原因是,虽然安装了texinfo,由于没有重新configure,MAKEINFO宏并没有改变。
于是删除编译目录的所有文件,重新解压源码,重新configure,make, make install。测试通过!
- 测试
[root@localhost gdb-8.3.1]# gdb -version
GNU gdb (GDB) 8.3.1
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
[root@localhost gdb-8.3.1]#
CentOS 安装Cmake
详细安装说明,官网说明如下:
https://cmake.org/install/
1 安装gcc gcc-c++
yum install -y gcc gcc-c++ make automake
-
下载Cmake源码
下载自己需要的版本
官网下载路径:https://cmake.org/download/ -
执行如下命令:
tar -zxvf cmake-3.16.0.tar.gz
cd cmake-3.16.0/
./configure
gmake
gmake install