summaryrefslogtreecommitdiffhomepage
path: root/auto/modules
diff options
context:
space:
mode:
authorAlexander Borisov <alexander.borisov@nginx.com>2018-12-19 15:56:57 +0300
committerAlexander Borisov <alexander.borisov@nginx.com>2018-12-19 15:56:57 +0300
commitd6f38a3268dd4df717bdb9054f3f9ee47fa1f429 (patch)
tree2e98fedf75a53ef5a34d3aedf7f7c547fe5a31a2 /auto/modules
parentc55f329ecf8d32bad0d5bc2aae1da1522b3a92f8 (diff)
downloadunit-d6f38a3268dd4df717bdb9054f3f9ee47fa1f429.tar.gz
unit-d6f38a3268dd4df717bdb9054f3f9ee47fa1f429.tar.bz2
Node.js: added check for libunit version at compile time.
Diffstat (limited to '')
-rw-r--r--auto/modules/nodejs11
1 files changed, 9 insertions, 2 deletions
diff --git a/auto/modules/nodejs b/auto/modules/nodejs
index d140eff1..e0208f5d 100644
--- a/auto/modules/nodejs
+++ b/auto/modules/nodejs
@@ -123,6 +123,7 @@ fi
NXT_NODE_TMP=${NXT_BUILD_DIR}/src/${NXT_NODE}/unit-http
NXT_NODE_TARBALL=${NXT_BUILD_DIR}/${NXT_NODE}-unit-http.tar.gz
+NXT_NODE_VERSION_FILE=${NXT_NODE_TMP}/version.h
NXT_NODE_EXPORTS="export UNIT_SRC_PATH=${PWD}/src \
&& export UNIT_BUILD_PATH=${PWD}/${NXT_BUILD_DIR} \
&& export UNIT_LIB_STATIC_PATH=${PWD}/${NXT_BUILD_DIR}/libunit.a"
@@ -149,9 +150,15 @@ ${NXT_NODE}: ${NXT_NODE}-copy $NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC
${NXT_NODE_EXPORTS} && \\
cd ${NXT_NODE_TMP} && ${NXT_NODE_GYP} configure build clean
-${NXT_NODE}-copy:
+${NXT_NODE}-copy: ${NXT_NODE_VERSION_FILE}
mkdir -p ${NXT_BUILD_DIR}/src/
- cp -rp src/nodejs/ ${NXT_BUILD_DIR}/src/${NXT_NODE}
+ cp -rp src/nodejs/* ${NXT_BUILD_DIR}/src/${NXT_NODE}
+
+${NXT_NODE_VERSION_FILE}: src/nxt_main.h
+ mkdir -p ${NXT_NODE_TMP}
+ $echo -n '#define NXT_NODE_VERNUM ' > $NXT_NODE_VERSION_FILE
+ grep 'define NXT_VERNUM' src/nxt_main.h \\
+ | sed -e 's/[^0-9]//g' >> $NXT_NODE_VERSION_FILE
${NXT_NODE_TARBALL}: ${NXT_NODE}-copy
tar -zcvf ${NXT_NODE_TARBALL} -C ${NXT_NODE_TMP} .