ubuntu22的make如何降级-CSDN博客
阿里云国内75折 回扣 微信号:monov8 |
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6 |
一、原因为什么要降级
直接使用apt安装make的时候,使用命令
sudo apt install make
安装完成后输入命令
make -v
显示make的版本是4.3用4.3会有全量编译的问题一个30s编译完的项目可能需要5分钟左右时间太长浪费时间。于是想进行降级因为在ubuntu20上是没有这种问题的打开ubuntu20看到make的版本是4.2.1而且这个版本的make没有问题。于是进行降级处理将4.3降级成4.2.1。
二、安装准备
卸载make
执行命令
sudo apt autoremove make
需要下载指定的make比如20版的4.2.1下载地址如下
放到linux系统下解压到指定位置
执行以下的命令
./configure
./build.sh
./make
sudo ./make install
即可安装成功。再次用4.2.1版本的make编译成功解决全量编译的问题。
三、问题解析
出现__alloca或者__stat的报错可以注释掉./glob/glob.c的宏定义即可
//#if !defined __alloca && !defined __GNU_LIBRARY__
# ifdef __GNUC__
# undef alloca
# define alloca(n) __builtin_alloca (n)
# else /* Not GCC. */
# ifdef HAVE_ALLOCA_H
# include <alloca.h>
# else /* Not HAVE_ALLOCA_H. */
# ifndef _AIX
# ifdef WINDOWS32
# include <malloc.h>
# else
extern char *alloca ();
# endif /* WINDOWS32 */
# endif /* Not _AIX. */
# endif /* sparc or HAVE_ALLOCA_H. */
# endif /* GCC. */
# define __alloca alloca
//#endif
//#ifndef __GNU_LIBRARY__
# define __stat stat
# ifdef STAT_MACROS_BROKEN
# undef S_ISDIR
# endif
# ifndef S_ISDIR
# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
# endif
//#endif