rkd77 / elinks

Fork of elinks
Other
349 stars 38 forks source link

Elinks fails to build with the JS support (mozjs-52). #111

Closed SpacingBat3 closed 3 years ago

SpacingBat3 commented 3 years ago

Device information:

Expected behavior:

Elinks would build fine, with JavaScript support.

Current behavior:

It will fail to build with mozjs-52 headers, as they're correct only for C++ code (not for C).

Fails on:

In file included from /usr/include/mozjs-52/mozilla/Move.h:12,
                 from /usr/include/mozjs-52/mozilla/AlreadyAddRefed.h:14,
                 from /usr/include/mozjs-52/jsapi.h:12,
                 from ../.././src/ecmascript/ecmascript.h:14,
                 from info.c:22:
/usr/include/mozjs-52/mozilla/TypeTraits.h:22:1: error: unknown type name 'namespace'
   22 | namespace mozilla {
      | ^~~~~~~~~
/usr/include/mozjs-52/mozilla/TypeTraits.h:22:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   22 | namespace mozilla {
      |                   ^
In file included from /usr/include/mozjs-52/mozilla/AlreadyAddRefed.h:14,
                 from /usr/include/mozjs-52/jsapi.h:12,
                 from ../.././src/ecmascript/ecmascript.h:14,
                 from info.c:22:
/usr/include/mozjs-52/mozilla/Move.h:14:1: error: unknown type name 'namespace'
   14 | namespace mozilla {
      | ^~~~~~~~~
/usr/include/mozjs-52/mozilla/Move.h:14:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   14 | namespace mozilla {
      |                   ^
In file included from /usr/include/mozjs-52/jsapi.h:12,
                 from ../.././src/ecmascript/ecmascript.h:14,
                 from info.c:22:
/usr/include/mozjs-52/mozilla/AlreadyAddRefed.h:16:1: error: unknown type name 'namespace'
   16 | namespace mozilla {
      | ^~~~~~~~~
/usr/include/mozjs-52/mozilla/AlreadyAddRefed.h:16:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   16 | namespace mozilla {
      |                   ^
/usr/include/mozjs-52/mozilla/AlreadyAddRefed.h:31:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   31 | template<class T>
      |         ^
In file included from /usr/include/mozjs-52/mozilla/FloatingPoint.h:14,
                 from /usr/include/mozjs-52/jsapi.h:13,
                 from ../.././src/ecmascript/ecmascript.h:14,
                 from info.c:22:
/usr/include/mozjs-52/mozilla/Casting.h:17:1: error: unknown type name 'namespace'
   17 | namespace mozilla {
      | ^~~~~~~~~
/usr/include/mozjs-52/mozilla/Casting.h:17:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   17 | namespace mozilla {
      |                   ^
In file included from /usr/include/mozjs-52/mozilla/FloatingPoint.h:15,
                 from /usr/include/mozjs-52/jsapi.h:13,
                 from ../.././src/ecmascript/ecmascript.h:14,
                 from info.c:22:
/usr/include/mozjs-52/mozilla/MathAlgorithms.h:15:10: fatal error: cmath: No such file or directory
   15 | #include <cmath>
      |          ^~~~~~~
compilation terminated.
rkd77 commented 3 years ago

How do you try to compile? Commands, please.

SpacingBat3 commented 3 years ago

How do you try to compile? Commands, please.

I used the following PKGBUILD for the compilation proccess. As for the commands, I've tried to compile the 0.14.0 version, actually I might try to compile it again, except with the current master version.

The commands that this PKGBUILD executes to compile it (and also to "install" it) are as follows:

cd <path-to-eslint-sources>
cp -fT /usr/share/autoconf/build-aux/config.sub config/config.sub
cp -fT /usr/share/autoconf/build-aux/config.guess config/config.guess
cp -fT /usr/share/autoconf/build-aux/install-sh config/install.sh
[ -x configure ] || sh autogen.sh
./configure --prefix=/usr --mandir=/usr/share/man \
              --sysconfdir=/etc \
              --disable-smb --without-x --enable-cgi \
              --enable-leds --enable-256-colors --enable-html-highlight \
              --with-zlib
make
make DESTDIR=<tarball-dir> install
rm -f "<tarball-dir>/usr/share/locale/locale.alias"
SpacingBat3 commented 3 years ago

How do you try to compile? Commands, please.

Just checked the master, I see JavaScript is currently disabled...

I guess I'll close this issue then...