2003-11-26 04:44:56 +08:00
|
|
|
|
2004-09-30 00:00:49 +08:00
|
|
|
# Copyright (C) Igor Sysoev
|
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
|
2003-12-15 04:10:27 +08:00
|
|
|
help=no
|
2003-11-26 04:44:56 +08:00
|
|
|
|
2004-05-19 04:28:54 +08:00
|
|
|
PREFIX=
|
|
|
|
SBIN_PATH=
|
|
|
|
CONF_PATH=
|
|
|
|
ERROR_LOG_PATH=
|
|
|
|
PID_PATH=
|
2004-10-21 23:34:38 +08:00
|
|
|
NGX_USER=
|
|
|
|
NGX_GROUP=
|
|
|
|
HTTP_LOG_PATH=
|
2004-05-19 04:28:54 +08:00
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
CC=${CC:-gcc}
|
2004-03-12 05:34:52 +08:00
|
|
|
CPP=
|
2004-10-21 23:34:38 +08:00
|
|
|
NGX_OBJS=objs
|
2003-11-26 04:44:56 +08:00
|
|
|
|
2004-03-11 23:42:41 +08:00
|
|
|
DEBUG=NO
|
2004-10-21 23:34:38 +08:00
|
|
|
NGX_CC_OPT=
|
|
|
|
NGX_LD_OPT=
|
2004-03-11 04:56:39 +08:00
|
|
|
CPU=NO
|
2004-03-11 01:55:19 +08:00
|
|
|
|
2003-11-26 04:44:56 +08:00
|
|
|
TEST_BUILD_DEVPOLL=NO
|
2004-01-30 05:45:01 +08:00
|
|
|
TEST_BUILD_EPOLL=NO
|
2004-02-18 01:53:12 +08:00
|
|
|
TEST_BUILD_RTSIG=NO
|
2003-11-26 04:44:56 +08:00
|
|
|
|
2004-02-03 05:19:52 +08:00
|
|
|
EVENT_FOUND=NO
|
|
|
|
|
2004-02-18 01:53:12 +08:00
|
|
|
EVENT_RTSIG=NO
|
2004-02-03 05:19:52 +08:00
|
|
|
EVENT_SELECT=NO
|
|
|
|
EVENT_POLL=NO
|
|
|
|
EVENT_AIO=NO
|
2004-01-23 17:26:18 +08:00
|
|
|
|
2004-02-24 04:57:12 +08:00
|
|
|
USE_THREADS=NO
|
|
|
|
|
2004-09-06 03:54:02 +08:00
|
|
|
HTTP=YES
|
2004-06-23 00:43:09 +08:00
|
|
|
HTTP_CHARSET=YES
|
2003-11-26 04:44:56 +08:00
|
|
|
HTTP_GZIP=YES
|
2004-07-08 23:17:47 +08:00
|
|
|
HTTP_SSL=NO
|
2004-09-28 00:03:21 +08:00
|
|
|
HTTP_SSI=NO
|
2004-06-25 00:07:04 +08:00
|
|
|
HTTP_ACCESS=YES
|
2004-08-27 23:40:59 +08:00
|
|
|
HTTP_USERID=YES
|
2004-09-28 00:03:21 +08:00
|
|
|
HTTP_STATUS=NO
|
2004-06-24 15:53:37 +08:00
|
|
|
HTTP_REWRITE=YES
|
2003-11-26 04:44:56 +08:00
|
|
|
HTTP_PROXY=YES
|
|
|
|
|
2004-09-07 23:29:22 +08:00
|
|
|
IMAP=NO
|
|
|
|
|
2004-02-10 04:47:18 +08:00
|
|
|
USE_PCRE=NO
|
2004-02-19 16:45:27 +08:00
|
|
|
PCRE=NONE
|
2004-03-12 05:34:52 +08:00
|
|
|
PCRE_OPT=
|
2003-11-26 04:44:56 +08:00
|
|
|
|
2004-07-26 02:34:14 +08:00
|
|
|
USE_OPENSSL=NO
|
|
|
|
OPENSSL=NONE
|
|
|
|
|
2004-02-03 05:19:52 +08:00
|
|
|
USE_MD5=NO
|
2004-02-09 15:46:43 +08:00
|
|
|
MD5=NONE
|
2004-03-12 05:34:52 +08:00
|
|
|
MD5_OPT=
|
2004-03-11 04:56:39 +08:00
|
|
|
MD5_ASM=NO
|
2003-11-26 04:44:56 +08:00
|
|
|
|
2004-02-03 05:19:52 +08:00
|
|
|
USE_ZLIB=NO
|
2004-02-09 15:46:43 +08:00
|
|
|
ZLIB=NONE
|
2004-03-12 05:34:52 +08:00
|
|
|
ZLIB_OPT=
|
2004-03-11 04:56:39 +08:00
|
|
|
ZLIB_ASM=NO
|
2003-11-26 04:44:56 +08:00
|
|
|
|
|
|
|
|
|
|
|
for option
|
|
|
|
do
|
|
|
|
case "$option" in
|
|
|
|
-*=*) value=`echo "$option" | sed -e 's/[-_a-zA-Z0-9]*=//'` ;;
|
|
|
|
*) value="" ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "$option" in
|
2003-12-15 04:10:27 +08:00
|
|
|
--help) help=yes ;;
|
2003-11-26 04:44:56 +08:00
|
|
|
|
2004-05-19 04:28:54 +08:00
|
|
|
--prefix=*) PREFIX="$value" ;;
|
|
|
|
--sbin-path=*) SBIN_PATH="$value" ;;
|
|
|
|
--conf-path=*) CONF_PATH="$value" ;;
|
|
|
|
--error-log-path=*) ERROR_LOG_PATH="$value" ;;
|
|
|
|
--pid-path=*) PID_PATH="$value" ;;
|
2004-10-21 23:34:38 +08:00
|
|
|
--user=*) NGX_USER="$value" ;;
|
|
|
|
--group=*) NGX_GROUP="$value" ;;
|
2004-05-19 04:28:54 +08:00
|
|
|
|
2003-11-26 04:44:56 +08:00
|
|
|
--crossbuild=*) PLATFORM="$value" ;;
|
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
--builddir=*) NGX_OBJS="$value" ;;
|
2003-11-26 04:44:56 +08:00
|
|
|
|
2004-02-18 01:53:12 +08:00
|
|
|
--with-rtsig_module) EVENT_RTSIG=YES ;;
|
2004-02-03 05:19:52 +08:00
|
|
|
--with-select_module) EVENT_SELECT=YES ;;
|
2004-02-10 04:47:18 +08:00
|
|
|
--without-select_module) EVENT_SELECT=NONE ;;
|
2004-02-03 05:19:52 +08:00
|
|
|
--with-poll_module) EVENT_POLL=YES ;;
|
2004-02-10 04:47:18 +08:00
|
|
|
--without-poll_module) EVENT_POLL=NONE ;;
|
2004-02-03 05:19:52 +08:00
|
|
|
--with-aio_module) EVENT_AIO=YES ;;
|
2004-01-23 17:26:18 +08:00
|
|
|
|
2004-02-24 04:57:12 +08:00
|
|
|
--with-threads=*) USE_THREADS="$value" ;;
|
|
|
|
--with-threads) USE_THREADS="pthreads" ;;
|
|
|
|
|
2004-09-06 03:54:02 +08:00
|
|
|
--without-http) HTTP=NO ;;
|
|
|
|
--http-log-path=*) HTTP_LOG_PATH="$value" ;;
|
|
|
|
|
2004-07-08 23:17:47 +08:00
|
|
|
--with-http_ssl_module) HTTP_SSL=YES ;;
|
2004-06-23 00:43:09 +08:00
|
|
|
--without-http_charset_module) HTTP_CHARSET=NO ;;
|
2003-11-26 04:44:56 +08:00
|
|
|
--without-http_gzip_module) HTTP_GZIP=NO ;;
|
2004-07-08 23:17:47 +08:00
|
|
|
--without-http_ssi_module) HTTP_SSI=NO ;;
|
2004-08-27 23:40:59 +08:00
|
|
|
--without-http_userid_module) HTTP_USERID=NO ;;
|
2004-08-29 11:55:41 +08:00
|
|
|
--without-http_access_module) HTTP_ACCESS=NO ;;
|
2004-06-24 15:53:37 +08:00
|
|
|
--without-http_status_module) HTTP_STATUS=NO ;;
|
|
|
|
--without-http_rewrite_module) HTTP_REWRITE=NO ;;
|
2003-11-26 04:44:56 +08:00
|
|
|
--without-http_proxy_module) HTTP_PROXY=NO ;;
|
|
|
|
|
2004-09-07 23:29:22 +08:00
|
|
|
--with-imap) IMAP=YES ;;
|
|
|
|
|
2003-11-26 04:44:56 +08:00
|
|
|
--with-cc=*) CC="$value" ;;
|
2004-03-12 05:34:52 +08:00
|
|
|
--with-cpp=*) CPP="$value" ;;
|
2004-10-21 23:34:38 +08:00
|
|
|
--with-cc-opt=*) NGX_CC_OPT="$value" ;;
|
|
|
|
--with-ld-opt=*) NGX_LD_OPT="$value" ;;
|
2004-03-11 04:56:39 +08:00
|
|
|
--with-cpu-opt=*) CPU="$value" ;;
|
2004-03-11 23:42:41 +08:00
|
|
|
--with-debug) DEBUG=YES ;;
|
2003-11-26 04:44:56 +08:00
|
|
|
|
2004-02-20 00:48:14 +08:00
|
|
|
--without-pcre) USE_PCRE=DISABLED ;;
|
2003-11-26 04:44:56 +08:00
|
|
|
--with-pcre=*) PCRE="$value" ;;
|
2004-03-11 04:56:39 +08:00
|
|
|
--with-pcre-opt=*) PCRE_OPT="$value" ;;
|
|
|
|
|
2004-07-26 02:34:14 +08:00
|
|
|
--with-openssl=*) OPENSSL="$value" ;;
|
|
|
|
|
2003-11-26 04:44:56 +08:00
|
|
|
--with-md5=*) MD5="$value" ;;
|
2004-03-11 04:56:39 +08:00
|
|
|
--with-md5-opt=*) MD5_OPT="$value" ;;
|
|
|
|
--with-md5-asm) MD5_ASM=YES ;;
|
|
|
|
|
2003-11-26 04:44:56 +08:00
|
|
|
--with-zlib=*) ZLIB="$value" ;;
|
2004-03-11 01:55:19 +08:00
|
|
|
--with-zlib-opt=*) ZLIB_OPT="$value" ;;
|
2004-03-11 04:56:39 +08:00
|
|
|
--with-zlib-asm=*) ZLIB_ASM="$value" ;;
|
2003-11-26 04:44:56 +08:00
|
|
|
|
|
|
|
--test-build-devpoll) TEST_BUILD_DEVPOLL=YES ;;
|
2004-01-30 05:45:01 +08:00
|
|
|
--test-build-epoll) TEST_BUILD_EPOLL=YES ;;
|
2004-02-18 01:53:12 +08:00
|
|
|
--test-build-rtsig) TEST_BUILD_RTSIG=YES ;;
|
2003-11-26 04:44:56 +08:00
|
|
|
|
|
|
|
*)
|
|
|
|
echo "$0: error: invalid option \"$option\""
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
|
2003-12-15 04:10:27 +08:00
|
|
|
if [ $help = yes ]; then
|
2004-01-23 17:26:18 +08:00
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
cat << END
|
|
|
|
|
|
|
|
--help this message
|
|
|
|
|
|
|
|
--user=USER set non-privilege user
|
|
|
|
for the worker processes
|
|
|
|
--group=GROUP set non-privilege group
|
|
|
|
for the worker processes
|
|
|
|
|
|
|
|
--with-select_module enable select module
|
|
|
|
--without-select_module disable select module
|
|
|
|
--with-poll_module enable poll module
|
|
|
|
--without-poll_module disable poll module
|
|
|
|
|
|
|
|
--without-http_charset_module disable ngx_http_charset_module
|
|
|
|
--without-http_rewrite_module disable ngx_http_rewrite_module
|
|
|
|
--without-http_gzip_module disable ngx_http_gzip_module
|
|
|
|
--without-http_proxy_module disable ngx_http_proxy_module
|
2003-11-26 04:44:56 +08:00
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
--with-cc-opt=OPTIONS additional options for compiler
|
|
|
|
--with-ld-opt=OPTIONS additional options for linker
|
2003-11-26 04:44:56 +08:00
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
--with-pcre=DIR path to PCRE library
|
|
|
|
--with-md5=DIR path to md5 library
|
|
|
|
--with-zlib=DIR path to zlib library
|
|
|
|
--with-openssl=DIR path to OpenSSL library
|
2003-11-26 04:44:56 +08:00
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
END
|
2003-11-26 04:44:56 +08:00
|
|
|
|
|
|
|
exit 1
|
|
|
|
fi
|
2004-04-22 02:54:33 +08:00
|
|
|
|
|
|
|
|
2004-09-14 13:45:22 +08:00
|
|
|
if [ $HTTP = NO ]; then
|
|
|
|
HTTP_CHARSET=NO
|
|
|
|
HTTP_GZIP=NO
|
|
|
|
HTTP_SSI=NO
|
|
|
|
HTTP_USERID=NO
|
|
|
|
HTTP_ACCESS=NO
|
|
|
|
HTTP_STATUS=NO
|
|
|
|
HTTP_REWRITE=NO
|
|
|
|
HTTP_PROXY=NO
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2004-04-22 02:54:33 +08:00
|
|
|
if [ ".$PLATFORM" = ".win32" -a $EVENT_POLL = YES ]; then
|
|
|
|
EVENT_POLL=NO
|
|
|
|
echo "$0: warning: --with-poll_module option is ignored for win32"
|
|
|
|
fi
|
2004-05-19 04:28:54 +08:00
|
|
|
|
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
if test -z "$PREFIX"; then
|
2004-05-19 04:28:54 +08:00
|
|
|
PREFIX=/usr/local/nginx
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
if test -z "$NGX_GROUP"; then
|
|
|
|
NGX_GROUP=NGX_USER
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if test -z "$NGX_USER"; then
|
|
|
|
NGX_USER=nobody
|
|
|
|
NGX_GROUP=nobody
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2004-09-28 00:03:21 +08:00
|
|
|
case ".$SBIN_PATH" in
|
|
|
|
./*)
|
|
|
|
;;
|
2004-05-19 04:28:54 +08:00
|
|
|
|
2004-09-28 00:03:21 +08:00
|
|
|
.)
|
|
|
|
SBIN_PATH=$PREFIX/sbin/nginx
|
|
|
|
;;
|
2004-05-19 04:28:54 +08:00
|
|
|
|
2004-09-28 00:03:21 +08:00
|
|
|
*)
|
|
|
|
SBIN_PATH=$PREFIX/$SBIN_PATH
|
|
|
|
;;
|
|
|
|
esac
|
2004-05-19 04:28:54 +08:00
|
|
|
|
2004-09-28 00:03:21 +08:00
|
|
|
|
|
|
|
case ".$CONF_PATH" in
|
|
|
|
./*)
|
|
|
|
;;
|
|
|
|
|
|
|
|
.)
|
|
|
|
CONF_PATH=$PREFIX/conf/nginx.conf
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
CONF_PATH=$PREFIX/$CONF_PATH
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
case ".$PID_PATH" in
|
|
|
|
./*)
|
|
|
|
;;
|
|
|
|
|
|
|
|
.)
|
|
|
|
PID_PATH=$PREFIX/logs/nginx.pid
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
PID_PATH=$PREFIX/$PID_PATH
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
case ".$ERROR_LOG_PATH" in
|
|
|
|
./*)
|
|
|
|
;;
|
|
|
|
|
|
|
|
.)
|
|
|
|
ERROR_LOG_PATH=$PREFIX/logs/error.log
|
|
|
|
;;
|
|
|
|
|
2004-09-30 00:00:49 +08:00
|
|
|
.stderr)
|
|
|
|
ERROR_LOG_PATH=
|
|
|
|
;;
|
|
|
|
|
2004-09-28 00:03:21 +08:00
|
|
|
*)
|
|
|
|
ERROR_LOG_PATH=$PREFIX/$ERROR_LOG_PATH
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
case ".$HTTP_LOG_PATH" in
|
|
|
|
./*)
|
|
|
|
;;
|
|
|
|
|
|
|
|
.)
|
|
|
|
HTTP_LOG_PATH=$PREFIX/logs/access.log
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
HTTP_LOG_PATH=$PREFIX/$HTTP_LOG_PATH
|
|
|
|
;;
|
|
|
|
esac
|