Skip to content

Instantly share code, notes, and snippets.

@hsyed
Last active November 22, 2019 03:46
Show Gist options
  • Save hsyed/b094299c27f89a029c816a1b281d61de to your computer and use it in GitHub Desktop.
Save hsyed/b094299c27f89a029c816a1b281d61de to your computer and use it in GitHub Desktop.
v8 build script.
#!/bin/bash -e
V8_RELEASE_TAG=5.7.457
DEPOT_TOOLS_REPO=https://chromium.googlesource.com/chromium/tools/depot_tools.git
git -C depot_tools pull || git clone ${DEPOT_TOOLS_REPO} depot_tools
export PATH=$PWD/depot_tools:$PATH
if [ ! -d "v8" ]; then
fetch v8
cd v8
else
cd v8
gclient sync
fi
if [ ! $(git describe --tags --abbrev=0) = "${V8_RELEASE_TAG}" ]; then
git checkout tags/${V8_RELEASE_TAG}
gclient sync
fi
GYP_DEFINES="mac_deployment_target=10.11" \
make -j8 x64.release GYPFLAGS="-Dv8_use_external_startup_data=0 -Dv8_enable_i18n_support=0 -Dv8_enable_gdbjit=0"
cd ..
cat<< EOF > "v8.pc"
prefix=$PWD/v8
includedir=\${prefix}/include
libdir=\${prefix}/out.gn/x64.release/
Name: libv8
Description: V8 engine
Version:${V8_RELEASE_TAG}
Cflags: -I\${includedir} -std=c++11
Libs: -L\${libdir} -lv8_base -lv8_libbase -lv8_libplatform -ldl -pthread
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment