diff --git a/pkg/Kconfig b/pkg/Kconfig index 537594aa57..4feea70743 100644 --- a/pkg/Kconfig +++ b/pkg/Kconfig @@ -54,6 +54,7 @@ rsource "micro-ecc/Kconfig" rsource "microcoap/Kconfig" rsource "micropython/Kconfig" rsource "minmea/Kconfig" +rsource "mjson/Kconfig" rsource "monocypher/Kconfig" rsource "mynewt-core/Kconfig" rsource "nanocbor/Kconfig" diff --git a/pkg/mjson/Kconfig b/pkg/mjson/Kconfig new file mode 100644 index 0000000000..8efce0a8bf --- /dev/null +++ b/pkg/mjson/Kconfig @@ -0,0 +1,9 @@ +# Copyright (c) 2023 Koen Zandberg +# +# 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_MJSON + bool "mjson" + depends on TEST_KCONFIG diff --git a/pkg/mjson/Makefile b/pkg/mjson/Makefile new file mode 100644 index 0000000000..f2d4fd40fc --- /dev/null +++ b/pkg/mjson/Makefile @@ -0,0 +1,10 @@ +PKG_NAME=mjson +PKG_URL=https://github.com/cesanta/mjson +# v1.2.7 +PKG_VERSION=032a2eaca1a989e56d88218f2a3cb91a68afebe8 +PKG_LICENSE=MIT + +include $(RIOTBASE)/pkg/pkg.mk + +all: + $(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/src -f $(CURDIR)/$(PKG_NAME).mk diff --git a/pkg/mjson/Makefile.include b/pkg/mjson/Makefile.include new file mode 100644 index 0000000000..33bd7b90f0 --- /dev/null +++ b/pkg/mjson/Makefile.include @@ -0,0 +1 @@ +INCLUDES += -I$(PKGDIRBASE)/mjson/src diff --git a/pkg/mjson/doc.txt b/pkg/mjson/doc.txt new file mode 100644 index 0000000000..043973b2ab --- /dev/null +++ b/pkg/mjson/doc.txt @@ -0,0 +1,16 @@ +/** + * @defgroup pkg_mjson mjson + * @ingroup pkg + * @brief mjson - a JSON parser + emitter + JSON-RPC engine + * + * # Introduction + * + * mjson is a small, embedded-friendly JSON parser, emitter and JSON-RPC + * engine. + * + * # License + * + * Licensed under MIT. + * + * @see https://github.com/cesanta/mjson + */ diff --git a/pkg/mjson/mjson.mk b/pkg/mjson/mjson.mk new file mode 100644 index 0000000000..f57a2d5d90 --- /dev/null +++ b/pkg/mjson/mjson.mk @@ -0,0 +1,7 @@ +MODULE = mjson + +# The mjson_merge function requires an alloca implementation, disabled to +# prevent stack memory allocations +CFLAGS += -DMJSON_ENABLE_MERGE=0 + +include $(RIOTBASE)/Makefile.base