luamodules/lsyslog: add lua syslog module
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
This commit is contained in:
parent
7a2774b75a
commit
6d7761f274
2
interpreters/luamodules/luasyslog/.gitignore
vendored
Normal file
2
interpreters/luamodules/luasyslog/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
lsyslog/
|
||||
*.tar.gz
|
21
interpreters/luamodules/luasyslog/Kconfig
Normal file
21
interpreters/luamodules/luasyslog/Kconfig
Normal file
@ -0,0 +1,21 @@
|
||||
#
|
||||
# For a description of the syntax of this configuration file,
|
||||
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||
#
|
||||
|
||||
config LUA_LSYSLOG_MODULE
|
||||
bool "Lua syslog module"
|
||||
default n
|
||||
depends on INTERPRETERS_LUA
|
||||
---help---
|
||||
LUA syslog module
|
||||
|
||||
if LUA_LSYSLOG_MODULE
|
||||
|
||||
config LUA_LSYSLOG_VERSION
|
||||
string "lsyslog version"
|
||||
default "2.0.1"
|
||||
---help---
|
||||
Lua lsyslog module release version to fetch and build.
|
||||
|
||||
endif # LUA_LSYSLOG_MODULE
|
24
interpreters/luamodules/luasyslog/Make.defs
Normal file
24
interpreters/luamodules/luasyslog/Make.defs
Normal file
@ -0,0 +1,24 @@
|
||||
############################################################################
|
||||
# apps/interpreters/luamodules/luasyslog/Make.defs
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
ifneq ($(CONFIG_LUA_LSYSLOG_MODULE),)
|
||||
CONFIGURED_APPS += $(APPDIR)/interpreters/luamodules/luasyslog
|
||||
|
||||
endif
|
65
interpreters/luamodules/luasyslog/Makefile
Normal file
65
interpreters/luamodules/luasyslog/Makefile
Normal file
@ -0,0 +1,65 @@
|
||||
############################################################################
|
||||
# apps/interpreters/luamodules/luasyslog/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
|
||||
|
||||
LSYSLOG_VERSION = $(patsubst "%",%,$(strip $(CONFIG_LUA_LSYSLOG_VERSION)))
|
||||
LSYSLOG_TARBALL = $(LSYSLOG_VERSION).tar.gz
|
||||
LSYSLOG_UNPACK = lsyslog
|
||||
LSYSLOG_URL_BASE = https://github.com/lunarmodules/luasyslog/archive/refs/tags
|
||||
LSYSLOG_URL = $(LSYSLOG_URL_BASE)/$(LSYSLOG_TARBALL)
|
||||
LSYSLOG_SRC = $(LSYSLOG_UNPACK)
|
||||
|
||||
VPATH += $(LSYSLOG_SRC)
|
||||
CSRCS = lsyslog.c
|
||||
|
||||
CFLAGS += -D'openlog(a,b,c)={(void)a; (void)c;}'
|
||||
CFLAGS += -D'closelog()={}'
|
||||
|
||||
$(LSYSLOG_TARBALL):
|
||||
$(Q) echo "Downloading $(LSYSLOG_TARBALL) from $(LSYSLOG_URL)"
|
||||
$(Q) curl -O -L $(LSYSLOG_URL)
|
||||
|
||||
$(LSYSLOG_UNPACK): $(LSYSLOG_TARBALL)
|
||||
$(Q) echo "Unpacking $(LSYSLOG_TARBALL) to $(LSYSLOG_UNPACK)"
|
||||
$(Q) tar -xvzf $(LSYSLOG_TARBALL)
|
||||
$(Q) mv luasyslog-$(LSYSLOG_VERSION) $(LSYSLOG_UNPACK)
|
||||
|
||||
$(LSYSLOG_UNPACK)/.patch: $(LSYSLOG_UNPACK)
|
||||
touch $(LSYSLOG_UNPACK)/.patch
|
||||
|
||||
# Download and unpack tarball if no git repo found
|
||||
ifeq ($(wildcard $(LSYSLOG_UNPACK)/.git),)
|
||||
distclean::
|
||||
$(call DELDIR, $(LSYSLOG_UNPACK))
|
||||
$(call DELFILE, $(LSYSLOG_TARBALL))
|
||||
|
||||
context:: $(LSYSLOG_UNPACK)/.patch
|
||||
endif
|
||||
|
||||
# Set LUAMODNAME and include Module.mk to add this module to the list of
|
||||
# builtin modules for the Lua interpreter. LUAMODNAME should match the
|
||||
# module's luaopen function.
|
||||
|
||||
LUAMODNAME = lsyslog
|
||||
|
||||
include $(APPDIR)/interpreters/lua/Module.mk
|
||||
|
||||
include $(APPDIR)/Application.mk
|
Loading…
Reference in New Issue
Block a user