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

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