diff --git a/pkg/Kconfig b/pkg/Kconfig index 26f4b61513..66ae3190ba 100644 --- a/pkg/Kconfig +++ b/pkg/Kconfig @@ -29,6 +29,7 @@ rsource "libfixmath/Kconfig" rsource "libhydrogen/Kconfig" rsource "lora-serialization/Kconfig" rsource "lvgl/Kconfig" +rsource "lz4/Kconfig" rsource "micro-ecc/Kconfig" rsource "microcoap/Kconfig" rsource "minmea/Kconfig" diff --git a/pkg/lz4/Kconfig b/pkg/lz4/Kconfig new file mode 100644 index 0000000000..9667ea32d0 --- /dev/null +++ b/pkg/lz4/Kconfig @@ -0,0 +1,9 @@ +# Copyright (c) 2021 Inria +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. + +config PACKAGE_LZ4 + bool "LZ4 fast compression library" + depends on TEST_KCONFIG diff --git a/pkg/lz4/Makefile b/pkg/lz4/Makefile new file mode 100644 index 0000000000..e8ce06320b --- /dev/null +++ b/pkg/lz4/Makefile @@ -0,0 +1,9 @@ +PKG_NAME=lz4 +PKG_URL=https://github.com/lz4/lz4 +PKG_VERSION=d44371841a2f1728a3f36839fd4b7e872d0927d3 # v1.9.3 +PKG_LICENSE=BSD + +include $(RIOTBASE)/pkg/pkg.mk + +all: + $(QQ)"$(MAKE)" -f $(CURDIR)/$(PKG_NAME).mk -C $(PKG_SOURCE_DIR)/lib diff --git a/pkg/lz4/Makefile.dep b/pkg/lz4/Makefile.dep new file mode 100644 index 0000000000..d3b78d3cf4 --- /dev/null +++ b/pkg/lz4/Makefile.dep @@ -0,0 +1,2 @@ +# lz4 cannot be built on 8bit and 16bit architectures +FEATURES_BLACKLIST += arch_8bit arch_16bit diff --git a/pkg/lz4/Makefile.include b/pkg/lz4/Makefile.include new file mode 100644 index 0000000000..0d2c47886a --- /dev/null +++ b/pkg/lz4/Makefile.include @@ -0,0 +1 @@ +INCLUDES += -I$(PKGDIRBASE)/lz4/lib diff --git a/pkg/lz4/doc.txt b/pkg/lz4/doc.txt new file mode 100644 index 0000000000..ed091e8b9a --- /dev/null +++ b/pkg/lz4/doc.txt @@ -0,0 +1,19 @@ +/** + * @defgroup pkg_lz4 LZ4 compression library + * @ingroup pkg + * @brief LZ4 is a fast compression library + * + * # Note about memory + * + * By default, the LZ4 implementation allocates memory on the stack. This + * way compression/decompression functions are fast but this comes at the cost + * of RAM usage. + * It is important to allocated enough stack memory (at least 16384 bytes) to + * any thread using LZ4 primitives. + * + * # License + * + * Licensed under BSD 2-clause. + * + * @see https://github.com/lz4/lz4 + */ diff --git a/pkg/lz4/lz4.mk b/pkg/lz4/lz4.mk new file mode 100644 index 0000000000..66273c6547 --- /dev/null +++ b/pkg/lz4/lz4.mk @@ -0,0 +1,8 @@ +MODULE = lz4 + +SRC := \ + lz4.c \ + lz4hc.c \ + # + +include $(RIOTBASE)/Makefile.base