Changed version processing for modules.
This commit is contained in:
@@ -121,8 +121,23 @@ if [ $nxt_found = no ]; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
NXT_PERL_VERSION=`$NXT_PERL -MConfig -e 'print $Config{version}'`
|
||||
$echo " + Perl version: ${NXT_PERL_VERSION}"
|
||||
|
||||
nxt_feature="Perl version"
|
||||
nxt_feature_name=""
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs="${NXT_PERL_INCLUDE}"
|
||||
nxt_feature_libs="${NXT_PERL_LIBS}"
|
||||
nxt_feature_test="
|
||||
#include <EXTERN.h>
|
||||
#include <perl.h>
|
||||
|
||||
int main() {
|
||||
printf(\"%s\", PERL_VERSION_STRING);
|
||||
return 0;
|
||||
}"
|
||||
|
||||
. auto/feature
|
||||
|
||||
|
||||
if grep ^$NXT_PERL_MODULE: $NXT_MAKEFILE 2>&1 > /dev/null; then
|
||||
$echo
|
||||
|
||||
@@ -73,7 +73,6 @@ if /bin/sh -c "${NXT_PHP_CONFIG} --version" >> $NXT_AUTOCONF_ERR 2>&1; then
|
||||
$echo " found"
|
||||
|
||||
NXT_PHP_VERSION="`${NXT_PHP_CONFIG} --version`"
|
||||
$echo " + PHP version: ${NXT_PHP_VERSION}"
|
||||
$echo " + PHP SAPI: [`${NXT_PHP_CONFIG} --php-sapis`]"
|
||||
|
||||
NXT_PHP_INCLUDE="`${NXT_PHP_CONFIG} --includes`"
|
||||
@@ -130,6 +129,23 @@ else
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
nxt_feature="PHP version"
|
||||
nxt_feature_name=""
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs="${NXT_PHP_INCLUDE}"
|
||||
nxt_feature_libs="${NXT_PHP_LIB} ${NXT_PHP_LDFLAGS}"
|
||||
nxt_feature_test="
|
||||
#include <php.h>
|
||||
|
||||
int main() {
|
||||
printf(\"%s\", PHP_VERSION);
|
||||
return 0;
|
||||
}"
|
||||
|
||||
. auto/feature
|
||||
|
||||
|
||||
if grep ^$NXT_PHP_MODULE: $NXT_MAKEFILE 2>&1 > /dev/null; then
|
||||
$echo
|
||||
$echo $0: error: duplicate \"$NXT_PHP_MODULE\" module configured.
|
||||
|
||||
@@ -111,7 +111,7 @@ nxt_feature_test="
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
printf("PY_VERSION");
|
||||
printf(\"%s\", PY_VERSION);
|
||||
return 0;
|
||||
}"
|
||||
|
||||
|
||||
@@ -91,8 +91,23 @@ if [ $nxt_found = no ]; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
NXT_RUBY_VERSION=`$NXT_RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG["RUBY_PROGRAM_VERSION"])'`
|
||||
$echo " + Ruby version: ${NXT_RUBY_VERSION}"
|
||||
|
||||
nxt_feature="Ruby version"
|
||||
nxt_feature_name=""
|
||||
nxt_feature_run=value
|
||||
nxt_feature_incs="${NXT_RUBY_INCPATH}"
|
||||
nxt_feature_libs="${NXT_RUBY_LIBS}"
|
||||
nxt_feature_test="
|
||||
#include <ruby.h>
|
||||
#include <ruby/version.h>
|
||||
|
||||
int main() {
|
||||
printf(\"%s\", ruby_version);
|
||||
return 0;
|
||||
}"
|
||||
|
||||
. auto/feature
|
||||
|
||||
|
||||
if grep ^$NXT_RUBY_MODULE: $NXT_MAKEFILE 2>&1 > /dev/null; then
|
||||
$echo
|
||||
|
||||
@@ -180,7 +180,7 @@ nxt_discovery_module(nxt_task_t *task, nxt_mp_t *mp, nxt_array_t *modules,
|
||||
const char *name)
|
||||
{
|
||||
void *dl;
|
||||
nxt_str_t *s;
|
||||
nxt_str_t version;
|
||||
nxt_int_t ret;
|
||||
nxt_uint_t i, n;
|
||||
nxt_module_t *module;
|
||||
@@ -203,8 +203,8 @@ nxt_discovery_module(nxt_task_t *task, nxt_mp_t *mp, nxt_array_t *modules,
|
||||
app = dlsym(dl, "nxt_app_module");
|
||||
|
||||
if (app != NULL) {
|
||||
nxt_log(task, NXT_LOG_NOTICE, "module: %V %V \"%s\"",
|
||||
&app->type, &app->version, name);
|
||||
nxt_log(task, NXT_LOG_NOTICE, "module: %V %s \"%s\"",
|
||||
&app->type, app->version, name);
|
||||
|
||||
if (app->compat_length != sizeof(compat)
|
||||
|| nxt_memcmp(app->compat, compat, sizeof(compat)) != 0)
|
||||
@@ -225,15 +225,17 @@ nxt_discovery_module(nxt_task_t *task, nxt_mp_t *mp, nxt_array_t *modules,
|
||||
module = modules->elts;
|
||||
n = modules->nelts;
|
||||
|
||||
version.start = (u_char *) app->version;
|
||||
version.length = nxt_strlen(app->version);
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
if (type == module[i].type
|
||||
&& nxt_strstr_eq(&app->version, &module[i].version))
|
||||
&& nxt_strstr_eq(&module[i].version, &version))
|
||||
{
|
||||
nxt_log(task, NXT_LOG_NOTICE,
|
||||
"ignoring %s module with the same "
|
||||
"application language version %V %V as in %V",
|
||||
name, &app->type, &app->version,
|
||||
&module[i].file);
|
||||
name, &app->type, version, &module[i].file);
|
||||
|
||||
goto done;
|
||||
}
|
||||
@@ -246,8 +248,8 @@ nxt_discovery_module(nxt_task_t *task, nxt_mp_t *mp, nxt_array_t *modules,
|
||||
|
||||
module->type = type;
|
||||
|
||||
s = nxt_str_dup(mp, &module->version, &app->version);
|
||||
if (s == NULL) {
|
||||
nxt_str_dup(mp, &module->version, &version);
|
||||
if (module->version.start == NULL) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ struct nxt_app_module_s {
|
||||
uint32_t *compat;
|
||||
|
||||
nxt_str_t type;
|
||||
nxt_str_t version;
|
||||
const char *version;
|
||||
|
||||
nxt_int_t (*init)(nxt_task_t *task,
|
||||
nxt_common_app_conf_t *conf);
|
||||
|
||||
@@ -17,7 +17,7 @@ nxt_application_module_t nxt_go_module = {
|
||||
0,
|
||||
NULL,
|
||||
nxt_string("go"),
|
||||
nxt_string("go"),
|
||||
"*",
|
||||
nxt_go_init,
|
||||
nxt_go_run,
|
||||
NULL,
|
||||
|
||||
@@ -166,7 +166,7 @@ NXT_EXPORT nxt_application_module_t nxt_app_module = {
|
||||
sizeof(compat),
|
||||
compat,
|
||||
nxt_string("php"),
|
||||
nxt_string(PHP_VERSION),
|
||||
PHP_VERSION,
|
||||
nxt_php_init,
|
||||
nxt_php_run,
|
||||
NULL,
|
||||
|
||||
@@ -100,7 +100,7 @@ NXT_EXPORT nxt_application_module_t nxt_app_module = {
|
||||
sizeof(compat),
|
||||
compat,
|
||||
nxt_string("python"),
|
||||
nxt_string(PY_VERSION),
|
||||
PY_VERSION,
|
||||
nxt_python_init,
|
||||
nxt_python_run,
|
||||
nxt_python_atexit,
|
||||
|
||||
@@ -113,7 +113,7 @@ NXT_EXPORT nxt_application_module_t nxt_app_module = {
|
||||
sizeof(nxt_perl_psgi_compat),
|
||||
nxt_perl_psgi_compat,
|
||||
nxt_string("perl"),
|
||||
nxt_string(PERL_VERSION_STRING),
|
||||
PERL_VERSION_STRING,
|
||||
nxt_perl_psgi_init,
|
||||
nxt_perl_psgi_run,
|
||||
nxt_perl_psgi_atexit,
|
||||
|
||||
@@ -74,7 +74,7 @@ NXT_EXPORT nxt_application_module_t nxt_app_module = {
|
||||
sizeof(compat),
|
||||
compat,
|
||||
nxt_string("ruby"),
|
||||
nxt_string(NXT_RUBY_LIB_VERSION),
|
||||
ruby_version,
|
||||
nxt_ruby_init,
|
||||
nxt_ruby_run,
|
||||
nxt_ruby_atexit,
|
||||
|
||||
Reference in New Issue
Block a user