lua-users home
lua-l archive

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

Miles Bader wrote:
  1) Is it a good idea to include the entire Lua source distribution
     (e.g. "lua-5.1.2/") as a subdirectory, or just include the actual
     Lua source (the "src/" subdir of the Lua distribution).

All the actual code is in src, so that's all you need (unless you need some of the optional bits).

  2) What's a good way to invoke the Lua Makefile from a
     autoconf/automake built project?  In particular, one conventionally
     specifies a machine-specific target to invoke the Lua Makefile;
     maybe in the case of a hardwired distribution, it's better to just
     use the "posix" target, and always link statically?

I never bother; I just build it from my own makefile (or, these days, <blatant plug> from the pmfile </blatant plug>). You don't need any special compilation options, just drop the files in and it'll work.

As an alternative you can use etc/all.c. This provides a single C file that compiles the entire Lua library (via includes). That might be easier to integrate into your build system, and on some platforms, could well produce faster code.

  3) If a Lua library is found on the system where the project is being
     built, should I use that, or just always use the Lua version
     included with my project.

It Depends.

If you customise the interpreter in any way, then of course you'll need to avoid the shared library. If you don't, it shouldn't make any difference --- although the shared version will be slower (slightly). Using the shared library will help overhead, but on most platforms Lua is only a couple of hundred kB at most. Whether that's worth the extra maintenance load is up to you.

David Given