Skip to content

Commit

Permalink
package/spidermonkey: do not build the JavaScript shell, by default
Browse files Browse the repository at this point in the history
Add a configuration to enable the JavaScript shell (default off). So
far only libmozjs is required (by polkit) and the shell takes around
24MiB.

Signed-off-by: Carlos Santos <[email protected]>
Signed-off-by: Thomas Petazzoni <[email protected]>
  • Loading branch information
casantos authored and tpetazzoni committed Mar 8, 2020
1 parent a8dc83b commit 04ce57e
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From b5e4a9926cf50d12e9c5c05c6d1b161e5b662d62 Mon Sep 17 00:00:00 2001
From: Carlos Santos <[email protected]>
Date: Sat, 7 Mar 2020 23:42:02 -0300
Subject: [PATCH] js/src/Makefile.in: install shell only if it's built

Prevents an installation error if we configure with --disable-js-shell.

Signed-off-by: Carlos Santos <[email protected]>
---
js/src/Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/js/src/Makefile.in b/js/src/Makefile.in
index 4ac9f48..9c8fb64 100644
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -136,7 +136,7 @@ endif

install::
$(MAKE) -C build install
- $(MAKE) -C shell install
+ if [ -d shell ]; then $(MAKE) -C shell install; fi

ifdef HAVE_DTRACE
javascript-trace.h: $(srcdir)/devtools/javascript-trace.d
--
2.18.2

11 changes: 11 additions & 0 deletions package/spidermonkey/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ config BR2_PACKAGE_SPIDERMONKEY

https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey

if BR2_PACKAGE_SPIDERMONKEY

config BR2_PACKAGE_SPIDERMONKEY_JS_SHELL
bool "JS shell"
help
Build the JavaScript shell.

WARNING: increases target image size by around 24 MiB.

endif

comment "spidermonkey needs a glibc or musl toolchain with C++, wchar, dynamic library, NPTL, gcc >= 4.9"
depends on BR2_USE_MMU
depends on BR2_PACKAGE_SPIDERMONKEY_ARCH_SUPPORTS
Expand Down
6 changes: 6 additions & 0 deletions package/spidermonkey/spidermonkey.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ else
SPIDERMONKEY_CONF_OPTS += --disable-ion
endif

ifeq ($(BR2_PACKAGE_SPIDERMONKEY_JS_SHELL),y)
SPIDERMONKEY_CONF_OPTS += --enable-js-shell
else
SPIDERMONKEY_CONF_OPTS += --disable-js-shell
endif

ifeq ($(BR2_PACKAGE_READLINE),y)
SPIDERMONKEY_CONF_OPTS += --enable-readline
SPIDERMONKEY_DEPENDENCIES += readline
Expand Down

0 comments on commit 04ce57e

Please sign in to comment.