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



##########
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:
       > Can you explain the use of `_FILE_OFFSET_BITS`?
   > 
   
   LUA_32BITS look like that is only used here:
   https://github.com/lua/lua/blob/master/lprefix.h#L25-L28
   
   Since _FILE_OFFSET_BITS is a standard macro, we can define _FILE_OFFSET_BITS 
correctly from nuttx instead.
   
   > By default, Lua will use `long` for integers and `double` for floats. The 
(not clearly named) `LUA_32BITS` define sets integers to `int` and floats to 
`float`.  The `CONFIG_INTERPRETER_LUA_32BITS` setting is meant as an optional 
config to adjust the resources required by the Lua interpreter. It doesn't have 
to match the word size of the target architecture.
   




-- 
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