Skip to content

Commit ef6fad2

Browse files
committed
Fix Solaris build
1 parent e51a1dc commit ef6fad2

File tree

4 files changed

+65
-16
lines changed

4 files changed

+65
-16
lines changed

build-libv8

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,36 @@ set -u
55

66
version="${1}"
77

8+
platform=$(uname)
9+
810
NJOBS="${NJOBS:-$(getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || true)}"
911
NJOBS="${NJOBS:-1}"
1012

1113
echo "parallel job count: ${NJOBS}"
1214

1315
cd "src/node-${version}"
1416

15-
patch -p1 < ../../py2-icutrim.patch
16-
1717
if which python3 >/dev/null 2>&1; then
1818
PYTHON="${PYTHON:-python3}"
1919
else
2020
PYTHON="${PYTHON:-python2}"
2121
fi
2222

23-
"${PYTHON}" configure --openssl-no-asm --without-npm --shared --with-intl=small-icu
24-
make -j"${NJOBS}"
25-
26-
# taken from
27-
# ./configure
28-
# make
29-
# make -C out BUILDTYPE=Release V=1
30-
31-
#python configure.py --openssl-no-asm --without-npm
32-
#make BUILDTYPE=Release out/Makefile
33-
#make -C out BUILDTYPE=Release V=1 v8
34-
#make -C out BUILDTYPE=Release V=1 v8_libbase
35-
#make -C out BUILDTYPE=Release V=1 v8_libplatform
36-
#make -C out BUILDTYPE=Release V=1 v8_libsampler
23+
case "${platform}" in
24+
SunOS)
25+
export CC="${CC:-/opt/local/gcc7/bin/gcc}"
26+
export CXX="${CXX:-/opt/local/gcc7/bin/g++}"
27+
;;
28+
*)
29+
if cc --version | grep 4.9 >/dev/null; then
30+
export CC="${CC:-clang}"
31+
export CXX="${CXX:-clang++}"
32+
fi
33+
;;
34+
esac
3735

36+
"${PYTHON}" configure --openssl-no-asm --without-npm --shared --with-intl=small-icu
37+
make BUILDTYPE=Release config.gypi
38+
make BUILDTYPE=Release out/Makefile
39+
export PATH="${PWD}/out/tools/bin:${PATH}"
40+
make -j"${NJOBS}" -C out BUILDTYPE=Release V=0 v8 v8_libbase v8_libplatform v8_libsampler

extract-node

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,19 @@ case "${platform}" in
1717
esac
1818

1919
"${TAR}" -C src -xz -f "src/node-${version}.tar.gz"
20+
21+
cd "src/node-${version}"
22+
23+
patch -p1 < ../../py2-icutrim.patch
24+
patch -p1 < ../../py2-genv8constants.patch
25+
26+
# TODO: the following still fails on py3 so the above one forcing py2 is needed
27+
# patch -p1 < ../../py3-genv8constants.patch
28+
#
29+
# This is the error:
30+
#
31+
# Traceback (most recent call last):
32+
# File "tools/genv8constants.py", line 99, in <module>
33+
# curr_val += int('0x%s' % octetstr, 16) << (curr_octet * 8)
34+
# ValueError: invalid literal for int() with base 16: "0xb'04 '"
35+
# node_dtrace_ustack.target.mk:13: recipe for target '/usbkey/user_home/vagrant/ruby-libv8-node/src/node-14.14.0/out/Release/obj/gen/v8constants.h' failed

py2-genv8constants.patch

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--- a/tools/genv8constants.py 2020-11-04 09:49:14.000000000 +0100
2+
+++ b/tools/genv8constants.py 2020-11-04 12:40:46.000000000 +0100
3+
@@ -1,4 +1,4 @@
4+
-#!/usr/bin/env python
5+
+#!/usr/bin/env python2
6+
7+
#
8+
# genv8constants.py output_file libv8_base.a
9+
10+

py3-genv8constants.patch

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--- a/tools/genv8constants.py 2020-11-04 09:49:14.000000000 +0100
2+
+++ b/tools/genv8constants.py 2020-11-04 09:49:25.000000000 +0100
3+
@@ -33,9 +33,14 @@
4+
5+
sys.exit()
6+
7+
-pattern = re.compile(bytes('([0-9a-fA-F]{8}|[0-9a-fA-F]{16}) <(.*)>:'))
8+
-v8dbg = re.compile(bytes('^v8dbg.*$'))
9+
-numpattern = re.compile(bytes('^[0-9a-fA-F]{2} $'))
10+
+if str == bytes:
11+
+ pattern = re.compile(bytes('([0-9a-fA-F]{8}|[0-9a-fA-F]{16}) <(.*)>:'))
12+
+ v8dbg = re.compile(bytes('^v8dbg.*$'))
13+
+ numpattern = re.compile(bytes('^[0-9a-fA-F]{2} $'))
14+
+else:
15+
+ pattern = re.compile(bytes('([0-9a-fA-F]{8}|[0-9a-fA-F]{16}) <(.*)>:', 'utf-8'))
16+
+ v8dbg = re.compile(bytes('^v8dbg.*$', 'utf-8'))
17+
+ numpattern = re.compile(bytes('^[0-9a-fA-F]{2} $', 'utf-8'))
18+
octets = 4
19+
20+
outfile.write("""

0 commit comments

Comments
 (0)