libpng: switch to CMake
Allows simplification of the Makefile. Remove no more needed patch. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
0304dcea72
commit
a1b14ab929
2 changed files with 16 additions and 32 deletions
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=libpng
|
PKG_NAME:=libpng
|
||||||
PKG_VERSION:=1.6.37
|
PKG_VERSION:=1.6.37
|
||||||
PKG_RELEASE:=4
|
PKG_RELEASE:=5
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||||
PKG_SOURCE_URL:=@SF/libpng
|
PKG_SOURCE_URL:=@SF/libpng
|
||||||
|
@ -20,11 +20,10 @@ PKG_LICENSE:=Libpng GPL-2.0-or-later BSD-3-Clause
|
||||||
PKC_LICENSE_FILES:=LICENSE contrib/gregbook/COPYING contrib/gregbook/LICENSE
|
PKC_LICENSE_FILES:=LICENSE contrib/gregbook/COPYING contrib/gregbook/LICENSE
|
||||||
PKG_CPE_ID:=cpe:/a:libpng:libpng
|
PKG_CPE_ID:=cpe:/a:libpng:libpng
|
||||||
|
|
||||||
PKG_FIXUP:=autoreconf
|
|
||||||
PKG_INSTALL:=1
|
|
||||||
PKG_BUILD_PARALLEL:=1
|
PKG_BUILD_PARALLEL:=1
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
include $(INCLUDE_DIR)/cmake.mk
|
||||||
|
|
||||||
define Package/libpng
|
define Package/libpng
|
||||||
SECTION:=libs
|
SECTION:=libs
|
||||||
|
@ -34,28 +33,26 @@ define Package/libpng
|
||||||
URL:=http://www.libpng.org/pub/png/libpng.html
|
URL:=http://www.libpng.org/pub/png/libpng.html
|
||||||
endef
|
endef
|
||||||
|
|
||||||
TARGET_CFLAGS += $(FPIC)
|
CMAKE_OPTIONS += \
|
||||||
|
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
||||||
|
-DPNG_BUILD_ZLIB=ON \
|
||||||
|
-DPNG_SHARED=ON \
|
||||||
|
-DPNG_STATIC=ON \
|
||||||
|
-DPNG_TESTS=OFF \
|
||||||
|
-DPNG_FRAMEWORK=OFF \
|
||||||
|
-DPNG_DEBUG=OFF \
|
||||||
|
-DPNG_HARDWARE_OPTIMIZATIONS=O$(if $(findstring powerpc,$(CONFIG_ARCH)),FF,N) \
|
||||||
|
-Dld-version-script=OFF
|
||||||
|
|
||||||
CONFIGURE_ARGS += \
|
TARGET_LDFLAGS += -lz
|
||||||
--enable-shared \
|
|
||||||
--enable-static \
|
|
||||||
$(if $(findstring neon,$(CONFIG_CPU_TYPE))$(findstring aarch64,$(CONFIG_ARCH)), \
|
|
||||||
--enable-hardware-optimizations=yes --enable-arm-neon=yes)
|
|
||||||
|
|
||||||
define Build/InstallDev
|
define Build/InstallDev
|
||||||
$(INSTALL_DIR) $(1)/usr/bin
|
$(call Build/InstallDev/cmake,$(1))
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/libpng{,16}-config $(1)/usr/bin/
|
|
||||||
$(SED) \
|
$(SED) \
|
||||||
's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
|
's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
|
||||||
$(1)/usr/bin/libpng{,16}-config
|
$(1)/usr/bin/libpng{,16}-config
|
||||||
$(INSTALL_DIR) $(1)/usr/include
|
$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libpng16.pc
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/png{,conf,libconf}.h $(1)/usr/include/
|
$(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libpng16.pc
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/libpng16 $(1)/usr/include/
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpng16.{a,la,so*} $(1)/usr/lib/
|
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpng.{a,la,so} $(1)/usr/lib/
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libpng{,16}.pc $(1)/usr/lib/pkgconfig/
|
|
||||||
$(INSTALL_DIR) $(2)/bin
|
$(INSTALL_DIR) $(2)/bin
|
||||||
for f in libpng{,16}-config; do \
|
for f in libpng{,16}-config; do \
|
||||||
$(LN) ../../usr/bin/$$$$f $(2)/bin/ ; \
|
$(LN) ../../usr/bin/$$$$f $(2)/bin/ ; \
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
diff --git a/configure.ac b/configure.ac
|
|
||||||
index a978473..302ac4d 100644
|
|
||||||
--- a/configure.ac
|
|
||||||
+++ b/configure.ac
|
|
||||||
@@ -70,7 +70,7 @@ AC_PROG_MAKE_SET
|
|
||||||
dnl libtool/libtoolize; version 2.4.2 is the tested version. This or any
|
|
||||||
dnl compatible later version may be used
|
|
||||||
LT_INIT([win32-dll])
|
|
||||||
-LT_PREREQ([2.4.2])
|
|
||||||
+LT_PREREQ([2.4])
|
|
||||||
|
|
||||||
# Some awks crash when confronted with pnglibconf.dfa, do a test run now
|
|
||||||
# to make sure this doesn't happen
|
|
Loading…
Reference in a new issue