Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 1 | |
Igor Sysoev | ff8da91 | 2004-09-29 16:00:49 +0000 | [diff] [blame] | 2 | # Copyright (C) Igor Sysoev |
| 3 | |
Igor Sysoev | dc867cd | 2003-12-14 20:10:27 +0000 | [diff] [blame] | 4 | help=no |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 5 | |
Igor Sysoev | 090849d | 2004-05-18 20:28:54 +0000 | [diff] [blame] | 6 | PREFIX= |
| 7 | SBIN_PATH= |
| 8 | CONF_PATH= |
| 9 | HTTP_LOG_PATH= |
| 10 | ERROR_LOG_PATH= |
| 11 | PID_PATH= |
| 12 | |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 13 | CC=gcc |
Igor Sysoev | a893eab | 2004-03-11 21:34:52 +0000 | [diff] [blame] | 14 | CPP= |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 15 | OBJS=objs |
| 16 | |
Igor Sysoev | 6bb889f | 2004-03-11 15:42:41 +0000 | [diff] [blame] | 17 | DEBUG=NO |
Igor Sysoev | b3968b3 | 2004-04-14 17:44:28 +0000 | [diff] [blame] | 18 | CC_OPT= |
Igor Sysoev | 7b90834 | 2004-03-10 20:56:39 +0000 | [diff] [blame] | 19 | CPU=NO |
Igor Sysoev | 24b56c9 | 2004-03-10 17:55:19 +0000 | [diff] [blame] | 20 | |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 21 | TEST_BUILD_DEVPOLL=NO |
Igor Sysoev | 10318a2 | 2004-01-29 21:45:01 +0000 | [diff] [blame] | 22 | TEST_BUILD_EPOLL=NO |
Igor Sysoev | 9139cd2 | 2004-02-17 17:53:12 +0000 | [diff] [blame] | 23 | TEST_BUILD_RTSIG=NO |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 24 | |
Igor Sysoev | a4b16df | 2004-02-02 21:19:52 +0000 | [diff] [blame] | 25 | EVENT_FOUND=NO |
| 26 | |
Igor Sysoev | 9139cd2 | 2004-02-17 17:53:12 +0000 | [diff] [blame] | 27 | EVENT_RTSIG=NO |
Igor Sysoev | a4b16df | 2004-02-02 21:19:52 +0000 | [diff] [blame] | 28 | EVENT_SELECT=NO |
| 29 | EVENT_POLL=NO |
| 30 | EVENT_AIO=NO |
Igor Sysoev | 5c8c52f | 2004-01-23 09:26:18 +0000 | [diff] [blame] | 31 | |
Igor Sysoev | b54698b | 2004-02-23 20:57:12 +0000 | [diff] [blame] | 32 | USE_THREADS=NO |
| 33 | |
Igor Sysoev | 980a924 | 2004-09-05 19:54:02 +0000 | [diff] [blame] | 34 | HTTP=YES |
Igor Sysoev | 3d5c0fc | 2004-06-22 16:43:09 +0000 | [diff] [blame] | 35 | HTTP_CHARSET=YES |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 36 | HTTP_GZIP=YES |
Igor Sysoev | 7556945 | 2004-07-08 15:17:47 +0000 | [diff] [blame] | 37 | HTTP_SSL=NO |
Igor Sysoev | 6d2a14a | 2004-09-27 16:03:21 +0000 | [diff] [blame] | 38 | HTTP_SSI=NO |
Igor Sysoev | 59f3aa3 | 2004-06-24 16:07:04 +0000 | [diff] [blame] | 39 | HTTP_ACCESS=YES |
Igor Sysoev | 967fd63 | 2004-08-27 15:40:59 +0000 | [diff] [blame] | 40 | HTTP_USERID=YES |
Igor Sysoev | 6d2a14a | 2004-09-27 16:03:21 +0000 | [diff] [blame] | 41 | HTTP_STATUS=NO |
Igor Sysoev | c83f683 | 2004-06-24 07:53:37 +0000 | [diff] [blame] | 42 | HTTP_REWRITE=YES |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 43 | HTTP_PROXY=YES |
| 44 | |
Igor Sysoev | 59cf56c | 2004-09-07 15:29:22 +0000 | [diff] [blame] | 45 | IMAP=NO |
| 46 | |
Igor Sysoev | e9b2cb1 | 2004-02-09 20:47:18 +0000 | [diff] [blame] | 47 | USE_PCRE=NO |
Igor Sysoev | 43c3cd9 | 2004-02-19 08:45:27 +0000 | [diff] [blame] | 48 | PCRE=NONE |
Igor Sysoev | a893eab | 2004-03-11 21:34:52 +0000 | [diff] [blame] | 49 | PCRE_OPT= |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 50 | |
Igor Sysoev | 0599b11 | 2004-07-25 18:34:14 +0000 | [diff] [blame] | 51 | USE_OPENSSL=NO |
| 52 | OPENSSL=NONE |
| 53 | |
Igor Sysoev | a4b16df | 2004-02-02 21:19:52 +0000 | [diff] [blame] | 54 | USE_MD5=NO |
Igor Sysoev | 7af6b16 | 2004-02-09 07:46:43 +0000 | [diff] [blame] | 55 | MD5=NONE |
Igor Sysoev | a893eab | 2004-03-11 21:34:52 +0000 | [diff] [blame] | 56 | MD5_OPT= |
Igor Sysoev | 7b90834 | 2004-03-10 20:56:39 +0000 | [diff] [blame] | 57 | MD5_ASM=NO |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 58 | |
Igor Sysoev | a4b16df | 2004-02-02 21:19:52 +0000 | [diff] [blame] | 59 | USE_ZLIB=NO |
Igor Sysoev | 7af6b16 | 2004-02-09 07:46:43 +0000 | [diff] [blame] | 60 | ZLIB=NONE |
Igor Sysoev | a893eab | 2004-03-11 21:34:52 +0000 | [diff] [blame] | 61 | ZLIB_OPT= |
Igor Sysoev | 7b90834 | 2004-03-10 20:56:39 +0000 | [diff] [blame] | 62 | ZLIB_ASM=NO |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 63 | |
| 64 | |
| 65 | for option |
| 66 | do |
| 67 | case "$option" in |
| 68 | -*=*) value=`echo "$option" | sed -e 's/[-_a-zA-Z0-9]*=//'` ;; |
| 69 | *) value="" ;; |
| 70 | esac |
| 71 | |
| 72 | case "$option" in |
Igor Sysoev | dc867cd | 2003-12-14 20:10:27 +0000 | [diff] [blame] | 73 | --help) help=yes ;; |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 74 | |
Igor Sysoev | 090849d | 2004-05-18 20:28:54 +0000 | [diff] [blame] | 75 | --prefix=*) PREFIX="$value" ;; |
| 76 | --sbin-path=*) SBIN_PATH="$value" ;; |
| 77 | --conf-path=*) CONF_PATH="$value" ;; |
Igor Sysoev | 090849d | 2004-05-18 20:28:54 +0000 | [diff] [blame] | 78 | --error-log-path=*) ERROR_LOG_PATH="$value" ;; |
| 79 | --pid-path=*) PID_PATH="$value" ;; |
| 80 | |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 81 | --crossbuild=*) PLATFORM="$value" ;; |
| 82 | |
| 83 | --builddir=*) OBJS="$value" ;; |
| 84 | |
Igor Sysoev | 9139cd2 | 2004-02-17 17:53:12 +0000 | [diff] [blame] | 85 | --with-rtsig_module) EVENT_RTSIG=YES ;; |
Igor Sysoev | a4b16df | 2004-02-02 21:19:52 +0000 | [diff] [blame] | 86 | --with-select_module) EVENT_SELECT=YES ;; |
Igor Sysoev | e9b2cb1 | 2004-02-09 20:47:18 +0000 | [diff] [blame] | 87 | --without-select_module) EVENT_SELECT=NONE ;; |
Igor Sysoev | a4b16df | 2004-02-02 21:19:52 +0000 | [diff] [blame] | 88 | --with-poll_module) EVENT_POLL=YES ;; |
Igor Sysoev | e9b2cb1 | 2004-02-09 20:47:18 +0000 | [diff] [blame] | 89 | --without-poll_module) EVENT_POLL=NONE ;; |
Igor Sysoev | a4b16df | 2004-02-02 21:19:52 +0000 | [diff] [blame] | 90 | --with-aio_module) EVENT_AIO=YES ;; |
Igor Sysoev | 5c8c52f | 2004-01-23 09:26:18 +0000 | [diff] [blame] | 91 | |
Igor Sysoev | b54698b | 2004-02-23 20:57:12 +0000 | [diff] [blame] | 92 | --with-threads=*) USE_THREADS="$value" ;; |
| 93 | --with-threads) USE_THREADS="pthreads" ;; |
| 94 | |
Igor Sysoev | 980a924 | 2004-09-05 19:54:02 +0000 | [diff] [blame] | 95 | --without-http) HTTP=NO ;; |
| 96 | --http-log-path=*) HTTP_LOG_PATH="$value" ;; |
| 97 | |
Igor Sysoev | 7556945 | 2004-07-08 15:17:47 +0000 | [diff] [blame] | 98 | --with-http_ssl_module) HTTP_SSL=YES ;; |
Igor Sysoev | 3d5c0fc | 2004-06-22 16:43:09 +0000 | [diff] [blame] | 99 | --without-http_charset_module) HTTP_CHARSET=NO ;; |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 100 | --without-http_gzip_module) HTTP_GZIP=NO ;; |
Igor Sysoev | 7556945 | 2004-07-08 15:17:47 +0000 | [diff] [blame] | 101 | --without-http_ssi_module) HTTP_SSI=NO ;; |
Igor Sysoev | 967fd63 | 2004-08-27 15:40:59 +0000 | [diff] [blame] | 102 | --without-http_userid_module) HTTP_USERID=NO ;; |
Igor Sysoev | a7c4a2a | 2004-08-29 03:55:41 +0000 | [diff] [blame] | 103 | --without-http_access_module) HTTP_ACCESS=NO ;; |
Igor Sysoev | c83f683 | 2004-06-24 07:53:37 +0000 | [diff] [blame] | 104 | --without-http_status_module) HTTP_STATUS=NO ;; |
| 105 | --without-http_rewrite_module) HTTP_REWRITE=NO ;; |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 106 | --without-http_proxy_module) HTTP_PROXY=NO ;; |
| 107 | |
Igor Sysoev | 59cf56c | 2004-09-07 15:29:22 +0000 | [diff] [blame] | 108 | --with-imap) IMAP=YES ;; |
| 109 | |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 110 | --with-cc=*) CC="$value" ;; |
Igor Sysoev | a893eab | 2004-03-11 21:34:52 +0000 | [diff] [blame] | 111 | --with-cpp=*) CPP="$value" ;; |
Igor Sysoev | b3968b3 | 2004-04-14 17:44:28 +0000 | [diff] [blame] | 112 | --with-cc-opt=*) CC_OPT="$value" ;; |
Igor Sysoev | 7b90834 | 2004-03-10 20:56:39 +0000 | [diff] [blame] | 113 | --with-cpu-opt=*) CPU="$value" ;; |
Igor Sysoev | 6bb889f | 2004-03-11 15:42:41 +0000 | [diff] [blame] | 114 | --with-debug) DEBUG=YES ;; |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 115 | |
Igor Sysoev | bb1ba3f | 2004-02-19 16:48:14 +0000 | [diff] [blame] | 116 | --without-pcre) USE_PCRE=DISABLED ;; |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 117 | --with-pcre=*) PCRE="$value" ;; |
Igor Sysoev | 7b90834 | 2004-03-10 20:56:39 +0000 | [diff] [blame] | 118 | --with-pcre-opt=*) PCRE_OPT="$value" ;; |
| 119 | |
Igor Sysoev | 0599b11 | 2004-07-25 18:34:14 +0000 | [diff] [blame] | 120 | --with-openssl=*) OPENSSL="$value" ;; |
| 121 | |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 122 | --with-md5=*) MD5="$value" ;; |
Igor Sysoev | 7b90834 | 2004-03-10 20:56:39 +0000 | [diff] [blame] | 123 | --with-md5-opt=*) MD5_OPT="$value" ;; |
| 124 | --with-md5-asm) MD5_ASM=YES ;; |
| 125 | |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 126 | --with-zlib=*) ZLIB="$value" ;; |
Igor Sysoev | 24b56c9 | 2004-03-10 17:55:19 +0000 | [diff] [blame] | 127 | --with-zlib-opt=*) ZLIB_OPT="$value" ;; |
Igor Sysoev | 7b90834 | 2004-03-10 20:56:39 +0000 | [diff] [blame] | 128 | --with-zlib-asm=*) ZLIB_ASM="$value" ;; |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 129 | |
| 130 | --test-build-devpoll) TEST_BUILD_DEVPOLL=YES ;; |
Igor Sysoev | 10318a2 | 2004-01-29 21:45:01 +0000 | [diff] [blame] | 131 | --test-build-epoll) TEST_BUILD_EPOLL=YES ;; |
Igor Sysoev | 9139cd2 | 2004-02-17 17:53:12 +0000 | [diff] [blame] | 132 | --test-build-rtsig) TEST_BUILD_RTSIG=YES ;; |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 133 | |
| 134 | *) |
| 135 | echo "$0: error: invalid option \"$option\"" |
| 136 | exit 1 |
| 137 | ;; |
| 138 | esac |
| 139 | done |
| 140 | |
| 141 | |
Igor Sysoev | dc867cd | 2003-12-14 20:10:27 +0000 | [diff] [blame] | 142 | if [ $help = yes ]; then |
| 143 | echo |
Igor Sysoev | 5c8c52f | 2004-01-23 09:26:18 +0000 | [diff] [blame] | 144 | echo " --help this message" |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 145 | echo |
| 146 | |
Igor Sysoev | 5c8c52f | 2004-01-23 09:26:18 +0000 | [diff] [blame] | 147 | echo " --without-select_module disable select_module" |
| 148 | echo " --without-poll_module disable poll_module" |
| 149 | |
| 150 | echo " --without-http_rewrite_module disable http_rewrite_module" |
| 151 | echo " --without-http_gzip_module disable http_gzip_module" |
| 152 | echo " --without-http_proxy_module disable http_proxy_module" |
| 153 | |
| 154 | echo " --with-cc=NAME name of or path to C compiler" |
| 155 | echo |
| 156 | |
| 157 | echo " --with-pcre=DIR path to PCRE library" |
| 158 | echo " --with-md5=DIR path to md5 library" |
| 159 | echo " --with-zlib=DIR path to zlib library" |
Igor Sysoev | dc867cd | 2003-12-14 20:10:27 +0000 | [diff] [blame] | 160 | echo |
Igor Sysoev | a8fa0a6 | 2003-11-25 20:44:56 +0000 | [diff] [blame] | 161 | |
| 162 | exit 1 |
| 163 | fi |
Igor Sysoev | 732a271 | 2004-04-21 18:54:33 +0000 | [diff] [blame] | 164 | |
| 165 | |
Igor Sysoev | 562626a | 2004-09-14 05:45:22 +0000 | [diff] [blame] | 166 | if [ $HTTP = NO ]; then |
| 167 | HTTP_CHARSET=NO |
| 168 | HTTP_GZIP=NO |
| 169 | HTTP_SSI=NO |
| 170 | HTTP_USERID=NO |
| 171 | HTTP_ACCESS=NO |
| 172 | HTTP_STATUS=NO |
| 173 | HTTP_REWRITE=NO |
| 174 | HTTP_PROXY=NO |
| 175 | fi |
| 176 | |
| 177 | |
Igor Sysoev | 732a271 | 2004-04-21 18:54:33 +0000 | [diff] [blame] | 178 | if [ ".$PLATFORM" = ".win32" -a $EVENT_POLL = YES ]; then |
| 179 | EVENT_POLL=NO |
| 180 | echo "$0: warning: --with-poll_module option is ignored for win32" |
| 181 | fi |
Igor Sysoev | 090849d | 2004-05-18 20:28:54 +0000 | [diff] [blame] | 182 | |
| 183 | |
| 184 | if [ ".$PREFIX" = "." ]; then |
| 185 | PREFIX=/usr/local/nginx |
| 186 | fi |
| 187 | |
Igor Sysoev | 090849d | 2004-05-18 20:28:54 +0000 | [diff] [blame] | 188 | |
Igor Sysoev | 6d2a14a | 2004-09-27 16:03:21 +0000 | [diff] [blame] | 189 | case ".$SBIN_PATH" in |
| 190 | ./*) |
| 191 | ;; |
Igor Sysoev | 090849d | 2004-05-18 20:28:54 +0000 | [diff] [blame] | 192 | |
Igor Sysoev | 6d2a14a | 2004-09-27 16:03:21 +0000 | [diff] [blame] | 193 | .) |
| 194 | SBIN_PATH=$PREFIX/sbin/nginx |
| 195 | ;; |
Igor Sysoev | 090849d | 2004-05-18 20:28:54 +0000 | [diff] [blame] | 196 | |
Igor Sysoev | 6d2a14a | 2004-09-27 16:03:21 +0000 | [diff] [blame] | 197 | *) |
| 198 | SBIN_PATH=$PREFIX/$SBIN_PATH |
| 199 | ;; |
| 200 | esac |
Igor Sysoev | 090849d | 2004-05-18 20:28:54 +0000 | [diff] [blame] | 201 | |
Igor Sysoev | 6d2a14a | 2004-09-27 16:03:21 +0000 | [diff] [blame] | 202 | |
| 203 | case ".$CONF_PATH" in |
| 204 | ./*) |
| 205 | ;; |
| 206 | |
| 207 | .) |
| 208 | CONF_PATH=$PREFIX/conf/nginx.conf |
| 209 | ;; |
| 210 | |
| 211 | *) |
| 212 | CONF_PATH=$PREFIX/$CONF_PATH |
| 213 | ;; |
| 214 | esac |
| 215 | |
| 216 | |
| 217 | case ".$PID_PATH" in |
| 218 | ./*) |
| 219 | ;; |
| 220 | |
| 221 | .) |
| 222 | PID_PATH=$PREFIX/logs/nginx.pid |
| 223 | ;; |
| 224 | |
| 225 | *) |
| 226 | PID_PATH=$PREFIX/$PID_PATH |
| 227 | ;; |
| 228 | esac |
| 229 | |
| 230 | |
| 231 | case ".$ERROR_LOG_PATH" in |
| 232 | ./*) |
| 233 | ;; |
| 234 | |
| 235 | .) |
| 236 | ERROR_LOG_PATH=$PREFIX/logs/error.log |
| 237 | ;; |
| 238 | |
Igor Sysoev | ff8da91 | 2004-09-29 16:00:49 +0000 | [diff] [blame] | 239 | .stderr) |
| 240 | ERROR_LOG_PATH= |
| 241 | ;; |
| 242 | |
Igor Sysoev | 6d2a14a | 2004-09-27 16:03:21 +0000 | [diff] [blame] | 243 | *) |
| 244 | ERROR_LOG_PATH=$PREFIX/$ERROR_LOG_PATH |
| 245 | ;; |
| 246 | esac |
| 247 | |
| 248 | |
| 249 | case ".$HTTP_LOG_PATH" in |
| 250 | ./*) |
| 251 | ;; |
| 252 | |
| 253 | .) |
| 254 | HTTP_LOG_PATH=$PREFIX/logs/access.log |
| 255 | ;; |
| 256 | |
| 257 | *) |
| 258 | HTTP_LOG_PATH=$PREFIX/$HTTP_LOG_PATH |
| 259 | ;; |
| 260 | esac |