xiaoxiang781216 commented on a change in pull request #1075:
URL: 
https://github.com/apache/incubator-nuttx-apps/pull/1075#discussion_r829360900



##########
File path: interpreters/lua/Kconfig
##########
@@ -0,0 +1,90 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+menuconfig INTERPRETERS_LUA
+       bool "Lua interpreter support"
+       default n
+       select ARCH_SETJMP_H
+       select LIBC_FLOATINGPOINT
+       select LIBC_LOCALE
+       select LIBM
+       select SYSTEM_SYSTEM

Review comment:
       Ok, it look fine.

##########
File path: interpreters/lua/Makefile
##########
@@ -0,0 +1,133 @@
+############################################################################
+# apps/interpreters/lua/Makefile
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+include $(APPDIR)/Make.defs
+
+# Lua built-in application info
+
+PROGNAME  = lua
+PRIORITY  = $(CONFIG_INTERPRETER_LUA_PRIORITY)
+STACKSIZE = $(CONFIG_INTERPRETER_LUA_STACKSIZE)
+MODULE    = $(CONFIG_INTERPRETERS_LUA)
+
+# Lua library
+
+LUA_VERSION  = $(patsubst "%",%,$(strip $(CONFIG_INTERPRETER_LUA_VERSION)))
+LUA_TARBALL  = lua-$(LUA_VERSION).tar.gz
+LUA_UNPACK   = lua-$(LUA_VERSION)
+LUA_URL_BASE = http://www.lua.org/ftp
+LUA_URL      = $(LUA_URL_BASE)/$(LUA_TARBALL)
+LUA_SRC      = $(LUA_UNPACK)/src
+
+MAINSRC      = $(LUA_SRC)/lua.c
+CORELIB_SRCS = $(filter-out $(LUA_SRC)/lauxlib.c,$(wildcard $(LUA_SRC)/*lib.c))
+EXCLUDE_SRCS = $(MAINSRC) $(CORELIB_SRCS) $(LUA_SRC)/luac.c $(LUA_SRC)/linit.c
+CSRCS        = $(filter-out $(EXCLUDE_SRCS),$(wildcard $(LUA_SRC)/*.c))
+CSRCS       += nuttx_linit.c
+
+CFLAGS += -DLUA_MAXINPUT=$(CONFIG_INTERPRETER_LUA_IOBUFSIZE)
+CFLAGS += -DLUA_PROGNAME=\"$(PROGNAME)\"
+
+ifeq ($(CONFIG_INTERPRETER_LUA_32BITS),y)
+CFLAGS += -DLUA_32BITS

Review comment:
       > `LUA_32BITS` is used in `luaconf.h` to set the size for integers and 
floats in Lua: https://github.com/lua/lua/blob/v5.4.0/luaconf.h#L139-L149
   > 
   > It looks like Lua respects the `_FILE_OFFSET_BITS` macro. It only sets 
this value is `LUA_32BITS` is not defined and if `_FILE_OFFSET_BITS` is not 
already defined. I don't think any change is required.
   > 
   
   Thanks for explanation, look good to me now.
   
   > If you prefer, we can not select `LIBC_FLOATINGPOINT` and instead list the 
optional requirement in the README. One side effect, is without 
`LIBC_FLOATINGPOINT` you will not be able to print floating point numbers. For 
example:
   > 
   > ```lua
   > > print(1)
   > 1
   > > print(0.5)
   > *float*
   > ```
   
   Yes, I understand the side effect. Maybe, we can change the output to 
CONFIG_LIBC_FLOATINGPOINT, so the newbie can know how to enable float output.
   

##########
File path: interpreters/lua/Makefile
##########
@@ -0,0 +1,133 @@
+############################################################################
+# apps/interpreters/lua/Makefile
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+include $(APPDIR)/Make.defs
+
+# Lua built-in application info
+
+PROGNAME  = lua
+PRIORITY  = $(CONFIG_INTERPRETER_LUA_PRIORITY)
+STACKSIZE = $(CONFIG_INTERPRETER_LUA_STACKSIZE)
+MODULE    = $(CONFIG_INTERPRETERS_LUA)
+
+# Lua library
+
+LUA_VERSION  = $(patsubst "%",%,$(strip $(CONFIG_INTERPRETER_LUA_VERSION)))
+LUA_TARBALL  = lua-$(LUA_VERSION).tar.gz
+LUA_UNPACK   = lua-$(LUA_VERSION)
+LUA_URL_BASE = http://www.lua.org/ftp
+LUA_URL      = $(LUA_URL_BASE)/$(LUA_TARBALL)
+LUA_SRC      = $(LUA_UNPACK)/src
+
+MAINSRC      = $(LUA_SRC)/lua.c
+CORELIB_SRCS = $(filter-out $(LUA_SRC)/lauxlib.c,$(wildcard $(LUA_SRC)/*lib.c))

Review comment:
       If so why not compile it to help the module writer?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to