How to run ranlib on an archive built through Android.mk?
Asked Answered
D

1

3

This has come up on a couple of libraries I work with regularly. See, for example:

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.

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.

When using Android.mk to build a static archive, how do we run ranlib on an archive through Android.mk?

Dactylology answered 31/3, 2016 at 17:35 Comment(0)
C
2

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
Cathicathie answered 10/5, 2018 at 13:40 Comment(1)
Thanks. I believe the command you showed uses OpenSSL makefile. This question is trying to determine how to have Android.mk run ranlib on the archive at build time. I also believe the OpenSSL makefile is broken in that it runs ranlib during install instead of a regular make [all] (or some other target). Make is not supposed to build components during install target.Dactylology

© 2022 - 2024 — McMap. All rights reserved.