Browse Source

Have WAF variants match GYP configuration names

Ryan Dahl 14 years ago
parent
commit
879eb16280
  1. 12
      Makefile
  2. 4
      test/simple/test-executable-path.js
  3. 4
      tools/test.py
  4. 6
      tools/wafadmin/Build.py
  5. 2
      tools/wafadmin/Constants.py
  6. 2
      tools/wafadmin/Tools/config_c.py
  7. 90
      wscript

12
Makefile

@ -11,8 +11,8 @@ web_root = ryan@nodejs.org:~/web/nodejs.org/
export NODE_MAKE := $(MAKE) export NODE_MAKE := $(MAKE)
all: program all: program
@-[ -f build/default/node ] && ls -lh build/default/node @-[ -f build/Release/node ] && ls -lh build/Release/node
@-[ -f build/debug/node_g ] && ls -lh build/debug/node_g @-[ -f build/Debug/node_g ] && ls -lh build/Debug/node_g
all-progress: all-progress:
@$(WAF) -p build @$(WAF) -p build
@ -265,7 +265,7 @@ test-uv-debug: all
NODE_USE_UV=1 python tools/test.py --mode=debug $(UVTEST) 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) apidoc_sources = $(wildcard doc/api/*.markdown)
apidocs = $(addprefix build/,$(apidoc_sources:.markdown=.html)) apidocs = $(addprefix build/,$(apidoc_sources:.markdown=.html))
@ -286,7 +286,7 @@ website_files = \
build/doc/favicon.ico \ build/doc/favicon.ico \
build/doc/pipe.css 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): $(apidoc_dirs):
mkdir -p $@ mkdir -p $@
@ -297,8 +297,8 @@ build/doc/api/assets/%: doc/api_assets/% build/doc/api/assets/
build/doc/%: doc/% build/doc/%: doc/%
cp $< $@ cp $< $@
build/doc/api/%.html: doc/api/%.markdown build/default/node $(apidoc_dirs) $(apiassets) tools/doctool/doctool.js build/doc/api/%.html: doc/api/%.markdown build/Release/node $(apidoc_dirs) $(apiassets) tools/doctool/doctool.js
build/default/node tools/doctool/doctool.js doc/template.html $< > $@ build/Release/node tools/doctool/doctool.js doc/template.html $< > $@
build/doc/%: build/doc/%:

4
test/simple/test-executable-path.js

@ -26,9 +26,9 @@ var path = require('path');
var isDebug = (process.version.indexOf('debug') >= 0); var isDebug = (process.version.indexOf('debug') >= 0);
var debugPath = path.normalize(path.join(__dirname, '..', '..', var debugPath = path.normalize(path.join(__dirname, '..', '..',
'build', 'debug', 'node')); 'build', 'Debug', 'node'));
var defaultPath = path.normalize(path.join(__dirname, '..', '..', var defaultPath = path.normalize(path.join(__dirname, '..', '..',
'build', 'default', 'node')); 'build', 'Release', 'node'));
console.error('debugPath: ' + debugPath); console.error('debugPath: ' + debugPath);
console.error('defaultPath: ' + defaultPath); console.error('defaultPath: ' + defaultPath);

4
tools/test.py

@ -663,9 +663,9 @@ class Context(object):
def GetVm(self, mode): def GetVm(self, mode):
if mode == 'debug': if mode == 'debug':
name = 'build/debug/node' name = 'build/Debug/node'
else: else:
name = 'build/default/node' name = 'build/Release/node'
if utils.IsWindows() and not name.endswith('.exe'): if utils.IsWindows() and not name.endswith('.exe'):
name = os.path.abspath(name + '.exe') name = os.path.abspath(name + '.exe')

6
tools/wafadmin/Build.py

@ -85,7 +85,7 @@ class BuildContext(Utils.Context):
self.id_nodes = 0 self.id_nodes = 0
self.idx = {} self.idx = {}
# map names to environments, the 'default' must be defined # map names to environments, the 'Release' must be defined
self.all_envs = {} self.all_envs = {}
# ======================================= # # ======================================= #
@ -454,7 +454,7 @@ class BuildContext(Utils.Context):
* remove the signatures for the build files that have disappeared * remove the signatures for the build files that have disappeared
* cache the results of os.listdir * cache the results of os.listdir
* create the build folder equivalent (mkdir) for each variant * 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 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. 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) cache.__delitem__(nid)
def get_env(self): def get_env(self):
return self.env_of_name('default') return self.env_of_name('Release')
def set_env(self, name, val): def set_env(self, name, val):
self.all_envs[name] = val self.all_envs[name] = val

2
tools/wafadmin/Constants.py

@ -31,7 +31,7 @@ WAF_CONFIG_H = 'config.h'
SIG_NIL = 'iluvcuteoverload' SIG_NIL = 'iluvcuteoverload'
VARIANT = '_VARIANT_' VARIANT = '_VARIANT_'
DEFAULT = 'default' DEFAULT = 'Release'
SRCDIR = 'srcdir' SRCDIR = 'srcdir'
BLDDIR = 'blddir' BLDDIR = 'blddir'

2
tools/wafadmin/Tools/config_c.py

@ -506,7 +506,7 @@ def run_c_code(self, *k, **kw):
bld = Build.BuildContext() bld = Build.BuildContext()
bld.log = self.log bld.log = self.log
bld.all_envs.update(self.all_envs) 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.lst_variants = bld.all_envs.keys()
bld.load_dirs(dir, bdir) bld.load_dirs(dir, bdir)

90
wscript

@ -65,31 +65,31 @@ def set_options(opt):
, action='store' , action='store'
, type='string' , type='string'
, default=False , default=False
, help='Install into this libdir [Default: ${PREFIX}/lib]' , help='Install into this libdir [Release: ${PREFIX}/lib]'
) )
opt.add_option( '--debug' opt.add_option( '--debug'
, action='store_true' , action='store_true'
, default=False , default=False
, help='Build debug variant [Default: False]' , help='Build debug variant [Release: False]'
, dest='debug' , dest='debug'
) )
opt.add_option( '--profile' opt.add_option( '--profile'
, action='store_true' , action='store_true'
, default=False , default=False
, help='Enable profiling [Default: False]' , help='Enable profiling [Release: False]'
, dest='profile' , dest='profile'
) )
opt.add_option( '--efence' opt.add_option( '--efence'
, action='store_true' , action='store_true'
, default=False , default=False
, help='Build with -lefence for debugging [Default: False]' , help='Build with -lefence for debugging [Release: False]'
, dest='efence' , dest='efence'
) )
opt.add_option( '--without-snapshot' opt.add_option( '--without-snapshot'
, action='store_true' , action='store_true'
, default=False , 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' , dest='without_snapshot'
) )
@ -499,7 +499,7 @@ def configure(conf):
# Split off debug variant before adding variant specific defines # Split off debug variant before adding variant specific defines
debug_env = conf.env.copy() debug_env = conf.env.copy()
conf.set_env_name('debug', debug_env) conf.set_env_name('Debug', debug_env)
if (sys.platform.startswith("win32")): if (sys.platform.startswith("win32")):
# Static pthread # Static pthread
@ -508,8 +508,8 @@ def configure(conf):
conf.env.append_value('CPPFLAGS', "-DPTW32_STATIC_LIB") conf.env.append_value('CPPFLAGS', "-DPTW32_STATIC_LIB")
# Configure debug variant # Configure debug variant
conf.setenv('debug') conf.setenv('Debug')
debug_env.set_variant('debug') debug_env.set_variant('Debug')
debug_env.append_value('CPPFLAGS', '-DDEBUG') debug_env.append_value('CPPFLAGS', '-DDEBUG')
debug_compile_flags = ['-g', '-O0', '-Wall', '-Wextra'] debug_compile_flags = ['-g', '-O0', '-Wall', '-Wextra']
debug_env.append_value('CCFLAGS', debug_compile_flags) debug_env.append_value('CCFLAGS', debug_compile_flags)
@ -517,7 +517,7 @@ def configure(conf):
conf.write_config_header("config.h") conf.write_config_header("config.h")
# Configure default variant # Configure default variant
conf.setenv('default') conf.setenv('Release')
default_compile_flags = ['-g', '-O3'] default_compile_flags = ['-g', '-O3']
conf.env.append_value('CCFLAGS', default_compile_flags) conf.env.append_value('CCFLAGS', default_compile_flags)
conf.env.append_value('CXXFLAGS', default_compile_flags) conf.env.append_value('CXXFLAGS', default_compile_flags)
@ -542,7 +542,7 @@ def v8_cmd(bld, variant):
toolchain = "gcc" toolchain = "gcc"
if variant == "default": if variant == "Release":
mode = "release" mode = "release"
else: else:
mode = "debug" mode = "debug"
@ -581,7 +581,7 @@ def build_v8(bld):
+ bld.path.ant_glob('v8/include/*') + bld.path.ant_glob('v8/include/*')
+ bld.path.ant_glob('v8/src/*'), + bld.path.ant_glob('v8/src/*'),
target = bld.env["staticlib_PATTERN"] % "v8", target = bld.env["staticlib_PATTERN"] % "v8",
rule = v8_cmd(bld, "default"), rule = v8_cmd(bld, "Release"),
before = "cxx", before = "cxx",
install_path = None) install_path = None)
@ -591,18 +591,18 @@ def build_v8(bld):
v8.uselib = "EXECINFO" v8.uselib = "EXECINFO"
bld.env["CPPPATH_V8"] = "deps/v8/include" bld.env["CPPPATH_V8"] = "deps/v8/include"
t = join(bld.srcnode.abspath(bld.env_of_name("default")), v8.target) t = join(bld.srcnode.abspath(bld.env_of_name("Release")), v8.target)
bld.env_of_name('default').append_value("LINKFLAGS_V8", t) bld.env_of_name('Release').append_value("LINKFLAGS_V8", t)
### v8 debug ### v8 debug
if bld.env["USE_DEBUG"]: if bld.env["USE_DEBUG"]:
v8_debug = v8.clone("debug") v8_debug = v8.clone("Debug")
v8_debug.rule = v8_cmd(bld, "debug") v8_debug.rule = v8_cmd(bld, "Debug")
v8_debug.target = bld.env["staticlib_PATTERN"] % "v8_g" v8_debug.target = bld.env["staticlib_PATTERN"] % "v8_g"
v8_debug.uselib = "EXECINFO" v8_debug.uselib = "EXECINFO"
bld.env["CPPPATH_V8_G"] = "deps/v8/include" bld.env["CPPPATH_V8_G"] = "deps/v8/include"
t = join(bld.srcnode.abspath(bld.env_of_name("debug")), v8_debug.target) 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.env_of_name('Debug').append_value("LINKFLAGS_V8_G", t)
bld.install_files('${PREFIX}/include/node/', 'deps/v8/include/*.h') bld.install_files('${PREFIX}/include/node/', 'deps/v8/include/*.h')
@ -635,7 +635,7 @@ def build_uv(bld):
source = 'deps/uv/include/uv.h', source = 'deps/uv/include/uv.h',
target = 'deps/uv/uv.a', target = 'deps/uv/uv.a',
before = "cxx", before = "cxx",
rule = uv_cmd(bld, 'default') rule = uv_cmd(bld, 'Release')
) )
uv.env.env = dict(os.environ) 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['CXX'] = sh_escape(bld.env['CXX'][0])
uv.env.env['CPPFLAGS'] = "-DPTW32_STATIC_LIB" uv.env.env['CPPFLAGS'] = "-DPTW32_STATIC_LIB"
t = join(bld.srcnode.abspath(bld.env_of_name("default")), uv.target) t = join(bld.srcnode.abspath(bld.env_of_name("Release")), uv.target)
bld.env_of_name('default').append_value("LINKFLAGS_UV", t) bld.env_of_name('Release').append_value("LINKFLAGS_UV", t)
if bld.env["USE_DEBUG"]: if bld.env["USE_DEBUG"]:
uv_debug = uv.clone("debug") uv_debug = uv.clone("Debug")
uv_debug.rule = uv_cmd(bld, 'debug') uv_debug.rule = uv_cmd(bld, 'Debug')
uv_debug.env.env = dict(os.environ) uv_debug.env.env = dict(os.environ)
uv_debug.env.env['CPPFLAGS'] = "-DPTW32_STATIC_LIB" uv_debug.env.env['CPPFLAGS'] = "-DPTW32_STATIC_LIB"
t = join(bld.srcnode.abspath(bld.env_of_name("debug")), uv_debug.target) t = join(bld.srcnode.abspath(bld.env_of_name("Debug")), uv_debug.target)
bld.env_of_name('debug').append_value("LINKFLAGS_UV", t) bld.env_of_name('Debug').append_value("LINKFLAGS_UV", t)
bld.install_files('${PREFIX}/include/node/', 'deps/uv/include/*.h') bld.install_files('${PREFIX}/include/node/', 'deps/uv/include/*.h')
@ -695,7 +695,7 @@ def build(bld):
http_parser.target = "http_parser" http_parser.target = "http_parser"
http_parser.install_path = None http_parser.install_path = None
if bld.env["USE_DEBUG"]: if bld.env["USE_DEBUG"]:
http_parser.clone("debug") http_parser.clone("Debug")
if product_type_is_lib: if product_type_is_lib:
http_parser.ccflags = '-fPIC' http_parser.ccflags = '-fPIC'
@ -706,12 +706,12 @@ def build(bld):
f.close f.close
macros_loc_debug = join( macros_loc_debug = join(
bld.srcnode.abspath(bld.env_of_name("debug")), bld.srcnode.abspath(bld.env_of_name("Debug")),
"macros.py" "macros.py"
) )
macros_loc_default = join( macros_loc_default = join(
bld.srcnode.abspath(bld.env_of_name("default")), bld.srcnode.abspath(bld.env_of_name("Release")),
"macros.py" "macros.py"
) )
@ -768,7 +768,7 @@ def build(bld):
# error that was had into the git commit meessage. git-blame to find out # error that was had into the git commit meessage. git-blame to find out
# where.) # where.)
if bld.env["USE_DEBUG"]: 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_debug.rule = javascript_in_c_debug
native_cc.rule = javascript_in_c_debug native_cc.rule = javascript_in_c_debug
@ -783,7 +783,7 @@ def build(bld):
) )
if bld.env["USE_DEBUG"]: if bld.env["USE_DEBUG"]:
dtrace_g = dtrace.clone("debug") dtrace_g = dtrace.clone("Debug")
bld.install_files('${LIBDIR}/dtrace', 'src/node.d') bld.install_files('${LIBDIR}/dtrace', 'src/node.d')
@ -820,8 +820,8 @@ def build(bld):
rule = dtrace_postprocess rule = dtrace_postprocess
) )
t = join(bld.srcnode.abspath(bld.env_of_name("default")), dtracepost.target) t = join(bld.srcnode.abspath(bld.env_of_name("Release")), dtracepost.target)
bld.env_of_name('default').append_value('LINKFLAGS', t) bld.env_of_name('Release').append_value('LINKFLAGS', t)
# #
# Note that for the same (mysterious) issue outlined above with respect # Note that for the same (mysterious) issue outlined above with respect
@ -832,10 +832,10 @@ def build(bld):
# LINKFLAGS_V8_G. # LINKFLAGS_V8_G.
# #
if bld.env["USE_DEBUG"]: if bld.env["USE_DEBUG"]:
dtracepost_g = dtracepost.clone("debug") dtracepost_g = dtracepost.clone("Debug")
dtracepost_g.rule = dtrace_postprocess dtracepost_g.rule = dtrace_postprocess
t = join(bld.srcnode.abspath(bld.env_of_name("debug")), dtracepost.target) t = join(bld.srcnode.abspath(bld.env_of_name("Debug")), dtracepost.target)
bld.env_of_name("debug").append_value('LINKFLAGS_V8_G', t) bld.env_of_name("Debug").append_value('LINKFLAGS_V8_G', t)
### node lib ### node lib
@ -904,7 +904,7 @@ def build(bld):
bld.env.append_value('LINKFLAGS', '-Wl,--export-all-symbols') 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,--out-implib,default/libnode.dll.a')
bld.env.append_value('LINKFLAGS', '-Wl,--output-def,default/libnode.def') 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")): if (sys.platform.startswith("win32")):
# Static libgcc # Static libgcc
@ -929,11 +929,11 @@ def build(bld):
node_conf.install_path = '${PREFIX}/include/node' node_conf.install_path = '${PREFIX}/include/node'
if bld.env["USE_DEBUG"]: if bld.env["USE_DEBUG"]:
node_g = node.clone("debug") node_g = node.clone("Debug")
node_g.target = "node_g" node_g.target = "node_g"
node_g.uselib += ' V8_G UV ' 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.dict = subflags(node_g)
node_conf_g.install_path = None node_conf_g.install_path = None
@ -971,15 +971,15 @@ def shutdown():
elif not Options.commands['clean']: elif not Options.commands['clean']:
if sys.platform.startswith("win32"): if sys.platform.startswith("win32"):
if os.path.exists('build/default/node.exe'): if os.path.exists('build/Release/node.exe'):
os.system('cp build/default/node.exe .') os.system('cp build/Release/node.exe .')
if os.path.exists('build/debug/node_g.exe'): if os.path.exists('build/Debug/node_g.exe'):
os.system('cp build/debug/node_g.exe .') os.system('cp build/Debug/node_g.exe .')
else: else:
if os.path.exists('build/default/node') and not os.path.exists('node'): if os.path.exists('build/Release/node') and not os.path.exists('node'):
os.symlink('build/default/node', 'node') os.symlink('build/Release/node', 'node')
if os.path.exists('build/debug/node_g') and not os.path.exists('node_g'): if os.path.exists('build/Debug/node_g') and not os.path.exists('node_g'):
os.symlink('build/debug/node_g', 'node_g') os.symlink('build/Debug/node_g', 'node_g')
else: else:
if sys.platform.startswith("win32"): if sys.platform.startswith("win32"):
if os.path.exists('node.exe'): os.unlink('node.exe') if os.path.exists('node.exe'): os.unlink('node.exe')

Loading…
Cancel
Save