Android.mk

LOCAL_STATIC_LIBRARIES

These are the static libraries that you want to include in your module. Mostly, we use shared libraries, but there are a couple of places, like executables in sbin and host executables where we use static libraries instead.

LOCAL_WHOLE_STATIC_LIBRARIES

These are the static libraries that you want to include in your module without allowing the linker to remove dead code from them. This is mostly useful if you want to add a static library to a shared library and have the static library's content exposed from the shared library.

是否链接到调用者模块 使用了静态库的global变量 不使用
LOCAL_STATIC_LIBRARIES  Y N
LOCAL_WHOLE_STATIC_LIBRARIES  Y Y

现在我们需要静态编译源码中的libchromium_net库,由源码分析可知,libchromium_net需要依赖libicuuc和libicui18n,而libicui18n又会依赖libicuuc。现在我们需要将libicui18n和libicuuc静态编译到libchromium_net中,这里就存在一个嵌套编译的问题

提示编译libicui18n时找不到libicuuc中的部分函数。但我们明明已经加载了静态库libicuuc,这是为什么呢?

因为在Android.mk文件中,我们先引入了libicuuc,系统就引入了libicuuc中所需要的函数,然后再引入libicui18n中所需要的函数,但是系统引入的时候不会递归引入(就是引入libicui18n所需函数的同时再引入这些函数所需的函数),所以libicui18n中所包含的libicuuc并没有被引入。

当开始编译的时候,如果libicui18n和libchromium_net所需要的libicuuc中的函数相同,就没问题。但是如果不同的话,就会提示libicuuc中部分函数找不到。


error:

http://stackoverflow.com/questions/12598933/ndk-build-createprocess-make-e-87-the-parameter-is-incorrect

process_begin: CreateProcess( "PATH"\android-ndk-r8b\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin\arm-linux-androideabi-ar.exe, "some other commands" ) failed.make (e=87): The parameter is incorrect.

make: *** [obj/local/armeabi-v7a/staticlib.a] Error 87

issue:

second parameter of CreateProcess Win API function lpCommandLine has max length 32,768 characters. But in my case it is more than 32,768 characters.

Note that any other value than 'true' will revert to the default behaviour. You can also define APP_SHORT_COMMANDS in your Application.mk to force this behaviour for all modules in your project.

NOTE: We do not recommend enabling this feature by default, since it makes the build slower.

在Android.mk文件中添加:LOCAL_SHORT_COMMANDS := true

在Application.mk文件中添加:APP_SHORT_COMMANDS := true


你可能感兴趣的:(Android.mk)