0

How to add a shared library (let it be libXYZ.so) as a dependency for a LOCAL_MODULE target, when libXYZ.so does not link to the target directly.

How to make sure build system first builds the dependency(libXYZ.so) and then execute commands for LOCAL_MODULE from a Android.mk

This is required because in my build, the dependency (libXYZ.so) it self is not used but a symlink with different name is used. (libABC.so -> libXYZ.so). The symlink is generated after the shared library is created, as part of LOCAL_POST_INSTALL_CMD.

kanna
  • 1,412
  • 1
  • 15
  • 33

1 Answers1

0

You can add the library to the prerequisite list:

LOCAL_MODULE: libXYZ.so

but then you must trust the rule that builds the library also builds the symlink. It would be safer to make the symlink itself a target, make the symlink a prereq of the module, and make the library a prereq of the symlink.

Beta
  • 96,650
  • 16
  • 149
  • 150
  • I have multilib build and symlinks were created using post install comand. As you said there is no gurantee that the links will be created. How can I create a target that create symlinks. I'm unable to figure out how to do that in way that works on 32 bit and multilib builds. – kanna Mar 02 '16 at 12:47
  • Do you know how to create symbolic links *without* Make (e.g. `ln -d libXYZ.so libABC.so`)? Do you wish to write a makefile that will work under multiple operating systems? – Beta Mar 03 '16 at 23:58