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

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