[lupa-dev] Re: Lupa with normal Lua interpreter (Lua 5.1)

  • From: Kermit Alexander II <kotuxguy@xxxxxxxxx>
  • To: lupa-dev@xxxxxxxxxxxxx
  • Date: Wed, 3 Aug 2011 13:35:21 -0500

It's OK, I was able to get Lupa working with Lua 5.1, although I had to
perform a few extra steps
to get Lupa to work with Lua 5.1:
 * Pass the --no-luajit option to setup.py
 * Apply this patch to setup.py (*nix only, and requires Lua 5.1 be
installed):

119a120
>         libraries=['lua5.1'], include_dirs=['/usr/include/lua5.1'],

To compile Lupa with Lua 5.1 on Windows, I had to apply this patch to
setup.py, instead:

119a120
>         extra_objects=['lua51.dll'], include_dirs=['..\\lua-5.1\\src'],

As you can probably guess, I also downloaded the Lua 5.1 source code and
simply used its header files in place of LuaJIT's. I also copied the
compiled Lua 5.1 .dll to
the same directory as setup.py.

For anyone who wants to fix Lua 5.1/Lupa crashing after DirectX is
initialized, apply this patch
to luaconf.h *before* you compile Lua 5.1:

260a261,262
>
> #undef LUA_USE_READLINE
544,545c546,548
< #if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__)
&& \
<     (defined(__i386) || defined (_M_IX86) || defined(__i386__))
---
> /*#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) &&
!defined(__SSE2__) && \
>     (defined(__i386) || defined (_M_IX86) || defined(__i386__)) */
> #if 0

And actually, I normally use Linux, but since my game development kit also
needs
to work on Windows (and Mac OSX), I have to make sure it works properly on
Windows, as well.


Thanks again for writing Lupa!
Kermit Alexander II



Other related posts: