tools: add ucl and upx

This commit is contained in:
Lienol 2020-02-18 13:23:41 +08:00
parent cc4072d3d2
commit aefa547bfa
3 changed files with 88 additions and 0 deletions

View File

@ -26,6 +26,7 @@ tools-y += e2fsprogs fakeroot findutils firmware-utils flex gengetopt
tools-y += libressl libtool lzma m4 make-ext4fs missing-macros mkimage
tools-y += mklibs mm-macros mtd-utils mtools padjffs2 patch-image
tools-y += patchelf pkgconf quilt squashfskit4 sstrip zip zlib zstd
tools-y += ucl upx
tools-$(BUILD_B43_TOOLS) += b43-tools
tools-$(BUILD_ISL) += isl
tools-$(BUILD_TOOLCHAIN) += expat gmp libelf mpc mpfr
@ -37,6 +38,7 @@ tools-$(CONFIG_USES_MINOR) += kernel2minor
tools-$(CONFIG_USE_SPARSE) += sparse
# builddir dependencies
$(curdir)/upx/compile := $(curdir)/ucl/compile
$(curdir)/autoconf/compile := $(curdir)/m4/compile
$(curdir)/automake/compile := $(curdir)/m4/compile $(curdir)/autoconf/compile $(curdir)/pkgconf/compile $(curdir)/xz/compile
$(curdir)/b43-tools/compile := $(curdir)/bison/compile

51
tools/ucl/Makefile Normal file
View File

@ -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))

35
tools/upx/Makefile Normal file
View File

@ -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))