title: Adding libpng in android ndk project
body: <p>I've searched a lot of topics about linking libpng to my android ndk project but I've found right answer for my problem and I hope somebody will help me. </p>
  
  <p>This is hierarchy of my project:</p>
  
  <p>jni </p>
  
  <pre><code>different_cpp_files
  different_hpp_files
  Android.mk
  libpng
      different_cpp_files
      different_hpp_files
      Android.mk
  </code></pre>
  
  <p>Android.mk in libpng folder:</p>
  
  <hr>
  
  <pre><code>LOCAL_PATH:= $(call my-dir)
  
  include $(CLEAR_VARS)
  
  LS_C=$(subst $(1)/,,$(wildcard $(1)/*.c))
  
  LOCAL_MODULE := png
  
  LOCAL_SRC_FILES := \
  
  $(filter-out example.c pngtest.c,$(call LS_C,$(LOCAL_PATH)))
  
  LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
  
  LOCAL_EXPORT_LDLIBS := -lz
  
  include $(BUILD_STATIC_LIBRARY)
  </code></pre>
  
  <hr>
  
  <p>I suppose that everything is right here..</p>
  
  <p>Android.mk in jni folder:</p>
  
  <hr>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  
  include $(CLEAR_VARS)
  
  LS_CPP=$(subst $(1)/,,$(wildcard $(1)/*.cpp))
  
  LOCAL_MODULE    := pacman
  
  LOCAL_CFLAGS    := -Wno-psabi
  
  LOCAL_SRC_FILES := $(call LS_CPP,$(LOCAL_PATH))
  
  LOCAL_LDLIBS    := -landroid -llog -lEGL -lGLESv1_CM -lOpenSLES
  
  LOCAL_STATIC_LIBRARIES := android_native_app_glue png
  
  include $(BUILD_SHARED_LIBRARY)
  
  $(call import-module,android/native_app_glue)
  
  $(call import-module,libpng)
  </code></pre>
  
  <hr>
  
  <p>The last line shows that I got libpng like native_app_glue lib(in the directory of android-ndk sources) Now I want to compile libpng from my project. What I need to change in Android.mk file?</p>