编译 zsh
编译 zsh
-
安装依赖
ncurses
:sudo yum install ncurses-devel
-
在 zsh.sourceforge.io 下载源码
-
编译:
./configure --prefix=$HOME/.local make -j$(nproc) make install # 如果安装到系统目录则要使用 sudo
Troubleshooting
No terminal handling library was found on your system
configure: error: in `/usr/local/src/zsh-5.9':
configure: error: "No terminal handling library was found on your system.
This is probably a library called 'curses' or 'ncurses'. You may
need to install a package called 'curses-devel' or 'ncurses-devel' on your
system."
See `config.log' for more details
需要编译 ncurses 库,并将库安装路径添加到 LDFLAGS
环境变量:
export LDFLAGS="-L$HOME/.local/lib $LDFLAGS"
conflicting types for ‘boolcodes’
termcap.c:45:14: error: conflicting types for ‘boolcodes’; have ‘char *[]’
45 | static char *boolcodes[] = {
| ^~~~~~~~~
In file included from ../../Src/zshterm.h:1,
from ../../Src/zsh_system.h:932,
from ../../Src/zsh.mdh:15,
from termcap.mdh:15,
from termcap.c:38:
/data2/lx/.local/include/term.h:783:56: note: previous declaration of ‘boolcodes’ with type ‘const char * const[]’
783 | extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[];
| ^~~~~~~~~
make[3]: *** [Makefile:230: termcap.o] Error 1
这是我在 CentOS 7 服务器上遇到的问题,这个问题我没能解决。后来想出了一个 workaround:建立一个本地的 CentOS 7 虚拟机,在虚拟机上编译并安装 zsh,然后将安装目录上传到服务器即可。
本文作者:Undefined443
本文链接:https://www.cnblogs.com/Undefined443/p/18516882
版权声明:本作品采用署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步