#!/bin/sh
tools_path=`cd $(dirname "$0");pwd`
+if [ ! "$D8_PATH" ]; then
+ d8_public=`which d8`
+ if [ $d8_public ]; then D8_PATH=$(dirname "$d8_public"); fi
+fi
[ "$D8_PATH" ] || D8_PATH=$tools_path/..
d8_exec=$D8_PATH/d8
+if [ "$1" == "--no-build" ]; then
+ shift
+else
# compile d8 if it doesn't exist, assuming this script
# resides in the repository.
-[ -x $d8_exec ] || scons -j4 -C $D8_PATH -Y $tools_path/.. d8
+ [ -x $d8_exec ] || scons -j4 -C $D8_PATH -Y $tools_path/.. d8
+fi
# nm spits out 'no symbols found' messages to stderr.
$d8_exec $tools_path/splaytree.js $tools_path/codemap.js \
};
-function UnixCppEntriesProvider() {
+function UnixCppEntriesProvider(nmExec) {
this.symbols = [];
this.parsePos = 0;
+ this.nmExec = nmExec;
};
inherits(UnixCppEntriesProvider, CppEntriesProvider);
this.parsePos = 0;
try {
this.symbols = [
- os.system('nm', ['-C', '-n', libName], -1, -1),
- os.system('nm', ['-C', '-n', '-D', libName], -1, -1)
+ os.system(this.nmExec, ['-C', '-n', libName], -1, -1),
+ os.system(this.nmExec, ['-C', '-n', '-D', libName], -1, -1)
];
} catch (e) {
// If the library cannot be found on this system let's not panic.
platform: 'unix',
stateFilter: null,
ignoreUnknown: false,
- separateIc: false
+ separateIc: false,
+ nm: 'nm'
};
var argsDispatch = {
'-j': ['stateFilter', TickProcessor.VmStates.JS,
'--unix': ['platform', 'unix',
'Specify that we are running on *nix platform'],
'--windows': ['platform', 'windows',
- 'Specify that we are running on Windows platform']
+ 'Specify that we are running on Windows platform'],
+ '--nm': ['nm', 'nm',
+ 'Specify the \'nm\' executable to use (e.g. --nm=/my_dir/nm)']
};
argsDispatch['--js'] = argsDispatch['-j'];
argsDispatch['--gc'] = argsDispatch['-g'];
break;
}
args.shift();
+ var userValue = null;
+ var eqPos = arg.indexOf('=');
+ if (eqPos != -1) {
+ userValue = arg.substr(eqPos + 1);
+ arg = arg.substr(0, eqPos);
+ }
if (arg in argsDispatch) {
var dispatch = argsDispatch[arg];
- result[dispatch[0]] = dispatch[1];
+ result[dispatch[0]] = userValue == null ? dispatch[1] : userValue;
} else {
printUsageAndExit();
}
var params = processArguments(arguments);
var tickProcessor = new TickProcessor(
- params.platform == 'unix' ? new UnixCppEntriesProvider() :
+ params.platform == 'unix' ? new UnixCppEntriesProvider(params.nm) :
new WindowsCppEntriesProvider(),
params.separateIc,
params.ignoreUnknown,