%general-entities; ]> ncurses &ncurses-version;
&ncurses-url;
Ncurses-&ncurses-version; Ncurses <para>Ncurses 软件包包含终端无关的字符屏幕处理库。</para> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> <seg>&ncurses-ch6-sbu;</seg> <seg>&ncurses-ch6-du;</seg> </seglistitem> </segmentedlist> </sect2> <sect2 role="installation"> <title>安装 Ncurses 输入以下命令,使构建系统不安装一个 configure 脚本未处理的静态库: sed -i '/LIBTOOL_INSTALL/d' c++/Makefile.in 准备安装 Ncurses: ./configure --prefix=/usr \ --mandir=/usr/share/man \ --with-shared \ --without-debug \ --without-normal \ --enable-pc-files \ --enable-widec 新的配置选项的含义: --enable-widec 该选项使得宽字符库(例如 libncursesw.so.&ncurses-version; ) 被构建,而不构建常规字符库(例如 libncurses.so.&ncurses-version;)。 宽字符库在多字节和传统 8 位 locale 中都能工作, 而常规字符库只能在 8 位 locale 中工作。 宽字符库和普通字符库在源码层面是兼容的,但二进制不兼容。 --enable-pc-files 该参数使得构建系统生成并安装 pkg-config 使用的 .pc 文件。 --without-normal 该选项禁止构建系统编译并安装多数静态库。 编译该软件包: make 该软件包有测试套件,但只能在安装该软件包后才能运行。 测试用例位于 test/ 中, 阅读其中的 README 文件了解更多细节。 安装该软件包: make install 将共享库移动到期望的 /lib 目录: mv -v /usr/lib/libncursesw.so.6* /lib 由于共享库被移走了,一个符号链接指向了不存在的文件。 重新创建它: ln -sfv ../../lib/$(readlink /usr/lib/libncursesw.so) /usr/lib/libncursesw.so 许多程序仍然希望链接器能够找到非宽字符版本的 Ncurses 库。 通过使用符号链接和链接脚本,诱导它们链接到宽字符库: for lib in ncurses form panel menu ; do rm -vf /usr/lib/lib${lib}.so echo "INPUT(-l${lib}w)" > /usr/lib/lib${lib}.so ln -sfv ${lib}w.pc /usr/lib/pkgconfig/${lib}.pc done 最后,确保那些在构建时寻找 -lcurses 的老式程序仍然能够构建: rm -vf /usr/lib/libcursesw.so echo "INPUT(-lncursesw)" > /usr/lib/libcursesw.so ln -sfv libncurses.so /usr/lib/libcurses.so 如果需要的话,安装 Ncurses 文档: mkdir -v /usr/share/doc/ncurses-&ncurses-version; cp -v -R doc/* /usr/share/doc/ncurses-&ncurses-version; 上述指令没有创建非宽字符的 Ncurses 库, 因为从源码编译的软件包不会在运行时链接到它。 然而,已知的需要链接到非宽字符 Ncurses 库的二进制程序都需要版本 5,如果您为了满足一些仅有二进制版本的程序,或者满足 LSB 兼容性, 必须安装这样的库,执行以下命令再次构建该软件包: make distclean ./configure --prefix=/usr \ --with-shared \ --without-normal \ --without-debug \ --without-cxx-binding \ --with-abi-version=5 make sources libs cp -av lib/lib*.so.5* /usr/lib Ncurses 的内容 安装的程序 安装的库 安装的目录 captoinfo (链接到 tic), clear, infocmp, infotocap (链接到 tic), ncursesw6-config, reset (链接到 tset), tabs, tic, toe, tput, 以及 tset libcursesw.so (指向 libncursesw.so 的符号链接和链接脚本), libformw.so, libmenuw.so, libncursesw.so, libncurses++w.a, libpanelw.so, 以及它们的库名称没有 w 的非宽字符替代品 /usr/share/tabset, /usr/share/terminfo, 以及 /usr/share/doc/ncurses-&ncurses-version; 简要描述 captoinfo 将 termcap 描述转换成 terminfo 描述 captoinfo clear 如果可能的话,清空屏幕 clear infocmp 比较或输出 terminfo 描述 infocmp infotocap 将 terminfo 描述转化为 termcap 描述 infotocap ncursesw6-config 提供 ncurses 的配置信息 ncursesw6-config reset 以终端默认值重新初始化终端 reset tabs 清除并设置终端的 tab 宽度 tabs tic Terminfo 条目描述编译器,将 terminfo 文件从源代码格式翻译为 ncurses 库子程序需要的二进制格式 [terminfo 文件包含特定终端的功能信息。] tic toe 列出所有可用的终端类型,并给出每种类型的主要名称和描述 toe tput 使 shell 可以使用终端相关的功能;也可以重置或初始化终端, 或者报告它的长名称 tput tset 可以被用于初始化终端 tset libcursesw 指向 libncursesw 的链接 libcursesw libncursesw 包含在终端屏幕上以多种复杂方式显示文本的函数; 使用这些函数的典型例子是运行内核的 make menuconfig 时显示的目录。 libncursesw libformw 包含实现表单的函数 libformw libmenuw 包含实现目录的函数 libmenuw libpanelw 包含实现面板的函数 libpanelw