Skip to content

Instantly share code, notes, and snippets.

@nilportugues
Last active March 31, 2016 15:51
Show Gist options
  • Save nilportugues/212f469c2f3365637caae8f9a87be0a6 to your computer and use it in GitHub Desktop.
Save nilportugues/212f469c2f3365637caae8f9a87be0a6 to your computer and use it in GitHub Desktop.
cd /tmp
# Install depot_tools first (needed for source checkout)
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=`pwd`/depot_tools:"$PATH"
# Download v8
fetch v8
cd v8
# (optional) If you'd like to build a certain version:
git checkout 4.9.385.28
gclient sync
# use libicu of operating system
export GYP_DEFINES="use_system_icu=1"
# Build (with internal snapshots)
export GYPFLAGS="-Dv8_use_external_startup_data=0"
make native library=shared snapshot=on -j8
# Install to /usr
sudo mkdir -p /usr/lib /usr/include
sudo cp out/native/lib.target/lib*.so /usr/lib/
sudo cp -R include/* /usr/include
echo -e "create /usr/lib/libv8_libplatform.a\naddlib out/native/obj.target/tools/gyp/libv8_libplatform.a\nsave\nend" | sudo ar -M
cd /tmp
git clone https://github.com/phpv8/v8js.git
cd v8js
phpize
./configure
make
make test
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment