[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Building Lua 5.3 from Lua.org on FreeBSD
- From: Russell Haley <russ.haley@...>
- Date: Fri, 8 Sep 2017 23:32:51 -0700
On Fri, Jul 28, 2017 at 10:04 AM, Coda Highland <chighland@gmail.com> wrote:
> On Fri, Jul 28, 2017 at 11:22 AM, Luiz Henrique de Figueiredo
> <lhf@tecgraf.puc-rio.br> wrote:
>>> Would you be open to considering dlopen()'ing readline? Then you
>>> wouldn't have to worry about it actually being installed, you'd just
>>> detect it at runtime and use it if it's available.
>>
>> Oh, this may open another big can of worms. For instance, which is the
>> full path of the readline.so to use in dlopen?
>>
>> However, this does not solve the problem because lua.c has to call
>> readline and cannot detect this at compiel time.
>>
>> If you could provide working code for your suggestion, I'd like to see it.
>>
>
> I don't believe you actually need to know the full path. On the two
> platforms I have available to me for testing -- Linux and OSX -- if
> you give dlopen() a path that does not contain a slash then it will
> search the system library path for the library in question. A Google
> search for the FreeBSD and Solaris man pages for dlopen() says that it
> works there, too.
>
> You would have to subsequently use dlsym() to get the functions you
> need to call instead of using header files, so it's definitely a bit
> of extra code, although you could fall back to basic stdio functions
> afterward.
I think the patch that Duane provided has the code you are refering to?
> I don't have time to write code at the present moment, but I'll see if
> I can get back to you on that.
>
> /s/ Adam
>