package/spidermonkey: do not build the JavaScript shell, by default
authorCarlos Santos <unixmania@gmail.com>
Sun, 8 Mar 2020 03:21:28 +0000 (00:21 -0300)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 8 Mar 2020 13:51:12 +0000 (14:51 +0100)
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 <unixmania@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/spidermonkey/0011-js-src-Makefile.in-install-shell-only-if-it-s-built.patch [new file with mode: 0644]
package/spidermonkey/Config.in
package/spidermonkey/spidermonkey.mk

diff --git a/package/spidermonkey/0011-js-src-Makefile.in-install-shell-only-if-it-s-built.patch b/package/spidermonkey/0011-js-src-Makefile.in-install-shell-only-if-it-s-built.patch
new file mode 100644 (file)
index 0000000..f6092af
--- /dev/null
@@ -0,0 +1,28 @@
+From b5e4a9926cf50d12e9c5c05c6d1b161e5b662d62 Mon Sep 17 00:00:00 2001
+From: Carlos Santos <unixmania@gmail.com>
+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 <unixmania@gmail.com>
+---
+ 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
+
index 5f121106262d131b210e9b540285bd32b4c33b26..e015e84ad2394618abd9aeb12b6d9f482a962b66 100644 (file)
@@ -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
index 579dc7b8648851e6a1e953620471c721120825c2..50afdc17580291c20698c346e458682502201a4e 100644 (file)
@@ -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