lua-users home
lua-l archive

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

On Sat, Jul 11, 2015 at 11:11 AM, Sean Conner <> wrote:
It was thus said that the Great Christopher Tallman once stated:
> Is there an easy way to build Lua with additional package search
> paths? I searched and didn't see any compile-time way to add in extra
> paths to the defaults apart from explicitly editing luaconf.h.
> Ideally, I would be able to add in a preprocessor definition like
> -DLUA_PATH_EXTRA="./modules/?.lua" when compiling and wouldn't have to
> change the actual source (so we can keep the same build process for
> subsequent versions).
> Is something like this already provided? Am I stuck with changing

  There are the environment variables LUA_PATH and LUA_CPATH that can be
used to modify the search paths.

It seems to me that this kind of thing is exactly the kind of thing that luaconf.h is there for; don't be afraid to hack it. It was never meant to be the canonical source of Universal Truth across all Lua builds everywhere. You want to build a custom configuration, so you have to customize the configuration.

Brigham Toskin