Opened 18 years ago

Closed 17 years ago

Last modified 6 years ago

#8657 closed patch

WIN32: Dynamic Plugin support with MinGW

Reported by: lordhoto Owned by: lordhoto
Priority: normal Component: Port: Win32
Version: 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 18 years ago.
Patch for dynamic plugin building with mingw

Download all attachments as: .zip

Change History (15)

by lordhoto, 18 years ago

Patch for dynamic plugin building with mingw

comment:1 by fingolfin, 18 years ago

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 by lordhoto, 18 years ago

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 by sev-, 17 years ago

What is the status of this item?

comment:4 by lordhoto, 17 years ago

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 by fingolfin, 17 years ago

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

comment:6 by sev-, 17 years ago

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 by sev-, 17 years ago

Owner: set to Kirben

comment:8 by Kirben, 17 years ago

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 by fingolfin, 17 years ago

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 by sev-, 17 years ago

Owner: changed from Kirben to lordhoto

comment:11 by sev-, 17 years ago

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

comment:12 by lordhoto, 17 years ago

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

comment:13 by lordhoto, 17 years ago

Status: newclosed

comment:14 by digitall, 6 years ago

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