lua-users home
lua-l archive

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


You should use Makefile.win as a base (making the necessary changes to
work with the GNU tools in your cross-compilation toolchain) instead
of the regular Makefile. Building libffi for Windows does not use
configure && make, but uses the patched version of libffi in the win32
directory directly.

--
Fabio Mascarenhas


On Tue, Aug 17, 2010 at 10:31 AM, Martin <wtxnh-lua@yahoo.com.au> wrote:
> Hi,
>
> I have tryed to cross-compile alien on Debian for Windows system with
> i586-mingw32msvc-gcc cross-compiler.
> I have done it as follows:
>
> $ cd alien-0.4.1
> $ cd libffi
> $ ./configure --disable-shared -host=i586-mingw32msvc CFLAGS=-DX86_WIN32
> $ make
> $ cd ..
> $ i586-mingw32msvc-gcc -shared -s  -I../installed/include -Ilibffi/include -DWINDOWS -L../installed -llua51 -o src/alien/core.dll src/alien/core.c libffi/.libs/libffi.a
> $ i586-mingw32msvc-gcc -shared -s  -I../installed/include -Ilibffi/include -DWINDOWS -L../installed -llua51 -o src/alien/struct.dll src/alien/struct.c
>
> It all compiles with only warnings like:
> src/alien/core.c:715: warning: assignment makes pointer from integer without a cast
>
> Then I copyed files
> src/alien.lua
> src/alien/core.dll
> src/alien/struct.dll
> to appropriate places in '../installed' directory.
>
> Now I can test it with:
> $ cd ../installed
> $ wine lua ../alien-0.4.1/samples/libc.lua
> lua: Procedure not found
>
> stack traceback:
>        [C]: ?
>        ../alien-0.4.1/samples/libc.lua:6: in main chunk
>        [C]: ?
>
>
> As it seems it is not able to execute line 6:
> libc.malloc:types("pointer", "int")
>
> Something here is apparently not as it should be. My  wild guess is
> that libffi is not compiled properly mainly because there is directory
> alien-0.4.1/libffi/win32
> but it is not used when I compile it with configure and make as showed
> above.
>
> Anybody has a clue what is really wrong here and how do I need to
> cross-compile it?
>
> Martin
>
>