Adding prebuilt shared library to Android Build System

Last two days i was unable to do a neat eng build for my galaxy note from cyanogen source. I was running into errors like unable to find libUMP.so and libion.so while building exynos hal specifically libgralloc_ump.
I was applying dirty workaround copy libUMP.so and libion.so to libUMP.so and libion.so and build again.
Another neat way to do is add both lib as prebuilt shared library to build system. For that you need to create projects for each and add it to product package.let me show how to do that for libUMP

  1. create a folder named libUMP in external folder.
  2. copy libUMP.so to the folder
  3. create make file named Android.mk
  4. paste the content to Android.mk
    1
    2
    3
    4
    5
    6
    7
    8
    LOCAL_PATH:= $(call my-dir)
    include $(CLEAR_VARS)
    LOCAL_MODULE := libUMP
    LOCAL_SRC_FILES := libUMP.so
    LOCAL_MODULE_TAGS := optional
    LOCAL_MODULE_CLASS := STATIC_LIBRARIES
    LOCAL_MODULE_SUFFIX := .so
    include $(BUILD_PREBUILT)
  5. now add libUMP( LOCAL_MODULE value in Android.mk) to your product make file. in my case i will add this line to n7000.mk
    1
    2
    PRODUCT_PACKAGES += \
          libUMP \
  6. repeat same for libion dont forget to replace libUMP with libion also dont forget to copy corresponding library file.

Enjoy ROM building

猜你喜欢

转载自blog.csdn.net/txbthy/article/details/18845961