diff options
author | Igor Sysoev <igor@sysoev.ru> | 2017-08-17 21:47:19 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2017-08-17 21:47:19 +0300 |
commit | 949548da293fa30ef200d07c3e4ff108174404b7 (patch) | |
tree | 8f03eaad277ec558f9ce2f223db350d134532e4b /src/nxt_runtime.c | |
parent | 5ef8e0ee8933e914b1847168255b53f07c3727b3 (diff) | |
download | unit-949548da293fa30ef200d07c3e4ff108174404b7.tar.gz unit-949548da293fa30ef200d07c3e4ff108174404b7.tar.bz2 |
The new module configuration interface.
Configuration and building example:
./configure
./configure python
./configure php
./configure go
make all
or
./configure
make nginext
./configure python
make python
./configure php
make php
./configure go
make go
Modules configuration options and building examples:
./configure python --module=python2 --config=python2.7-config
make python2
./configure php --module=php7 --config=php7.0-config
--lib-path=/usr/local/php7.0
make php7
./configure go --go=go1.6 --go-path=${HOME}/go1.6
make go1.6
Diffstat (limited to 'src/nxt_runtime.c')
-rw-r--r-- | src/nxt_runtime.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/nxt_runtime.c b/src/nxt_runtime.c index 30474ce8..5e67ecfd 100644 --- a/src/nxt_runtime.c +++ b/src/nxt_runtime.c @@ -57,10 +57,11 @@ static nxt_process_t *nxt_runtime_process_remove_pid(nxt_runtime_t *rt, nxt_int_t nxt_runtime_create(nxt_task_t *task) { - nxt_mp_t *mp; - nxt_int_t ret; - nxt_array_t *listen_sockets; - nxt_runtime_t *rt; + nxt_mp_t *mp; + nxt_int_t ret; + nxt_array_t *listen_sockets; + nxt_runtime_t *rt; + nxt_app_lang_module_t *lang; mp = nxt_mp_create(1024, 128, 256, 32); @@ -90,6 +91,18 @@ nxt_runtime_create(nxt_task_t *task) goto fail; } + rt->languages = nxt_array_create(mp, 1, sizeof(nxt_app_lang_module_t)); + if (nxt_slow_path(rt->languages == NULL)) { + goto fail; + } + + /* Should not fail. */ + lang = nxt_array_add(rt->languages); + lang->type = (nxt_str_t) nxt_string("go"); + lang->version = (nxt_str_t) nxt_null_string; + lang->file = NULL; + lang->module = &nxt_go_module; + listen_sockets = nxt_array_create(mp, 1, sizeof(nxt_listen_socket_t)); if (nxt_slow_path(listen_sockets == NULL)) { goto fail; @@ -324,7 +337,6 @@ nxt_runtime_thread_pools(nxt_thread_t *thr, nxt_runtime_t *rt) static void nxt_runtime_start(nxt_task_t *task, void *obj, void *data) { - nxt_uint_t i; nxt_runtime_t *rt; rt = obj; @@ -338,12 +350,6 @@ nxt_runtime_start(nxt_task_t *task, void *obj, void *data) goto fail; } - for (i = 0; i < nxt_init_modules_n; i++) { - if (nxt_init_modules[i](task->thread, rt) != NXT_OK) { - goto fail; - } - } - if (nxt_runtime_log_files_create(task, rt) != NXT_OK) { goto fail; } |