1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-07-26 16:45:12 -04:00

Merge pull request #141 from schra/fix/doc-js

[doc] Update ECMAScript documentation
This commit is contained in:
rkd77 2022-03-15 13:15:02 +01:00 committed by GitHub
commit 5a113f0bde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 136 deletions

View File

@ -1,61 +0,0 @@
This quick'n'dirty patch enables relatively painless SpiderMonkey installation.
See doc/ecmascript.txt for details.
diff -ru js-1.5-rc6a/src/config.mk js-1.5-rc6a+elinks/src/config.mk
--- js-1.5-rc6a/src/config.mk Sat Nov 15 01:10:55 2003
+++ js-1.5-rc6a+elinks/src/config.mk Wed Sep 22 16:32:12 2004
@@ -37,10 +37,15 @@
#
# ***** END LICENSE BLOCK *****
+BUILD_OPT=1
+ifndef PREFIX
+PREFIX = /opt/spidermonkey
+endif
+
ifdef JS_DIST
DIST = $(JS_DIST)
else
-DIST = $(DEPTH)/../../dist/$(OBJDIR)
+DIST = dist/
endif
# Set os+release dependent make variables
diff -ru js-1.5-rc6a/src/jsconfig.mk js-1.5-rc6a+elinks/src/jsconfig.mk
--- js-1.5-rc6a/src/jsconfig.mk Sat Nov 15 01:10:56 2003
+++ js-1.5-rc6a+elinks/src/jsconfig.mk Wed Sep 22 16:34:28 2004
@@ -104,8 +104,8 @@
echo $(NSPR_VERSION) > $(NSPR_VERSIONFILE)
endif
-SHIP_DIST = $(MOZ_DEPTH)/dist/$(OBJDIR)
-SHIP_DIR = $(SHIP_DIST)/SHIP
+SHIP_DIST = $(DIST)
+SHIP_DIR = $(PREFIX)
SHIP_LIBS = libjs.$(SO_SUFFIX) libjs.a
ifdef JS_LIVECONNECT
@@ -117,7 +117,7 @@
SHIP_LIBS += jsj.dll jsj.lib
endif
endif
-SHIP_LIBS += $(LCJAR)
+#SHIP_LIBS += $(LCJAR)
SHIP_LIBS := $(addprefix $(SHIP_DIST)/lib/, $(SHIP_LIBS))
SHIP_INCS = js*.h prmjtime.h resource.h *.msg *.tbl
@@ -144,6 +144,14 @@
JSREFJAR = jsref_dbg.jar
endif
endif
+
+install:
+ mkdir -p $(SHIP_DIR)/$(LIBDIR)
+ mkdir -p $(SHIP_DIR)/include
+ mkdir -p $(SHIP_DIR)/bin
+ cp $(SHIP_LIBS) $(SHIP_DIR)/$(LIBDIR)
+ cp $(SHIP_INCS) $(SHIP_DIR)/include
+ cp $(SHIP_BINS) $(SHIP_DIR)/bin
ship:
mkdir -p $(SHIP_DIR)/$(LIBDIR)

View File

@ -21,12 +21,6 @@ acceptable documentation, is actively developed and ought to work.
Ok, so how to get the ECMAScript support working?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Some systems come with either the SpiderMonkey installed or as an option. It
would be good to test if you can take the easy path and let the system take
care of installation through a package system. Below are listed instructions
on what package you need to install on various systems (please help improve
the list). If all goes well you can proceed to rebuilding ELinks.
On Debian testing (Etch) or unstable (SID), run the following:
$ apt-get install libmozjs-dev
@ -35,84 +29,23 @@ On Debian stable (Sarge), run the following:
$ apt-get install libsmjs-dev
Installing the -dev package will automatically pull in the library package.
On Arch Linux, run the following:
Once this is done, rebuild ELinks. The configure script should detect
the SpiderMonkey library--check for this line in the features summary:
$ pacman -S js78
ECMAScript (JavaScript) ......... SpiderMonkey document scripting
SpiderMonkey is disabled by default, enable it like this:
After following these instructions on a Debian system, you are done and should
ignore the following directions.
The rest is only for non-Debian system.
Note that this procedure enables you to install SpiderMonkey, but in such a
way that it might not work with anything else but ELinks. It is unlikely that
anything else is ever going to use SpiderMonkey on your system, but if you
want to take the safe way, get SM and follow the instructions in
`src/README.html` instead. You will probably need to do some checkouting of
bits of the Mozilla CVS tree and so, have fun.
To get SpiderMonkey source, go at
link:ftp://ftp.mozilla.org/pub/mozilla.org/js/[] and fetch the newest `js-`
tarball there (`js-1.5-rc6a.tar.gz` at the time of writing this; you may try
the RPMs, but we didn't test them).
$ cd elinks
$ wget ftp://ftp.mozilla.org/pub/mozilla.org/js/js-1.5-rc6a.tar.gz
$ tar xvzf js-1.5-rc6a.tar.gz
Next, you need to patch it so that you will have any chance to install it as
you fetched it. Grab it in ELinks at `contrib/js-1.5-rc6a+elinks.patch` (if
you have a different version, still try to go ahead, you might have some
success), then go to the SpiderMonkey directory (called js) and apply it as
$ cd js
$ patch -p1 <../contrib/js-1.5-rc6a+elinks.patch
$ cd src
Now, edit config.mk and adjust the `$PREFIX` variable - you probably won't
like the default value - ELinks will find it there, but your dynamic linker
likely won't.
E.g., for /usr/local installation:
$ sed 's#^PREFIX = /opt/spidermonkey#PREFIX = /usr/local#' < config.mk > config.mk.t
$ mv -f config.mk.t config.mk
Now you can finally go for it:
$ make -f Makefile.ref
$ make -f Makefile.ref export
Now install it:
$ su -c 'make -f Makefile.ref install && (ldconfig -v | grep libjs)'
Check for:
libjs.so -> libjs.so
If you don't get such result, check that the library's installation path
(e.g. /usr/local/lib) is present in /etc/ld.so.conf (man 8 ldconfig).
If all went well, you can proceed to rebuild ELinks now. If something broke,
see you on #elinks @ FreeNode or in the mailing list.
You may add your options to `./configure` as usual; SpiderMonkey should be
autodetected.
$ cd ../..
$ ./configure
$ meson build -Dspidermonkey=true
Check for the following line in the features summary:
ECMAScript (JavaScript) ......... SpiderMonkey document scripting
Run-time dependency mozjs-78 found: YES 78.15.0
Then run:
$ make
$ su -c 'make install'
$ cd build/
$ ninja
$ sudo ninja install
Enjoy.