[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Compiling pure Lua project into singe file
- From: "Nijdam, Marc" <mnijdam@...>
- Date: Sun, 13 Feb 2005 19:02:05 -0800
I've done something slightly more complex, by allowing glue.exe to glue
multiple lue files onto the srlue executable. The glue tail at the end
maintains the basenames (ie. No directories) of all the files that were
included. When srlua starts up it adds all those basenames into a
_BUILTIN table. I then added a few lines of code to the lbaselib.c
require implementation to look in _BUILTIN before doing its usual
processing.
This way my project can have multiple files during development, each one
require'ing one or more others. I can distribute all those files in a
single executable without having to strip out the requires. The errors
that come back from an srlua base executable are also more informative
for the developer as they point out what original file it came from.
If anyone's interested I can put it up somewhere
--Marc
-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Frank Bechmann
Sent: Sunday, February 13, 2005 8:44 AM
To: Lua list
Subject: Re: Compiling pure Lua project into singe file
This is the 1st thing I wanted to have in Lua, so I came up w/ a quite
crude solution, see there:
http://lua-users.org/lists/lua-l/2005-01/msg00056.html
Limitations are described there.
If you need the sources just drop me a mail.
Regards, Frank
Mike Crowe wrote:
> Hi folks,
>
> This is probably very easy, but I can't seem to see how to do it. I
> have a complete project of ~12 .lua files that I want to distribute.
> Windows platform. Assume destination has lua.exe and luac.exe
>
> I thought the answer was to:
> luac -o myfile.luac file1.lua file2.lua file3.lua .... file12.lua
>
> That creates "myfile.luac" that appears to be all the files together.
>
> However, if I copy this file to a new directory, and execute:
> lua myfile.luac
>
> I get an error like:
> lua: cannot read compat.lua: No such file or directory stack
> traceback:
> [C]: in function `dofile'
> all.lua:9: in main chunk
> (luac): in main chunk
> [C]: ?
>
> (compat.lua is one of the files in my project).
>
> What am I missing here?
> TIA
> Mike
>
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.7 - Release Date: 10.02.2005