Browse Source

Put git revision into version string

v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
d979ac9c7f
  1. 11
      wscript

11
wscript

@ -3,9 +3,11 @@ import platform
import re import re
import Options import Options
import sys, os, shutil import sys, os, shutil
from Utils import cmd_output
from os.path import join, dirname, abspath from os.path import join, dirname, abspath
from logging import fatal from logging import fatal
cwd = os.getcwd()
VERSION="0.1.13" VERSION="0.1.13"
APPNAME="node.js" APPNAME="node.js"
@ -13,7 +15,6 @@ import js2c
srcdir = '.' srcdir = '.'
blddir = 'build' blddir = 'build'
cwd = os.getcwd()
def set_options(opt): def set_options(opt):
# the gcc module provides a --debug-level option # the gcc module provides a --debug-level option
@ -342,15 +343,21 @@ def build(bld):
node.chmod = 0755 node.chmod = 0755
def subflags(program): def subflags(program):
if os.path.exists(join(cwd, ".git")):
actual_version=cmd_output("git-describe").strip()
else:
actual_version=VERSION
x = { 'CCFLAGS' : " ".join(program.env["CCFLAGS"]) x = { 'CCFLAGS' : " ".join(program.env["CCFLAGS"])
, 'CPPFLAGS' : " ".join(program.env["CPPFLAGS"]) , 'CPPFLAGS' : " ".join(program.env["CPPFLAGS"])
, 'LIBFLAGS' : " ".join(program.env["LIBFLAGS"]) , 'LIBFLAGS' : " ".join(program.env["LIBFLAGS"])
, 'VERSION' : VERSION , 'VERSION' : actual_version
, 'PREFIX' : program.env["PREFIX"] , 'PREFIX' : program.env["PREFIX"]
} }
return x return x
# process file.pc.in -> file.pc # process file.pc.in -> file.pc
node_version = bld.new_task_gen('subst', before="cxx") node_version = bld.new_task_gen('subst', before="cxx")
node_version.source = 'src/node_version.h.in' node_version.source = 'src/node_version.h.in'
node_version.target = 'src/node_version.h' node_version.target = 'src/node_version.h'

Loading…
Cancel
Save