Building elinks with JavaScript support

2

1

The elinks manual says if the SpiderMonkey library is installed then the configure script "should" recognize it and enable JavaScript support. But, it's not working for me so far.

Setup

  • I've got the latest elinks (2018-03-02) from git cloned under my home directory.
  • libmozjs-dev 24.8.1esr-2~deb7u1 from the Debian repos.
  • CONFIG_SCRIPTING_SPIDERMONKEY=yes Is turned on in features.conf.

Results

  • elinks builds successfully and works, but without JavaScript.

From configure output and features.log:

ECMAScript (JavaScript) ......... no

config.log has the following:

configure:9236: checking for SpiderMonkey (1.8.5 or later) in pkg-config mozjs185
Package mozjs185 was not found in the pkg-config search path.
Perhaps you should add the directory containing `mozjs185.pc'
to the PKG_CONFIG_PATH environment variable
No package 'mozjs185' found
configure:9282: result: no
configure:9236: checking for SpiderMonkey (1.8.5 or later) in pkg-config mozilla-js
configure:9270: gcc -o conftest -g -O2 -Wall -include /usr/include/mozjs/mozjs/js/RequiredDefines.h -I/usr/include/nspr -I/usr/include/mozjs    -include /usr/include/mozjs/mozjs/js/RequiredDefines.h -I/usr/include/nspr -I/usr/include/mozjs    conftest.c -lmozjs   -ldl  -lz -lbz2 >&5
cc1: fatal error: /usr/include/mozjs/mozjs/js/RequiredDefines.h: No such file or directory
compilation terminated.

There is a directory /usr/include/mozjs but it doesn't have a child directory mozjs. There exists a /usr/include/mozjs/js/RequiredDefines.h, so I think I'm on the right track. It sort of looks like the installed SpiderMonkey is not recent enough, but I don't know whether version "24.8.1" is in the same timeline as the "1.8.5" that the configure script is looking for -- perhaps it's too new and elinks got left behind. The 1.8.5 version requirement was added to the elinks NEWS file in 2011... on the other hand the repo has commits as recently as last year.

If anyone has had success compiling JavaScript support into elinks, please advise. Experiences somewhat contemporaneous to the year 2018 would be most helpful : )

gws

Posted 2018-03-02T23:02:42.827

Reputation: 219

Answers

1

Currently ELinks expects SpiderMonkey 1.8.5 (libmozjs185-dev). It "should" be "possible" to update the build script for newer releases but the current HEAD is only happy with this specific version.

gws

Posted 2018-03-02T23:02:42.827

Reputation: 219

1I'm still understanding how the autoconf script does its version-number check but that looks like where things go wrong(?). Editing the header path that gets generated into Makefile just causes configure to say the scripting library is "found, but unusable". – gws – 2018-03-06T17:31:43.480