[Feature][ZXW-88]merge P50 version

Only Configure: No
Affected branch: master
Affected module: unknown
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No

Change-Id: I34667719d9e0e7e29e8e4368848601cde0a48408
diff --git a/ap/lib/libpng/makefile b/ap/lib/libpng/makefile
new file mode 100755
index 0000000..5781347
--- /dev/null
+++ b/ap/lib/libpng/makefile
@@ -0,0 +1,43 @@
+
+include $(COMMON_BASE_MK)
+
+NAME=libpng
+SRC_DIR=libpng-1.6.37
+INSTALL_DIR=$(LIB_DIR)/$(NAME)/install
+BUILD_DIR=build
+GEN_MAKEFILE=$(BUILD_DIR)/Makefile
+
+CONFIG_OPTS = --target=arm-linux --host=arm-linux
+CONFIG_OPTS += --enable-static
+ifeq ($(CONFIG_LIBCURL_SHARE_LIB), y)
+CONFIG_OPTS += --enable-shared
+else
+CONFIG_OPTS += --disable-shared
+endif
+export ZLIBINC=$(LIB_DIR)/zlib/install/include
+export ZLIBLIB=$(LIB_DIR)/zlib/install/lib
+export CFLAGS += -I$(ZLIBINC)
+export CPPFLAGS += -I$(ZLIBINC)
+export LDFLAGS += -L$(ZLIBLIB)
+
+all: $(GEN_MAKEFILE)
+	make -C build all
+	make -C build install
+
+$(GEN_MAKEFILE):
+	mkdir -p $(BUILD_DIR)
+	cd $(BUILD_DIR); ../$(SRC_DIR)/configure --prefix=$(INSTALL_DIR) $(CONFIG_OPTS)
+
+clean:
+	-rm -fr $(BUILD_DIR) $(INSTALL_DIR)
+
+romfs:
+	cd $(INSTALL_DIR)/lib; \
+	for i in *.so*; do \
+		if [ -L $$i ]; then \
+			$(ROMFSINST) -s `find $$i -printf %l` /lib/$$i; \
+		elif [ -f $$i ]; then \
+			$(ROMFSINST) /lib/$$i; \
+		fi; \
+	done
+