Managing AOSP Project Interdependencies using LOCAL_EXPORT_C_INCLUDE_DIRS
I recently submitted and had merged this change to the AOSP. I was prompted by a question on the android-platform group and also my own requirement to make use of the zlib headers in a new Android.mk I was creating ....
The patch adds
"LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)"
to the libraries built by external/zlib/Android.mk fragment. Include this variable creates an entry in the export_includes of the libz (in this case ) intermediates output directory. The effect of this means you no longer need to include LOCAL_C_INCLUDES := external/zlib in the Android.mk of a project that depend on libz, just LOCAL_SHARED_LIBRARIES := libz is sufficient.
Obviously zlib is just the example here and LOCAL_EXPORT_C_INCLUDE_DIRS should be used wherever you have a project interdependencies. It means your makefiles will be more "portable" due to less hardcoded paths as well as reducing the Maintenance should a project you are referencing be moved at any point 9 which from experience is not a uncommon occurrence..https://android-review.googlesource.com/#/c/116708/