Bug 62697 - Compiling GStreamer wrapper fails using r8e
Summary: Compiling GStreamer wrapper fails using r8e
Status: RESOLVED FIXED
Alias: None
Product: GStreamer SDK
Classification: Unclassified
Component: Android SDK distribution (show other bugs)
Version: 2012.11
Hardware: Other All
: medium blocker
Assignee: bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-24 14:20 UTC by LCID Fire
Modified: 2014-05-06 09:29 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description LCID Fire 2013-03-24 14:20:57 UTC
When gstreamer-android is being built (using NDK r8e), it fails with the following output:

GStreamer      : [GEN] => gst-build/gstreamer_android.c
GStreamer      : [COMPILE] => gst-build/gstreamer_android.c
gst-build/gstreamer_android.c:1:17: fatal error: jni.h: No such file or directory
Comment 1 LCID Fire 2013-03-25 07:50:48 UTC
Seems like the problem is:

@$(_CC) --sysroot=$(SYSROOT) $(CFLAGS) -c $(GSTREAMER_ANDROID_C) -Wall -Werror -o $(GSTREAMER_ANDROID_O) $(GSTREAMER_ANDROID_CFLAGS)

So either `$(CFLAGS)` was set in previous releases, or I really don't know where you would get the include directories.
Comment 2 LCID Fire 2013-03-25 09:10:02 UTC
So one step further. I added:

# Build CFLAGS manually so we have standard android CFLAGS
GSTREAMER_TARGET_CFLAGS      := $(addprefix -isystem , $(TARGET_C_INCLUDES)) $(TARGET_CFLAGS) $(CFLAGS)
GSTREAMER_TARGET_LDFLAGS     := $(TARGET_LDFLAGS) $(LDFLAGS)

and

@$(HOST_ECHO) "GStreamer      : [COMPILE] => $(GSTREAMER_ANDROID_C)"
	@$(TARGET_CC) --sysroot=$(SYSROOT) $(GSTREAMER_TARGET_CFLAGS) -c $(GSTREAMER_ANDROID_C) -Wall -Werror -o $(GSTREAMER_ANDROID_O) $(GSTREAMER_ANDROID_CFLAGS)

and it at least compiles.
Comment 3 LCID Fire 2013-03-25 09:12:09 UTC
Now it fails with:

GStreamer      : [LINK] => gst-build/libgstreamer_android.so
collect2: fatal error: cannot find 'ld'

I have not found where it forces `ld` instead of the target linker.
I do get a little worried because the build script seems really wonky.
Comment 4 gouailia 2013-04-14 11:47:05 UTC
I have the same issue "gst-build/gstreamer_android.c:1:17: fatal error: jni.h: No such file or directory" when compiling Gstreamer tutorials on Eclipse using NDK r8e (linux). I tried to compile using NDK-build from command line and it shows the same error message. Please tell me how to fix it.
Comment 5 spise 2013-04-22 12:10:29 UTC
to compile tutorial with Android NDK r8e i just add SYSROOT variable to Android.mk

Tutorial1/jni/Android.mk

...
LOCAL_LDLIBS := -llog

SYSROOT := /opt/android-ndk-r8e/platforms/android-14/arch-arm/

include $(BUILD_SHARED_LIBRARY)
...
Comment 6 Sebastian Dröge (slomo) 2013-04-22 12:12:29 UTC
Did someone try with latest cerbero (not the last SDK release)? For me everything is working fine there with r8e.
Comment 7 cee1 2014-05-06 09:29:48 UTC
(In reply to comment #6)
> Did someone try with latest cerbero (not the last SDK release)? For me
> everything is working fine there with r8e.

gstreamer-sdk/share/gst-android/ndk-build/gstreamer.mk
+# 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 := $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-$(TARGET_ARCH)
+endif
+

The new lines above in gstreamer.mk(in cerbero master branch) fix the problem, tested under android-ndk-r9d.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.