summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej MaƂecki <me@mmalecki.com>2012-12-21 02:56:47 +0100
committerisaacs <i@izs.me>2012-12-26 20:15:17 -0800
commitc2e71dd51d8db42ab19cd9e5243af9a121ba0247 (patch)
treeb6fe253b685c12b71a62af40f07c0c3dc1bb93df
parent54740c8b247c9ce50a4400142004fd05ec098e21 (diff)
downloadnode-c2e71dd51d8db42ab19cd9e5243af9a121ba0247.tar.gz
build: allow to specify custom tags
When building custom `node` versions (e.g., floating features/fixes from different versions) it's often useful to specify a custom tag which easily identifies build when invoking `node -v`. Introduce a way to specify this tag in `node_version.h` file or by running `./configure --tag="<tag>"`. Insert it right after the patch version (and before `-pre`, if build is not a release).
-rwxr-xr-xconfigure10
-rw-r--r--node.gyp1
-rw-r--r--src/node_version.h11
3 files changed, 20 insertions, 2 deletions
diff --git a/configure b/configure
index 7211682ac..aa8c99846 100755
--- a/configure
+++ b/configure
@@ -182,6 +182,11 @@ parser.add_option("--unsafe-optimizations",
dest="unsafe_optimizations",
help=optparse.SUPPRESS_HELP)
+parser.add_option("--tag",
+ action="store",
+ dest="tag",
+ help="Custom build tag")
+
(options, args) = parser.parse_args()
@@ -394,6 +399,11 @@ def configure_node(o):
else:
o['variables']['node_use_etw'] = 'false'
+ if options.tag:
+ o['variables']['node_tag'] = '-' + options.tag
+ else:
+ o['variables']['node_tag'] = ''
+
def configure_libz(o):
o['variables']['node_shared_zlib'] = b(options.shared_zlib)
diff --git a/node.gyp b/node.gyp
index 82af2fe7c..2473879a1 100644
--- a/node.gyp
+++ b/node.gyp
@@ -130,6 +130,7 @@
'NODE_WANT_INTERNALS=1',
'ARCH="<(target_arch)"',
'PLATFORM="<(OS)"',
+ 'NODE_TAG="<(node_tag)"',
],
'conditions': [
diff --git a/src/node_version.h b/src/node_version.h
index 7ba88b33a..c611332e4 100644
--- a/src/node_version.h
+++ b/src/node_version.h
@@ -25,6 +25,11 @@
#define NODE_MAJOR_VERSION 0
#define NODE_MINOR_VERSION 8
#define NODE_PATCH_VERSION 17
+
+#ifndef NODE_TAG
+# define NODE_TAG ""
+#endif
+
#define NODE_VERSION_IS_RELEASE 0
#ifndef NODE_STRINGIFY
@@ -35,11 +40,13 @@
#if NODE_VERSION_IS_RELEASE
# define NODE_VERSION_STRING NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
NODE_STRINGIFY(NODE_MINOR_VERSION) "." \
- NODE_STRINGIFY(NODE_PATCH_VERSION)
+ NODE_STRINGIFY(NODE_PATCH_VERSION) \
+ NODE_TAG
#else
# define NODE_VERSION_STRING NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \
NODE_STRINGIFY(NODE_MINOR_VERSION) "." \
- NODE_STRINGIFY(NODE_PATCH_VERSION) "-pre"
+ NODE_STRINGIFY(NODE_PATCH_VERSION) \
+ NODE_TAG "-pre"
#endif
#define NODE_VERSION "v" NODE_VERSION_STRING