Skip to content

Commit

Permalink
build: allow to specify custom tags
Browse files Browse the repository at this point in the history
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).

Closes nodejs#4452.
  • Loading branch information
mmalecki authored and TooTallNate committed Dec 21, 2012
1 parent 70eb227 commit f84bf5b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
7 changes: 7 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ parser.add_option("--xcode",
dest="use_xcode",
help="Generate build files for use with xcode")

parser.add_option("--tag",
action="store",
dest="tag",
help="Custom build tag")

(options, args) = parser.parse_args()


Expand Down Expand Up @@ -490,6 +495,8 @@ def configure_node(o):
else:
o['variables']['node_use_perfctr'] = 'false'

o['variables']['node_tag'] = options.tag or ''


def configure_libz(o):
o['variables']['node_shared_zlib'] = b(options.shared_zlib)
Expand Down
1 change: 1 addition & 0 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
'NODE_WANT_INTERNALS=1',
'ARCH="<(target_arch)"',
'PLATFORM="<(OS)"',
'NODE_TAG="<(node_tag)"',
],

'conditions': [
Expand Down
11 changes: 9 additions & 2 deletions src/node_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
#define NODE_MAJOR_VERSION 0
#define NODE_MINOR_VERSION 9
#define NODE_PATCH_VERSION 5

#ifndef NODE_TAG
# define NODE_TAG ""
#endif

#define NODE_VERSION_IS_RELEASE 0

#ifndef NODE_STRINGIFY
Expand All @@ -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
Expand Down

0 comments on commit f84bf5b

Please sign in to comment.