Lua: compile a script with all dependencies
<p>Is there a way one can compile a script in which everything except standard Lua libraries is linked statically?</p>

<p>I am embedding a script in my C program, the functionality is split between modules, which are then loaded in main module. I would like to compile the main module into Lua bytecode, convert it to hex code, so it can easily be stored in my program. The problem is that main module still requires source code of other modules to be present either in <code>LUA_PATH</code> or in current directory. Is there a way how to override this behaviour? Sure, I could simply merge all files (automatically, during the compilation) into one lua source file, but since I am a beginning with Lua, I would like to know if there are some other solutions to this problem, and perhaps expand my horizons.</p>

<p>I was looking at <code>luac</code> and <code>luajit</code> but I could not make them to do what I need.</p>

<p>Any hints?</p>