Have WAF variants match GYP configuration names
This commit is contained in:
parent
85f7b78e9b
commit
879eb16280
12
Makefile
12
Makefile
@ -11,8 +11,8 @@ web_root = ryan@nodejs.org:~/web/nodejs.org/
|
||||
export NODE_MAKE := $(MAKE)
|
||||
|
||||
all: program
|
||||
@-[ -f build/default/node ] && ls -lh build/default/node
|
||||
@-[ -f build/debug/node_g ] && ls -lh build/debug/node_g
|
||||
@-[ -f build/Release/node ] && ls -lh build/Release/node
|
||||
@-[ -f build/Debug/node_g ] && ls -lh build/Debug/node_g
|
||||
|
||||
all-progress:
|
||||
@$(WAF) -p build
|
||||
@ -265,7 +265,7 @@ test-uv-debug: all
|
||||
NODE_USE_UV=1 python tools/test.py --mode=debug $(UVTEST)
|
||||
|
||||
|
||||
build/default/node: all
|
||||
build/Release/node: all
|
||||
|
||||
apidoc_sources = $(wildcard doc/api/*.markdown)
|
||||
apidocs = $(addprefix build/,$(apidoc_sources:.markdown=.html))
|
||||
@ -286,7 +286,7 @@ website_files = \
|
||||
build/doc/favicon.ico \
|
||||
build/doc/pipe.css
|
||||
|
||||
doc: build/default/node $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs)
|
||||
doc: build/Release/node $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs)
|
||||
|
||||
$(apidoc_dirs):
|
||||
mkdir -p $@
|
||||
@ -297,8 +297,8 @@ build/doc/api/assets/%: doc/api_assets/% build/doc/api/assets/
|
||||
build/doc/%: doc/%
|
||||
cp $< $@
|
||||
|
||||
build/doc/api/%.html: doc/api/%.markdown build/default/node $(apidoc_dirs) $(apiassets) tools/doctool/doctool.js
|
||||
build/default/node tools/doctool/doctool.js doc/template.html $< > $@
|
||||
build/doc/api/%.html: doc/api/%.markdown build/Release/node $(apidoc_dirs) $(apiassets) tools/doctool/doctool.js
|
||||
build/Release/node tools/doctool/doctool.js doc/template.html $< > $@
|
||||
|
||||
build/doc/%:
|
||||
|
||||
|
@ -26,9 +26,9 @@ var path = require('path');
|
||||
var isDebug = (process.version.indexOf('debug') >= 0);
|
||||
|
||||
var debugPath = path.normalize(path.join(__dirname, '..', '..',
|
||||
'build', 'debug', 'node'));
|
||||
'build', 'Debug', 'node'));
|
||||
var defaultPath = path.normalize(path.join(__dirname, '..', '..',
|
||||
'build', 'default', 'node'));
|
||||
'build', 'Release', 'node'));
|
||||
|
||||
console.error('debugPath: ' + debugPath);
|
||||
console.error('defaultPath: ' + defaultPath);
|
||||
|
@ -663,9 +663,9 @@ class Context(object):
|
||||
|
||||
def GetVm(self, mode):
|
||||
if mode == 'debug':
|
||||
name = 'build/debug/node'
|
||||
name = 'build/Debug/node'
|
||||
else:
|
||||
name = 'build/default/node'
|
||||
name = 'build/Release/node'
|
||||
|
||||
if utils.IsWindows() and not name.endswith('.exe'):
|
||||
name = os.path.abspath(name + '.exe')
|
||||
|
@ -85,7 +85,7 @@ class BuildContext(Utils.Context):
|
||||
self.id_nodes = 0
|
||||
self.idx = {}
|
||||
|
||||
# map names to environments, the 'default' must be defined
|
||||
# map names to environments, the 'Release' must be defined
|
||||
self.all_envs = {}
|
||||
|
||||
# ======================================= #
|
||||
@ -454,7 +454,7 @@ class BuildContext(Utils.Context):
|
||||
* remove the signatures for the build files that have disappeared
|
||||
* cache the results of os.listdir
|
||||
* create the build folder equivalent (mkdir) for each variant
|
||||
src/bar -> build/default/src/bar, build/release/src/bar
|
||||
src/bar -> build/Release/src/bar, build/Debug/src/bar
|
||||
|
||||
when a folder in the source directory is removed, we do not check recursively
|
||||
to remove the unused nodes. To do that, call 'waf clean' and build again.
|
||||
@ -564,7 +564,7 @@ class BuildContext(Utils.Context):
|
||||
cache.__delitem__(nid)
|
||||
|
||||
def get_env(self):
|
||||
return self.env_of_name('default')
|
||||
return self.env_of_name('Release')
|
||||
def set_env(self, name, val):
|
||||
self.all_envs[name] = val
|
||||
|
||||
|
@ -31,7 +31,7 @@ WAF_CONFIG_H = 'config.h'
|
||||
SIG_NIL = 'iluvcuteoverload'
|
||||
|
||||
VARIANT = '_VARIANT_'
|
||||
DEFAULT = 'default'
|
||||
DEFAULT = 'Release'
|
||||
|
||||
SRCDIR = 'srcdir'
|
||||
BLDDIR = 'blddir'
|
||||
|
@ -506,7 +506,7 @@ def run_c_code(self, *k, **kw):
|
||||
bld = Build.BuildContext()
|
||||
bld.log = self.log
|
||||
bld.all_envs.update(self.all_envs)
|
||||
bld.all_envs['default'] = env
|
||||
bld.all_envs['Release'] = env
|
||||
bld.lst_variants = bld.all_envs.keys()
|
||||
bld.load_dirs(dir, bdir)
|
||||
|
||||
|
90
wscript
90
wscript
@ -65,31 +65,31 @@ def set_options(opt):
|
||||
, action='store'
|
||||
, type='string'
|
||||
, default=False
|
||||
, help='Install into this libdir [Default: ${PREFIX}/lib]'
|
||||
, help='Install into this libdir [Release: ${PREFIX}/lib]'
|
||||
)
|
||||
opt.add_option( '--debug'
|
||||
, action='store_true'
|
||||
, default=False
|
||||
, help='Build debug variant [Default: False]'
|
||||
, help='Build debug variant [Release: False]'
|
||||
, dest='debug'
|
||||
)
|
||||
opt.add_option( '--profile'
|
||||
, action='store_true'
|
||||
, default=False
|
||||
, help='Enable profiling [Default: False]'
|
||||
, help='Enable profiling [Release: False]'
|
||||
, dest='profile'
|
||||
)
|
||||
opt.add_option( '--efence'
|
||||
, action='store_true'
|
||||
, default=False
|
||||
, help='Build with -lefence for debugging [Default: False]'
|
||||
, help='Build with -lefence for debugging [Release: False]'
|
||||
, dest='efence'
|
||||
)
|
||||
|
||||
opt.add_option( '--without-snapshot'
|
||||
, action='store_true'
|
||||
, default=False
|
||||
, help='Build without snapshotting V8 libraries. You might want to set this for cross-compiling. [Default: False]'
|
||||
, help='Build without snapshotting V8 libraries. You might want to set this for cross-compiling. [Release: False]'
|
||||
, dest='without_snapshot'
|
||||
)
|
||||
|
||||
@ -499,7 +499,7 @@ def configure(conf):
|
||||
|
||||
# Split off debug variant before adding variant specific defines
|
||||
debug_env = conf.env.copy()
|
||||
conf.set_env_name('debug', debug_env)
|
||||
conf.set_env_name('Debug', debug_env)
|
||||
|
||||
if (sys.platform.startswith("win32")):
|
||||
# Static pthread
|
||||
@ -508,8 +508,8 @@ def configure(conf):
|
||||
conf.env.append_value('CPPFLAGS', "-DPTW32_STATIC_LIB")
|
||||
|
||||
# Configure debug variant
|
||||
conf.setenv('debug')
|
||||
debug_env.set_variant('debug')
|
||||
conf.setenv('Debug')
|
||||
debug_env.set_variant('Debug')
|
||||
debug_env.append_value('CPPFLAGS', '-DDEBUG')
|
||||
debug_compile_flags = ['-g', '-O0', '-Wall', '-Wextra']
|
||||
debug_env.append_value('CCFLAGS', debug_compile_flags)
|
||||
@ -517,7 +517,7 @@ def configure(conf):
|
||||
conf.write_config_header("config.h")
|
||||
|
||||
# Configure default variant
|
||||
conf.setenv('default')
|
||||
conf.setenv('Release')
|
||||
default_compile_flags = ['-g', '-O3']
|
||||
conf.env.append_value('CCFLAGS', default_compile_flags)
|
||||
conf.env.append_value('CXXFLAGS', default_compile_flags)
|
||||
@ -542,7 +542,7 @@ def v8_cmd(bld, variant):
|
||||
|
||||
toolchain = "gcc"
|
||||
|
||||
if variant == "default":
|
||||
if variant == "Release":
|
||||
mode = "release"
|
||||
else:
|
||||
mode = "debug"
|
||||
@ -581,7 +581,7 @@ def build_v8(bld):
|
||||
+ bld.path.ant_glob('v8/include/*')
|
||||
+ bld.path.ant_glob('v8/src/*'),
|
||||
target = bld.env["staticlib_PATTERN"] % "v8",
|
||||
rule = v8_cmd(bld, "default"),
|
||||
rule = v8_cmd(bld, "Release"),
|
||||
before = "cxx",
|
||||
install_path = None)
|
||||
|
||||
@ -591,18 +591,18 @@ def build_v8(bld):
|
||||
|
||||
v8.uselib = "EXECINFO"
|
||||
bld.env["CPPPATH_V8"] = "deps/v8/include"
|
||||
t = join(bld.srcnode.abspath(bld.env_of_name("default")), v8.target)
|
||||
bld.env_of_name('default').append_value("LINKFLAGS_V8", t)
|
||||
t = join(bld.srcnode.abspath(bld.env_of_name("Release")), v8.target)
|
||||
bld.env_of_name('Release').append_value("LINKFLAGS_V8", t)
|
||||
|
||||
### v8 debug
|
||||
if bld.env["USE_DEBUG"]:
|
||||
v8_debug = v8.clone("debug")
|
||||
v8_debug.rule = v8_cmd(bld, "debug")
|
||||
v8_debug = v8.clone("Debug")
|
||||
v8_debug.rule = v8_cmd(bld, "Debug")
|
||||
v8_debug.target = bld.env["staticlib_PATTERN"] % "v8_g"
|
||||
v8_debug.uselib = "EXECINFO"
|
||||
bld.env["CPPPATH_V8_G"] = "deps/v8/include"
|
||||
t = join(bld.srcnode.abspath(bld.env_of_name("debug")), v8_debug.target)
|
||||
bld.env_of_name('debug').append_value("LINKFLAGS_V8_G", t)
|
||||
t = join(bld.srcnode.abspath(bld.env_of_name("Debug")), v8_debug.target)
|
||||
bld.env_of_name('Debug').append_value("LINKFLAGS_V8_G", t)
|
||||
|
||||
bld.install_files('${PREFIX}/include/node/', 'deps/v8/include/*.h')
|
||||
|
||||
@ -635,7 +635,7 @@ def build_uv(bld):
|
||||
source = 'deps/uv/include/uv.h',
|
||||
target = 'deps/uv/uv.a',
|
||||
before = "cxx",
|
||||
rule = uv_cmd(bld, 'default')
|
||||
rule = uv_cmd(bld, 'Release')
|
||||
)
|
||||
|
||||
uv.env.env = dict(os.environ)
|
||||
@ -643,17 +643,17 @@ def build_uv(bld):
|
||||
uv.env.env['CXX'] = sh_escape(bld.env['CXX'][0])
|
||||
uv.env.env['CPPFLAGS'] = "-DPTW32_STATIC_LIB"
|
||||
|
||||
t = join(bld.srcnode.abspath(bld.env_of_name("default")), uv.target)
|
||||
bld.env_of_name('default').append_value("LINKFLAGS_UV", t)
|
||||
t = join(bld.srcnode.abspath(bld.env_of_name("Release")), uv.target)
|
||||
bld.env_of_name('Release').append_value("LINKFLAGS_UV", t)
|
||||
|
||||
if bld.env["USE_DEBUG"]:
|
||||
uv_debug = uv.clone("debug")
|
||||
uv_debug.rule = uv_cmd(bld, 'debug')
|
||||
uv_debug = uv.clone("Debug")
|
||||
uv_debug.rule = uv_cmd(bld, 'Debug')
|
||||
uv_debug.env.env = dict(os.environ)
|
||||
uv_debug.env.env['CPPFLAGS'] = "-DPTW32_STATIC_LIB"
|
||||
|
||||
t = join(bld.srcnode.abspath(bld.env_of_name("debug")), uv_debug.target)
|
||||
bld.env_of_name('debug').append_value("LINKFLAGS_UV", t)
|
||||
t = join(bld.srcnode.abspath(bld.env_of_name("Debug")), uv_debug.target)
|
||||
bld.env_of_name('Debug').append_value("LINKFLAGS_UV", t)
|
||||
|
||||
bld.install_files('${PREFIX}/include/node/', 'deps/uv/include/*.h')
|
||||
|
||||
@ -695,7 +695,7 @@ def build(bld):
|
||||
http_parser.target = "http_parser"
|
||||
http_parser.install_path = None
|
||||
if bld.env["USE_DEBUG"]:
|
||||
http_parser.clone("debug")
|
||||
http_parser.clone("Debug")
|
||||
if product_type_is_lib:
|
||||
http_parser.ccflags = '-fPIC'
|
||||
|
||||
@ -706,12 +706,12 @@ def build(bld):
|
||||
f.close
|
||||
|
||||
macros_loc_debug = join(
|
||||
bld.srcnode.abspath(bld.env_of_name("debug")),
|
||||
bld.srcnode.abspath(bld.env_of_name("Debug")),
|
||||
"macros.py"
|
||||
)
|
||||
|
||||
macros_loc_default = join(
|
||||
bld.srcnode.abspath(bld.env_of_name("default")),
|
||||
bld.srcnode.abspath(bld.env_of_name("Release")),
|
||||
"macros.py"
|
||||
)
|
||||
|
||||
@ -768,7 +768,7 @@ def build(bld):
|
||||
# error that was had into the git commit meessage. git-blame to find out
|
||||
# where.)
|
||||
if bld.env["USE_DEBUG"]:
|
||||
native_cc_debug = native_cc.clone("debug")
|
||||
native_cc_debug = native_cc.clone("Debug")
|
||||
native_cc_debug.rule = javascript_in_c_debug
|
||||
|
||||
native_cc.rule = javascript_in_c_debug
|
||||
@ -783,7 +783,7 @@ def build(bld):
|
||||
)
|
||||
|
||||
if bld.env["USE_DEBUG"]:
|
||||
dtrace_g = dtrace.clone("debug")
|
||||
dtrace_g = dtrace.clone("Debug")
|
||||
|
||||
bld.install_files('${LIBDIR}/dtrace', 'src/node.d')
|
||||
|
||||
@ -820,8 +820,8 @@ def build(bld):
|
||||
rule = dtrace_postprocess
|
||||
)
|
||||
|
||||
t = join(bld.srcnode.abspath(bld.env_of_name("default")), dtracepost.target)
|
||||
bld.env_of_name('default').append_value('LINKFLAGS', t)
|
||||
t = join(bld.srcnode.abspath(bld.env_of_name("Release")), dtracepost.target)
|
||||
bld.env_of_name('Release').append_value('LINKFLAGS', t)
|
||||
|
||||
#
|
||||
# Note that for the same (mysterious) issue outlined above with respect
|
||||
@ -832,10 +832,10 @@ def build(bld):
|
||||
# LINKFLAGS_V8_G.
|
||||
#
|
||||
if bld.env["USE_DEBUG"]:
|
||||
dtracepost_g = dtracepost.clone("debug")
|
||||
dtracepost_g = dtracepost.clone("Debug")
|
||||
dtracepost_g.rule = dtrace_postprocess
|
||||
t = join(bld.srcnode.abspath(bld.env_of_name("debug")), dtracepost.target)
|
||||
bld.env_of_name("debug").append_value('LINKFLAGS_V8_G', t)
|
||||
t = join(bld.srcnode.abspath(bld.env_of_name("Debug")), dtracepost.target)
|
||||
bld.env_of_name("Debug").append_value('LINKFLAGS_V8_G', t)
|
||||
|
||||
|
||||
### node lib
|
||||
@ -904,7 +904,7 @@ def build(bld):
|
||||
bld.env.append_value('LINKFLAGS', '-Wl,--export-all-symbols')
|
||||
bld.env.append_value('LINKFLAGS', '-Wl,--out-implib,default/libnode.dll.a')
|
||||
bld.env.append_value('LINKFLAGS', '-Wl,--output-def,default/libnode.def')
|
||||
bld.install_files('${LIBDIR}', "build/default/libnode.*")
|
||||
bld.install_files('${LIBDIR}', "build/Release/libnode.*")
|
||||
|
||||
if (sys.platform.startswith("win32")):
|
||||
# Static libgcc
|
||||
@ -929,11 +929,11 @@ def build(bld):
|
||||
node_conf.install_path = '${PREFIX}/include/node'
|
||||
|
||||
if bld.env["USE_DEBUG"]:
|
||||
node_g = node.clone("debug")
|
||||
node_g = node.clone("Debug")
|
||||
node_g.target = "node_g"
|
||||
node_g.uselib += ' V8_G UV '
|
||||
|
||||
node_conf_g = node_conf.clone("debug")
|
||||
node_conf_g = node_conf.clone("Debug")
|
||||
node_conf_g.dict = subflags(node_g)
|
||||
node_conf_g.install_path = None
|
||||
|
||||
@ -971,15 +971,15 @@ def shutdown():
|
||||
|
||||
elif not Options.commands['clean']:
|
||||
if sys.platform.startswith("win32"):
|
||||
if os.path.exists('build/default/node.exe'):
|
||||
os.system('cp build/default/node.exe .')
|
||||
if os.path.exists('build/debug/node_g.exe'):
|
||||
os.system('cp build/debug/node_g.exe .')
|
||||
if os.path.exists('build/Release/node.exe'):
|
||||
os.system('cp build/Release/node.exe .')
|
||||
if os.path.exists('build/Debug/node_g.exe'):
|
||||
os.system('cp build/Debug/node_g.exe .')
|
||||
else:
|
||||
if os.path.exists('build/default/node') and not os.path.exists('node'):
|
||||
os.symlink('build/default/node', 'node')
|
||||
if os.path.exists('build/debug/node_g') and not os.path.exists('node_g'):
|
||||
os.symlink('build/debug/node_g', 'node_g')
|
||||
if os.path.exists('build/Release/node') and not os.path.exists('node'):
|
||||
os.symlink('build/Release/node', 'node')
|
||||
if os.path.exists('build/Debug/node_g') and not os.path.exists('node_g'):
|
||||
os.symlink('build/Debug/node_g', 'node_g')
|
||||
else:
|
||||
if sys.platform.startswith("win32"):
|
||||
if os.path.exists('node.exe'): os.unlink('node.exe')
|
||||
|
Loading…
x
Reference in New Issue
Block a user