[waffle] [PATCH] android: misc build fixes

Emil Velikov emil.l.velikov at gmail.com
Thu Jul 31 06:14:46 PDT 2014


 - Add $(top)/include to the local_c_includes. Required for c99_compat.h
header.
 - Build third_party/threads library, add $(top)/third_party/threads to
local_c_includes (for threads.h)
 - pthread_mutex_timedlock is not available in bionic.
 - Drop unneeded trailing backslash(es).

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---

While going through the scons, I've completely missed out that we have 
another two build setups - Android + Xcode.

This patch resolves the Android code, and I assume that a similar one is 
needed for Xcode. Btw why do we have the latter one in git ? AFAICS 
cmake is perfectly capable of generating a Xcode projects.

-Emil


 Android.mk                          | 7 +++++--
 third_party/threads/threads_posix.c | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/Android.mk b/Android.mk
index 7e46154..fcb0061 100644
--- a/Android.mk
+++ b/Android.mk
@@ -39,6 +39,7 @@ LOCAL_CFLAGS := \
     -Wno-pointer-arith
 
 LOCAL_C_INCLUDES := \
+    $(LOCAL_PATH)/include \
     $(LOCAL_PATH)/include/waffle \
     $(LOCAL_PATH)/src/ \
     $(LOCAL_PATH)/src/waffle/api/ \
@@ -47,6 +48,7 @@ LOCAL_C_INCLUDES := \
     $(LOCAL_PATH)/src/waffle/linux/ \
     $(LOCAL_PATH)/src/waffle/droid/ \
     $(LOCAL_PATH)/third_party/khronos/ \
+    $(LOCAL_PATH)/third_party/threads/
 
 LOCAL_SRC_FILES := \
     src/waffle/core/wcore_tinfo.c \
@@ -77,12 +79,13 @@ LOCAL_SRC_FILES := \
     src/waffle/android/droid_display.c \
     src/waffle/android/droid_window.c \
     src/waffle/android/droid_surfaceflingerlink.cpp \
+    third_party/threads/threads_posix.c
 
 LOCAL_SHARED_LIBRARIES := \
     libEGL \
     libdl \
     libutils \
-    libgui \
+    libgui
 
 LOCAL_GENERATED_SOURCES := \
     $(LOCAL_PATH)/include/waffle/waffle_version.h
@@ -93,7 +96,7 @@ LOCAL_COPY_HEADERS := \
     include/waffle/waffle_glx.h \
     include/waffle/waffle_version.h \
     include/waffle/waffle_wayland.h \
-    include/waffle/waffle_x11_egl.h \
+    include/waffle/waffle_x11_egl.h
 
 LOCAL_COPY_HEADERS_TO := waffle-$(waffle_major_version)
 
diff --git a/third_party/threads/threads_posix.c b/third_party/threads/threads_posix.c
index 6e6b983..5835e43 100644
--- a/third_party/threads/threads_posix.c
+++ b/third_party/threads/threads_posix.c
@@ -42,7 +42,7 @@ Configuration macro:
     Use pthread_mutex_timedlock() for `mtx_timedlock()'
     Otherwise use mtx_trylock() + *busy loop* emulation.
 */
-#if !defined(__CYGWIN__)
+#if !defined(__CYGWIN__) && !defined(ANDROID)
 #define EMULATED_THREADS_USE_NATIVE_TIMEDLOCK
 #endif
 
-- 
2.0.2



More information about the waffle mailing list