Mac OS X and readline

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Mac OS X and readline

Luiz Henrique de Figueiredo
It turns out that Mac OS X 10.4 has readline and so Lua builds just fine with
        make MYCFLAGS="-DLUA_USE_MACOSX -DLUA_USE_READLINE" MYLIBS="-lreadline"

We don't have access to older versions of Mac OS X. Can anyone check whether
this would work in previous versions? Or can we just add LUA_USE_READLINE to
the Mac OS X part of luaconf.h and assume readline is available?
--lhf
Reply | Threaded
Open this post in threaded view
|

Re: Mac OS X and readline

varol kaptan
Actually, Mac OS X 10.4 has libedit (which has a readline emulation
layer). Previous versions of  Mac OS X didn't have it (as far as
remember they had it as a private framework only, not for general
consumption). I've found that libedit causes crashes when used with
the advanced readline patch from the lua-users.org wiki (but that's
not part of lua proper, so it may be ok).

Varol Kaptan

On 1/13/06, Luiz Henrique de Figueiredo <[hidden email]> wrote:
> It turns out that Mac OS X 10.4 has readline and so Lua builds just fine with
>         make MYCFLAGS="-DLUA_USE_MACOSX -DLUA_USE_READLINE" MYLIBS="-lreadline"
>
> We don't have access to older versions of Mac OS X. Can anyone check whether
> this would work in previous versions? Or can we just add LUA_USE_READLINE to
> the Mac OS X part of luaconf.h and assume readline is available?
> --lhf
>
Reply | Threaded
Open this post in threaded view
|

Re: Mac OS X and readline

Rici Lake-2

On 13-Jan-06, at 3:05 PM, varol kaptan wrote:

> Actually, Mac OS X 10.4 has libedit (which has a readline emulation
> layer). Previous versions of  Mac OS X didn't have it (as far as
> remember they had it as a private framework only, not for general
> consumption). I've found that libedit causes crashes when used with
> the advanced readline patch from the lua-users.org wiki (but that's
> not part of lua proper, so it may be ok).
>

Mac OS X 10.3 has <histedit.h> in /usr/include, and it seems to work.
However, the version distributed with 10.3 does not include the
readline emulation support distributed with more recent versions of
libedit (which, confusingly, put the readline emulation header in
<editline/readline.h>).

libedit comes from NetBSD, and is under the BSD licence rather than
the GPL. The simple use of readline in Lua could easily be achieved
with libedit's basic functionality; the emulation library attempts
to duplicate readline's hundreds of global variables, etc., and
may not be a perfect match :)

Reply | Threaded
Open this post in threaded view
|

Re: Mac OS X and readline

Asko Kauppi
In reply to this post by Luiz Henrique de Figueiredo

I'd say go for it. Any developers are more than likely to have 10.4  
(Tiger) anyhow, and for those who don't, it's quite easy to remove  
the -lreadline etc. from the Makefile.

Mostly, it is the users that may be lagging in 10.3 (Panther) to  
avoid the "Apple tax" upgrade fee.

Now, if you want to make readline work on 10.3 as well, here's the  
code you need. The BSD license is probably the main issue, since it  
does not allow relicensing as MIT/Lua.

.asko




Luiz Henrique de Figueiredo kirjoitti 13.1.2006 kello 18.58:

> It turns out that Mac OS X 10.4 has readline and so Lua builds just  
> fine with
> make MYCFLAGS="-DLUA_USE_MACOSX -DLUA_USE_READLINE" MYLIBS="-
> lreadline"
>
> We don't have access to older versions of Mac OS X. Can anyone  
> check whether
> this would work in previous versions? Or can we just add  
> LUA_USE_READLINE to
> the Mac OS X part of luaconf.h and assume readline is available?
> --lhf

rl-darwin.c (4K) Download Attachment