summaryrefslogtreecommitdiffhomepage
path: root/auto
diff options
context:
space:
mode:
Diffstat (limited to 'auto')
-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} .