Introduction to JS

JS is Mozilla's JavaScript engine written in C.

This package is known to build and work properly using an LFS-8.2 platform.

Package Information

Additional Downloads

JS38 Dependencies


Autoconf-2.13, ICU-60.2, NSPR-4.18, Python-2.7.14, and Zip-3.0



User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/js38

Installation of JS



The tarball extracts to mozjs-38.0.0, rather than what is listed in the download section.

First, apply a patch to fix the build and to prevent segmentation faults.

patch -Np1 -i ../js38-38.2.1-upstream_fixes-2.patch

Install JS by running the following commands:

cd js/src &&
autoconf2.13 &&

./configure --prefix=/usr       \
            --with-intl-api     \
            --with-system-zlib  \
            --with-system-ffi   \
            --with-system-nspr  \
            --with-system-icu   \
            --enable-threadsafe \
            --enable-readline   &&

This package does not come with a working test suite.

Now, as the root user:

make install &&
pushd /usr/include/mozjs-38 &&
for link in `find . -type l`; do
    header=`readlink $link`
    rm -f $link
    cp -pv $header $link
    chmod 644 $link
done &&
popd &&

chown -Rv root.root /usr/include/mozjs-38

Command Explanations

autoconf2.13: This command regenerates the configure script with the changes from the patch.

--with-*: These parameters allow the build system to use system versions of the above libraries. These are required for stability.

--enable-readline: This switch enables Readline support in the JS shell.

--enable-threadsafe: This switch enables support for multiple threads at one time. This increases performance as well as stability.

for link in...: This command replaces links to the build directory, with files copied from the build directory.


Installed Programs: js38 and js38-config
Installed Libraries): libmozjs-38.so and libjs_static.ajs
Installed Directories: /usr/include/mozjs-38

Short Descriptions


provides a command line interface to the JavaScript engine.


is used to find the JS compiler and linker flags.


contains the Mozilla JavaScript API functions.

Last updated on 2018-02-17 15:35:13 -0800