[Box Backup-dev] Re: [Box Backup] readline support on OS X

Johan Allard boxbackup-dev@fluffy.co.uk
Sat, 18 Feb 2006 14:31:46 +1100


On 18/02/2006, at 10:58 AM, Martin Ebourne wrote:

> On Fri, 2006-02-17 at 12:09 +1100, Johan Allard wrote:
>> So what happens is that on the Mac Apple has actually only editline
>> installed and it symlinks to make believe that it has readline, and
>> it doesn't have the include files in the right place to use editline
>> properly. Box Backup the detects libedit just fine but it doesn't
>> pickup editline/readline.h because that's not where Apple has stored
>> it. To get the Mac to do it properly we could: ln -s /usr/include/
>> readline /usr/include/editline (and that's what I did when testing
>> it), but of course we can't get everyone to do that to get readline/
>> editline support so we'll have to update the configure script
>> instead. Or does anyone have any other idea?
>
> Johan,
>
> Thanks for the explanation as to what causes the problem. Here is  
> why I
> am not planning to fix this issue (unless a safer fix can be found):
>
> i) The suggested fix is a hack around Apple's hack. It is not at all
> unlikely that some other system could have only the libraries  
> installed
> for editline, but have both headers and libraries for GNU readline. In
> this case your fix is likely to cause Box to try and compile against
> readline but link against editline. The resulting mess is unlikely to
> work properly, and quite likely to create a support burden.

hmm, maybe some #ifdef __DARWIN__ thing is what's needed.

> ii) Given that Apple is trying to emulate GNU readline then simply
> giving --enable-gnu-readline to ./configure should get it working
> correctly.

It doesn't sadly. I tried this first and regardless that I actually  
have readline compiled in /opt/local (using darwinports) I couldn't  
get readline support to be recognized by configure. That's the only  
reason I decided to patch instead.

If a fix can't be produced safely then at least document the problem  
somewhere with the optional fix for OS X as readline/editline is very  
nice.

Cheers

//johan