lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 9 July 2018 at 23:13, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>> On 9 July 2018 at 22:44, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>> >> I assume this doesn't occur today as luaconf.h is installed as a
>> >> header onto end user systems.
>> >> There are some ways around this:
>> >>   - some of the defines (such as LUA_ROOT) probably don't need to be
>> >> available for compiling modules
>> >>   - for values that do need to exist at runtime, they could be made
>> >> available through externs, or some new function
>> >> lua_compilation_flags();
>> >
>> > I did not understand your points here.
>>
>> Lets ignore my assumption then:
>> Is there a reason that lua isn't configurable by command line defines
>> instead of editing luaconf.h?
>
> Several configurations affect the API. So, if you compile Lua with
> some options and then compile your code with other options, they will
> not match.

That is the issue I was trying to say above.
I proposed that this issue could be avoided by compiling the values
into the binary.
e.g. a new function: const char* lua_compilation_flags(const char* flag_name);

> Moreover, there are many configurations, and a .h file is
> more portable than a makefile.

Keeping a patch (or writing a sed script) is more complex than passing
an extra command line argument to your compiler.

> But I guess we can add '#if !defined'
> around several of them (like LUA_ROOT).

That would be great!