summaryrefslogtreecommitdiff
path: root/data/ndk-build
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2017-11-29 16:12:54 +1100
committerMatthew Waters <matthew@centricular.com>2017-11-29 16:27:17 +1100
commitb6d1bdf6b7778fdcce921b4e0fd783ae289fb5b1 (patch)
treeefe1e5fcba5076500c2d84a791b4fd9e68ff77bb /data/ndk-build
parentfad4db6dfc334a1619f70a1e35d6279d8555580a (diff)
android/ndk-build: update sysroot parameters for ndk-r16
This allows building a precompiled GStreamer application against android-ndk-r16. Headers for all platforms have been moved to a single location. See https://android.googlesource.com/platform/ndk/+/master/docs/UnifiedHeaders.md
Diffstat (limited to 'data/ndk-build')
-rw-r--r--data/ndk-build/gstreamer-1.0.mk20
-rw-r--r--data/ndk-build/gstreamer_android-1.0.c.in1
2 files changed, 16 insertions, 5 deletions
diff --git a/data/ndk-build/gstreamer-1.0.mk b/data/ndk-build/gstreamer-1.0.mk
index aa3f912a..c37dbeea 100644
--- a/data/ndk-build/gstreamer-1.0.mk
+++ b/data/ndk-build/gstreamer-1.0.mk
@@ -156,14 +156,24 @@ GSTREAMER_ANDROID_CFLAGS := $(call pkg-config-get-includes,$(GSTREAMER_DEPS)
# In newer NDK, SYSROOT is replaced by SYSROOT_INC and SYSROOT_LINK, which
# now points to the root directory. But this will probably change in the future from:
# https://android.googlesource.com/platform/ndk/+/fa8c1b4338c1bef2813ecee0ee298e9498a1aaa7
-ifndef SYSROOT
- SYSROOT_GST := $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-$(TARGET_ARCH)
+ifdef SYSROOT
+ SYSROOT_GST_INC := $(SYSROOT)
+ SYSROOT_GST_LINK := $(SYSROOT)
else
- SYSROOT_GST := $(SYSROOT)
+ ifdef SYSROOT_INC
+ $(call assert-defined, SYSROOT_LINK)
+ ifdef SYSROOT_LINK
+ SYSROOT_GST_INC := $(SYSROOT_INC)
+ SYSROOT_GST_LINK := $(SYSROOT_LINK)
+ endif
+ else
+ SYSROOT_GST_INC := $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-$(TARGET_ARCH)
+ SYSROOT_GST_LINK := $(SYSROOT_GST_INC)
+ endif
endif
# Create the link command
-GSTREAMER_ANDROID_CMD := $(call libtool-link,$(TARGET_CC) $(TARGET_LDFLAGS) -shared --sysroot=$(SYSROOT_GST) \
+GSTREAMER_ANDROID_CMD := $(call libtool-link,$(TARGET_CC) $(TARGET_LDFLAGS) -shared --sysroot=$(SYSROOT_GST_LINK) \
-o $(GSTREAMER_ANDROID_SO) $(GSTREAMER_ANDROID_O) \
-L$(GSTREAMER_ROOT)/lib -L$(GSTREAMER_STATIC_PLUGINS_PATH) $(G_IO_MODULES_PATH) \
$(GSTREAMER_ANDROID_LIBS), $(GSTREAMER_LD)) -Wl,-no-undefined $(GSTREAMER_LD)
@@ -203,7 +213,7 @@ genstatic_$(TARGET_ARCH_ABI):
# Compile the source file
$(GSTREAMER_ANDROID_O): PRIV_C := $(GSTREAMER_ANDROID_C)
-$(GSTREAMER_ANDROID_O): PRIV_CC_CMD := $(TARGET_CC) --sysroot=$(SYSROOT_GST) $(TARGET_CFLAGS) \
+$(GSTREAMER_ANDROID_O): PRIV_CC_CMD := $(TARGET_CC) --sysroot=$(SYSROOT_GST_INC) $(SYSROOT_ARCH_INC_ARG) $(TARGET_CFLAGS) \
-c $(GSTREAMER_ANDROID_C) -Wall -Werror -o $(GSTREAMER_ANDROID_O) $(GSTREAMER_ANDROID_CFLAGS)
$(GSTREAMER_ANDROID_O): PRIV_GST_CFLAGS := $(GSTREAMER_ANDROID_CFLAGS) $(TARGET_CFLAGS)
$(GSTREAMER_ANDROID_O): genstatic_$(TARGET_ARCH_ABI)
diff --git a/data/ndk-build/gstreamer_android-1.0.c.in b/data/ndk-build/gstreamer_android-1.0.c.in
index 9b3ec37c..5453dc78 100644
--- a/data/ndk-build/gstreamer_android-1.0.c.in
+++ b/data/ndk-build/gstreamer_android-1.0.c.in
@@ -2,6 +2,7 @@
#include <gst/gst.h>
#include <gio/gio.h>
#include <android/log.h>
+#include <string.h>
/* XXX: Workaround for Android <21 making signal() an inline function
* around bsd_signal(), and Android >= 21 not having any bsd_signal()