File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -3,17 +3,18 @@ import platform
3
3
import re
4
4
import Options
5
5
import sys , os , shutil
6
+ from Utils import cmd_output
6
7
from os .path import join , dirname , abspath
7
8
from logging import fatal
8
9
10
+ cwd = os .getcwd ()
9
11
VERSION = "0.1.13"
10
12
APPNAME = "node.js"
11
13
12
14
import js2c
13
15
14
16
srcdir = '.'
15
17
blddir = 'build'
16
- cwd = os .getcwd ()
17
18
18
19
def set_options (opt ):
19
20
# the gcc module provides a --debug-level option
@@ -342,15 +343,21 @@ def build(bld):
342
343
node .chmod = 0755
343
344
344
345
def subflags (program ):
346
+ if os .path .exists (join (cwd , ".git" )):
347
+ actual_version = cmd_output ("git-describe" ).strip ()
348
+ else :
349
+ actual_version = VERSION
350
+
345
351
x = { 'CCFLAGS' : " " .join (program .env ["CCFLAGS" ])
346
352
, 'CPPFLAGS' : " " .join (program .env ["CPPFLAGS" ])
347
353
, 'LIBFLAGS' : " " .join (program .env ["LIBFLAGS" ])
348
- , 'VERSION' : VERSION
354
+ , 'VERSION' : actual_version
349
355
, 'PREFIX' : program .env ["PREFIX" ]
350
356
}
351
357
return x
352
358
353
359
# process file.pc.in -> file.pc
360
+
354
361
node_version = bld .new_task_gen ('subst' , before = "cxx" )
355
362
node_version .source = 'src/node_version.h.in'
356
363
node_version .target = 'src/node_version.h'
You can’t perform that action at this time.
0 commit comments