Bug 96754

Summary: webrtc-audio-processing: Add MinGW build support
Product: PulseAudio Reporter: Nicolas Dufresne <nicolas>
Component: miscAssignee: pulseaudio-bugs
Status: RESOLVED MOVED QA Contact: pulseaudio-bugs
Severity: normal    
Priority: medium CC: lennart, nicolas
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Don't include execinfo.h for windows
Don't use MSVC specific exception handler for MINGW
Add missing throw in destructor override
lrint is available with mingw
Fix case sensitivity issue with MinGW cross-build
Add missing windows specific headers
Add missing windows specific headers
Fix build on win64
Disable backtrace on android
Don't blindly link to pthread
Add required define for Windows
Properly select the right system wrappers
Fix case sensitivity in windows include
Define MSVC _WIN32 so we can build on mingw
Add missing windows conditions variable
Link against winmm on Windows
Add required define for Windows
Properly select the right system wrappers
Properly select the right system wrappers
Define MSVC _WIN32 so we can build on mingw

Description Nicolas Dufresne 2016-06-30 18:39:14 UTC
As of now, the webrtc-audio-processing library cannot be build on Windows. As most of our build system is gcc specific, I'll start with adding MinGW support, even though the code is clearly made for MSVC. Patches coming.
Comment 1 Nicolas Dufresne 2016-06-30 18:45:43 UTC
Created attachment 124808 [details] [review]
Don't include execinfo.h for windows

And that even if we have GLIBC. This fixes a build issue in mingw.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Comment 2 Nicolas Dufresne 2016-06-30 18:45:45 UTC
Created attachment 124809 [details] [review]
Don't use MSVC specific exception handler for MINGW

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Comment 3 Nicolas Dufresne 2016-06-30 18:45:47 UTC
Created attachment 124810 [details] [review]
Add missing throw in destructor override

This is being inforced by mingw.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Comment 4 Nicolas Dufresne 2016-06-30 18:45:50 UTC
Created attachment 124811 [details] [review]
lrint is available with mingw

This make use of lrint when building with mingw. The assembly code
for X86 is MSVC specific and would not build.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Comment 5 Nicolas Dufresne 2016-06-30 18:45:52 UTC
Created attachment 124812 [details] [review]
Fix case sensitivity issue with MinGW cross-build

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Comment 6 Nicolas Dufresne 2016-06-30 19:05:19 UTC
Created attachment 124813 [details] [review]
Add missing windows specific headers
Comment 7 Nicolas Dufresne 2016-06-30 19:09:14 UTC
Created attachment 124814 [details] [review]
Add missing windows specific headers
Comment 8 Nicolas Dufresne 2016-06-30 19:26:29 UTC
Created attachment 124815 [details] [review]
Fix build on win64

This trace function is mixing long int and long long int pointers.
Comment 9 Nicolas Dufresne 2016-06-30 20:44:41 UTC
Created attachment 124817 [details] [review]
Disable backtrace on android

The check get confused if one uses GNU STL rather then STL port.
Comment 10 Nicolas Dufresne 2016-06-30 20:50:00 UTC
Created attachment 124818 [details] [review]
Don't blindly link to pthread

This otherwise breaks the build on Android and Windows.
Comment 11 Nicolas Dufresne 2016-07-05 20:34:17 UTC
Created attachment 124914 [details] [review]
Add required define for Windows

This will also add it to the .pc file as WEBRTC_WIN leaks into the
public interface and undefined __STRICT_ANSI__ so M_PI is available.
Comment 12 Nicolas Dufresne 2016-07-05 20:34:20 UTC
Created attachment 124915 [details] [review]
Properly select the right system wrappers

This is needed for windows build to be usable.
Comment 13 Nicolas Dufresne 2016-07-05 20:34:22 UTC
Created attachment 124916 [details] [review]
Fix case sensitivity in windows include

While cross-compiling from linux, we need all include to be
lower case.
Comment 14 Nicolas Dufresne 2016-07-05 20:34:25 UTC
Created attachment 124917 [details] [review]
Define MSVC _WIN32 so we can build on mingw
Comment 15 Nicolas Dufresne 2016-07-05 20:34:28 UTC
Created attachment 124918 [details] [review]
Add missing windows conditions variable

Those are used by generic RW lock implementation.
Comment 16 Nicolas Dufresne 2016-07-05 20:34:30 UTC
Created attachment 124919 [details] [review]
Link against winmm on Windows
Comment 17 Nicolas Dufresne 2016-07-05 20:38:56 UTC
With that I'm now able to run on Windows with success. Note that an Android patch just slipped in the lot, please ignore, I'll create separate bug for Android and OSX/iOS.

An important aspect is that you need at least version 0x0600 of Windows API to build. Note sure if we should document, check, or simply define it.
Comment 18 Nicolas Dufresne 2016-07-05 21:29:46 UTC
Created attachment 124920 [details] [review]
Add required define for Windows

Added missing ,
Comment 19 Nicolas Dufresne 2016-07-05 21:30:19 UTC
Created attachment 124921 [details] [review]
Properly select the right system wrappers

Was in conflict after previous update.
Comment 20 Nicolas Dufresne 2016-07-05 21:33:58 UTC
Created attachment 124922 [details] [review]
Properly select the right system wrappers

Always better if I don't send the same one.
Comment 21 Nicolas Dufresne 2016-07-05 21:37:37 UTC
Created attachment 124923 [details] [review]
Define MSVC _WIN32 so we can build on mingw

Another one that was rebased
Comment 22 GitLab Migration User 2018-07-30 10:22:27 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/382.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.