!interpreters/lua: Align naming of configuration options

Aligns `CONFIG_INTERPRETER_*` options to `CONFIG_INTERPRETERS_*` options
to be consistent with other interpreters.

BREAKING CHANGE: All configurations using `CONFIG_INTERPRETER_LUA_*`
options will no longer compile due to missing symbol errors. The fix is
very quick: any configurations using this options should add a trailing
S following INTERPRETER in the affected Kconfig variables. I believe
`./tools/refresh.sh` should also be capable of doing this automatically.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This commit is contained in:
Matteo Golin 2026-02-15 16:24:23 -05:00 committed by simbit18
parent be2cdfa597
commit 468ded86bb
4 changed files with 30 additions and 30 deletions

View file

@ -32,7 +32,7 @@ if(CONFIG_INTERPRETERS_LUA)
set(LUA_URL https://github.com/lua/lua/archive/refs/tags/)
FetchContent_Declare(
lua_fetch
URL ${LUA_URL}/v${CONFIG_INTERPRETER_LUA_VERSION}.tar.gz SOURCE_DIR
URL ${LUA_URL}/v${CONFIG_INTERPRETERS_LUA_VERSION}.tar.gz SOURCE_DIR
${CMAKE_CURRENT_LIST_DIR}/lua BINARY_DIR
${CMAKE_BINARY_DIR}/apps/interpreters/lua/lua
DOWNLOAD_NO_PROGRESS true
@ -49,17 +49,17 @@ if(CONFIG_INTERPRETERS_LUA)
# Flags
# ############################################################################
set(CFLAGS -DLUA_MAXINPUT=${CONFIG_INTERPRETER_LUA_IOBUFSIZE}
set(CFLAGS -DLUA_MAXINPUT=${CONFIG_INTERPRETERS_LUA_IOBUFSIZE}
-DLUA_PROGNAME=\"lua\")
if(CONFIG_INTERPRETER_LUA_32BITS)
if(CONFIG_INTERPRETERS_LUA_32BITS)
list(APPEND CFLAGS -DLUA_32BITS)
endif()
if(NOT "${CONFIG_INTERPRETER_LUA_PATH}" STREQUAL "")
list(APPEND CFLAGS -DLUA_PATH_DEFAULT=\"${CONFIG_INTERPRETER_LUA_PATH}\")
if(NOT "${CONFIG_INTERPRETERS_LUA_PATH}" STREQUAL "")
list(APPEND CFLAGS -DLUA_PATH_DEFAULT=\"${CONFIG_INTERPRETERS_LUA_PATH}\")
endif()
if(NOT "${CONFIG_INTERPRETER_LUA_CPATH}" STREQUAL "")
list(APPEND CFLAGS -DLUA_CPATH_DEFAULT=\"${CONFIG_INTERPRETER_LUA_CPATH}\")
if(NOT "${CONFIG_INTERPRETERS_LUA_CPATH}" STREQUAL "")
list(APPEND CFLAGS -DLUA_CPATH_DEFAULT=\"${CONFIG_INTERPRETERS_LUA_CPATH}\")
endif()
if(CONFIG_SYSTEM_READLINE)
@ -96,7 +96,7 @@ if(CONFIG_INTERPRETERS_LUA)
${CORELIBS_SRCS})
list(APPEND CSRCS nuttx_linit.c)
if(CONFIG_INTERPRETER_LUA_CORELIBS)
if(CONFIG_INTERPRETERS_LUA_CORELIBS)
list(APPEND CSRCS ${CORELIBS_SRCS})
set(LUA_LIB_H_PATH ${LUA_DIR}/lualib.h)
@ -135,9 +135,9 @@ if(CONFIG_INTERPRETERS_LUA)
NAME
lua
STACKSIZE
${CONFIG_INTERPRETER_LUA_STACKSIZE}
${CONFIG_INTERPRETERS_LUA_STACKSIZE}
PRIORITY
${CONFIG_INTERPRETER_LUA_PRIORITY}
${CONFIG_INTERPRETERS_LUA_PRIORITY}
SRCS
${LUA_DIR}/lua.c
${CSRCS}

View file

@ -10,55 +10,55 @@ menuconfig INTERPRETERS_LUA
select LIBC_LOCALE
---help---
Embed Lua language interpreter.
Select the Lua version with the INTERPRETER_LUA_VERSION config.
Select the Lua version with the INTERPRETERS_LUA_VERSION config.
A math library is required. Use the LIBM config or a toolchain library.
It's suggested to enable the SYSTEM_READLINE and LIBC_FLOATINGPOINT configs.
if INTERPRETERS_LUA
config INTERPRETER_LUA_VERSION
config INTERPRETERS_LUA_VERSION
string "Lua interpreter version"
default "5.4.0"
---help---
Lua release version to fetch and build.
Versions 5.2.0 and up are supported.
config INTERPRETER_LUA_CORELIBS
config INTERPRETERS_LUA_CORELIBS
bool "Load core Lua modules"
default y
select SYSTEM_SYSTEM
---help---
Load core Lua modules like "os", "string", and "table".
config INTERPRETER_LUA_PATH
config INTERPRETERS_LUA_PATH
string "Lua modules search path"
---help---
Override default package.path search path for Lua modules.
config INTERPRETER_LUA_CPATH
config INTERPRETERS_LUA_CPATH
string "Lua C modules search path"
---help---
Override default package.cpath search path for C modules.
config INTERPRETER_LUA_32BIT
config INTERPRETERS_LUA_32BIT
bool "Use 32-bit integers and floats"
default y
---help---
"Use int and float instead of long and double for Lua numbers."
config INTERPRETER_LUA_PRIORITY
config INTERPRETERS_LUA_PRIORITY
int "Lua interpreter priority"
default 100
---help---
Task priority of the Lua interpreter main task.
config INTERPRETER_LUA_STACKSIZE
config INTERPRETERS_LUA_STACKSIZE
int "Lua interpreter stack size"
default 32768
---help---
Size of the stack allocated for the Lua interpreter main task.
config INTERPRETER_LUA_IOBUFSIZE
config INTERPRETERS_LUA_IOBUFSIZE
int "I/O buffer size"
default 1024
---help---

View file

@ -25,13 +25,13 @@ include $(APPDIR)/Make.defs
# Lua built-in application info
PROGNAME = lua
PRIORITY = $(CONFIG_INTERPRETER_LUA_PRIORITY)
STACKSIZE = $(CONFIG_INTERPRETER_LUA_STACKSIZE)
PRIORITY = $(CONFIG_INTERPRETERS_LUA_PRIORITY)
STACKSIZE = $(CONFIG_INTERPRETERS_LUA_STACKSIZE)
MODULE = $(CONFIG_INTERPRETERS_LUA)
# Lua library
LUA_VERSION = $(patsubst "%",%,$(strip $(CONFIG_INTERPRETER_LUA_VERSION)))
LUA_VERSION = $(patsubst "%",%,$(strip $(CONFIG_INTERPRETERS_LUA_VERSION)))
LUA_TARBALL = v$(LUA_VERSION).tar.gz
LUA_UNPACK = lua
LUA_URL_BASE = https://github.com/lua/lua/archive/refs/tags/
@ -44,19 +44,19 @@ EXCLUDE_SRCS = $(MAINSRC) $(CORELIBS_SRCS) $(LUA_SRC)$(DELIM)onelua.c $(LUA_SRC
CSRCS = $(filter-out $(EXCLUDE_SRCS),$(wildcard $(LUA_SRC)$(DELIM)*.c))
CSRCS += nuttx_linit.c
CFLAGS += -DLUA_MAXINPUT=$(CONFIG_INTERPRETER_LUA_IOBUFSIZE)
CFLAGS += -DLUA_MAXINPUT=$(CONFIG_INTERPRETERS_LUA_IOBUFSIZE)
CFLAGS += -DLUA_PROGNAME=\"$(PROGNAME)\"
ifeq ($(CONFIG_INTERPRETER_LUA_32BITS),y)
ifeq ($(CONFIG_INTERPRETERS_LUA_32BITS),y)
CFLAGS += -DLUA_32BITS
endif
ifneq ($(CONFIG_INTERPRETER_LUA_PATH),"")
CFLAGS += -DLUA_PATH_DEFAULT=\"$(CONFIG_INTERPRETER_LUA_PATH)\"
ifneq ($(CONFIG_INTERPRETERS_LUA_PATH),"")
CFLAGS += -DLUA_PATH_DEFAULT=\"$(CONFIG_INTERPRETERS_LUA_PATH)\"
endif
ifneq ($(CONFIG_INTERPRETER_LUA_CPATH),"")
CFLAGS += -DLUA_CPATH_DEFAULT=\"$(CONFIG_INTERPRETER_LUA_CPATH)\"
ifneq ($(CONFIG_INTERPRETERS_LUA_CPATH),"")
CFLAGS += -DLUA_CPATH_DEFAULT=\"$(CONFIG_INTERPRETERS_LUA_CPATH)\"
endif
ifeq ($(CONFIG_SYSTEM_READLINE),y)
@ -83,7 +83,7 @@ endif
# Register core modules
ifeq ($(CONFIG_INTERPRETER_LUA_CORELIBS),y)
ifeq ($(CONFIG_INTERPRETERS_LUA_CORELIBS),y)
CSRCS += $(CORELIBS_SRCS)
register::

View file

@ -48,7 +48,7 @@
static const luaL_Reg g_loadedlibs[] =
{
#ifdef CONFIG_INTERPRETER_LUA_CORELIBS
#ifdef CONFIG_INTERPRETERS_LUA_CORELIBS
{LUA_GNAME, luaopen_base},
#endif
#include "luamod_list.h"