Opened 12 years ago

Closed 12 years ago

Last modified 8 months ago

#8657 closed patch

WIN32: Dynamic Plugin support with MinGW

Reported by: lordhoto Owned by: lordhoto
Priority: normal Component: Port: Win32
Keywords: Cc:
Game:

Description

Hi,

I added dynamic plugin build support for Windows with MinGW. I'm using the method described here:
http://edll.sourceforge.net/index.html#gimp

It builds and works fine with my mingw ("gcc version 3.4.5 (mingw special)").

There're some problems though, since engines like SCUMM or AGOS are using zlib from inside their engines I have to link the plugins against $(LIBS), which is rather bad, it could be 'worked around' by adding some wrapper function to the ScummVM core, since just those symbols are exported to be accessable by the plugin.

Also I'm not sure if this solution is OK for us. Maybe we want a solution working with MSVC too? That's why I'm posting it here instead of just commiting it.

Ticket imported from: #1715310. Ticket imported from: patches/762.

Attachments (1)

dynamic_plugins_win32_v1.patch (1.6 KB) - added by lordhoto 12 years ago.
Patch for dynamic plugin building with mingw

Download all attachments as: .zip

Change History (15)

Changed 12 years ago by lordhoto

Patch for dynamic plugin building with mingw

comment:1 Changed 12 years ago by fingolfin

Looks simple and safe enough, at least after a quick glance. The only thing that worries me a little bit is the change to rules.mk -- I am not sure whether the order matters on other platforms, i.e. whether this change will break something or not (I simply don't recalled, it's been some time since I last touched that code). Guess somebody should test this. BTW, any particular reason why you made that change?

As for resolving the zlib issue: Yeah, that would be nice. We could add some low level wrappers, I guess. If you feel like it, submit a separate patch for that.

comment:2 Changed 12 years ago by lordhoto

Well for Win32 I need the scummvm symbol export file the be after the objects using it, that's why I had to change it in rules.mk.

comment:3 Changed 12 years ago by sev-

What is the status of this item?

comment:4 Changed 12 years ago by lordhoto

I'm still waiting for someone to test the rules.mk change on other platforms, but if nobody does it I'll just commit it and let the porters worry about it then.

comment:5 Changed 12 years ago by fingolfin

Sev, I thought you were using plugins all the time -- can you test the patch then?

comment:6 Changed 12 years ago by sev-

That's correct, but I build and run ScummVM under FreeBSD.

Kirben, who routinely builds ScummVM with MinGW is the best person to test it. Assigning to him.

comment:7 Changed 12 years ago by sev-

Owner: set to Kirben

comment:8 Changed 12 years ago by Kirben

Actually it sounds like lordhoto wants the patch tested on other (non-Windows) platforms, to be sure the changes to rules.mk don't cause any regressions.

The patch was designed for a mingw build, and works fine under mingw.

comment:9 Changed 12 years ago by fingolfin

Indeed. Sev is the person best suited to test it, not Kirben ;-).

But I'll also try a plugins build with it, I am just not going to test it extensively.

comment:10 Changed 12 years ago by sev-

Owner: changed from Kirben to lordhoto

comment:11 Changed 12 years ago by sev-

Ok, I tested the patch. It did not preak POSIX plugins. So please, commit it.

comment:12 Changed 12 years ago by lordhoto

Fine I'll commit it then. By the way I tried this on MinGW... ;-)

comment:13 Changed 12 years ago by lordhoto

Status: newclosed

comment:14 Changed 8 months ago by digitall

Component: Port: Win32
Note: See TracTickets for help on using tickets.