Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I link against the GNU readline library rather than libedit in macosx?

Attempting to build Term-Readline-Gnu on macosx, fails complaining about libedit and recommending to use gnu readline. How do I do that?

This is one of the attempts I have tried:

First I built GNU libreadline v6.2 statically but did not install it - to make sure I did not screw up the system version with the same name:

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

make

make install-static

Then tried to build 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

Found `/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

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

The libreadline you are using is the libedit library. Use the GNU Readline Library.

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

Chris

like image 618
Chris Avatar asked Aug 27 '11 11:08

Chris


1 Answers

Here is an awesome post explaining how to fix OP's issue in few simple steps:

brew install readline

brew link --force readline

cpanm Term::ReadLine::Gnu

brew unlink readline

Check

brew info readline | head -1
like image 78
Mr. L Avatar answered Sep 27 '22 19:09

Mr. L