Skip to content

Instantly share code, notes, and snippets.

@Stalinko
Created February 9, 2022 14:30
Show Gist options
  • Save Stalinko/8bf64ea216d406207235406aa2af6f4e to your computer and use it in GitHub Desktop.
Save Stalinko/8bf64ea216d406207235406aa2af6f4e to your computer and use it in GitHub Desktop.
Build latest cURL with BoringSSL / http2 (nghttp2) / zlib
#All of commands are run from root. If you're using non-root user you might need to add "sudo" before some commands
#Install required Ubuntu packages
apt update
apt install git cmake build-essential golang wget autoconf libtool
#Let's build everything in /tmp folder
cd /tmp
#Build BoringSSL
git clone --depth=1 https://boringssl.googlesource.com/boringssl
cd boringssl
mkdir build
cd build
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=on ..
make
#set up the build tree to get detected by curl's configure
cd ..
mkdir lib
cd lib
ln -s ../build/ssl/libssl.a
ln -s ../build/crypto/libcrypto.a
#install nghttp2
cd /tmp
git clone --depth=1 https://github.com/tatsuhiro-t/nghttp2.git
cd nghttp2
autoreconf -i
automake
autoconf
./configure
make
sudo make install
#build zlib (you can get the latest version at https://zlib.net/)
cd /tmp
wget https://zlib.net/zlib-1.2.11.tar.gz
tar -xf zlib-1.2.11.tar.gz
./configure --prefix=/usr/local/zlib
make install
#build curl (you can get the latest version at https://curl.se/download/)
cd /tmp
wget https://curl.se/download/curl-7.81.0.tar.gz
tar -xf https://curl.se/download/curl-7.81.0.tar.gz
cd curl-7.81.0
./buildconf
LIBS=-lpthread ./configure --with-nghttp2=/usr/local --with-ssl=/tmp/boring2 --with-zlib=/usr/local/zlib
make
make install
ldconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment