如何在通过 Android.mk 构建的存档上运行 ranlib? [英] How to run ranlib on an archive built through Android.mk?
问题描述
这出现在我经常使用的几个图书馆中.参见,例如:
This has come up on a couple of libraries I work with regularly. See, for example:
在问题中,用户为 OpenSSL 和 Crypto++ 库创建了一个 Android.mk.痛点似乎是用户将 Android.mk 包装器添加到源代码中.
In the questions, the users created an Android.mk for the OpenSSL and Crypto++ libraries. The pain point seems to be users adding the Android.mk wrapper to the sources.
在Android之外,每个项目都是基于Makefile,每个项目构建一个静态存档,每个项目基于静态存档构建一个共享对象.每个项目还在静态存档上运行 ranlib
.Crypto++ 对 ranlib
的需求特别敏感,因为它是一个 C++ 库和 One Definition违反规则会导致未定义的行为.
Outside of Android, each project is Makefile based, each project builds a static archive, and each project builds a shared object based on the static archive. Each project also runs ranlib
on the static archive. Crypto++ is especially sensitive to the need for ranlib
because its a C++ library and One Definition Rule violations lead to undefined behavior.
使用Android.mk构建静态存档时,如何通过Android.mk在存档上运行ranlib?
When using Android.mk to build a static archive, how do we run ranlib on an archive through Android.mk?
推荐答案
我遇到了类似的问题,并在 这个网站 为我修复了它
I was running into similar issues and found a command on this website which fixed it for me
# The -E is important. Root needs some of the user's environment
$ sudo -E make install CC=$ANDROID_TOOLCHAIN/arm-linux-androideabi-gcc RANLIB=$ANDROID_TOOLCHAIN/arm-linux-androideabi-ranlib
这篇关于如何在通过 Android.mk 构建的存档上运行 ranlib?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!