lua-users home
lua-l archive

Re: Including Lua source with one's project

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


These days I use lua with C#, and I've never had to compile it for that (luainterface right out of the box), but for most of my C++ I need to compile all modules and the core for 64bit, and for that reason simply do all of them manually.. But I do that once, not each build (or rarely if I change anything, which almost never happens) Also, simply copying into your project might make it easier to contain, but I trust the lua releases enough to have it shared, and update it on new releases without too much worry.
(also, that voids any local changes, obviously)
All in all, I've never had any thoughts along these lines, either I use luabinaries for quick tests (or apt-getalized), or when I need 64bit I do all of it in one go, once...
Miles Bader wrote:
I use Lua in my project. Currently I treat it more or less like any
other external library (e.g. use autoconf to detect it).
However, since Lua source is so small, I'm thinking it might be nice to
just include the Lua sources as a subdirectory in my source tree, where
the configure script could locate it and compile it for use in cases
where Lua is not installed otherwise. [In particular, I'm thinking
about windows / cygwin, since generally they seem much less standardized
with regard to user-installed libraries and the like.]
Does anyone have any pointers or hints about "best practice" with regard
to this, or to projects which are already distributed with Lua in this
manner?
For instance:
 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).
 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?
 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. [I guess the latter is probably safer,
 but using the system's Lua library might offer some advantages such
 as dynamic linking or more recent/bugfixed versions...]
 ..etc..
I don't want to modify the Lua distribution if I can avoid it -- I just
want to drop in the Lua distribution tree (or some subdirectory of it)
verbatim; I imagine I can do this automatically in my "make dist" rule.
Thanks,
-Miles

AltStyle によって変換されたページ (->オリジナル) /