curl -O https://ftp.gnu.org/gnu/ncurses/ncurses-6.5.tar.gz
tar -zxf ncurses-6.5.tar.gz && cd ncurses-6.5
./configure --disable-shared && make -j4
sudo make install
sudo ln -s /usr/local/include/ncursesw/curses.h /usr/local/include/ncurses.h # so Emacs can #include <ncurses.h>
# ...
sed -i '' '/darwin/ s/lncurses/lncursesw/g' configure.ac # before ./autogen.sh
出此下策(用 sed 替换 configure.ac)是因为它被写死了
# line 6155-6160
case "$opsys$REALLY_ANDROID" in
## darwin: Prevents crashes when running Emacs in Terminal.app under 10.2.
## The ncurses library has been moved out of the System framework in
## Mac OS X 10.2. So if configure detects it, set the command-line
## option to use it.
darwin) LIBS_TERMCAP="-lncurses" ;;
AC_PATH_PROG([INSTALL_INFO], [install-info], [:],
[$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin])
dnl Don't use GZIP, which is used by gzip for additional parameters.
AC_PATH_PROG([GZIP_PROG], [gzip])
test $with_compress_install != yes && test -n "$GZIP_PROG" && \
GZIP_PROG=" # $GZIP_PROG # (disabled by configure --without-compress-install)"