Skip to content

Commit 926fe8f

Browse files
xeioexy82
authored andcommitted
Documented building njs module with QuickJS from sources.
1 parent d3c0a99 commit 926fe8f

File tree

2 files changed

+66
-8
lines changed

2 files changed

+66
-8
lines changed

xml/en/docs/njs/install.xml

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<article name="Download and install"
1010
link="/en/docs/njs/install.html"
1111
lang="en"
12-
rev="4">
12+
rev="5">
1313

1414
<section id="install_package" name="Installing as a Linux package">
1515

@@ -51,7 +51,7 @@ load_module modules/ngx_stream_js_module.so;
5151

5252
<para>
5353
The <link url="https://github.com/nginx/njs">repository</link>
54-
with njs sources can be cloned with the following command:
54+
with njs sources can be cloned with the following command
5555
(requires <link url="https://git-scm.com/">Git</link> client):
5656
<example>
5757
git clone https://github.com/nginx/njs
@@ -69,13 +69,42 @@ The modules can also be built as
6969
</example>
7070
</para>
7171

72+
<section id="install_quickjs" name="Adding QuickJS engine support">
73+
7274
<para>
73-
To build only njs command-line <link doc="cli.xml">utility</link>, run
75+
Make sure you have built the QuickJS library:
76+
<example>
77+
git clone https://github.com/bellard/quickjs
78+
cd quickjs
79+
CFLAGS='-fPIC' make libquickjs.a
80+
</example>
81+
At the module compilation step, also
82+
specify the include (<literal>-I</literal>) and library (<literal>-L</literal>)
83+
paths with the
84+
<literal>--with-cc-opt=</literal> and
85+
<literal>--with-ld-opt=</literal> configuration parameters:
86+
<example>
87+
./configure --add-module=<value>path-to-njs</value>/nginx \
88+
--with-cc-opt="-I <value>path-to-quickjs</value>" \
89+
--with-ld-opt="-L <value>path-to-quickjs</value>"
90+
</example>
91+
</para>
92+
93+
</section>
94+
95+
</section>
96+
97+
98+
<section id="cli" name="Building njs command-line utility">
99+
100+
<para>
101+
To build only the njs command-line <link doc="cli.xml">utility</link>, run
74102
<literal>./configure</literal> and <literal>make njs</literal> commands
75103
from njs root directory.
76-
The utility is available as <literal>./build/njs</literal>.
104+
After building, the utility is available as <literal>./build/njs</literal>.
77105
</para>
78106

79107
</section>
80108

81109
</article>
110+

xml/ru/docs/njs/install.xml

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<article name="Загрузка и установка"
1010
link="/ru/docs/njs/install.html"
1111
lang="ru"
12-
rev="4">
12+
rev="5">
1313

1414
<section id="install_package" name="Установка пакета Linux">
1515

@@ -52,7 +52,7 @@ load_module modules/ngx_stream_js_module.so;
5252

5353
<para>
5454
<link url="https://github.com/nginx/njs">Репозиторий</link>
55-
с исходным кодом njs можно клонировать следующей командой:
55+
с исходным кодом njs можно клонировать следующей командой
5656
(необходим клиент <link url="https://git-scm.com/">Git</link>):
5757
<example>
5858
git clone https://github.com/nginx/njs
@@ -70,12 +70,41 @@ git clone https://github.com/nginx/njs
7070
</example>
7171
</para>
7272

73+
<section id="install_quickjs" name="Добавление поддержки QuickJS">
74+
75+
<para>
76+
Убедитесь, что присутствует библиотека QuickJS:
77+
<example>
78+
git clone https://github.com/bellard/quickjs
79+
cd quickjs
80+
CFLAGS='-fPIC' make libquickjs.a
81+
</example>
82+
На этапе компиляции модулей также укажите пути
83+
include (<literal>-I</literal>) и library (<literal>-L</literal>)
84+
с помощью
85+
конфигурационных параметров
86+
<literal>--with-cc-opt=</literal> и
87+
<literal>--with-ld-opt=</literal>:
88+
<example>
89+
./configure --add-module=<value>path-to-njs</value>/nginx \
90+
--with-cc-opt="-I <value>path-to-quickjs</value>" \
91+
--with-ld-opt="-L <value>path-to-quickjs</value>"
92+
</example>
93+
</para>
94+
95+
</section>
96+
97+
</section>
98+
99+
100+
<section id="cli" name="Сборка утилиты командной строки njs">
101+
73102
<para>
74-
Чтобы собрать только <link doc="cli.xml">утилиту</link> командной строки njs
103+
Чтобы собрать только <link doc="cli.xml">утилиту</link> командной строки njs,
75104
необходимо запустить
76105
команды <literal>./configure</literal> и <literal>make njs</literal>
77106
из корневого каталога njs.
78-
Утилита доступна как <literal>./build/njs</literal>.
107+
После сборки утилита доступна как <literal>./build/njs</literal>.
79108
</para>
80109

81110
</section>

0 commit comments

Comments
 (0)