[Openal-devel] [patch] Improvements for Windows / MinGW

Chris Robinson chris.kcat at gmail.com
Sun Nov 28 16:41:56 PST 2010


On Sunday, November 28, 2010 1:25:16 pm Volker Grabsch wrote:
> Dear OpenAL team,
> 
> I created the following patches to improved the MinGW support
> of OpenAL, especially regarding static linking.
> 
> Are those okay to be included in OpenAL?

Hi. Thanks for the patches.

I needed to do it a little bit differently to avoid a couple issues (described 
below), but the Git version should now work a bit better.

>     Since the type of linking is impossible to detect on
>     compile time, I'm using a new symbol AL_LIBTYPE_STATIC
>     that will be part of the pkg-config CFLAGS.
> 
>     This is a standard construction and found in many other
>     libraries, too.
> 
>     The patch also takes care to provide this symbol to the
>     example programs when necessary.

That definition needs to make sure the AL[C]_API definitions are explicitly 
empty, otherwise it can fall back to being 'extern' which could cause issues. 
Because of that, it needs to be set when building the library, too.

>     When using WINMM, the "-lwinmm" linker option needs to
>     be added to the pkg-config file. This patch does just
>     that.

It needs to be added for static builds regardless, since that's where 
timeGetTime() comes from and which is used by other parts of the library (the 
wave and null output backends, specifically).

Note, though, that static linking OpenAL Soft is (still) discouraged. You 
can't really do it with closed source apps, and it prevents easilly updating 
the app later on.


More information about the Openal-devel mailing list