[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/libpng-1.6.37/scripts/genchk.cmake.in b/ap/lib/libpng/libpng-1.6.37/scripts/genchk.cmake.in
new file mode 100755
index 0000000..ab3b9d7
--- /dev/null
+++ b/ap/lib/libpng/libpng-1.6.37/scripts/genchk.cmake.in
@@ -0,0 +1,37 @@
+# genchk.cmake.in
+# Generate .chk from .out with awk (generic), based upon the automake logic.
+
+# Copyright (C) 2016 Glenn Randers-Pehrson
+# Written by Roger Leigh, 2016
+
+# This code is released under the libpng license.
+# For conditions of distribution and use, see the disclaimer
+# and license in png.h
+
+# Variables substituted from CMakeLists.txt
+set(SRCDIR "@CMAKE_CURRENT_SOURCE_DIR@")
+
+set(AWK "@AWK@")
+
+get_filename_component(INPUTEXT "${INPUT}" EXT)
+get_filename_component(OUTPUTEXT "${OUTPUT}" EXT)
+get_filename_component(INPUTBASE "${INPUT}" NAME_WE)
+get_filename_component(OUTPUTBASE "${OUTPUT}" NAME_WE)
+get_filename_component(INPUTDIR "${INPUT}" PATH)
+get_filename_component(OUTPUTDIR "${OUTPUT}" PATH)
+
+if("${INPUTEXT}" STREQUAL ".out" AND "${OUTPUTEXT}" STREQUAL ".chk")
+  # Generate .chk from .out with awk (generic)
+  file(REMOVE "${OUTPUT}" "${OUTPUTDIR}/${OUTPUTBASE}.new")
+  execute_process(COMMAND "${AWK}" -f "${SRCDIR}/scripts/checksym.awk"
+                          "${SRCDIR}/scripts/${INPUTBASE}.def"
+                          "of=${OUTPUTDIR}/${OUTPUTBASE}.new"
+                          "${INPUT}"
+                  RESULT_VARIABLE AWK_FAIL)
+  if(AWK_FAIL)
+    message(FATAL_ERROR "Failed to generate ${OUTPUTDIR}/${OUTPUTBASE}.new")
+  endif()
+  file(RENAME "${OUTPUTDIR}/${OUTPUTBASE}.new" "${OUTPUT}")
+else()
+  message(FATAL_ERROR "Unsupported conversion: ${INPUTEXT} to ${OUTPUTEXT}")
+endif()