Skip to content

Instantly share code, notes, and snippets.

@slanterns
Created July 30, 2018 12:01
Show Gist options
  • Save slanterns/2141b3e1d55c383bdf557600956ad984 to your computer and use it in GitHub Desktop.
Save slanterns/2141b3e1d55c383bdf557600956ad984 to your computer and use it in GitHub Desktop.
#! /bin/bash
# 创建编译目录
mkdir build_ngx && cd build_ngx
# brotli
git clone https://github.com/eustas/ngx_brotli.git #google/ngx_brotli 年久失修
cd ngx_brotli
git submodule update --init
cd ..
# patches
git clone https://github.com/kn007/patch.git #cloudflare/sslconfig 年久失修
# openssl
wget -O openssl.tar.gz -c https://www.openssl.org/source/openssl-1.1.1-pre8.tar.gz
tar zxf openssl.tar.gz
mv openssl-1.1.1-pre8/ openssl
# nginx
wget -c https://nginx.org/download/nginx-1.15.2.tar.gz
tar zxf nginx-1.15.2.tar.gz
# patch
cd nginx-1.15.2
patch -p1 < ../patch/nginx_auto_using_PRIORITIZE_CHACHA.patch #https://github.com/openssl/openssl/pull/4436
patch -p1 < ../patch/nginx.patch
patch -p1 < ../patch/fix_nginx_hpack_push_error.patch
# make
./configure --add-module=../ngx_brotli --with-openssl=../openssl --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_v2_hpack_enc #https://github.com/kn007/patch/issues/3
date >> ../../time.log
make
date >> ../../time.log
cd ../..
rm -rf build_ngx
# 创建编译目录
mkdir build_ngx && cd build_ngx
# brotli
git clone https://github.com/eustas/ngx_brotli.git #google/ngx_brotli 年久失修
cd ngx_brotli
git submodule update --init
cd ..
# patches
git clone https://github.com/kn007/patch.git #cloudflare/sslconfig 年久失修
# openssl
wget -O openssl.tar.gz -c https://www.openssl.org/source/openssl-1.1.1-pre8.tar.gz
tar zxf openssl.tar.gz
mv openssl-1.1.1-pre8/ openssl
# nginx
wget -c https://nginx.org/download/nginx-1.15.2.tar.gz
tar zxf nginx-1.15.2.tar.gz
# patch
cd nginx-1.15.2
patch -p1 < ../patch/nginx_auto_using_PRIORITIZE_CHACHA.patch #https://github.com/openssl/openssl/pull/4436
patch -p1 < ../patch/nginx.patch
patch -p1 < ../patch/fix_nginx_hpack_push_error.patch
# make
./configure --with-cc-opt='-m64 -march=native -O3 -flto -fuse-ld=gold' --add-module=../ngx_brotli --with-openssl=../openssl --with-openssl-opt='no-ssl3 -march=native -flto' --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_v2_hpack_enc #https://github.com/kn007/patch/issues/3
date >> ../../time.log
make
date >> ../../time.log
cd ../..
rm -rf build_ngx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment