Minimal
The file h.luaconf contains the configuration data for compiling Lua. The simplest strategem for replacing Unix values by RISC OS ones is to add the three lines

#ifdef RISCOS
#include "risclua.h"
#endif 
just before the final line

#endif
Then we add a new file h.risclua to the sources in which we can put:

#undef LUA_DIRSEP
#define LUA_DIRSEP              "."
#undef LUA_PATH_SEP
#define LUA_PATH_SEP             ","
#define LUA_USE_DLOPEN
to change the directory separator character to "." and the path-list separator character to ",". The last line tells the compiler to implement dynamic loading of modules using the dlopen library from UnixLib.

You also need to give default values for LUA_PATH and LUA_CPATH, system variables which are used for loading modules written in Lia and in C. These will depend on your setup, but for RiscLua 6 these are

#undef  LUA_PATH_DEFAULT
#define LUA_PATH_DEFAULT        "rlua:lib.?,?"
#undef LUA_CPATH_DEFAULT
#define LUA_CPATH_DEFAULT       "rlua:solib.?/so,?/so"
It also has, for feedback with commandline use:

#define LUA_PROGNAME            "lua"
#define RISCLUA_VERSION         "RiscLua 8.6  (VFP)"
The first is required by a small change in c.luac at line 28: Replace

#define PROGNAME	"luac"		/* default program name */
#define OUTPUT		PROGNAME ".out"	/* default output file */
by

#ifdef RISCOS
#define PROGNAME	"luac"		/* default program name */
#define OUTPUT		PROGNAME "/out"	/* default output file */
#else
#define PROGNAME	"luac"		/* default program name */
#define OUTPUT		PROGNAME ".out"	/* default output file */
#endif
The second is required by a small change in c.lua at line 210. Replace

static void print_version (void) {
  lua_writestring(LUA_COPYRIGHT, strlen(LUA_COPYRIGHT));
  lua_writeline();
}
by

static void print_version (void) {
  lua_writestring(LUA_COPYRIGHT, strlen(LUA_COPYRIGHT));
  lua_writeline();
#ifdef RISCOS
  lua_writestring(RISCLUA_VERSION, strlen(RISCLUA_VERSION));
  lua_writeline();
#endif
}
For a minimal version you probably do not need either of these modifications.