ifneq ($(CONFIG_SDK)$(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4),)
BUILD_LZ4_TOOLS = y
endif
+ifneq ($(CONFIG_SDK)$(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZO),)
+ BUILD_LZO_TOOLS = y
+endif
tools-y += autoconf
tools-y += autoconf-archive
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_B43_TOOLS),y) += b43-tools
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_ISL),y) += isl
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_LZ4_TOOLS),y) += lz4
+tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_LZO_TOOLS),y) += lzop
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_TOOLCHAIN),y) += gmp mpc mpfr
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_apm821xx)$(CONFIG_TARGET_gemini),y) += genext2fs
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_ath79),y) += lzma-old squashfs
$(curdir)/libressl/compile := $(curdir)/pkgconf/compile
$(curdir)/libtool/compile := $(curdir)/automake/compile $(curdir)/missing-macros/compile
$(curdir)/lzma-old/compile := $(curdir)/zlib/compile
+$(curdir)/lzop/compile := $(curdir)/cmake/compile $(curdir)/liblzo/compile
$(curdir)/llvm-bpf/compile := $(curdir)/cmake/compile
$(curdir)/make-ext4fs/compile := $(curdir)/zlib/compile
$(curdir)/meson/compile := $(curdir)/ninja/compile
--- /dev/null
+#
+# Copyright (C) 2022 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:=lzop
+PKG_VERSION:=1.04
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.lzop.org/download/
+PKG_HASH:=7e72b62a8a60aff5200a047eea0773a8fb205caf7acbe1774d95147f305a2f41
+
+PKG_LICENSE:=GPL-2.0-or-later
+PKG_LICENSE_FILES:=COPYING
+
+CMAKE_BINARY_SUBDIR:=openwrt-build
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+CMAKE_HOST_OPTIONS += \
+ -DENABLE_DOCS=ON \
+ -DBUILD_TESTING=OFF
+
+define Host/Uninstall
+ rm -f $(STAGING_DIR_HOST)/bin/lzop
+endef
+
+$(eval $(call HostBuild))
--- /dev/null
+--- a/CMakeLists.txt 2017-08-10 04:19:45.000000000 -0700
++++ b/CMakeLists.txt 2022-11-28 17:21:03.453548350 -0800
+@@ -50,6 +50,9 @@
+
+ project(lzop VERSION 1.04 LANGUAGES C)
+
++# configuration options
++option(ENABLE_DOCS "Install documentation." ON)
++
+ # install directories
+ if(NOT CMAKE_INSTALL_PREFIX)
+ message(FATAL_ERROR "ERROR: CMAKE_INSTALL_PREFIX is not defined.")
+@@ -186,9 +189,11 @@
+
+ install(TARGETS lzop DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}")
+
++if(ENABLE_DOCS)
+ set(f AUTHORS COPYING NEWS README THANKS doc/lzop.html doc/lzop.man doc/lzop.pod doc/lzop.ps doc/lzop.tex doc/lzop.txt)
+ install(FILES ${f} DESTINATION "${CMAKE_INSTALL_FULL_DOCDIR}")
+ install(FILES doc/lzop.1 DESTINATION "${CMAKE_INSTALL_FULL_MANDIR}/man1")
++endif() # ENABLE_DOCS
+
+ endif() # CMAKE_INSTALL_FULL_LIBDIR
+