X-OpenWrt/CustomFiles/Patches/0003-upx-ucl-19.07.patch

137 lines
4.0 KiB
Diff
Executable File

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: slitaz-cn <teasiu@163.com>
Date: Tue, 6 Apr 2021 01:25:07 +0800
Subject: [PATCH] add upx ucl for 19.07.7
Signed-off-by: slitaz-cn <teasiu@163.com>
---
tools/Makefile | 3 ++-
tools/ucl/Makefile | 51 ++++++++++++++++++++++++++++++++++++++++++++++
tools/upx/Makefile | 35 +++++++++++++++++++++++++++++++
3 files changed, 88 insertions(+), 1 deletion(-)
create mode 100644 tools/ucl/Makefile
create mode 100644 tools/upx/Makefile
diff --git a/tools/Makefile b/tools/Makefile
index b8d986b80c..bcde9a720d 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -33,7 +33,7 @@ tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
tools-$(CONFIG_TARGET_ar71xx) += lzma-old
tools-$(CONFIG_TARGET_ar71xx)$(CONFIG_TARGET_ath79) += squashfs
tools-$(CONFIG_USES_MINOR) += kernel2minor
-tools-y += lzma squashfskit4 zip
+tools-y += lzma squashfskit4 zip ucl upx
tools-$(BUILD_B43_TOOLS) += b43-tools
tools-$(BUILD_ISL) += isl
tools-$(CONFIG_USE_SPARSE) += sparse
@@ -46,6 +46,7 @@ $(curdir)/flex/compile := $(curdir)/libtool/compile
$(curdir)/libtool/compile := $(curdir)/m4/compile $(curdir)/autoconf/compile $(curdir)/automake/compile $(curdir)/missing-macros/compile
$(curdir)/squashfs/compile := $(curdir)/lzma-old/compile
$(curdir)/squashfskit4/compile := $(curdir)/xz/compile $(curdir)/zlib/compile
+$(curdir)/upx/compile := $(curdir)/ucl/compile
$(curdir)/quilt/compile := $(curdir)/autoconf/compile $(curdir)/findutils/compile
$(curdir)/autoconf/compile := $(curdir)/m4/compile
$(curdir)/automake/compile := $(curdir)/m4/compile $(curdir)/autoconf/compile $(curdir)/pkg-config/compile $(curdir)/xz/compile
diff --git a/tools/ucl/Makefile b/tools/ucl/Makefile
new file mode 100644
index 0000000000..9fb9aec117
--- /dev/null
+++ b/tools/ucl/Makefile
@@ -0,0 +1,51 @@
+#
+# Copyright (C) 2019 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ucl
+PKG_VERSION:=1.03
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.oberhumer.com/opensource/ucl/download/$(PKG_SOURCE)
+PKG_HASH:=b865299ffd45d73412293369c9754b07637680e5c826915f097577cd27350348
+
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/host-build.mk
+
+HOSTCC :=gcc
+HOST_CFLAGS +=-std=gnu89
+
+define Host/Prepare
+ $(Host/Prepare/Default)
+ mkdir -p $(STAGING_DIR_HOST)/include/ucl
+endef
+
+define Host/Configure
+ (cd $(HOST_BUILD_DIR); \
+ CC="$(HOSTCC)" \
+ CFLAGS="$(HOST_CFLAGS)" \
+ ./configure --prefix=$(STAGING_DIR_HOST) \
+ );
+ $(call Host/Configure/Default)
+endef
+
+define Host/Compile
+ $(MAKE) -C $(HOST_BUILD_DIR)
+endef
+
+define Host/Install
+ $(MAKE) -C $(HOST_BUILD_DIR) install
+endef
+
+define Host/Clean
+ $(MAKE) -C $(HOST_BUILD_DIR) uninstall
+ rm -rf $(HOST_BUILD_DIR)
+ rm -rf $(STAGING_DIR_HOST)/include/ucl
+endef
+
+$(eval $(call HostBuild))
diff --git a/tools/upx/Makefile b/tools/upx/Makefile
new file mode 100644
index 0000000000..fbf1dfbd2e
--- /dev/null
+++ b/tools/upx/Makefile
@@ -0,0 +1,35 @@
+#
+# Copyright (C) 2011-2020 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=upx
+PKG_VERSION:=3.95
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.xz
+PKG_SOURCE_URL:=https://github.com/upx/upx/releases/download/v$(PKG_VERSION)
+PKG_HASH:=3b0f55468d285c760fcf5ea865a070b27696393002712054c69ff40d8f7f5592
+
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)-src
+
+include $(INCLUDE_DIR)/host-build.mk
+
+define Host/Compile
+ UPX_UCLDIR=$(STAGING_DIR_HOST) \
+ $(MAKE) -C $(HOST_BUILD_DIR)/src \
+ CXXFLAGS_WERROR="" LDFLAGS="$(HOST_LDFLAGS)" \
+ CXX="$(HOSTCXX)"
+endef
+
+define Host/Install
+ $(CP) $(HOST_BUILD_DIR)/src/upx.out $(STAGING_DIR_HOST)/bin/upx
+endef
+
+define Host/Clean
+ rm -f $(STAGING_DIR_HOST)/bin/upx
+endef
+
+$(eval $(call HostBuild))
--
2.20.1