APP_STL := stlport_shared also needs APP_MODULES := stlport_shared ?

1,043 views
Skip to first unread message

wolftag

unread,
Oct 20, 2011, 11:12:40 PM10/20/11
to android-ndk
I'm working with NDK r6b.

If I just add

APP_STL := stlport_shared

to Application.mk, I see the libstlport_shared.so being copied in the
obj directory, but not into the libs directory.

If I also add

APP_MODULES := stlport_shared mymodule1 mymodule2

everything works as expected.

I don't see the APP_MODULES step mentioned in docs/CPLUSPLUS-
SUPPORT.html. Is this normal? I'd rather not have to specify the
modules.

I tried adding LOCAL_SHARED_LIBRARIES := stlport_shared to the local
module in Android.mk, but that didn't work.





David Turner

unread,
Oct 21, 2011, 4:29:06 AM10/21/11
to andro...@googlegroups.com
That is normal, by default, i.e. if you don't specify an APP_MODULES, only the top-level module declared in your Android.mk and their dependencies will be copied to the libs/ directory.
If your Android.mk is empty, nothing will be copied. As soon as you declare a shared library or an executable, it will automatically depend on stlport_shared, and thus the latter will be copied to libs/ as well.
 




--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


wolftag

unread,
Oct 21, 2011, 8:04:14 PM10/21/11
to android-ndk
On Oct 21, 1:29 am, David Turner <di...@android.com> wrote:
> That is normal, by default, i.e. if you don't specify an APP_MODULES, only
> the top-level module declared in your Android.mk and their dependencies will
> be copied to the libs/ directory.
> If your Android.mk is empty, nothing will be copied. As soon as you declare
> a shared library or an executable, it will automatically depend on
> stlport_shared, and thus the latter will be copied to libs/ as well.

It seems like that automatic dependency on stlport_shared isn't
happening.

If I start with the hello-jni sample and do only the following:
1. Create a dummy.cpp file and add it to LOCAL_SRC_FILES in
Android.mk
2. Create Application.mk with only APP_STL := stlport_shared

When I run ndk-build, I get the following output. The Install step
for libstlport_shared.so doesn't happen.

Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/
gdbserver
Gdbsetup : libs/armeabi/gdb.setup
Compile thumb : hello-jni <= hello-jni.c
Compile++ thumb : hello-jni <= dummy.cpp
StaticLibrary : libstdc++.a
Prebuilt : libstlport_shared.so <= <NDK>/sources/cxx-stl/
stlport/libs/armeabi/
SharedLibrary : libhello-jni.so
Install : libhello-jni.so => libs/armeabi/libhello-jni.so

I see the following files in the obj directory:
./local/armeabi/libhello-jni.so
./local/armeabi/libstdc++.a
./local/armeabi/libstlport_shared.so
./local/armeabi/objs-debug/hello-jni
./local/armeabi/objs-debug/hello-jni/dummy.o
./local/armeabi/objs-debug/hello-jni/dummy.o.d
./local/armeabi/objs-debug/hello-jni/hello-jni.o
./local/armeabi/objs-debug/hello-jni/hello-jni.o.d

And this in the libs directory:
./armeabi/gdb.setup
./armeabi/gdbserver
./armeabi/libhello-jni.so

There is no libstlport_shared.so in the libs directory.

I know there's an additional step of adding the loadLibrary to the
Java code, just using this as a simple example.

Am I missing something?

Thanks much!

wolftag

unread,
Oct 24, 2011, 6:37:50 PM10/24/11
to android-ndk
I filed Bug 21180 for this.

David Turner

unread,
Oct 25, 2011, 8:14:24 AM10/25/11
to andro...@googlegroups.com
No, you are right, it's a bug, and I already submitted a fix that will be part of the next NDK release.
I have updated the bug with more information. The work-around is to use APP_MODULES in your Application.mk and list stlport_shared here, along with your other modules.

Sorry for the annoyance.
 
Thanks much!
Reply all
Reply to author
Forward
0 new messages