[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: cross-compile alien
- From: Fabio Mascarenhas <mascarenhas@...>
- Date: Tue, 17 Aug 2010 10:54:35 -0300
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
On Tue, Aug 17, 2010 at 10:31 AM, Martin <firstname.lastname@example.org> wrote:
> 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
> 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
> but it is not used when I compile it with configure and make as showed
> Anybody has a clue what is really wrong here and how do I need to
> cross-compile it?