Blame SOURCES/0005-build-Properly-select-the-right-system-wrappers.patch

71361e
From bf6b9de143edfe45ec6f40845510bdb655f866aa Mon Sep 17 00:00:00 2001
71361e
From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
71361e
Date: Mon, 4 Jul 2016 16:02:29 -0400
71361e
Subject: [PATCH 05/16] build: Properly select the right system wrappers
71361e
71361e
This is needed for windows build to be usable.
71361e
71361e
https://bugs.freedesktop.org/show_bug.cgi?id=96754
71361e
---
71361e
 configure.ac                       |  6 ++++++
71361e
 webrtc/system_wrappers/Makefile.am | 12 ++++++++++--
71361e
 2 files changed, 16 insertions(+), 2 deletions(-)
71361e
71361e
diff --git a/configure.ac b/configure.ac
71361e
index ccaa758..92706e7 100644
71361e
--- a/configure.ac
71361e
+++ b/configure.ac
71361e
@@ -53,11 +53,13 @@ AS_CASE(["${host}"],
71361e
         [
71361e
          OS_CFLAGS="-DWEBRTC_ANDROID -DWEBRTC_LINUX"
71361e
          PLATFORM_CFLAGS="-DWEBRTC_POSIX"
71361e
+         HAVE_POSIX=1
71361e
         ],
71361e
     [*-*linux*],
71361e
         [
71361e
          OS_CFLAGS="-DWEBRTC_LINUX"
71361e
          PLATFORM_CFLAGS="-DWEBRTC_POSIX"
71361e
+         HAVE_POSIX=1
71361e
         ],
71361e
     [*-*darwin*],
71361e
         [
71361e
@@ -65,13 +67,17 @@ AS_CASE(["${host}"],
71361e
              [OS_FLAGS="-DWEBRTC_MAC -DWEBRTC_IOS"],
71361e
              [OS_FLAGS="-DWEBRTC_MAC"])
71361e
          PLATFORM_CFLAGS="-DWEBRTC_POSIX"
71361e
+         HAVE_POSIX=1
71361e
         ],
71361e
     [*-mingw32*],
71361e
         [
71361e
          PLATFORM_CFLAGS="-DWEBRTC_WIN -U__STRICT_ANSI__"
71361e
+         HAVE_WIN=1
71361e
         ]
71361e
 )
71361e
 AC_SUBST(PLATFORM_CFLAGS)
71361e
+AM_CONDITIONAL(HAVE_POSIX, [test "x${HAVE_POSIX}" = "x1"])
71361e
+AM_CONDITIONAL(HAVE_WIN, [test "x${HAVE_WIN}" = "x1"])
71361e
 
71361e
 AS_CASE(["${host_cpu}"],
71361e
     [i?86|x86_64],
71361e
diff --git a/webrtc/system_wrappers/Makefile.am b/webrtc/system_wrappers/Makefile.am
71361e
index 6c9f4ee..8215013 100644
71361e
--- a/webrtc/system_wrappers/Makefile.am
71361e
+++ b/webrtc/system_wrappers/Makefile.am
71361e
@@ -42,13 +42,21 @@ libsystem_wrappers_la_SOURCES = include/aligned_malloc.h \
71361e
 				source/trace_impl.h \
71361e
 				source/trace_posix.h \
71361e
 				source/trace_win.h
71361e
-# This assumes that we want the POSIX implementation -- should eventually be
71361e
-# converted to a conditional to include Windows support
71361e
+if HAVE_POSIX
71361e
 libsystem_wrappers_la_SOURCES += source/critical_section_posix.cc \
71361e
 				 source/event_timer_posix.cc \
71361e
 				 source/rw_lock_posix.cc \
71361e
 				 source/thread_posix.cc \
71361e
 				 source/trace_posix.cc
71361e
+endif
71361e
+if HAVE_WIN
71361e
+libsystem_wrappers_la_SOURCES += source/critical_section_win.cc \
71361e
+				 source/event_timer_win.cc \
71361e
+				 source/rw_lock_win.cc \
71361e
+				 source/rw_lock_generic.cc \
71361e
+				 source/thread_win.cc \
71361e
+				 source/trace_win.cc
71361e
+endif
71361e
 libsystem_wrappers_la_CXXFLAGS = $(AM_CXXFLAGS) $(COMMON_CXXFLAGS)
71361e
 
71361e
 EXTRA_DIST = BUILD.gn \
71361e
-- 
71361e
2.14.3
71361e