Skip to content

Commit ef21134

Browse files
committed
tools: H3 tools build script. Add go+boringssl
1 parent 736dd5a commit ef21134

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

tools/build_h3_tools.sh

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ ${MAKE} -j ${num_threads}
167167
sudo ${MAKE} install
168168
cd ..
169169

170-
# And finally curl
170+
# Then curl
171171
echo "Building curl ..."
172172
[ ! -d curl ] && git clone --branch curl-7_88_1 https://github.com/curl/curl.git
173173
cd curl
@@ -185,3 +185,50 @@ autoreconf -fi || autoreconf -fi
185185
LDFLAGS="${LDFLAGS}"
186186
${MAKE} -j ${num_threads}
187187
sudo ${MAKE} install
188+
189+
# boringssl
190+
echo "Building boringssl..."
191+
192+
# We need this go version.
193+
GO_BASE_PATH=/usr/local
194+
if [ ! -d ${GO_BASE_PATH} ]; then
195+
sudo mkdir ${GO_BASE_PATH}
196+
fi
197+
198+
if [ `uname -m` = "arm64" ]; then
199+
ARCH="arm64"
200+
else
201+
ARCH="amd64"
202+
fi
203+
204+
if [ `uname -s` = "Darwin" ]; then
205+
OS="darwin"
206+
else
207+
OS="linux"
208+
fi
209+
210+
wget https://go.dev/dl/go1.20.1.${OS}-${ARCH}.tar.gz
211+
sudo rm -rf ${GO_BASE_PATH}/go && sudo tar -C ${GO_BASE_PATH} -xf go1.20.1.${OS}-${ARCH}.tar.gz
212+
rm go1.20.1.${OS}-${ARCH}.tar.gz
213+
214+
GO_BINARY_PATH=${GO_BASE_PATH}/go/bin/go
215+
if [ ! -d boringssl ]; then
216+
git clone https://boringssl.googlesource.com/boringssl
217+
cd boringssl
218+
git checkout 31bad2514d21f6207f3925ba56754611c462a873
219+
cd ..
220+
fi
221+
cd boringssl
222+
if [ ! -d build ]; then
223+
mkdir build
224+
fi
225+
cd build
226+
cmake \
227+
-DGO_EXECUTABLE=${GO_BINARY_PATH} \
228+
-DCMAKE_INSTALL_PREFIX=${BASE}/boringssl \
229+
-DCMAKE_BUILD_TYPE=Release \
230+
-DBUILD_SHARED_LIBS=1 ../
231+
232+
${MAKE} -j ${num_threads}
233+
sudo ${MAKE} install
234+
cd ..

0 commit comments

Comments
 (0)