start | find | index | login or register | edit
2008-09-06
by earl, 4026 days ago
To build a 32-bit V8 on 64-bit Ubuntu Hardy: install scons, libc6-dev-i386, and g++4.2-multilib. Then run scons to build the lib and scons sample=shell to build the shell.

Ah, yes. Here's a stupid hack to make V8 work as shebang-ready script interpreter:

--- a/samples/shell.cc
+++ b/samples/shell.cc
@@ -77,6 +77,11 @@ int main(int argc, char* argv[]) {
printf("Error reading '%s'\n", str);
return 1;
}
+ // Skip shebang line
+ v8::String::AsciiValue source_str(source);
+ if (strncmp(*source_str, "#!", 2) == 0) {
+ source = v8::String::New(strchr(*source_str, '\n'));
+ }
if (!ExecuteString(source, file_name, false))
return 1;
}

(I promise that I'll get rid of this gist embedding thingie real soon now. It's just so damn convenient. Heh. And it's broken. It does not escape the \n. Well. Then it's a hooray for sed 's/\([*{}_]\)/\\\1/g' i guess. All hail the Vanilla escapor!)
powered by vanilla
echo earlZstrainYat|tr ZY @.
earl.strain.at • esa3 • online for 6769 days • c'est un vanilla site