Hello,

First of all, this is not a question related to the NDK, so I'm redirecting
this to android-porting instead.

On Mon, Dec 19, 2011 at 8:39 AM, Meraj Ahmad Ansari <
meraj.ahmad.ans...@hotmail.com> wrote:

> Hi List,
>
> I have 2 questions -
>
> Q1-
> ---------
> I am trying to build static lib with android source code by using
> "mmm" command and it is creating static lib in -
> target StaticLib: nativestaticlibdemo (out/target/product/generic/obj/
> STATIC_LIBRARIES/nativestaticlibdemo_intermediates/
> nativestaticlibdemo.a)
>
> It seams that there is no nativestaticlibdemo.a created in - "out/
> target/product/generic/system/lib" folder as like shared lib.
>
> Is it valid behavior or i am missing something?
>

No, this is perfectly valid behaviour. Only stuff that gets installed to
the final partition image go into $ANDROID_PRODUCT_OUT/system
A static library is neither an executable or loadable file, so has no point
in being there.


> I am trying to compile only one .C file and my Android.mk is -
>
> LOCAL_PATH := $(call my-dir)
> include $(CLEAR_VARS)
> LOCAL_MODULE    := nativestaticlibdemo
> LOCAL_SRC_FILES := nativeTest.c
> include $(BUILD_STATIC_LIBRARY)
>
>
>
> Q-2
> ---------
>
> When i use "ndk-build" command of Android NDK then it is not creating
> static lib(creation of shared lib is fine)
>

List your library in your APP_MODULES definition.

By default, the NDK only builds the executable and shared libraries in your
project, as well as all their dependencies (which can be static libraries
too).

So if you have a shared library that depends on a static library, the
latter will be automatically built.
If you only have a static library, you need to list it in your APP_MODULES
to force its compilation.


> Following is the log-
>
> rm -f /home/administrator/Development/android-ndk-r6b/samples/
> nativeStaticLibDemo/libs/armeabi/lib*.so /home/administrator/
> Development/android-ndk-r6b/samples/nativeStaticLibDemo/libs/armeabi-
> v7a/lib*.so /home/administrator/Development/android-ndk-r6b/samples/
> nativeStaticLibDemo/libs/x86/lib*.so
> rm -f /home/administrator/Development/android-ndk-r6b/samples/
> nativeStaticLibDemo/libs/armeabi/gdbserver /home/administrator/
> Development/android-ndk-r6b/samples/nativeStaticLibDemo/libs/armeabi-
> v7a/gdbserver /home/administrator/Development/android-ndk-r6b/samples/
> nativeStaticLibDemo/libs/x86/gdbserver
> rm -f /home/administrator/Development/android-ndk-r6b/samples/
> nativeStaticLibDemo/libs/armeabi/gdb.setup /home/administrator/
> Development/android-ndk-r6b/samples/nativeStaticLibDemo/libs/armeabi-
> v7a/gdb.setup /home/administrator/Development/android-ndk-r6b/samples/
> nativeStaticLibDemo/libs/x86/gdb.setup
>
> Any pointer is really helpful.
>
> Regards,
> Meraj
>
> --
> You received this message because you are subscribed to the Google Groups
> "android-ndk" group.
> To post to this group, send email to android-...@googlegroups.com.
> To unsubscribe from this group, send email to
> android-ndk+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/android-ndk?hl=en.
>
>

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to