2016-08-18 15:16:30 +00:00
|
|
|
#! /bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [[ $# -lt 1 || $# -gt 2 ]] ; then
|
|
|
|
echo "Usage: $0 <nginx-version> [1]" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
readonly NGINX=$1
|
|
|
|
|
|
|
|
if [[ $2 -eq 1 ]] ; then
|
|
|
|
readonly DYNAMIC=$2
|
|
|
|
fi
|
|
|
|
|
2022-05-09 19:18:39 +00:00
|
|
|
case $(uname -s) in
|
|
|
|
Darwin)
|
|
|
|
JOBS=$(sysctl -n hw.activecpu)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
JOBS=1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2016-08-18 15:16:30 +00:00
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
wget -O - http://nginx.org/download/nginx-${NGINX}.tar.gz | tar -xzf -
|
|
|
|
rm -rf prefix/
|
|
|
|
cd nginx-${NGINX}
|
|
|
|
./configure \
|
|
|
|
--add-${DYNAMIC:+dynamic-}module=.. \
|
|
|
|
--with-http_addition_module \
|
2023-01-20 11:35:13 +00:00
|
|
|
--without-http_rewrite_module \
|
2016-08-18 15:16:30 +00:00
|
|
|
--prefix="$(pwd)/../prefix"
|
2022-05-09 19:18:39 +00:00
|
|
|
make -j"$JOBS"
|
2016-08-18 15:16:30 +00:00
|
|
|
make install
|
|
|
|
cd ..
|
|
|
|
exec ./t/run prefix ${DYNAMIC}
|