Skip to content
Browse files

Initial import of 0.8.54 release tarball

  • Loading branch information...
0 parents commit 610c88ae9b4feb17917b06706d8ceb4baf0732b6 @mpalmer committed Mar 22, 2011
Showing with 29,737 additions and 0 deletions.
  1. +5,123 −0 CHANGES
  2. +5,211 −0 CHANGES.ru
  3. +24 −0 LICENSE
  4. +4 −0 README
  5. +14 −0 auto/cc/acc
  6. +71 −0 auto/cc/bcc
  7. +45 −0 auto/cc/ccc
  8. +188 −0 auto/cc/conf
  9. +182 −0 auto/cc/gcc
  10. +145 −0 auto/cc/icc
  11. +137 −0 auto/cc/msvc
  12. +92 −0 auto/cc/name
  13. +103 −0 auto/cc/owc
  14. +145 −0 auto/cc/sunc
  15. +11 −0 auto/define
  16. +44 −0 auto/endianess
  17. +104 −0 auto/feature
  18. +11 −0 auto/have
  19. +11 −0 auto/have_headers
  20. +12 −0 auto/headers
  21. +60 −0 auto/include
  22. +50 −0 auto/init
  23. +161 −0 auto/install
  24. +80 −0 auto/lib/conf
  25. +78 −0 auto/lib/geoip/conf
  26. +44 −0 auto/lib/google-perftools/conf
  27. +42 −0 auto/lib/libatomic/conf
  28. +13 −0 auto/lib/libatomic/make
  29. +82 −0 auto/lib/libgd/conf
  30. +155 −0 auto/lib/libxslt/conf
  31. +31 −0 auto/lib/make
  32. +113 −0 auto/lib/md5/conf
  33. +95 −0 auto/lib/md5/make
  34. +21 −0 auto/lib/md5/makefile.bcc
  35. +21 −0 auto/lib/md5/makefile.msvc
  36. +10 −0 auto/lib/md5/makefile.owc
  37. +73 −0 auto/lib/openssl/conf
  38. +66 −0 auto/lib/openssl/make
  39. +17 −0 auto/lib/openssl/makefile.bcc
  40. +13 −0 auto/lib/openssl/makefile.msvc
  41. +179 −0 auto/lib/pcre/conf
  42. +63 −0 auto/lib/pcre/make
  43. +25 −0 auto/lib/pcre/makefile.bcc
  44. +21 −0 auto/lib/pcre/makefile.msvc
  45. +23 −0 auto/lib/pcre/makefile.owc
  46. +59 −0 auto/lib/perl/conf
  47. +34 −0 auto/lib/perl/make
  48. +77 −0 auto/lib/sha1/conf
  49. +95 −0 auto/lib/sha1/make
  50. +21 −0 auto/lib/sha1/makefile.bcc
  51. +21 −0 auto/lib/sha1/makefile.msvc
  52. +10 −0 auto/lib/sha1/makefile.owc
  53. +39 −0 auto/lib/test
  54. +75 −0 auto/lib/zlib/conf
  55. +113 −0 auto/lib/zlib/make
  56. +14 −0 auto/lib/zlib/makefile.bcc
  57. +13 −0 auto/lib/zlib/makefile.msvc
  58. +13 −0 auto/lib/zlib/makefile.owc
  59. +10 −0 auto/lib/zlib/patch.zlib.h
  60. +416 −0 auto/make
  61. +471 −0 auto/modules
  62. +11 −0 auto/nohave
  63. +483 −0 auto/options
  64. +104 −0 auto/os/conf
  65. +115 −0 auto/os/darwin
  66. +354 −0 auto/os/features
  67. +126 −0 auto/os/freebsd
  68. +149 −0 auto/os/linux
  69. +59 −0 auto/os/solaris
  70. +28 −0 auto/os/win32
  71. +508 −0 auto/sources
  72. +7 −0 auto/stubs
  73. +112 −0 auto/summary
  74. +70 −0 auto/threads
  75. +82 −0 auto/types/sizeof
  76. +76 −0 auto/types/typedef
  77. +41 −0 auto/types/uintptr_t
  78. +11 −0 auto/types/value
  79. +266 −0 auto/unix
  80. +24 −0 conf/fastcgi.conf
  81. +23 −0 conf/fastcgi_params
  82. +109 −0 conf/koi-utf
  83. +103 −0 conf/koi-win
  84. +74 −0 conf/mime.types
  85. +118 −0 conf/nginx.conf
  86. +15 −0 conf/scgi_params
  87. +15 −0 conf/uwsgi_params
  88. +126 −0 conf/win-utf
  89. +112 −0 configure
  90. +15 −0 contrib/README
  91. +58 −0 contrib/geo2nginx.pl
  92. +131 −0 contrib/unicode2nginx/koi-utf
  93. +45 −0 contrib/unicode2nginx/unicode-to-nginx.pl
  94. +130 −0 contrib/unicode2nginx/win-utf
  95. +18 −0 html/50x.html
  96. +8 −0 html/index.html
  97. +1,322 −0 src/core/nginx.c
  98. +19 −0 src/core/nginx.h
  99. +146 −0 src/core/ngx_array.c
  100. +52 −0 src/core/ngx_array.h
  101. +217 −0 src/core/ngx_buf.c
  102. +161 −0 src/core/ngx_buf.h
  103. +1,505 −0 src/core/ngx_conf_file.c
  104. +347 −0 src/core/ngx_conf_file.h
  105. +131 −0 src/core/ngx_config.h
  106. +1,018 −0 src/core/ngx_connection.c
  107. +190 −0 src/core/ngx_connection.h
  108. +93 −0 src/core/ngx_core.h
  109. +138 −0 src/core/ngx_cpuinfo.c
  110. +38 −0 src/core/ngx_crc.h
  111. +128 −0 src/core/ngx_crc32.c
  112. +78 −0 src/core/ngx_crc32.h
  113. +1,380 −0 src/core/ngx_cycle.c
  114. +139 −0 src/core/ngx_cycle.h
  115. +991 −0 src/core/ngx_file.c
  116. +149 −0 src/core/ngx_file.h
  117. +975 −0 src/core/ngx_hash.c
  118. +121 −0 src/core/ngx_hash.h
  119. +1,007 −0 src/core/ngx_inet.c
  120. +119 −0 src/core/ngx_inet.h
  121. +70 −0 src/core/ngx_list.c
  122. +82 −0 src/core/ngx_list.h
  123. +451 −0 src/core/ngx_log.c
  124. +210 −0 src/core/ngx_log.h
  125. +40 −0 src/core/ngx_md5.h
Sorry, we could not display the entire diff because too many files (342) changed.
5,123 CHANGES
5,123 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
5,211 CHANGES.ru
5,211 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
24 LICENSE
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2002-2010 Igor Sysoev
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
4 README
@@ -0,0 +1,4 @@
+
+The Russian documentation is available at http://sysoev.ru/nginx/
+The English documentation is available at http://nginx.net
+
14 auto/cc/acc
@@ -0,0 +1,14 @@
+
+# Copyright (C) Igor Sysoev
+
+
+# aCC: HP ANSI C++ B3910B A.03.55.02
+
+# C89 mode
+
+CFLAGS="$CFLAGS -Ae"
+CC_TEST_FLAGS="-Ae"
+
+PCRE_OPT="$PCRE_OPT -Ae"
+ZLIB_OPT="$ZLIB_OPT -Ae"
+MD5_OPT="$MD5_OPT -Ae"
71 auto/cc/bcc
@@ -0,0 +1,71 @@
+
+# Copyright (C) Igor Sysoev
+
+
+# Borland C++ 5.5
+
+# optimizations
+
+# maximize speed
+CFLAGS="$CFLAGS -O2"
+
+case $CPU in
+ pentium)
+ # optimize for Pentium and Athlon
+ CPU_OPT="-5"
+ ;;
+
+ pentiumpro)
+ # optimize for Pentium Pro, Pentium II and Pentium III
+ CPU_OPT="-6"
+ ;;
+esac
+
+# __stdcall
+#CPU_OPT="$CPU_OPT -ps"
+# __fastcall
+#CPU_OPT="$CPU_OPT -pr"
+
+CFLAGS="$CFLAGS $CPU_OPT"
+
+# multithreaded
+CFLAGS="$CFLAGS -tWM"
+
+# stop on warning
+CFLAGS="$CFLAGS -w!"
+
+# disable logo
+CFLAGS="$CFLAGS -q"
+
+
+# precompiled headers
+CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.csm"
+NGX_PCH="$NGX_OBJS/ngx_config.csm"
+NGX_BUILD_PCH="-H=$NGX_OBJS/ngx_config.csm"
+NGX_USE_PCH="-Hu -H=$NGX_OBJS/ngx_config.csm"
+
+
+# Win32 GUI mode application
+#LINK="\$(CC) -laa"
+
+
+# the resource file
+NGX_RES="$NGX_OBJS/nginx.res"
+NGX_RCC="brcc32 -fo$NGX_OBJS/nginx.res \$(CORE_INCS) $NGX_WIN32_RC"
+# the pragma allows to link the resource file using bcc32 and
+# to avoid the direct ilink32 calling and the c0w32.obj's WinMain/main problem
+NGX_PRAGMA="#pragma resource \"$NGX_OBJS/nginx.res\""
+
+
+ngx_include_opt="-I"
+ngx_objout="-o"
+ngx_binout="-e"
+ngx_objext="obj"
+ngx_binext=".exe"
+
+ngx_long_start='@&&|
+ '
+ngx_long_end='|'
+
+ngx_regex_dirsep='\\'
+ngx_dirsep="\\"
45 auto/cc/ccc
@@ -0,0 +1,45 @@
+
+# Copyright (C) Igor Sysoev
+
+
+# Compaq C V6.5-207
+
+ngx_include_opt="-I"
+
+# warnings
+
+CFLAGS="$CFLAGS -msg_enable level6 -msg_fatal level6"
+
+CFLAGS="$CFLAGS -msg_disable unknownmacro"
+CFLAGS="$CFLAGS -msg_disable unusedincl"
+CFLAGS="$CFLAGS -msg_disable unnecincl"
+CFLAGS="$CFLAGS -msg_disable nestincl"
+CFLAGS="$CFLAGS -msg_disable strctpadding"
+CFLAGS="$CFLAGS -msg_disable ansialiascast"
+CFLAGS="$CFLAGS -msg_disable inlinestoclsmod"
+CFLAGS="$CFLAGS -msg_disable cxxkeyword"
+CFLAGS="$CFLAGS -msg_disable longlongsufx"
+CFLAGS="$CFLAGS -msg_disable valuepres"
+
+# STUB
+CFLAGS="$CFLAGS -msg_disable truncintcast"
+CFLAGS="$CFLAGS -msg_disable trunclongcast"
+
+CFLAGS="$CFLAGS -msg_disable truncintasn"
+CFLAGS="$CFLAGS -msg_disable trunclongint"
+CFLAGS="$CFLAGS -msg_disable intconcastsgn"
+CFLAGS="$CFLAGS -msg_disable intconstsign"
+CFLAGS="$CFLAGS -msg_disable switchlong"
+CFLAGS="$CFLAGS -msg_disable subscrbounds2"
+
+CFLAGS="$CFLAGS -msg_disable hexoctunsign"
+
+CFLAGS="$CFLAGS -msg_disable ignorecallval"
+CFLAGS="$CFLAGS -msg_disable nonstandcast"
+CFLAGS="$CFLAGS -msg_disable embedcomment"
+CFLAGS="$CFLAGS -msg_disable unreachcode"
+CFLAGS="$CFLAGS -msg_disable questcompare2"
+CFLAGS="$CFLAGS -msg_disable unusedtop"
+CFLAGS="$CFLAGS -msg_disable unrefdecl"
+
+CFLAGS="$CFLAGS -msg_disable bitnotint"
188 auto/cc/conf
@@ -0,0 +1,188 @@
+
+# Copyright (C) Igor Sysoev
+
+
+LINK="\$(CC)"
+
+ngx_include_opt="-I "
+ngx_compile_opt="-c"
+ngx_objout="-o "
+ngx_binout="-o "
+ngx_objext="o"
+ngx_binext=
+
+ngx_long_start=
+ngx_long_end=
+
+ngx_regex_dirsep="\/"
+ngx_dirsep='/'
+
+ngx_regex_cont=' \\\
+ '
+ngx_cont=' \
+ '
+ngx_tab=' \
+ '
+ngx_spacer=
+
+ngx_long_regex_cont=$ngx_regex_cont
+ngx_long_cont=$ngx_cont
+
+. auto/cc/name
+
+if test -n "$CFLAGS"; then
+
+ CC_TEST_FLAGS="$CFLAGS $NGX_CC_OPT"
+
+ case $NGX_CC_NAME in
+
+ ccc)
+ # Compaq C V6.5-207
+
+ ngx_include_opt="-I"
+ ;;
+
+ esac
+
+else
+
+ case $NGX_CC_NAME in
+ gcc)
+ # gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2
+ # 3.0.4, 3.1.1, 3.2.3, 3.3.2, 3.3.3, 3.3.4, 3.4.0, 3.4.2
+ # 4.0.0, 4.0.1, 4.1.0
+
+ . auto/cc/gcc
+ ;;
+
+ icc)
+ # Intel C++ compiler 7.1, 8.0, 8.1
+
+ . auto/cc/icc
+ ;;
+
+ sunc)
+ # Sun C 5.7 Patch 117837-04 2005/05/11
+
+ . auto/cc/sunc
+ ;;
+
+ ccc)
+ # Compaq C V6.5-207
+
+ . auto/cc/ccc
+ ;;
+
+ acc)
+ # aCC: HP ANSI C++ B3910B A.03.55.02
+
+ . auto/cc/acc
+ ;;
+
+ msvc*)
+ # MSVC++ 6.0 SP2, MSVC++ Toolkit 2003
+
+ . auto/cc/msvc
+ ;;
+
+ owc)
+ # Open Watcom C 1.0, 1.2
+
+ . auto/cc/owc
+ ;;
+
+ bcc)
+ # Borland C++ 5.5
+
+ . auto/cc/bcc
+ ;;
+
+ esac
+
+ CC_TEST_FLAGS="$CC_TEST_FLAGS $NGX_CC_OPT"
+
+fi
+
+CFLAGS="$CFLAGS $NGX_CC_OPT"
+NGX_TEST_LD_OPT="$NGX_LD_OPT"
+
+if [ "$NGX_PLATFORM" != win32 ]; then
+
+ if test -n "$NGX_LD_OPT"; then
+ ngx_feature=--with-ld-opt=\"$NGX_LD_OPT\"
+ ngx_feature_name=
+ ngx_feature_run=no
+ ngx_feature_incs=
+ ngx_feature_path=
+ ngx_feature_libs=
+ ngx_feature_test=
+ . auto/feature
+
+ if [ $ngx_found = no ]; then
+ echo $0: error: the invalid value in --with-ld-opt=\"$NGX_LD_OPT\"
+ echo
+ exit 1
+ fi
+ fi
+
+
+ ngx_feature="gcc builtin atomic operations"
+ ngx_feature_name=NGX_HAVE_GCC_ATOMIC
+ ngx_feature_run=yes
+ ngx_feature_incs=
+ ngx_feature_path=
+ ngx_feature_libs=
+ ngx_feature_test="long n = 0;
+ if (!__sync_bool_compare_and_swap(&n, 0, 1))
+ return 1;
+ if (__sync_fetch_and_add(&n, 1) != 1)
+ return 1;
+ if (n != 2)
+ return 1;
+ __sync_synchronize();"
+ . auto/feature
+
+
+ if [ "$NGX_CC_NAME" = "ccc" ]; then
+ echo "checking for C99 variadic macros ... disabled"
+ else
+ ngx_feature="C99 variadic macros"
+ ngx_feature_name="NGX_HAVE_C99_VARIADIC_MACROS"
+ ngx_feature_run=yes
+ ngx_feature_incs="#include <stdio.h>
+#define var(dummy, ...) sprintf(__VA_ARGS__)"
+ ngx_feature_path=
+ ngx_feature_libs=
+ ngx_feature_test="char buf[30]; buf[0] = '0';
+ var(0, buf, \"%d\", 1);
+ if (buf[0] != '1') return 1"
+ . auto/feature
+ fi
+
+
+ ngx_feature="gcc variadic macros"
+ ngx_feature_name="NGX_HAVE_GCC_VARIADIC_MACROS"
+ ngx_feature_run=yes
+ ngx_feature_incs="#include <stdio.h>
+#define var(dummy, args...) sprintf(args)"
+ ngx_feature_path=
+ ngx_feature_libs=
+ ngx_feature_test="char buf[30]; buf[0] = '0';
+ var(0, buf, \"%d\", 1);
+ if (buf[0] != '1') return 1"
+ . auto/feature
+
+
+# ngx_feature="inline"
+# ngx_feature_name=
+# ngx_feature_run=no
+# ngx_feature_incs="int inline f(void) { return 1 }"
+# ngx_feature_path=
+# ngx_feature_libs=
+# ngx_feature_test=
+# . auto/feature
+#
+# if [ $ngx_found = yes ]; then
+# fi
+
+fi
182 auto/cc/gcc
@@ -0,0 +1,182 @@
+
+# Copyright (C) Igor Sysoev
+
+
+# gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2
+# 3.0.4, 3.1.1, 3.2.3, 3.3.2, 3.3.3, 3.3.4, 3.4.0, 3.4.2
+# 4.0.0, 4.0.1, 4.1.0
+
+
+NGX_GCC_VER=`$CC -v 2>&1 | grep 'gcc version' 2>&1 \
+ | sed -e 's/^.* version \(.*\)/\1/'`
+
+echo " + gcc version: $NGX_GCC_VER"
+
+have=NGX_COMPILER value="\"gcc $NGX_GCC_VER\"" . auto/define
+
+
+# Solaris 7's /usr/ccs/bin/as does not support "-pipe"
+
+CC_TEST_FLAGS="-pipe"
+
+ngx_feature="gcc -pipe switch"
+ngx_feature_name=
+ngx_feature_run=no
+ngx_feature_incs=
+ngx_feature_path=
+ngx_feature_libs=
+ngx_feature_test=
+. auto/feature
+
+CC_TEST_FLAGS=
+
+if [ $ngx_found = yes ]; then
+ PIPE="-pipe"
+fi
+
+
+case "$NGX_MACHINE" in
+
+ sun4u | sun4v | sparc | sparc64 )
+ # "-mcpu=v9" enables the "casa" assembler instruction
+ CFLAGS="$CFLAGS -mcpu=v9"
+ ;;
+
+esac
+
+
+# optimizations
+
+#NGX_GCC_OPT="-O2"
+#NGX_GCC_OPT="-Os"
+NGX_GCC_OPT="-O"
+
+#CFLAGS="$CFLAGS -fomit-frame-pointer"
+
+case $CPU in
+ pentium)
+ # optimize for Pentium and Athlon
+ CPU_OPT="-march=pentium"
+ NGX_CPU_CACHE_LINE=32
+ ;;
+
+ pentiumpro | pentium3)
+ # optimize for Pentium Pro, Pentium II and Pentium III
+ CPU_OPT="-march=pentiumpro"
+ NGX_CPU_CACHE_LINE=32
+ ;;
+
+ pentium4)
+ # optimize for Pentium 4, gcc 3.x
+ CPU_OPT="-march=pentium4"
+ NGX_CPU_CACHE_LINE=128
+ ;;
+
+ athlon)
+ # optimize for Athlon, gcc 3.x
+ CPU_OPT="-march=athlon"
+ NGX_CPU_CACHE_LINE=64
+ ;;
+
+ opteron)
+ # optimize for Opteron, gcc 3.x
+ CPU_OPT="-march=opteron"
+ NGX_CPU_CACHE_LINE=64
+ ;;
+
+ sparc32)
+ # build 32-bit UltraSparc binary
+ CPU_OPT="-m32"
+ CORE_LINK="$CORE_LINK -m32"
+ NGX_CPU_CACHE_LINE=64
+ ;;
+
+ sparc64)
+ # build 64-bit UltraSparc binary
+ CPU_OPT="-m64"
+ CORE_LINK="$CORE_LINK -m64"
+ NGX_CPU_CACHE_LINE=64
+ ;;
+
+ ppc64)
+ # build 64-bit PowerPC binary
+ CPU_OPT="-m64"
+ CPU_OPT="$CPU_OPT -falign-functions=32 -falign-labels=32"
+ CPU_OPT="$CPU_OPT -falign-loops=32 -falign-jumps=32"
+ CORE_LINK="$CORE_LINK -m64"
+ NGX_CPU_CACHE_LINE=128
+ ;;
+
+esac
+
+CC_AUX_FLAGS="$CC_AUX_FLAGS $CPU_OPT"
+
+case "$NGX_GCC_VER" in
+ 2.7*)
+ # batch build
+ CPU_OPT=
+ ;;
+esac
+
+
+CFLAGS="$CFLAGS $PIPE $CPU_OPT"
+
+if [ ".$PCRE_OPT" = "." ]; then
+ PCRE_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
+else
+ PCRE_OPT="$PCRE_OPT $PIPE"
+fi
+
+if [ ".$MD5_OPT" = "." ]; then
+ MD5_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
+else
+ MD5_OPT="$MD5_OPT $PIPE"
+fi
+
+if [ ".$ZLIB_OPT" = "." ]; then
+ ZLIB_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
+else
+ ZLIB_OPT="$ZLIB_OPT $PIPE"
+fi
+
+
+# warnings
+
+# -W requires at least -O
+CFLAGS="$CFLAGS ${NGX_GCC_OPT:--O} -W"
+
+CFLAGS="$CFLAGS -Wall -Wpointer-arith"
+#CFLAGS="$CFLAGS -Wconversion"
+#CFLAGS="$CFLAGS -Winline"
+
+
+case "$NGX_GCC_VER" in
+ 3.* | 4.* )
+ # we have a lot of the unused function arguments
+ CFLAGS="$CFLAGS -Wno-unused-parameter"
+ CFLAGS="$CFLAGS -Wunused-function"
+ CFLAGS="$CFLAGS -Wunused-variable"
+ CFLAGS="$CFLAGS -Wunused-value"
+ # 4.2.1 shows the warning in wrong places
+ #CFLAGS="$CFLAGS -Wunreachable-code"
+ ;;
+
+ *)
+ # we have a lot of the unused function arguments
+ CFLAGS="$CFLAGS -Wno-unused"
+ ;;
+esac
+
+
+# stop on warning
+CFLAGS="$CFLAGS -Werror"
+
+# debug
+CFLAGS="$CFLAGS -g"
+
+# DragonFly's gcc3 generates DWARF
+#CFLAGS="$CFLAGS -g -gstabs"
+
+if [ ".$CPP" = "." ]; then
+ CPP="$CC -E"
+fi
145 auto/cc/icc
@@ -0,0 +1,145 @@
+
+# Copyright (C) Igor Sysoev
+
+
+# Intel C++ compiler 7.1, 8.0, 8.1, 9.0
+
+NGX_ICC_VER=`$CC -V 2>&1 | grep 'Version' 2>&1 \
+ | sed -e 's/^.* Version \([^ ]*\) *Build.*$/\1/'`
+
+echo " + icc version: $NGX_ICC_VER"
+
+have=NGX_COMPILER value="\"Intel C Compiler $NGX_ICC_VER\"" . auto/define
+
+
+# optimizations
+
+CFLAGS="$CFLAGS -O"
+# inline the functions declared with __inline
+#CFLAGS="$CFLAGS -Ob1"
+# inline any function, at the compiler's discretion
+CFLAGS="$CFLAGS -Ob2"
+
+# multi-file IP optimizations
+case "$NGX_ICC_VER" in
+ 9.*)
+ IPO="-ipo"
+ ;;
+
+ # 8.1.38 under FreeBSD can not link -ipo
+ 8.1)
+ IPO="-ip"
+ ;;
+
+ *)
+ IPO="-ipo -ipo_obj"
+ ;;
+esac
+
+# single-file IP optimizations
+#IPO="-ip"
+
+CFLAGS="$CFLAGS $IPO"
+CORE_LINK="$CORE_LINK $IPO"
+CORE_LINK="$CORE_LINK -opt_report_file=$NGX_OBJS/opt_report_file"
+
+
+case $CPU in
+ pentium)
+ # optimize for Pentium and Athlon
+ CPU_OPT="-march=pentium"
+ ;;
+
+ pentiumpro)
+ # optimize for Pentium Pro, Pentium II and Pentium III
+ CPU_OPT="-mcpu=pentiumpro -march=pentiumpro"
+ ;;
+
+ pentium4)
+ # optimize for Pentium 4, default
+ CPU_OPT="-march=pentium4"
+ ;;
+esac
+
+CFLAGS="$CFLAGS $CPU_OPT"
+
+if [ ".$PCRE_OPT" = "." ]; then
+ PCRE_OPT="-O $IPO $CPU_OPT"
+fi
+
+if [ ".$MD5_OPT" = "." ]; then
+ MD5_OPT="-O $IPO $CPU_OPT"
+fi
+
+if [ ".$ZLIB_OPT" = "." ]; then
+ ZLIB_OPT="-O $IPO $CPU_OPT"
+fi
+
+
+# warnings
+
+CFLAGS="$CFLAGS -w2"
+
+# disable some warnings
+
+# invalid type conversion: "int" to "char *"
+CFLAGS="$CFLAGS -wd171"
+# argument is incompatible with corresponding format string conversion
+CFLAGS="$CFLAGS -wd181"
+# zero used for undefined preprocessing identifier
+CFLAGS="$CFLAGS -wd193"
+# the format string ends before this argument
+CFLAGS="$CFLAGS -wd268"
+# invalid format string conversion
+CFLAGS="$CFLAGS -wd269"
+# conversion from "long long" to "size_t" may lose significant bits
+CFLAGS="$CFLAGS -wd810"
+# parameter was never referenced
+CFLAGS="$CFLAGS -wd869"
+# attribute "unused" is only allowed in a function definition, warning on pTHX_
+CFLAGS="$CFLAGS -wd1301"
+
+# STUB
+# enumerated type mixed with another type
+CFLAGS="$CFLAGS -wd188"
+# controlling expression is constant
+CFLAGS="$CFLAGS -wd279"
+# operands are evaluated in unspecified order
+CFLAGS="$CFLAGS -wd981"
+# external definition with no prior declaration
+CFLAGS="$CFLAGS -wd1418"
+# external declaration in primary source file
+CFLAGS="$CFLAGS -wd1419"
+
+case "$NGX_ICC_VER" in
+ 9.*)
+ # "cc" clobber ignored, warnings for Liunx's htonl()/htons()
+ CFLAGS="$CFLAGS -wd1469"
+ # explicit conversion of a 64-bit integral type to a smaller
+ # integral type
+ CFLAGS="$CFLAGS -wd1683"
+ # conversion from pointer to same-sized integral type,
+ # warning on offsetof()
+ CFLAGS="$CFLAGS -wd1684"
+ # floating-point equality and inequality comparisons are unreliable,
+ # warning on SvTRUE()
+ CFLAGS="$CFLAGS -wd1572"
+ ;;
+
+ 8.*)
+ # "cc" clobber ignored, warnings for Liunx's htonl()/htons()
+ CFLAGS="$CFLAGS -wd1469"
+ # floating-point equality and inequality comparisons are unreliable,
+ # warning on SvTRUE()
+ CFLAGS="$CFLAGS -wd1572"
+ ;;
+
+ *)
+ ;;
+esac
+
+# stop on warning
+CFLAGS="$CFLAGS -Werror"
+
+# debug
+CFLAGS="$CFLAGS -g"
137 auto/cc/msvc
@@ -0,0 +1,137 @@
+
+# Copyright (C) Igor Sysoev
+
+
+# MSVC 6.0 SP2
+# MSVC Toolkit 2003 (7.1)
+# MSVC 2005 Express Edition SP1 (8.0)
+
+# optimizations
+
+# maximize speed, equivalent to -Og -Oi -Ot -Oy -Ob2 -Gs -GF -Gy
+CFLAGS="$CFLAGS -O2"
+
+# enable global optimization
+#CFLAGS="$CFLAGS -Og"
+# enable intrinsic functions
+#CFLAGS="$CFLAGS -Oi"
+
+# disable inline expansion
+#CFLAGS="$CFLAGS -Ob0"
+# explicit inline expansion
+#CFLAGS="$CFLAGS -Ob1"
+# explicit and implicit inline expansion
+#CFLAGS="$CFLAGS -Ob2"
+
+# enable frame pointer omission
+#CFLAGS="$CFLAGS -Oy"
+# disable stack checking calls
+#CFLAGS="$CFLAGS -Gs"
+
+# pools strings as read/write
+#CFLAGS="$CFLAGS -Gf"
+# pools strings as read-only
+#CFLAGS="$CFLAGS -GF"
+
+
+case $CPU in
+ pentium)
+ # optimize for Pentium and Athlon
+ CPU_OPT="-G5"
+ ;;
+
+ pentiumpro)
+ # optimize for Pentium Pro, Pentium II and Pentium III
+ CPU_OPT="-G6"
+ ;;
+
+ pentium4)
+ # optimize for Pentium 4, MSVC 7
+ CPU_OPT="-G7"
+ ;;
+esac
+
+# __cdecl, default, must be used with OpenSSL, md5 asm, and sha1 asm
+#CPU_OPT="$CPU_OPT -Gd"
+# __stdcall
+#CPU_OPT="$CPU_OPT -Gz"
+# __fastcall
+#CPU_OPT="$CPU_OPT -Gr"
+
+
+CFLAGS="$CFLAGS $CPU_OPT"
+
+
+# warnings
+
+CFLAGS="$CFLAGS -W4"
+
+# stop on warning
+CFLAGS="$CFLAGS -WX"
+
+# disable logo
+CFLAGS="$CFLAGS -nologo"
+
+
+LINK="\$(CC)"
+
+# the link flags
+CORE_LINK="$CORE_LINK -link -verbose:lib"
+
+# link with libcmt.lib, multithreaded
+LIBC="-MT"
+# link with msvcrt.dll
+# however, MSVC Toolkit 2003 has no MSVCRT.LIB
+#LIBC="-MD"
+
+CFLAGS="$CFLAGS $LIBC"
+
+CORE_LIBS="$CORE_LIBS kernel32.lib user32.lib"
+
+# Win32 GUI mode application
+#CORE_LINK="$CORE_LINK -subsystem:windows -entry:mainCRTStartup"
+
+# debug
+# msvc8 under Wine issues
+# Program database manager mismatch; please check your installation
+if [ $NGX_CC_NAME != msvc8 ]; then
+ CFLAGS="$CFLAGS -Zi"
+ CORE_LINK="$CORE_LINK -debug"
+fi
+
+
+# MSVC 2005 supports C99 variadic macros
+if [ $NGX_CC_NAME = msvc8 ]; then
+ have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have
+fi
+
+
+# precompiled headers
+CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch"
+NGX_PCH="$NGX_OBJS/ngx_config.pch"
+NGX_BUILD_PCH="-Ycngx_config.h -Fp$NGX_OBJS/ngx_config.pch"
+NGX_USE_PCH="-Yungx_config.h -Fp$NGX_OBJS/ngx_config.pch"
+
+
+# the resource file
+NGX_RES="$NGX_OBJS/nginx.res"
+NGX_RCC="rc -fo$NGX_RES \$(CORE_INCS) $NGX_WIN32_RC"
+CORE_LINK="$NGX_RES $CORE_LINK"
+
+
+ngx_objout="-Fo"
+ngx_binout="-Fe"
+ngx_objext="obj"
+ngx_binext=".exe"
+
+ngx_long_start='@<<
+ '
+ngx_long_end='<<'
+ngx_long_regex_cont=' \
+ '
+ngx_long_cont='
+ '
+
+# MSVC understand / in path
+#ngx_regex_dirsep='\\'
+#ngx_dirsep="\\"
92 auto/cc/name
@@ -0,0 +1,92 @@
+
+# Copyright (C) Igor Sysoev
+
+
+if [ "$NGX_PLATFORM" != win32 ]; then
+
+ ngx_feature="C compiler"
+ ngx_feature_name=
+ ngx_feature_run=yes
+ ngx_feature_incs=
+ ngx_feature_path=
+ ngx_feature_libs=
+ ngx_feature_test=
+ . auto/feature
+
+ if [ $ngx_found = no ]; then
+ echo
+ echo $0: error: C compiler $CC is not found
+ echo
+ exit 1
+ fi
+
+fi
+
+
+if [ "$CC" = cl ]; then
+ if `$NGX_WINE $CC -v 2>&1 \
+ | grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14' \
+ >/dev/null 2>&1`; then
+
+ NGX_CC_NAME=msvc8
+ echo " + using Microsoft Visual C++ 8 compiler"
+
+ else if `$NGX_WINE $CC -v 2>&1 \
+ | grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13' \
+ >/dev/null 2>&1`; then
+
+ NGX_CC_NAME=msvc7
+ echo " + using Microsoft Visual C++ 7 compiler"
+
+ else
+ NGX_CC_NAME=msvc
+ echo " + using Microsoft Visual C++ compiler"
+ fi
+ fi
+
+else
+if [ "$CC" = wcl386 ]; then
+ NGX_CC_NAME=owc
+ echo " + using Open Watcom C compiler"
+
+else
+if [ "$CC" = bcc32 ]; then
+ NGX_CC_NAME=bcc
+ echo " + using Borland C++ compiler"
+
+else
+if `$CC -v 2>&1 | grep 'gcc version' >/dev/null 2>&1`; then
+ NGX_CC_NAME=gcc
+ echo " + using GNU C compiler"
+
+else
+if `$CC -V 2>&1 | grep '^Intel(R) C' >/dev/null 2>&1`; then
+ NGX_CC_NAME=icc
+ echo " + using Intel C++ compiler"
+
+else
+if `$CC -V 2>&1 | grep 'Sun C' >/dev/null 2>&1`; then
+ NGX_CC_NAME=sunc
+ echo " + using Sun C compiler"
+
+else
+if `$CC -V 2>&1 | grep '^Compaq C' >/dev/null 2>&1`; then
+ NGX_CC_NAME=ccc
+ echo " + using Compaq C compiler"
+
+else
+if `$CC -V 2>&1 | grep '^aCC: ' >/dev/null 2>&1`; then
+ NGX_CC_NAME=acc
+ echo " + using HP aC++ compiler"
+
+else
+ NGX_CC_NAME=unknown
+
+fi # acc
+fi # ccc
+fi # sunc
+fi # icc
+fi # gcc
+fi # bcc
+fi # owc
+fi # msvc
103 auto/cc/owc
@@ -0,0 +1,103 @@
+
+# Copyright (C) Igor Sysoev
+
+
+# Open Watcom C 1.0, 1.2, 1.3
+
+# optimizations
+
+# maximize speed
+CFLAGS="$CFLAGS -ot"
+# reorder instructions for best pipeline usage
+CFLAGS="$CFLAGS -op"
+# inline intrinsic functions
+CFLAGS="$CFLAGS -oi"
+# inline expansion
+CFLAGS="$CFLAGS -oe"
+# disable stack checking calls
+CFLAGS="$CFLAGS -s"
+
+case $CPU in
+ pentium)
+ # optimize for Pentium and Athlon
+ # register-based arguments passing conventions
+ CPU_OPT="-5r"
+ # stack-based arguments passing conventions
+ #CPU_OPT="-5s"
+ ;;
+
+ pentiumpro)
+ # optimize for Pentium Pro, Pentium II and Pentium III
+ # register-based arguments passing conventions
+ CPU_OPT="-6r"
+ # stack-based arguments passing conventions
+ #CPU_OPT="-6s"
+ ;;
+esac
+
+CFLAGS="$CFLAGS $CPU_OPT"
+
+
+# warnings
+
+# maximum level
+CFLAGS="$CFLAGS -wx"
+#CFLAGS="$CFLAGS -w3"
+
+# stop on warning
+CFLAGS="$CFLAGS -we"
+
+# built target is NT
+CFLAGS="$CFLAGS -bt=nt"
+
+# multithreaded
+CFLAGS="$CFLAGS -bm"
+
+# debug
+CFLAGS="$CFLAGS -d2"
+
+# quiet
+CFLAGS="$CFLAGS -zq"
+
+# Open Watcom C 1.2
+have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have
+
+
+# the precompiled headers
+CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch"
+NGX_PCH="$NGX_OBJS/ngx_config.pch"
+NGX_BUILD_PCH="-fhq=$NGX_OBJS/ngx_config.pch"
+NGX_USE_PCH="-fh=$NGX_OBJS/ngx_config.pch"
+
+
+# the link flags, built target is NT GUI mode application
+#CORE_LINK="$CORE_LINK -l=nt_win"
+
+
+# the resource file
+NGX_RCC="wrc \$(CORE_INCS) -fo=$NGX_OBJS/nginx.res "
+NGX_RCC="$NGX_RCC $NGX_WIN32_RC $NGX_OBJS/nginx.exe"
+
+
+ngx_include_opt="-i="
+ngx_objout="-fo"
+ngx_binout="-fe="
+ngx_objext="obj"
+ngx_binext=".exe"
+
+ngx_regex_dirsep='\\'
+ngx_dirsep="\\"
+
+ngx_long_start=' '
+ngx_long_end=' '
+ngx_long_regex_cont=' \&\
+ '
+ngx_long_cont=' &
+ '
+
+ngx_regex_cont=' \&\
+ '
+ngx_cont=' &
+ '
+ngx_tab=' &
+ '
145 auto/cc/sunc
@@ -0,0 +1,145 @@
+
+# Copyright (C) Igor Sysoev
+
+
+# Sun C 5.7 Patch 117837-04 2005/05/11 Sun Studio 10
+# Sun C 5.8 2005/10/13 Sun Studio 11
+# Sun C 5.9 SunOS_i386 2007/05/03 Sun Studio 12
+# Sun C 5.9 SunOS_sparc 2007/05/03
+
+NGX_SUNC_VER=`$CC -V 2>&1 | grep 'Sun C' 2>&1 \
+ | sed -e 's/^.* Sun C \(.*\)/\1/'`
+
+echo " + Sun C version: $NGX_SUNC_VER"
+
+have=NGX_COMPILER value="\"Sun C $NGX_SUNC_VER\"" . auto/define
+
+
+cat << END > $NGX_AUTOTEST.c
+
+int main() { printf("%d", __SUNPRO_C); }
+
+END
+
+eval "$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c >> $NGX_ERR 2>&1"
+
+if [ -x $NGX_AUTOTEST ]; then
+ ngx_sunc_ver=`$NGX_AUTOTEST`
+fi
+
+rm $NGX_AUTOTEST*
+
+# 1424 == 0x590, Sun Studio 12
+
+if [ "$ngx_sunc_ver" -ge 1424 ]; then
+ ngx_sparc32="-m32"
+ ngx_sparc64="-m64"
+ ngx_amd64="-m64"
+
+else
+ ngx_sparc32="-xarch=v8plus"
+ ngx_sparc64="-xarch=v9"
+ ngx_amd64="-xarch=amd64"
+fi
+
+case "$NGX_MACHINE" in
+
+ i86pc)
+ NGX_AUX=" src/os/unix/ngx_sunpro_x86.il"
+ ;;
+
+ sun4u | sun4v)
+ NGX_AUX=" src/os/unix/ngx_sunpro_sparc64.il"
+ ;;
+
+esac
+
+
+# optimizations
+
+IPO=-xipo
+CFLAGS="$CFLAGS -fast $IPO"
+CORE_LINK="$CORE_LINK -fast $IPO"
+
+
+case $CPU in
+ pentium)
+ # optimize for Pentium and Athlon
+ CPU_OPT="-xchip=pentium"
+ ;;
+
+ pentiumpro)
+ # optimize for Pentium Pro, Pentium II
+ CPU_OPT="-xchip=pentium_pro"
+ ;;
+
+ pentium3)
+ # optimize for Pentium III
+ CPU_OPT="-xchip=pentium3"
+ #CPU_OPT="$CPU_OPT -xarch=sse"
+ CPU_OPT="$CPU_OPT -xcache=16/32/4:256/32/4"
+ ;;
+
+ pentium4)
+ # optimize for Pentium 4
+ CPU_OPT="-xchip=pentium4"
+ #CPU_OPT="$CPU_OPT -xarch=sse2"
+ CPU_OPT="$CPU_OPT -xcache=8/64/4:256/128/8"
+ ;;
+
+ opteron)
+ # optimize for Opteron
+ CPU_OPT="-xchip=opteron"
+ #CPU_OPT="$CPU_OPT -xarch=sse2"
+ CPU_OPT="$CPU_OPT -xcache=64/64/2:1024/64/16"
+ ;;
+
+ sparc32)
+ # build 32-bit UltraSparc binary
+ CPU_OPT="$ngx_sparc32"
+ CORE_LINK="$CORE_LINK $ngx_sparc32"
+ CC_AUX_FLAGS="$CC_AUX_FLAGS $ngx_sparc32"
+ NGX_CPU_CACHE_LINE=64
+ ;;
+
+ sparc64)
+ # build 64-bit UltraSparc binary
+ CPU_OPT="$ngx_sparc64"
+ CORE_LINK="$CORE_LINK $ngx_sparc64"
+ CC_AUX_FLAGS="$CC_AUX_FLAGS $ngx_sparc64"
+ NGX_CPU_CACHE_LINE=64
+ ;;
+
+ amd64)
+ # build 64-bit amd64 binary
+ CPU_OPT="$ngx_amd64"
+ CORE_LINK="$CORE_LINK $ngx_amd64"
+ CC_AUX_FLAGS="$CC_AUX_FLAGS $ngx_amd64"
+ NGX_AUX=" src/os/unix/ngx_sunpro_amd64.il"
+ NGX_CPU_CACHE_LINE=64
+ ;;
+
+esac
+
+
+CFLAGS="$CFLAGS $CPU_OPT"
+
+
+if [ ".$PCRE_OPT" = "." ]; then
+ PCRE_OPT="-fast $IPO $CPU_OPT"
+fi
+
+if [ ".$MD5_OPT" = "." ]; then
+ MD5_OPT="-fast $IPO $CPU_OPT"
+fi
+
+if [ ".$ZLIB_OPT" = "." ]; then
+ ZLIB_OPT="-fast $IPO $CPU_OPT"
+fi
+
+
+# stop on warning
+CFLAGS="$CFLAGS -errwarn=%all"
+
+# debug
+CFLAGS="$CFLAGS -g"
11 auto/define
@@ -0,0 +1,11 @@
+
+# Copyright (C) Igor Sysoev
+
+
+cat << END >> $NGX_AUTO_CONFIG_H
+
+#ifndef $have
+#define $have $value
+#endif
+
+END
44 auto/endianess
@@ -0,0 +1,44 @@
+
+# Copyright (C) Igor Sysoev
+
+
+echo $ngx_n "checking for system endianess ...$ngx_c"
+echo >> $NGX_ERR
+echo "checking for system endianess" >> $NGX_ERR
+
+
+cat << END > $NGX_AUTOTEST.c
+
+int main() {
+ int i = 0x11223344;
+ char *p;
+
+ p = (char *) &i;
+ if (*p == 0x44) return 0;
+ return 1;
+}
+
+END
+
+ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
+ -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
+
+eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
+
+if [ -x $NGX_AUTOTEST ]; then
+ if $NGX_AUTOTEST >/dev/null 2>&1; then
+ echo " little endianess"
+ have=NGX_HAVE_LITTLE_ENDIAN . auto/have
+ else
+ echo " big endianess"
+ fi
+
+ rm $NGX_AUTOTEST*
+
+else
+ rm $NGX_AUTOTEST*
+
+ echo
+ echo "$0: error: can not detect system endianess"
+ exit 1
+fi
104 auto/feature
@@ -0,0 +1,104 @@
+
+# Copyright (C) Igor Sysoev
+
+
+echo $ngx_n "checking for $ngx_feature ...$ngx_c"
+
+cat << END >> $NGX_AUTOCONF_ERR
+
+----------------------------------------
+checking for $ngx_feature
+
+END
+
+ngx_found=no
+
+if test -n "$ngx_feature_name"; then
+ ngx_have_feature=`echo $ngx_feature_name \
+ | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
+fi
+
+if test -n "$ngx_feature_path"; then
+ for ngx_temp in $ngx_feature_path; do
+ ngx_feature_inc_path="$ngx_feature_inc_path -I $ngx_temp"
+ done
+fi
+
+cat << END > $NGX_AUTOTEST.c
+
+#include <sys/types.h>
+$NGX_INCLUDE_UNISTD_H
+$ngx_feature_incs
+
+int main() {
+ $ngx_feature_test;
+ return 0;
+}
+
+END
+
+
+ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS $ngx_feature_inc_path \
+ -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_TEST_LD_OPT $ngx_feature_libs"
+
+ngx_feature_inc_path=
+
+eval "/bin/sh -c \"$ngx_test\" >> $NGX_AUTOCONF_ERR 2>&1"
+
+
+if [ -x $NGX_AUTOTEST ]; then
+
+ case "$ngx_feature_run" in
+
+ yes)
+ # /bin/sh is used to intercept "Killed" or "Abort trap" messages
+ if /bin/sh -c $NGX_AUTOTEST >/dev/null 2>&1; then
+ echo " found"
+ ngx_found=yes
+
+ if test -n "$ngx_feature_name"; then
+ have=$ngx_have_feature . auto/have
+ fi
+
+ else
+ echo " found but is not working"
+ fi
+ ;;
+
+ bug)
+ # /bin/sh is used to intercept "Killed" or "Abort trap" messages
+ if /bin/sh -c $NGX_AUTOTEST >/dev/null 2>&1; then
+ echo " not found"
+
+ else
+ echo " found"
+ ngx_found=yes
+
+ if test -n "$ngx_feature_name"; then
+ have=$ngx_have_feature . auto/have
+ fi
+ fi
+ ;;
+
+ *)
+ echo " found"
+ ngx_found=yes
+
+ if test -n "$ngx_feature_name"; then
+ have=$ngx_have_feature . auto/have
+ fi
+ ;;
+
+ esac
+
+else
+ echo " not found"
+
+ echo "----------" >> $NGX_AUTOCONF_ERR
+ cat $NGX_AUTOTEST.c >> $NGX_AUTOCONF_ERR
+ echo "----------" >> $NGX_AUTOCONF_ERR
+ echo $ngx_test >> $NGX_AUTOCONF_ERR
+ echo "----------" >> $NGX_AUTOCONF_ERR
+fi
+
+rm $NGX_AUTOTEST*
11 auto/have
@@ -0,0 +1,11 @@
+
+# Copyright (C) Igor Sysoev
+
+
+cat << END >> $NGX_AUTO_CONFIG_H
+
+#ifndef $have
+#define $have 1
+#endif
+
+END
11 auto/have_headers
@@ -0,0 +1,11 @@
+
+# Copyright (C) Igor Sysoev
+
+
+cat << END >> $NGX_AUTO_HEADERS_H
+
+#ifndef $have
+#define $have 1
+#endif
+
+END
12 auto/headers
@@ -0,0 +1,12 @@
+
+# Copyright (C) Igor Sysoev
+
+
+ngx_include="unistd.h"; . auto/include
+ngx_include="inttypes.h"; . auto/include
+ngx_include="limits.h"; . auto/include
+ngx_include="sys/filio.h"; . auto/include
+ngx_include="sys/param.h"; . auto/include
+ngx_include="sys/mount.h"; . auto/include
+ngx_include="sys/statvfs.h"; . auto/include
+ngx_include="crypt.h"; . auto/include
60 auto/include
@@ -0,0 +1,60 @@
+
+# Copyright (C) Igor Sysoev
+
+
+echo $ngx_n "checking for $ngx_include ...$ngx_c"
+
+cat << END >> $NGX_AUTOCONF_ERR
+
+----------------------------------------
+checking for $ngx_include
+
+END
+
+
+ngx_found=no
+
+cat << END > $NGX_AUTOTEST.c
+
+$NGX_INCLUDE_SYS_PARAM_H
+#include <$ngx_include>
+
+int main() {
+ return 0;
+}
+
+END
+
+
+ngx_test="$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c"
+
+eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
+
+if [ -x $NGX_AUTOTEST ]; then
+
+ ngx_found=yes
+
+ echo " found"
+
+ ngx_name=`echo $ngx_include \
+ | tr abcdefghijklmnopqrstuvwxyz/. ABCDEFGHIJKLMNOPQRSTUVWXYZ__`
+
+
+ have=NGX_HAVE_$ngx_name . auto/have_headers
+
+ eval "NGX_INCLUDE_$ngx_name='#include <$ngx_include>'"
+
+ #STUB
+ eval "NGX_$ngx_name='#include <$ngx_include>'"
+
+else
+ echo " not found"
+
+ echo "----------" >> $NGX_AUTOCONF_ERR
+ cat $NGX_AUTOTEST.c >> $NGX_AUTOCONF_ERR
+ echo "----------" >> $NGX_AUTOCONF_ERR
+ echo $ngx_test >> $NGX_AUTOCONF_ERR
+ echo "----------" >> $NGX_AUTOCONF_ERR
+fi
+
+rm $NGX_AUTOTEST*
50 auto/init
@@ -0,0 +1,50 @@
+
+# Copyright (C) Igor Sysoev
+
+
+NGX_MAKEFILE=$NGX_OBJS/Makefile
+NGX_MODULES_C=$NGX_OBJS/ngx_modules.c
+
+NGX_AUTO_HEADERS_H=$NGX_OBJS/ngx_auto_headers.h
+NGX_AUTO_CONFIG_H=$NGX_OBJS/ngx_auto_config.h
+
+NGX_AUTOTEST=$NGX_OBJS/autotest
+NGX_AUTOCONF_ERR=$NGX_OBJS/autoconf.err
+
+# STUBs
+NGX_ERR=$NGX_OBJS/autoconf.err
+MAKEFILE=$NGX_OBJS/Makefile
+
+
+NGX_PCH=
+NGX_USE_PCH=
+
+
+# check the echo's "-n" option and "\c" capability
+
+if echo "test\c" | grep c >/dev/null; then
+
+ if echo -n test | grep n >/dev/null; then
+ ngx_n=
+ ngx_c=
+
+ else
+ ngx_n=-n
+ ngx_c=
+ fi
+
+else
+ ngx_n=
+ ngx_c='\c'
+fi
+
+
+# create Makefile
+
+cat << END > Makefile
+
+default: build
+
+clean:
+ rm -rf Makefile $NGX_OBJS
+END
161 auto/install
@@ -0,0 +1,161 @@
+
+# Copyright (C) Igor Sysoev
+
+
+if [ $USE_PERL = YES ]; then
+
+ cat << END >> $NGX_MAKEFILE
+
+install_perl_modules:
+ cd $NGX_OBJS/src/http/modules/perl && make install
+END
+
+ NGX_INSTALL_PERL_MODULES=install_perl_modules
+
+fi
+
+
+case ".$NGX_SBIN_PATH" in
+ ./*)
+ ;;
+
+ .)
+ NGX_SBIN_PATH=$NGX_PREFIX/sbin/nginx
+ ;;
+
+ *)
+ NGX_SBIN_PATH=$NGX_PREFIX/$NGX_SBIN_PATH
+ ;;
+esac
+
+
+case ".$NGX_CONF_PATH" in
+ ./*)
+ ;;
+
+ *)
+ NGX_CONF_PATH=$NGX_PREFIX/$NGX_CONF_PATH
+ ;;
+esac
+
+
+NGX_CONF_PREFIX=`dirname $NGX_CONF_PATH`
+
+
+case ".$NGX_PID_PATH" in
+ ./*)
+ ;;
+
+ *)
+ NGX_PID_PATH=$NGX_PREFIX/$NGX_PID_PATH
+ ;;
+esac
+
+
+case ".$NGX_ERROR_LOG_PATH" in
+ ./*)
+ ;;
+
+ *)
+ NGX_ERROR_LOG_PATH=$NGX_PREFIX/$NGX_ERROR_LOG_PATH
+ ;;
+esac
+
+
+case ".$NGX_HTTP_LOG_PATH" in
+ ./*)
+ ;;
+
+ *)
+ NGX_HTTP_LOG_PATH=$NGX_PREFIX/$NGX_HTTP_LOG_PATH
+ ;;
+esac
+
+
+cat << END >> $NGX_MAKEFILE
+
+install: $NGX_OBJS${ngx_dirsep}nginx${ngx_binext} \
+ $NGX_INSTALL_PERL_MODULES
+ test -d '\$(DESTDIR)$NGX_PREFIX' || mkdir -p '\$(DESTDIR)$NGX_PREFIX'
+
+ test -d '\$(DESTDIR)`dirname "$NGX_SBIN_PATH"`' \
+ || mkdir -p '\$(DESTDIR)`dirname "$NGX_SBIN_PATH"`'
+ test ! -f '\$(DESTDIR)$NGX_SBIN_PATH' \
+ || mv '\$(DESTDIR)$NGX_SBIN_PATH' \
+ '\$(DESTDIR)$NGX_SBIN_PATH.old'
+ cp $NGX_OBJS/nginx '\$(DESTDIR)$NGX_SBIN_PATH'
+
+ test -d '\$(DESTDIR)$NGX_CONF_PREFIX' \
+ || mkdir -p '\$(DESTDIR)$NGX_CONF_PREFIX'
+
+ cp conf/koi-win '\$(DESTDIR)$NGX_CONF_PREFIX'
+ cp conf/koi-utf '\$(DESTDIR)$NGX_CONF_PREFIX'
+ cp conf/win-utf '\$(DESTDIR)$NGX_CONF_PREFIX'
+
+ test -f '\$(DESTDIR)$NGX_CONF_PREFIX/mime.types' \
+ || cp conf/mime.types '\$(DESTDIR)$NGX_CONF_PREFIX'
+ cp conf/mime.types '\$(DESTDIR)$NGX_CONF_PREFIX/mime.types.default'
+
+ test -f '\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi_params' \
+ || cp conf/fastcgi_params '\$(DESTDIR)$NGX_CONF_PREFIX'
+ cp conf/fastcgi_params \
+ '\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi_params.default'
+
+ test -f '\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi.conf' \
+ || cp conf/fastcgi.conf '\$(DESTDIR)$NGX_CONF_PREFIX'
+ cp conf/fastcgi.conf '\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi.conf.default'
+
+ test -f '\$(DESTDIR)$NGX_CONF_PREFIX/uwsgi_params' \
+ || cp conf/uwsgi_params '\$(DESTDIR)$NGX_CONF_PREFIX'
+ cp conf/uwsgi_params \
+ '\$(DESTDIR)$NGX_CONF_PREFIX/uwsgi_params.default'
+
+ test -f '\$(DESTDIR)$NGX_CONF_PREFIX/scgi_params' \
+ || cp conf/scgi_params '\$(DESTDIR)$NGX_CONF_PREFIX'
+ cp conf/scgi_params \
+ '\$(DESTDIR)$NGX_CONF_PREFIX/scgi_params.default'
+
+ test -f '\$(DESTDIR)$NGX_CONF_PATH' \
+ || cp conf/nginx.conf '\$(DESTDIR)$NGX_CONF_PATH'
+ cp conf/nginx.conf '\$(DESTDIR)$NGX_CONF_PREFIX/nginx.conf.default'
+
+ test -d '\$(DESTDIR)`dirname "$NGX_PID_PATH"`' \
+ || mkdir -p '\$(DESTDIR)`dirname "$NGX_PID_PATH"`'
+
+ test -d '\$(DESTDIR)`dirname "$NGX_HTTP_LOG_PATH"`' || \
+ mkdir -p '\$(DESTDIR)`dirname "$NGX_HTTP_LOG_PATH"`'
+
+ test -d '\$(DESTDIR)$NGX_PREFIX/html' \
+ || cp -r html '\$(DESTDIR)$NGX_PREFIX'
+END
+
+
+if test -n "\$(DESTDIR)$NGX_ERROR_LOG_PATH"; then
+ cat << END >> $NGX_MAKEFILE
+
+ test -d '\$(DESTDIR)`dirname "$NGX_ERROR_LOG_PATH"`' || \
+ mkdir -p '\$(DESTDIR)`dirname "$NGX_ERROR_LOG_PATH"`'
+END
+
+fi
+
+
+# create Makefile
+
+cat << END >> Makefile
+
+build:
+ \$(MAKE) -f $NGX_MAKEFILE
+
+install:
+ \$(MAKE) -f $NGX_MAKEFILE install
+
+upgrade:
+ $NGX_SBIN_PATH -t
+
+ kill -USR2 \`cat $NGX_PID_PATH\`
+ sleep 1
+ test -f $NGX_PID_PATH.oldbin
+
+ kill -QUIT \`cat $NGX_PID_PATH.oldbin\`
+END
80 auto/lib/conf
@@ -0,0 +1,80 @@
+
+# Copyright (C) Igor Sysoev
+
+
+if [ $USE_PCRE = YES -o $PCRE != NONE ]; then
+ . auto/lib/pcre/conf
+
+else
+ if [ $USE_PCRE = DISABLED -a $HTTP_REWRITE = YES ]; then
+
+cat << END
+
+$0: error: the HTTP rewrite module requires the PCRE library.
+You can either disable the module by using --without-http_rewrite_module
+option or you have to enable the PCRE support.
+
+END
+ exit 1
+ fi
+fi
+
+
+if [ $USE_OPENSSL = YES ]; then
+ . auto/lib/openssl/conf
+fi
+
+if [ $USE_MD5 = YES ]; then
+
+ if [ $USE_OPENSSL = YES ]; then
+ have=NGX_HAVE_OPENSSL_MD5_H . auto/have
+ have=NGX_OPENSSL_MD5 . auto/have
+ MD5=YES
+ MD5_LIB=OpenSSL
+
+ else
+ . auto/lib/md5/conf
+ fi
+
+fi
+
+if [ $USE_SHA1 = YES ]; then
+
+ if [ $USE_OPENSSL = YES ]; then
+ have=NGX_HAVE_OPENSSL_SHA1_H . auto/have
+ SHA1=YES
+ SHA1_LIB=OpenSSL
+
+ else
+ . auto/lib/sha1/conf
+ fi
+
+fi
+
+if [ $USE_ZLIB = YES ]; then
+ . auto/lib/zlib/conf
+fi
+
+if [ $USE_LIBXSLT = YES ]; then
+ . auto/lib/libxslt/conf
+fi
+
+if [ $USE_LIBGD = YES ]; then
+ . auto/lib/libgd/conf
+fi
+
+if [ $USE_PERL = YES ]; then
+ . auto/lib/perl/conf
+fi
+
+if [ $HTTP_GEOIP = YES ]; then
+ . auto/lib/geoip/conf
+fi
+
+if [ $NGX_GOOGLE_PERFTOOLS = YES ]; then
+ . auto/lib/google-perftools/conf
+fi
+
+if [ $NGX_LIBATOMIC != NO ]; then
+ . auto/lib/libatomic/conf
+fi
78 auto/lib/geoip/conf
@@ -0,0 +1,78 @@
+
+# Copyright (C) Igor Sysoev
+
+
+ ngx_feature="GeoIP library"
+ ngx_feature_name=
+ ngx_feature_run=no
+ ngx_feature_incs=
+ ngx_feature_path=
+ ngx_feature_libs="-lGeoIP"
+ ngx_feature_test="GeoIP_open(NULL, 0)"
+ . auto/feature
+
+
+if [ $ngx_found = no ]; then
+
+ # FreeBSD port
+
+ ngx_feature="GeoIP library in /usr/local/"
+
+ if [ $NGX_RPATH = YES ]; then
+ ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lGeoIP"
+ else
+ ngx_feature_libs="-L/usr/local/lib -lGeoIP"
+ fi
+
+ . auto/feature
+fi
+
+
+if [ $ngx_found = no ]; then
+
+ # NetBSD port
+
+ ngx_feature="GeoIP library in /usr/pkg/"
+ ngx_feature_path="/usr/pkg/include/"
+
+ if [ $NGX_RPATH = YES ]; then
+ ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lGeoIP"
+ else
+ ngx_feature_libs="-L/usr/pkg/lib -lGeoIP"
+ fi
+
+ . auto/feature
+fi
+
+
+if [ $ngx_found = no ]; then
+
+ # MacPorts
+
+ ngx_feature="GeoIP library in /opt/local/"
+ ngx_feature_path="/opt/local/include"
+
+ if [ $NGX_RPATH = YES ]; then
+ ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lGeoIP"
+ else
+ ngx_feature_libs="-L/opt/local/lib -lGeoIP"
+ fi
+
+ . auto/feature
+fi
+
+
+if [ $ngx_found = yes ]; then
+ CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
+
+else
+
+cat << END
+
+$0: error: the GeoIP module requires the GeoIP library.
+You can either do not enable the module or install the library.
+
+END
+
+ exit 1
+fi
44 auto/lib/google-perftools/conf
@@ -0,0 +1,44 @@
+
+# Copyright (C) Igor Sysoev
+
+
+ ngx_feature="Google perftools"
+ ngx_feature_name=
+ ngx_feature_run=no
+ ngx_feature_incs=
+ ngx_feature_path=
+ ngx_feature_libs="-lprofiler"
+ ngx_feature_test="ProfilerStop()"
+ . auto/feature
+
+
+if [ $ngx_found = no ]; then
+
+ # FreeBSD port
+
+ ngx_feature="Google perftools in /usr/local/"
+
+ if [ $NGX_RPATH = YES ]; then
+ ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lprofiler"
+ else
+ ngx_feature_libs="-L/usr/local/lib -lprofiler"
+ fi
+
+ . auto/feature
+fi
+
+
+if [ $ngx_found = yes ]; then
+ CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
+
+else
+
+cat << END
+
+$0: error: the Google perftool module requires the Google perftools
+library. You can either do not enable the module or install the library.
+
+END
+
+ exit 1
+fi
42 auto/lib/libatomic/conf
@@ -0,0 +1,42 @@
+
+# Copyright (C) Igor Sysoev
+
+
+if [ $NGX_LIBATOMIC != YES ]; then
+
+ have=NGX_HAVE_LIBATOMIC . auto/have
+ CORE_INCS="$CORE_INCS $NGX_LIBATOMIC/src"
+ LINK_DEPS="$LINK_DEPS $NGX_LIBATOMIC/src/libatomic_ops.a"
+ CORE_LIBS="$CORE_LIBS $NGX_LIBATOMIC/src/libatomic_ops.a"
+
+else
+
+ ngx_feature="atomic_ops library"
+ ngx_feature_name=NGX_HAVE_LIBATOMIC
+ ngx_feature_run=yes
+ ngx_feature_incs="#define AO_REQUIRE_CAS
+ #include <atomic_ops.h>"
+ ngx_feature_path=
+ ngx_feature_libs="-latomic_ops"
+ ngx_feature_test="long n = 0;
+ if (!AO_compare_and_swap(&n, 0, 1))
+ return 1;
+ if (AO_fetch_and_add(&n, 1) != 1)
+ return 1;
+ if (n != 2)
+ return 1;
+ AO_nop();"
+ . auto/feature
+
+ if [ $ngx_found = yes ]; then
+ CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
+ else
+
+cat << END
+
+$0: error: libatomic_ops library was not found.
+
+END
+ exit 1
+ fi
+fi
13 auto/lib/libatomic/make
@@ -0,0 +1,13 @@
+
+# Copyright (C) Igor Sysoev
+
+
+ cat << END >> $NGX_MAKEFILE
+
+$NGX_LIBATOMIC/src/libatomic_ops.a: $NGX_LIBATOMIC/Makefile
+ cd $NGX_LIBATOMIC && make
+
+$NGX_LIBATOMIC/Makefile: $NGX_MAKEFILE
+ cd $NGX_LIBATOMIC && ./configure
+
+END
82 auto/lib/libgd/conf
@@ -0,0 +1,82 @@
+
+# Copyright (C) Igor Sysoev
+
+
+ ngx_feature="GD library"
+ ngx_feature_name=
+ ngx_feature_run=no
+ ngx_feature_incs="#include <gd.h>"
+ ngx_feature_path=
+ ngx_feature_libs="-lgd"
+ ngx_feature_test="gdImagePtr img = gdImageCreateFromGifPtr(1, NULL);"
+ . auto/feature
+
+
+if [ $ngx_found = no ]; then
+
+ # FreeBSD port
+
+ ngx_feature="GD library in /usr/local/"
+ ngx_feature_path="/usr/local/include"
+
+ if [ $NGX_RPATH = YES ]; then
+ ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lgd"
+ else
+ ngx_feature_libs="-L/usr/local/lib -lgd"
+ fi
+
+ . auto/feature
+fi
+
+
+if [ $ngx_found = no ]; then
+
+ # NetBSD port
+
+ ngx_feature="GD library in /usr/pkg/"
+ ngx_feature_path="/usr/pkg/include/"
+
+ if [ $NGX_RPATH = YES ]; then
+ ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lgd"
+ else
+ ngx_feature_libs="-L/usr/pkg/lib -lgd"
+ fi
+
+ . auto/feature
+fi
+
+
+if [ $ngx_found = no ]; then
+
+ # MacPorts
+
+ ngx_feature="GD library in /opt/local/"
+ ngx_feature_path="/opt/local/include"
+
+ if [ $NGX_RPATH = YES ]; then
+ ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lgd"
+ else
+ ngx_feature_libs="-L/opt/local/lib -lgd"
+ fi
+
+ . auto/feature
+fi
+
+
+if [ $ngx_found = yes ]; then
+
+ CORE_INCS="$CORE_INCS $ngx_feature_path"
+ CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
+
+else
+
+cat << END
+
+$0: error: the HTTP image filter module requires the GD library.
+You can either do not enable the module or install the libraries.
+
+END
+
+ exit 1
+
+fi
155 auto/lib/libxslt/conf
@@ -0,0 +1,155 @@
+
+# Copyright (C) Igor Sysoev
+
+
+ ngx_feature="libxslt"
+ ngx_feature_name=
+ ngx_feature_run=no
+ ngx_feature_incs="#include <libxml/parser.h>
+ #include <libxml/tree.h>
+ #include <libxslt/xslt.h>
+ #include <libxslt/xsltInternals.h>
+ #include <libxslt/transform.h>
+ #include <libxslt/xsltutils.h>"
+ ngx_feature_path="/usr/include/libxml2"
+ ngx_feature_libs="-lxml2 -lxslt"
+ ngx_feature_test="xmlParserCtxtPtr ctxt = NULL;
+ xsltStylesheetPtr sheet = NULL;
+ xmlDocPtr doc;
+ doc = xmlParseChunk(ctxt, NULL, 0, 0);
+ xsltApplyStylesheet(sheet, doc, NULL);"
+ . auto/feature
+
+
+if [ $ngx_found = no ]; then
+
+ # FreeBSD port
+
+ ngx_feature="libxslt in /usr/local/"
+ ngx_feature_path="/usr/local/include/libxml2 /usr/local/include"
+
+ if [ $NGX_RPATH = YES ]; then
+ ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lxml2 -lxslt"
+ else
+ ngx_feature_libs="-L/usr/local/lib -lxml2 -lxslt"
+ fi
+
+ . auto/feature
+fi
+
+
+if [ $ngx_found = no ]; then
+
+ # NetBSD port
+
+ ngx_feature="libxslt in /usr/pkg/"
+ ngx_feature_path="/usr/pkg/include/libxml2 /usr/pkg/include"
+
+ if [ $NGX_RPATH = YES ]; then
+ ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lxml2 -lxslt"
+ else
+ ngx_feature_libs="-L/usr/pkg/lib -lxml2 -lxslt"
+ fi
+
+ . auto/feature
+fi
+
+
+if [ $ngx_found = no ]; then
+
+ # MacPorts
+
+ ngx_feature="libxslt in /opt/local/"
+ ngx_feature_path="/opt/local/include/libxml2 /opt/local/include"
+
+ if [ $NGX_RPATH = YES ]; then
+ ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lxml2 -lxslt"
+ else
+ ngx_feature_libs="-L/opt/local/lib -lxml2 -lxslt"
+ fi
+
+ . auto/feature
+fi
+
+
+if [ $ngx_found = yes ]; then
+
+ CORE_INCS="$CORE_INCS $ngx_feature_path"
+ CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
+
+else
+
+cat << END
+
+$0: error: the HTTP XSLT module requires the libxml2/libxslt
+libraries. You can either do not enable the module or install the libraries.
+
+END
+
+ exit 1
+fi
+
+
+ ngx_feature="libexslt"
+ ngx_feature_name=NGX_HAVE_EXSLT
+ ngx_feature_run=no
+ ngx_feature_incs="#include <libexslt/exslt.h>"
+ ngx_feature_path="/usr/include/libxml2"
+ ngx_feature_libs="-lexslt"
+ ngx_feature_test="exsltRegisterAll();"
+ . auto/feature
+
+if [ $ngx_found = no ]; then
+
+ # FreeBSD port
+
+ ngx_feature="libexslt in /usr/local/"
+ ngx_feature_path="/usr/local/include/libxml2 /usr/local/include"
+
+ if [ $NGX_RPATH = YES ]; then
+ ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lexslt"
+ else
+ ngx_feature_libs="-L/usr/local/lib -lexslt"
+ fi
+
+ . auto/feature
+fi
+
+
+if [ $ngx_found = no ]; then
+
+ # NetBSD port
+
+ ngx_feature="libexslt in /usr/pkg/"
+ ngx_feature_path="/usr/pkg/include/libxml2 /usr/local/include"
+
+ if [ $NGX_RPATH = YES ]; then
+ ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lexslt"
+ else
+ ngx_feature_libs="-L/usr/pkg/lib -lexslt"
+ fi
+
+ . auto/feature
+fi
+
+
+if [ $ngx_found = no ]; then
+
+ # MacPorts
+
+ ngx_feature="libexslt in /opt/local/"
+ ngx_feature_path="/opt/local/include/libxml2 /opt/local/include"
+
+ if [ $NGX_RPATH = YES ]; then
+ ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lexslt"
+ else
+ ngx_feature_libs="-L/opt/local/lib -lexslt"
+ fi
+
+ . auto/feature
+fi
+
+
+if [ $ngx_found = yes ]; then
+ CORE_LIBS="$CORE_LIBS -lexslt"
+fi
31 auto/lib/make
@@ -0,0 +1,31 @@
+
+# Copyright (C) Igor Sysoev
+
+
+if [ $PCRE != NONE -a $PCRE != NO -a $PCRE != YES ]; then
+ . auto/lib/pcre/make
+fi
+
+if [ $MD5 != NONE -a $MD5 != NO -a $MD5 != YES ]; then
+ . auto/lib/md5/make
+fi
+
+if [ $SHA1 != NONE -a $SHA1 != NO -a $SHA1 != YES ]; then
+ . auto/lib/sha1/make
+fi
+
+if [ $OPENSSL != NONE -a $OPENSSL != NO -a $OPENSSL != YES ]; then
+ . auto/lib/openssl/make
+fi
+
+if [ $ZLIB != NONE -a $ZLIB != NO -a $ZLIB != YES ]; then
+ . auto/lib/zlib/make
+fi
+
+if [ $NGX_LIBATOMIC != NO -a $NGX_LIBATOMIC != YES ]; then
+ . auto/lib/libatomic/make
+fi
+
+if [ $USE_PERL = YES ]; then
+ . auto/lib/perl/make
+fi
113 auto/lib/md5/conf
@@ -0,0 +1,113 @@
+
+# Copyright (C) Igor Sysoev
+
+
+if [ $MD5 != NONE ]; then
+
+ if grep MD5_Init $MD5/md5.h 2>&1 >/dev/null; then
+ # OpenSSL md5
+ OPENSSL_MD5=YES
+ have=NGX_HAVE_OPENSSL_MD5 . auto/have
+ have=NGX_OPENSSL_MD5 . auto/have
+ else
+ # rsaref md5
+ OPENSSL_MD5=NO
+ fi
+
+ CORE_INCS="$CORE_INCS $MD5"
+
+ case "$NGX_CC_NAME" in
+
+ msvc* | owc* | bcc)
+ LINK_DEPS="$LINK_DEPS $MD5/md5.lib"
+ CORE_LIBS="$CORE_LIBS $MD5/md5.lib"
+ ;;
+
+ icc*)
+ LINK_DEPS="$LINK_DEPS $MD5/libmd5.a"
+
+ # to allow -ipo optimization we link with the *.o but not library
+ CORE_LIBS="$CORE_LIBS $MD5/md5_dgst.o"
+
+ if [ $MD5_ASM = YES ]; then
+ CORE_LIBS="$CORE_LIBS $MD5/asm/mx86-elf.o"
+ fi
+ ;;
+
+ *)
+ LINK_DEPS="$LINK_DEPS $MD5/libmd5.a"
+ CORE_LIBS="$CORE_LIBS $MD5/libmd5.a"
+ #CORE_LIBS="$CORE_LIBS -L $MD5 -lmd5"
+ ;;
+
+ esac
+
+else
+
+ if [ "$NGX_PLATFORM" != win32 ]; then
+
+ MD5=NO
+
+ # FreeBSD, Solaris 10
+
+ ngx_feature="system md library"
+ ngx_feature_name=
+ ngx_feature_run=no
+ ngx_feature_incs="#include <md5.h>"
+ ngx_feature_path=
+ ngx_feature_libs="-lmd"
+ ngx_feature_test="MD5_CTX md5; MD5Init(&md5)"
+ . auto/feature
+
+ ngx_md5_lib="system md"
+
+ if [ $ngx_found = no ]; then
+
+ # Solaris 8/9
+
+ ngx_feature="system md5 library"
+ ngx_feature_libs="-lmd5"
+ . auto/feature
+
+ ngx_md5_lib="system md5"
+ fi
+
+ if [ $ngx_found = no ]; then
+
+ # OpenSSL crypto library
+
+ ngx_feature="OpenSSL md5 crypto library"
+ ngx_feature_name="NGX_OPENSSL_MD5"
+ ngx_feature_incs="#include <openssl/md5.h>"
+ ngx_feature_libs="-lcrypto"
+ ngx_feature_test="MD5_CTX md5; MD5_Init(&md5)"
+ . auto/feature
+
+ ngx_md5_lib="system crypto"
+
+ if [ $ngx_found = yes ]; then
+ have=NGX_HAVE_OPENSSL_MD5_H . auto/have
+ fi
+ fi
+
+ if [ $ngx_found = yes ]; then
+ CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
+ MD5=YES
+ MD5_LIB=$ngx_md5_lib
+ fi
+ fi
+
+ if [ $MD5 != YES ]; then
+cat << END
+
+$0: error: the HTTP cache module requires md5 functions
+from OpenSSL library. You can either disable the module by using
+--without-http-cache option, or install the OpenSSL library into the system,
+or build the OpenSSL library statically from the source with nginx by using
+--with-http_ssl_module --with-openssl=<path> options.
+
+END
+ exit 1
+ fi
+
+fi
95 auto/lib/md5/make
@@ -0,0 +1,95 @@
+
+# Copyright (C) Igor Sysoev
+
+
+case "$NGX_CC_NAME" in
+
+ msvc*)
+ ngx_makefile=makefile.msvc
+ ngx_opt="CPU_OPT=\"$CPU_OPT\" LIBC=$LIBC MD5_ASM=$MD5_ASM"
+ ngx_md5="MD5=\"$MD5\""
+ ;;
+
+ owc*)
+ ngx_makefile=makefile.owc
+ ngx_opt="CPU_OPT=\"$CPU_OPT\""
+ ngx_md5=`echo MD5=\"$MD5\" | sed -e "s/\//$ngx_regex_dirsep/g"`
+ ;;
+
+ bcc)
+ ngx_makefile=makefile.bcc
+ ngx_opt="-DCPU_OPT=\"$CPU_OPT\" -DMD5_ASM=$MD5_ASM"
+ ngx_md5=`echo \-DMD5=\"$MD5\" | sed -e "s/\//$ngx_regex_dirsep/g"`
+ ;;
+
+esac
+
+
+done=NO
+
+
+case "$NGX_PLATFORM" in
+
+ win32)
+ cat << END >> $NGX_MAKEFILE
+
+`echo "$MD5/md5.lib: $NGX_MAKEFILE" | sed -e "s/\//$ngx_regex_dirsep/g"`
+ \$(MAKE) -f auto/lib/md5/$ngx_makefile $ngx_opt $ngx_md5
+
+END
+
+ done=YES
+ ;;
+
+ SunOS:*:i86pc)
+ if [ $MD5_ASM = YES ]; then
+
+ cat << END >> $NGX_MAKEFILE
+
+$MD5/libmd5.a: $NGX_MAKEFILE
+ cd $MD5 \\
+ && \$(MAKE) CFLAGS="$MD5_OPT -DSOL -DMD5_ASM -DL_ENDIAN" \\
+ CC="\$(CC)" CPP="\$(CPP)" \\
+ MD5_ASM_OBJ=asm/mx86-sol.o clean libmd5.a
+
+END
+
+ done=YES
+ fi
+ ;;
+
+ # FreeBSD: i386
+ # Linux: i686
+
+ *:i386 | *:i686)
+ if [ $MD5_ASM = YES ]; then
+
+ cat << END >> $NGX_MAKEFILE
+
+$MD5/libmd5.a: $NGX_MAKEFILE
+ cd $MD5 \\
+ && \$(MAKE) CFLAGS="$MD5_OPT -DELF -DMD5_ASM -DL_ENDIAN" \\
+ CC="\$(CC)" CPP="\$(CPP)" \\
+ MD5_ASM_OBJ=asm/mx86-elf.o clean libmd5.a
+
+END
+
+ done=YES
+ fi
+ ;;
+
+esac
+
+
+if [ $done = NO ]; then
+
+ cat << END >> $NGX_MAKEFILE
+
+$MD5/libmd5.a: $NGX_MAKEFILE
+ cd $MD5 \\
+ && \$(MAKE) CFLAGS="$MD5_OPT" \\
+ CC="\$(CC)" MD5_ASM_OBJ= clean libmd5.a
+
+END
+
+fi
21 auto/lib/md5/makefile.bcc
@@ -0,0 +1,21 @@
+
+# Copyright (C) Igor Sysoev
+
+
+CFLAGS = -q -O2 -tWM $(CPU_OPT) -DL_ENDIAN
+
+!if "$(MD5_ASM)" == "YES"
+
+md5.lib:
+ cd $(MD5)
+ bcc32 -c $(CFLAGS) -DMD5_ASM md5_dgst.c
+ tlib md5.lib +md5_dgst.obj +"asm\m-win32.obj"
+
+!else
+
+md5.lib:
+ cd $(MD5)
+ bcc32 -c $(CFLAGS) md5_dgst.c
+ tlib md5.lib +md5_dgst.obj
+
+!endif
21 auto/lib/md5/makefile.msvc
@@ -0,0 +1,21 @@
+
+# Copyright (C) Igor Sysoev
+
+
+CFLAGS = -nologo -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT) -D L_ENDIAN
+
+!IF "$(MD5_ASM)" == "YES"
+
+md5.lib:
+ cd $(MD5)
+ cl -c $(CFLAGS) -D MD5_ASM md5_dgst.c
+ link -lib -out:md5.lib md5_dgst.obj asm/m-win32.obj
+
+!ELSE
+
+md5.lib:
+ cd $(MD5)
+ cl -c $(CFLAGS) md5_dgst.c
+ link -lib -out:md5.lib md5_dgst.obj
+
+!ENDIF
10 auto/lib/md5/makefile.owc
@@ -0,0 +1,10 @@
+
+# Copyright (C) Igor Sysoev
+
+
+CFLAGS = -zq -bt=nt -bm -ot -op -oi -oe -s $(CPU_OPT)
+
+md5.lib:
+ cd $(MD5)
+ wcl386 -c $(CFLAGS) -dL_ENDIAN md5_dgst.c
+ wlib -n md5.lib md5_dgst.obj
73 auto/lib/openssl/conf
@@ -0,0 +1,73 @@
+
+# Copyright (C) Igor Sysoev
+
+
+if [ $OPENSSL != NONE ]; then
+
+ case "$CC" in
+
+ cl | bcc32)
+ have=NGX_OPENSSL . auto/have
+ have=NGX_SSL . auto/have
+
+ CFLAGS="$CFLAGS -DNO_SYS_TYPES_H"
+
+ CORE_INCS="$CORE_INCS $OPENSSL/openssl/include"
+ CORE_DEPS="$CORE_DEPS $OPENSSL/openssl/include/openssl/ssl.h"
+ CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/ssleay32.lib"
+ CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libeay32.lib"
+
+ # libeay32.lib requires gdi32.lib
+ CORE_LIBS="$CORE_LIBS gdi32.lib"
+ # OpenSSL 1.0.0 requires crypt32.lib
+ CORE_LIBS="$CORE_LIBS crypt32.lib"
+ ;;
+
+ *)
+ have=NGX_OPENSSL . auto/have
+ have=NGX_SSL . auto/have
+
+ CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
+ CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
+ CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
+ CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
+ CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
+ ;;
+ esac
+
+else