forked from mhrdev/v8.go
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·43 lines (36 loc) · 953 Bytes
/
install.sh
File metadata and controls
executable file
·43 lines (36 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
set -v #echo on
# build v8 native version
cd v8
if [ `g++ --version | grep -o LLVM` == 'LLVM' ]; then
export CXXFLAGS="-Wno-tautological-undefined-compare"
fi
make i18nsupport=off native
cd ..
outdir="`pwd`/v8/out/native"
libv8_base="`find $outdir -name 'libv8_base.*.a' | head -1`"
if [ ! -f $libv8_base ]; then
echo >&2 "V8 build failed?"
exit
fi
# for Linux
librt=''
if [ `go env | grep GOHOSTOS` == 'GOHOSTOS="linux"' ]; then
librt='-lrt'
# For some reason linux (or is it GCC) puts this in a weird place
outdir="$outdir/obj.target/tools/gyp/"
fi
# for Mac
libstdcpp=''
if [ `go env | grep GOHOSTOS` == 'GOHOSTOS="darwin"' ]; then
libstdcpp='-stdlib=libstdc++'
fi
# create package config file
echo "Name: v8
Description: v8 javascript engine
Version: $v8_version
Cflags: $libstdcpp -I`pwd` -I`pwd`/v8/include
Libs: $libstdcpp $libv8_base $outdir/libv8_snapshot.a $librt" > v8.pc
# let's go
go install
#go test -v