如何链接GNU readline库而不是macosx中的libedit?

Chr*_*ris 7 macos perl gnu readline libreadline

试图在macosx上构建Term-Readline-Gnu,无法抱怨libedit并建议使用gnu readline.我怎么做?

这是我尝试过的尝试之一:

首先我静态构建了GNU libreadline v6.2,但没有安装它 - 以确保我没有搞砸具有相同名称的系统版本:

./configure --prefix =/Users/Fred/Downloads/tmp1

使

make install-static

然后尝试构建Term_Readline-Gnu-1.20

cmc:Term-ReadLine-Gnu-1.20 cmc $ perl Makefile.PL --includedir =/Users/cmc/Downloads/tmp1/include --libdir =/Users/Fred/Downloads/tmp1/lib

找到`/usr/lib/libtermcap.dylib'.

gcc-4.2 -I/Users/Fred/Downloads/tmp1/include -arch x86_64 -arch i386 -arch ppc -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -I/usr/local/include -DHAVE_STRING_H rlver.c -o rlver -L/Users/Fred/Downloads/tmp1/lib -arch x86_64 -arch i386 -arch ppc -L/usr/local/lib -lreadline -ltermcap

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!

您正在使用的libreadline是libedit库.使用GNU Readline Library.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!

克里斯

Mr.*_*. L 7

是一篇很棒的文章,解释了如何通过几个简单的步骤解决OP的问题:

brew install readline

brew link --force readline

cpanm Term::ReadLine::Gnu

brew unlink readline

校验

brew info readline | head -1
Run Code Online (Sandbox Code Playgroud)


Mis*_*rEd 0

看来 GNU readline 库不在/Users/Fred/Downloads/tmp1/lib.

首先确保该库已安装。如果您有 Mac 端口:

sudo port install readline
Run Code Online (Sandbox Code Playgroud)

在我的机器上将port东西安装到/opt,所以我运行:

perl Makefile.PL --includedir=/opt/local/include --libddir=/opt/local/lib
Run Code Online (Sandbox Code Playgroud)