quickjs: add qjs tool configuration item
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
parent
c2fdd8e99d
commit
75673fed70
@ -9,9 +9,20 @@ config INTERPRETERS_QUICKJS
|
|||||||
|
|
||||||
if INTERPRETERS_QUICKJS
|
if INTERPRETERS_QUICKJS
|
||||||
|
|
||||||
|
choice
|
||||||
|
prompt "QuickJS command line interpreter"
|
||||||
|
default INTERPRETERS_QUICKJS_NONE
|
||||||
|
|
||||||
|
config INTERPRETERS_QUICKJS_NONE
|
||||||
|
bool "distable quickjs interpreter"
|
||||||
|
|
||||||
config INTERPRETERS_QUICKJS_MINI
|
config INTERPRETERS_QUICKJS_MINI
|
||||||
bool "Minimal interpreter"
|
bool "Minimal quickjs interpreter"
|
||||||
default n
|
|
||||||
|
config INTERPRETERS_QUICKJS_FULL
|
||||||
|
bool "normal quickjs interpreter"
|
||||||
|
|
||||||
|
endchoice # QuickJS command line interpreter
|
||||||
|
|
||||||
config INTERPRETERS_QUICKJS_BIGNUM
|
config INTERPRETERS_QUICKJS_BIGNUM
|
||||||
bool "Bignum support"
|
bool "Bignum support"
|
||||||
|
@ -28,13 +28,6 @@ QUICKJS_URL = $(QUICKJS_URL_BASE)/$(QUICKJS_TARBALL)
|
|||||||
|
|
||||||
CSRCS = quickjs.c libregexp.c libbf.c libunicode.c cutils.c
|
CSRCS = quickjs.c libregexp.c libbf.c libunicode.c cutils.c
|
||||||
|
|
||||||
ifeq ($(CONFIG_INTERPRETERS_QUICKJS_MINI),y)
|
|
||||||
MAINSRC = qjsmini.c
|
|
||||||
else
|
|
||||||
CSRCS += quickjs-libc.c repl.c
|
|
||||||
MAINSRC = qjs.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
VERSION=\"$(QUICKJS_VERSION)\"
|
VERSION=\"$(QUICKJS_VERSION)\"
|
||||||
|
|
||||||
CFLAGS += -DCONFIG_VERSION=$(VERSION) -Wno-shadow
|
CFLAGS += -DCONFIG_VERSION=$(VERSION) -Wno-shadow
|
||||||
@ -59,10 +52,12 @@ endif
|
|||||||
|
|
||||||
VPATH += $(QUICKJS_UNPACK)
|
VPATH += $(QUICKJS_UNPACK)
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_INTERPRETERS_QUICKJS_NONE),y)
|
||||||
PROGNAME = qjs
|
PROGNAME = qjs
|
||||||
PRIORITY = $(CONFIG_INTERPRETERS_QUICKJS_PRIORITY)
|
PRIORITY = $(CONFIG_INTERPRETERS_QUICKJS_PRIORITY)
|
||||||
STACKSIZE = $(CONFIG_INTERPRETERS_QUICKJS_STACKSIZE)
|
STACKSIZE = $(CONFIG_INTERPRETERS_QUICKJS_STACKSIZE)
|
||||||
MODULE = $(CONFIG_INTERPRETERS_QUICKJS)
|
MODULE = $(CONFIG_INTERPRETERS_QUICKJS)
|
||||||
|
endif
|
||||||
|
|
||||||
$(QUICKJS_TARBALL):
|
$(QUICKJS_TARBALL):
|
||||||
$(Q) echo "Downloading $(QUICKJS_TARBALL)"
|
$(Q) echo "Downloading $(QUICKJS_TARBALL)"
|
||||||
@ -79,19 +74,25 @@ $(QUICKJS_UNPACK)/.patch: $(QUICKJS_UNPACK)
|
|||||||
|
|
||||||
# Download and unpack tarball if no git repo found
|
# Download and unpack tarball if no git repo found
|
||||||
ifeq ($(wildcard $(QUICKJS_UNPACK)/.git),)
|
ifeq ($(wildcard $(QUICKJS_UNPACK)/.git),)
|
||||||
|
QUICKJS_DOWNLOAD=$(QUICKJS_UNPACK)/.patch
|
||||||
distclean::
|
distclean::
|
||||||
$(call DELDIR, $(QUICKJS_UNPACK))
|
$(call DELDIR, $(QUICKJS_UNPACK))
|
||||||
$(call DELFILE, $(QUICKJS_TARBALL))
|
$(call DELFILE, $(QUICKJS_TARBALL))
|
||||||
|
|
||||||
build_host: $(QUICKJS_UNPACK)/.patch
|
|
||||||
else
|
|
||||||
build_host:
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_INTERPRETERS_QUICKJS_MINI),y)
|
||||||
|
MAINSRC = qjsmini.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_INTERPRETERS_QUICKJS_FULL),y)
|
||||||
|
CSRCS += quickjs-libc.c repl.c
|
||||||
|
MAINSRC = qjs.c
|
||||||
|
context:: $(QUICKJS_DOWNLOAD)
|
||||||
$(MAKE) -C $(QUICKJS_UNPACK) \
|
$(MAKE) -C $(QUICKJS_UNPACK) \
|
||||||
CONFIG_BIGNUM=$(CONFIG_INTERPRETERS_QUICKJS_BIGNUM)
|
CONFIG_BIGNUM=$(CONFIG_INTERPRETERS_QUICKJS_BIGNUM)
|
||||||
|
else
|
||||||
context:: build_host
|
context:: $(QUICKJS_DOWNLOAD)
|
||||||
|
endif
|
||||||
|
|
||||||
clean::
|
clean::
|
||||||
$(Q) test ! -d $(QUICKJS_UNPACK) || $(MAKE) -C $(QUICKJS_UNPACK) clean
|
$(Q) test ! -d $(QUICKJS_UNPACK) || $(MAKE) -C $(QUICKJS_UNPACK) clean
|
||||||
|
Loading…
x
Reference in New Issue
Block a user