logo       

RE: swi-prolog and mingw32: msg#01536

Subject: RE: swi-prolog and mingw32
Hi Gary,

I have not built the SWI-Prolog system using mingw32, but I have had success
in building a foreign dll for SWI-Prolog (win32) using a linux system and
the mingw32 cross compilation tools.  

I can't find my notes on this ... But the following might be useful:

1.  Installed mingw packages on the linux box:

mingw32-runtime-3.7-2
binutils-mingw32-2.15.94-1
gcc-mingw32-3.4.2-4
mingw32-w32api-3.2-2

2.  Sample Makefile

The simple Makefile below, allowed the same C source for a foreign module
for SWI-Prolog to be built for either linux or win32.

(Note that libpl.lib was copied from the Win32 distribution of SWI-Prolog,
whilst the Linux system had its own distribution of SWI-Prolog)

PLBASE=$(shell eval `pl -dump-runtime-variables` && echo $$PLBASE)
MINGW=i386-mingw32
WINLIBPL=build_scripts/materials/libpl.lib

all:    so dll

so:     bin/my_shared_object.so
dll:    bin/my_shared_object.dll


bin/my_shared_object.so: my_shared_object.c
        plld -o bin/sql_tokens -shared -Wall -O3 -g sql_tokens.c

bin/my_shared_object.dll: my_shared_object.c
        $(MINGW)-gcc -I$(PLBASE)/include -O3 -shared -o $@ $< $(WINLIBPL)
        $(MINGW)-strip bin/sql_tokens.dll

Let me know if this was any help.

Cheers,

Steve

> -----Original Message-----
> From: owner-prolog@xxxxxxxxxxxxxx 
> [mailto:owner-prolog@xxxxxxxxxxxxxx] On Behalf Of Gary
> Sent: 06 December 2005 19:43
> To: prolog@xxxxxxxxxxxxxx
> Subject: [SWIPL] swi-prolog and mingw32
> 
> Hello,
> 
> Does anyone have experience with, or guidelines for, 
> developing using the mingw32 compiler tool-set and 
> swi-prolog. I am trying without - much success - to compile using it.
> 
> I want to develop for win32 and unix from a FreeBSD 
> development system via cross-compilation and using gcc in its 
> various forms is the best option - I really don't want to 
> have to use a different compiler for
> win32 code.
> 
> Many thanks
> 
> ------------
> For further info, please visit http://www.swi-prolog.org/
> 
> To unsubscribe, send a plaintext mail with "unsubscribe 
> prolog <e-mail>"
> in its body to majordomo@xxxxxxxxxxxxxx
> 




<Prev in Thread] Current Thread [Next in Thread>