Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Initial import of 0.8.54 release tarball

  • Loading branch information...
commit 610c88ae9b4feb17917b06706d8ceb4baf0732b6 0 parents
Matt Palmer authored

Showing 343 changed files with 51,673 additions and 0 deletions. Show diff stats Hide diff stats

  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
  126. +886 0 src/core/ngx_open_file_cache.c
  127. +117 0 src/core/ngx_open_file_cache.h
  128. +672 0 src/core/ngx_output_chain.c
  129. +432 0 src/core/ngx_palloc.c
  130. +94 0 src/core/ngx_palloc.h
  131. +248 0 src/core/ngx_parse.c
  132. +23 0 src/core/ngx_parse.h
  133. +79 0 src/core/ngx_queue.c
  134. +111 0 src/core/ngx_queue.h
  135. +290 0 src/core/ngx_radix_tree.c
  136. +45 0 src/core/ngx_radix_tree.h
  137. +382 0 src/core/ngx_rbtree.c
  138. +83 0 src/core/ngx_rbtree.h
  139. +222 0 src/core/ngx_regex.c
  140. +55 0 src/core/ngx_regex.h
  141. +2,204 0 src/core/ngx_resolver.c
  142. +148 0 src/core/ngx_resolver.h
  143. +30 0 src/core/ngx_sha1.h
  144. +68 0 src/core/ngx_shmtx.c
  145. +109 0 src/core/ngx_shmtx.h
  146. +700 0 src/core/ngx_slab.c
  147. +53 0 src/core/ngx_slab.h
  148. +52 0 src/core/ngx_spinlock.c
  149. +1,807 0 src/core/ngx_string.c
  150. +225 0 src/core/ngx_string.h
  151. +392 0 src/core/ngx_times.c
  152. +49 0 src/core/ngx_times.h
  153. +170 0 src/event/modules/ngx_aio_module.c
  154. +568 0 src/event/modules/ngx_devpoll_module.c
  155. +781 0 src/event/modules/ngx_epoll_module.c
  156. +601 0 src/event/modules/ngx_eventport_module.c
  157. +784 0 src/event/modules/ngx_kqueue_module.c
  158. +442 0 src/event/modules/ngx_poll_module.c
  159. +734 0 src/event/modules/ngx_rtsig_module.c
  160. +434 0 src/event/modules/ngx_select_module.c
  161. +399 0 src/event/modules/ngx_win32_select_module.c
  162. +1,273 0 src/event/ngx_event.c
  163. +572 0 src/event/ngx_event.h
  164. +402 0 src/event/ngx_event_accept.c
  165. +285 0 src/event/ngx_event_busy_lock.c
  166. +64 0 src/event/ngx_event_busy_lock.h
  167. +258 0 src/event/ngx_event_connect.c
  168. +75 0 src/event/ngx_event_connect.h
  169. +69 0 src/event/ngx_event_mutex.c
  170. +2,322 0 src/event/ngx_event_openssl.c
  171. +157 0 src/event/ngx_event_openssl.h
  172. +995 0 src/event/ngx_event_pipe.c
  173. +94 0 src/event/ngx_event_pipe.h
  174. +172 0 src/event/ngx_event_posted.c
  175. +74 0 src/event/ngx_event_posted.h
  176. +158 0 src/event/ngx_event_timer.c
  177. +101 0 src/event/ngx_event_timer.h
  178. +376 0 src/http/modules/ngx_http_access_module.c
Sorry, we could not display the entire diff because too many files (343) changed.
5,123 CHANGES
5,123 additions, 0 deletions not shown
5,211 CHANGES.ru
5,211 additions, 0 deletions not shown
24 LICENSE
... ... @@ -0,0 +1,24 @@
  1 +/*
  2 + * Copyright (C) 2002-2010 Igor Sysoev
  3 + *
  4 + * Redistribution and use in source and binary forms, with or without
  5 + * modification, are permitted provided that the following conditions
  6 + * are met:
  7 + * 1. Redistributions of source code must retain the above copyright
  8 + * notice, this list of conditions and the following disclaimer.
  9 + * 2. Redistributions in binary form must reproduce the above copyright
  10 + * notice, this list of conditions and the following disclaimer in the
  11 + * documentation and/or other materials provided with the distribution.
  12 + *
  13 + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  14 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  15 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  16 + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
  17 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  18 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  19 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  20 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  21 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  22 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23 + * SUCH DAMAGE.
  24 + */
4 README
... ... @@ -0,0 +1,4 @@
  1 +
  2 +The Russian documentation is available at http://sysoev.ru/nginx/
  3 +The English documentation is available at http://nginx.net
  4 +
14 auto/cc/acc
... ... @@ -0,0 +1,14 @@
  1 +
  2 +# Copyright (C) Igor Sysoev
  3 +
  4 +
  5 +# aCC: HP ANSI C++ B3910B A.03.55.02
  6 +
  7 +# C89 mode
  8 +
  9 +CFLAGS="$CFLAGS -Ae"
  10 +CC_TEST_FLAGS="-Ae"
  11 +
  12 +PCRE_OPT="$PCRE_OPT -Ae"
  13 +ZLIB_OPT="$ZLIB_OPT -Ae"
  14 +MD5_OPT="$MD5_OPT -Ae"
71 auto/cc/bcc
... ... @@ -0,0 +1,71 @@
  1 +
  2 +# Copyright (C) Igor Sysoev
  3 +
  4 +
  5 +# Borland C++ 5.5
  6 +
  7 +# optimizations
  8 +
  9 +# maximize speed
  10 +CFLAGS="$CFLAGS -O2"
  11 +
  12 +case $CPU in
  13 + pentium)
  14 + # optimize for Pentium and Athlon
  15 + CPU_OPT="-5"
  16 + ;;
  17 +
  18 + pentiumpro)
  19 + # optimize for Pentium Pro, Pentium II and Pentium III
  20 + CPU_OPT="-6"
  21 + ;;
  22 +esac
  23 +
  24 +# __stdcall
  25 +#CPU_OPT="$CPU_OPT -ps"
  26 +# __fastcall
  27 +#CPU_OPT="$CPU_OPT -pr"
  28 +
  29 +CFLAGS="$CFLAGS $CPU_OPT"
  30 +
  31 +# multithreaded
  32 +CFLAGS="$CFLAGS -tWM"
  33 +
  34 +# stop on warning
  35 +CFLAGS="$CFLAGS -w!"
  36 +
  37 +# disable logo
  38 +CFLAGS="$CFLAGS -q"
  39 +
  40 +
  41 +# precompiled headers
  42 +CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.csm"
  43 +NGX_PCH="$NGX_OBJS/ngx_config.csm"
  44 +NGX_BUILD_PCH="-H=$NGX_OBJS/ngx_config.csm"
  45 +NGX_USE_PCH="-Hu -H=$NGX_OBJS/ngx_config.csm"
  46 +
  47 +
  48 +# Win32 GUI mode application
  49 +#LINK="\$(CC) -laa"
  50 +
  51 +
  52 +# the resource file
  53 +NGX_RES="$NGX_OBJS/nginx.res"
  54 +NGX_RCC="brcc32 -fo$NGX_OBJS/nginx.res \$(CORE_INCS) $NGX_WIN32_RC"
  55 +# the pragma allows to link the resource file using bcc32 and
  56 +# to avoid the direct ilink32 calling and the c0w32.obj's WinMain/main problem
  57 +NGX_PRAGMA="#pragma resource \"$NGX_OBJS/nginx.res\""
  58 +
  59 +
  60 +ngx_include_opt="-I"
  61 +ngx_objout="-o"
  62 +ngx_binout="-e"
  63 +ngx_objext="obj"
  64 +ngx_binext=".exe"
  65 +
  66 +ngx_long_start='@&&|
  67 + '
  68 +ngx_long_end='|'
  69 +
  70 +ngx_regex_dirsep='\\'
  71 +ngx_dirsep="\\"
45 auto/cc/ccc
... ... @@ -0,0 +1,45 @@
  1 +
  2 +# Copyright (C) Igor Sysoev
  3 +
  4 +
  5 +# Compaq C V6.5-207
  6 +
  7 +ngx_include_opt="-I"
  8 +
  9 +# warnings
  10 +
  11 +CFLAGS="$CFLAGS -msg_enable level6 -msg_fatal level6"
  12 +
  13 +CFLAGS="$CFLAGS -msg_disable unknownmacro"
  14 +CFLAGS="$CFLAGS -msg_disable unusedincl"
  15 +CFLAGS="$CFLAGS -msg_disable unnecincl"
  16 +CFLAGS="$CFLAGS -msg_disable nestincl"
  17 +CFLAGS="$CFLAGS -msg_disable strctpadding"
  18 +CFLAGS="$CFLAGS -msg_disable ansialiascast"
  19 +CFLAGS="$CFLAGS -msg_disable inlinestoclsmod"
  20 +CFLAGS="$CFLAGS -msg_disable cxxkeyword"
  21 +CFLAGS="$CFLAGS -msg_disable longlongsufx"
  22 +CFLAGS="$CFLAGS -msg_disable valuepres"
  23 +
  24 +# STUB
  25 +CFLAGS="$CFLAGS -msg_disable truncintcast"
  26 +CFLAGS="$CFLAGS -msg_disable trunclongcast"
  27 +
  28 +CFLAGS="$CFLAGS -msg_disable truncintasn"
  29 +CFLAGS="$CFLAGS -msg_disable trunclongint"
  30 +CFLAGS="$CFLAGS -msg_disable intconcastsgn"
  31 +CFLAGS="$CFLAGS -msg_disable intconstsign"
  32 +CFLAGS="$CFLAGS -msg_disable switchlong"
  33 +CFLAGS="$CFLAGS -msg_disable subscrbounds2"
  34 +
  35 +CFLAGS="$CFLAGS -msg_disable hexoctunsign"
  36 +
  37 +CFLAGS="$CFLAGS -msg_disable ignorecallval"
  38 +CFLAGS="$CFLAGS -msg_disable nonstandcast"
  39 +CFLAGS="$CFLAGS -msg_disable embedcomment"
  40 +CFLAGS="$CFLAGS -msg_disable unreachcode"
  41 +CFLAGS="$CFLAGS -msg_disable questcompare2"
  42 +CFLAGS="$CFLAGS -msg_disable unusedtop"
  43 +CFLAGS="$CFLAGS -msg_disable unrefdecl"
  44 +
  45 +CFLAGS="$CFLAGS -msg_disable bitnotint"
188 auto/cc/conf
... ... @@ -0,0 +1,188 @@
  1 +
  2 +# Copyright (C) Igor Sysoev
  3 +
  4 +
  5 +LINK="\$(CC)"
  6 +
  7 +ngx_include_opt="-I "
  8 +ngx_compile_opt="-c"
  9 +ngx_objout="-o "
  10 +ngx_binout="-o "
  11 +ngx_objext="o"
  12 +ngx_binext=
  13 +
  14 +ngx_long_start=
  15 +ngx_long_end=
  16 +
  17 +ngx_regex_dirsep="\/"
  18 +ngx_dirsep='/'
  19 +
  20 +ngx_regex_cont=' \\\
  21 + '
  22 +ngx_cont=' \
  23 + '
  24 +ngx_tab=' \
  25 + '
  26 +ngx_spacer=
  27 +
  28 +ngx_long_regex_cont=$ngx_regex_cont
  29 +ngx_long_cont=$ngx_cont
  30 +
  31 +. auto/cc/name
  32 +
  33 +if test -n "$CFLAGS"; then
  34 +
  35 + CC_TEST_FLAGS="$CFLAGS $NGX_CC_OPT"
  36 +
  37 + case $NGX_CC_NAME in
  38 +
  39 + ccc)
  40 + # Compaq C V6.5-207
  41 +
  42 + ngx_include_opt="-I"
  43 + ;;
  44 +
  45 + esac
  46 +
  47 +else
  48 +
  49 + case $NGX_CC_NAME in
  50 + gcc)
  51 + # gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2
  52 + # 3.0.4, 3.1.1, 3.2.3, 3.3.2, 3.3.3, 3.3.4, 3.4.0, 3.4.2
  53 + # 4.0.0, 4.0.1, 4.1.0
  54 +
  55 + . auto/cc/gcc
  56 + ;;
  57 +
  58 + icc)
  59 + # Intel C++ compiler 7.1, 8.0, 8.1
  60 +
  61 + . auto/cc/icc
  62 + ;;
  63 +
  64 + sunc)
  65 + # Sun C 5.7 Patch 117837-04 2005/05/11
  66 +
  67 + . auto/cc/sunc
  68 + ;;
  69 +
  70 + ccc)
  71 + # Compaq C V6.5-207
  72 +
  73 + . auto/cc/ccc
  74 + ;;
  75 +
  76 + acc)
  77 + # aCC: HP ANSI C++ B3910B A.03.55.02
  78 +
  79 + . auto/cc/acc
  80 + ;;
  81 +
  82 + msvc*)
  83 + # MSVC++ 6.0 SP2, MSVC++ Toolkit 2003
  84 +
  85 + . auto/cc/msvc
  86 + ;;
  87 +
  88 + owc)
  89 + # Open Watcom C 1.0, 1.2
  90 +
  91 + . auto/cc/owc
  92 + ;;
  93 +
  94 + bcc)
  95 + # Borland C++ 5.5
  96 +
  97 + . auto/cc/bcc
  98 + ;;
  99 +
  100 + esac
  101 +
  102 + CC_TEST_FLAGS="$CC_TEST_FLAGS $NGX_CC_OPT"
  103 +
  104 +fi
  105 +
  106 +CFLAGS="$CFLAGS $NGX_CC_OPT"
  107 +NGX_TEST_LD_OPT="$NGX_LD_OPT"
  108 +
  109 +if [ "$NGX_PLATFORM" != win32 ]; then
  110 +
  111 + if test -n "$NGX_LD_OPT"; then
  112 + ngx_feature=--with-ld-opt=\"$NGX_LD_OPT\"
  113 + ngx_feature_name=
  114 + ngx_feature_run=no
  115 + ngx_feature_incs=
  116 + ngx_feature_path=
  117 + ngx_feature_libs=
  118 + ngx_feature_test=
  119 + . auto/feature
  120 +
  121 + if [ $ngx_found = no ]; then
  122 + echo $0: error: the invalid value in --with-ld-opt=\"$NGX_LD_OPT\"
  123 + echo
  124 + exit 1
  125 + fi
  126 + fi
  127 +
  128 +
  129 + ngx_feature="gcc builtin atomic operations"
  130 + ngx_feature_name=NGX_HAVE_GCC_ATOMIC
  131 + ngx_feature_run=yes
  132 + ngx_feature_incs=
  133 + ngx_feature_path=
  134 + ngx_feature_libs=
  135 + ngx_feature_test="long n = 0;
  136 + if (!__sync_bool_compare_and_swap(&n, 0, 1))
  137 + return 1;
  138 + if (__sync_fetch_and_add(&n, 1) != 1)
  139 + return 1;
  140 + if (n != 2)
  141 + return 1;
  142 + __sync_synchronize();"
  143 + . auto/feature
  144 +
  145 +
  146 + if [ "$NGX_CC_NAME" = "ccc" ]; then
  147 + echo "checking for C99 variadic macros ... disabled"
  148 + else
  149 + ngx_feature="C99 variadic macros"
  150 + ngx_feature_name="NGX_HAVE_C99_VARIADIC_MACROS"
  151 + ngx_feature_run=yes
  152 + ngx_feature_incs="#include <stdio.h>
  153 +#define var(dummy, ...) sprintf(__VA_ARGS__)"
  154 + ngx_feature_path=
  155 + ngx_feature_libs=
  156 + ngx_feature_test="char buf[30]; buf[0] = '0';
  157 + var(0, buf, \"%d\", 1);
  158 + if (buf[0] != '1') return 1"
  159 + . auto/feature
  160 + fi
  161 +
  162 +
  163 + ngx_feature="gcc variadic macros"
  164 + ngx_feature_name="NGX_HAVE_GCC_VARIADIC_MACROS"
  165 + ngx_feature_run=yes
  166 + ngx_feature_incs="#include <stdio.h>
  167 +#define var(dummy, args...) sprintf(args)"
  168 + ngx_feature_path=
  169 + ngx_feature_libs=
  170 + ngx_feature_test="char buf[30]; buf[0] = '0';
  171 + var(0, buf, \"%d\", 1);
  172 + if (buf[0] != '1') return 1"
  173 + . auto/feature
  174 +
  175 +
  176 +# ngx_feature="inline"
  177 +# ngx_feature_name=
  178 +# ngx_feature_run=no
  179 +# ngx_feature_incs="int inline f(void) { return 1 }"
  180 +# ngx_feature_path=
  181 +# ngx_feature_libs=
  182 +# ngx_feature_test=
  183 +# . auto/feature
  184 +#
  185 +# if [ $ngx_found = yes ]; then
  186 +# fi
  187 +
  188 +fi
182 auto/cc/gcc
... ... @@ -0,0 +1,182 @@
  1 +
  2 +# Copyright (C) Igor Sysoev
  3 +
  4 +
  5 +# gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2
  6 +# 3.0.4, 3.1.1, 3.2.3, 3.3.2, 3.3.3, 3.3.4, 3.4.0, 3.4.2
  7 +# 4.0.0, 4.0.1, 4.1.0
  8 +
  9 +
  10 +NGX_GCC_VER=`$CC -v 2>&1 | grep 'gcc version' 2>&1 \
  11 + | sed -e 's/^.* version \(.*\)/\1/'`
  12 +
  13 +echo " + gcc version: $NGX_GCC_VER"
  14 +
  15 +have=NGX_COMPILER value="\"gcc $NGX_GCC_VER\"" . auto/define
  16 +
  17 +
  18 +# Solaris 7's /usr/ccs/bin/as does not support "-pipe"
  19 +
  20 +CC_TEST_FLAGS="-pipe"
  21 +
  22 +ngx_feature="gcc -pipe switch"
  23 +ngx_feature_name=
  24 +ngx_feature_run=no
  25 +ngx_feature_incs=
  26 +ngx_feature_path=
  27 +ngx_feature_libs=
  28 +ngx_feature_test=
  29 +. auto/feature
  30 +
  31 +CC_TEST_FLAGS=
  32 +
  33 +if [ $ngx_found = yes ]; then
  34 + PIPE="-pipe"
  35 +fi
  36 +
  37 +
  38 +case "$NGX_MACHINE" in
  39 +
  40 + sun4u | sun4v | sparc | sparc64 )
  41 + # "-mcpu=v9" enables the "casa" assembler instruction
  42 + CFLAGS="$CFLAGS -mcpu=v9"
  43 + ;;
  44 +
  45 +esac
  46 +
  47 +
  48 +# optimizations
  49 +
  50 +#NGX_GCC_OPT="-O2"
  51 +#NGX_GCC_OPT="-Os"
  52 +NGX_GCC_OPT="-O"
  53 +
  54 +#CFLAGS="$CFLAGS -fomit-frame-pointer"
  55 +
  56 +case $CPU in
  57 + pentium)
  58 + # optimize for Pentium and Athlon
  59 + CPU_OPT="-march=pentium"
  60 + NGX_CPU_CACHE_LINE=32
  61 + ;;
  62 +
  63 + pentiumpro | pentium3)
  64 + # optimize for Pentium Pro, Pentium II and Pentium III
  65 + CPU_OPT="-march=pentiumpro"
  66 + NGX_CPU_CACHE_LINE=32
  67 + ;;
  68 +
  69 + pentium4)
  70 + # optimize for Pentium 4, gcc 3.x
  71 + CPU_OPT="-march=pentium4"
  72 + NGX_CPU_CACHE_LINE=128
  73 + ;;
  74 +
  75 + athlon)
  76 + # optimize for Athlon, gcc 3.x
  77 + CPU_OPT="-march=athlon"
  78 + NGX_CPU_CACHE_LINE=64
  79 + ;;
  80 +
  81 + opteron)
  82 + # optimize for Opteron, gcc 3.x
  83 + CPU_OPT="-march=opteron"
  84 + NGX_CPU_CACHE_LINE=64
  85 + ;;
  86 +
  87 + sparc32)
  88 + # build 32-bit UltraSparc binary
  89 + CPU_OPT="-m32"
  90 + CORE_LINK="$CORE_LINK -m32"
  91 + NGX_CPU_CACHE_LINE=64
  92 + ;;
  93 +
  94 + sparc64)
  95 + # build 64-bit UltraSparc binary
  96 + CPU_OPT="-m64"
  97 + CORE_LINK="$CORE_LINK -m64"
  98 + NGX_CPU_CACHE_LINE=64
  99 + ;;
  100 +
  101 + ppc64)
  102 + # build 64-bit PowerPC binary
  103 + CPU_OPT="-m64"
  104 + CPU_OPT="$CPU_OPT -falign-functions=32 -falign-labels=32"
  105 + CPU_OPT="$CPU_OPT -falign-loops=32 -falign-jumps=32"
  106 + CORE_LINK="$CORE_LINK -m64"
  107 + NGX_CPU_CACHE_LINE=128
  108 + ;;
  109 +
  110 +esac
  111 +
  112 +CC_AUX_FLAGS="$CC_AUX_FLAGS $CPU_OPT"
  113 +
  114 +case "$NGX_GCC_VER" in
  115 + 2.7*)
  116 + # batch build
  117 + CPU_OPT=
  118 + ;;
  119 +esac
  120 +
  121 +
  122 +CFLAGS="$CFLAGS $PIPE $CPU_OPT"
  123 +
  124 +if [ ".$PCRE_OPT" = "." ]; then
  125 + PCRE_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
  126 +else
  127 + PCRE_OPT="$PCRE_OPT $PIPE"
  128 +fi
  129 +
  130 +if [ ".$MD5_OPT" = "." ]; then
  131 + MD5_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
  132 +else
  133 + MD5_OPT="$MD5_OPT $PIPE"
  134 +fi
  135 +
  136 +if [ ".$ZLIB_OPT" = "." ]; then
  137 + ZLIB_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
  138 +else
  139 + ZLIB_OPT="$ZLIB_OPT $PIPE"
  140 +fi
  141 +
  142 +
  143 +# warnings
  144 +
  145 +# -W requires at least -O
  146 +CFLAGS="$CFLAGS ${NGX_GCC_OPT:--O} -W"
  147 +
  148 +CFLAGS="$CFLAGS -Wall -Wpointer-arith"
  149 +#CFLAGS="$CFLAGS -Wconversion"
  150 +#CFLAGS="$CFLAGS -Winline"
  151 +
  152 +
  153 +case "$NGX_GCC_VER" in
  154 + 3.* | 4.* )
  155 + # we have a lot of the unused function arguments
  156 + CFLAGS="$CFLAGS -Wno-unused-parameter"
  157 + CFLAGS="$CFLAGS -Wunused-function"
  158 + CFLAGS="$CFLAGS -Wunused-variable"
  159 + CFLAGS="$CFLAGS -Wunused-value"
  160 + # 4.2.1 shows the warning in wrong places
  161 + #CFLAGS="$CFLAGS -Wunreachable-code"
  162 + ;;
  163 +
  164 + *)
  165 + # we have a lot of the unused function arguments
  166 + CFLAGS="$CFLAGS -Wno-unused"
  167 + ;;
  168 +esac
  169 +
  170 +
  171 +# stop on warning
  172 +CFLAGS="$CFLAGS -Werror"
  173 +
  174 +# debug
  175 +CFLAGS="$CFLAGS -g"
  176 +
  177 +# DragonFly's gcc3 generates DWARF
  178 +#CFLAGS="$CFLAGS -g -gstabs"
  179 +
  180 +if [ ".$CPP" = "." ]; then
  181 + CPP="$CC -E"
  182 +fi
145 auto/cc/icc
... ... @@ -0,0 +1,145 @@
  1 +
  2 +# Copyright (C) Igor Sysoev
  3 +
  4 +
  5 +# Intel C++ compiler 7.1, 8.0, 8.1, 9.0
  6 +
  7 +NGX_ICC_VER=`$CC -V 2>&1 | grep 'Version' 2>&1 \
  8 + | sed -e 's/^.* Version \([^ ]*\) *Build.*$/\1/'`
  9 +
  10 +echo " + icc version: $NGX_ICC_VER"
  11 +
  12 +have=NGX_COMPILER value="\"Intel C Compiler $NGX_ICC_VER\"" . auto/define
  13 +
  14 +
  15 +# optimizations
  16 +
  17 +CFLAGS="$CFLAGS -O"
  18 +# inline the functions declared with __inline
  19 +#CFLAGS="$CFLAGS -Ob1"
  20 +# inline any function, at the compiler's discretion
  21 +CFLAGS="$CFLAGS -Ob2"
  22 +
  23 +# multi-file IP optimizations
  24 +case "$NGX_ICC_VER" in
  25 + 9.*)
  26 + IPO="-ipo"
  27 + ;;
  28 +
  29 + # 8.1.38 under FreeBSD can not link -ipo
  30 + 8.1)
  31 + IPO="-ip"
  32 + ;;
  33 +
  34 + *)
  35 + IPO="-ipo -ipo_obj"
  36 + ;;
  37 +esac
  38 +
  39 +# single-file IP optimizations
  40 +#IPO="-ip"
  41 +
  42 +CFLAGS="$CFLAGS $IPO"
  43 +CORE_LINK="$CORE_LINK $IPO"
  44 +CORE_LINK="$CORE_LINK -opt_report_file=$NGX_OBJS/opt_report_file"
  45 +
  46 +
  47 +case $CPU in
  48 + pentium)
  49 + # optimize for Pentium and Athlon
  50 + CPU_OPT="-march=pentium"
  51 + ;;
  52 +
  53 + pentiumpro)
  54 + # optimize for Pentium Pro, Pentium II and Pentium III
  55 + CPU_OPT="-mcpu=pentiumpro -march=pentiumpro"
  56 + ;;
  57 +
  58 + pentium4)
  59 + # optimize for Pentium 4, default
  60 + CPU_OPT="-march=pentium4"
  61 + ;;
  62 +esac
  63 +
  64 +CFLAGS="$CFLAGS $CPU_OPT"
  65 +
  66 +if [ ".$PCRE_OPT" = "." ]; then
  67 + PCRE_OPT="-O $IPO $CPU_OPT"
  68 +fi
  69 +
  70 +if [ ".$MD5_OPT" = "." ]; then
  71 + MD5_OPT="-O $IPO $CPU_OPT"
  72 +fi
  73 +
  74 +if [ ".$ZLIB_OPT" = "." ]; then
  75 + ZLIB_OPT="-O $IPO $CPU_OPT"
  76 +fi
  77 +
  78 +
  79 +# warnings
  80 +
  81 +CFLAGS="$CFLAGS -w2"
  82 +
  83 +# disable some warnings
  84 +
  85 +# invalid type conversion: "int" to "char *"
  86 +CFLAGS="$CFLAGS -wd171"
  87 +# argument is incompatible with corresponding format string conversion
  88 +CFLAGS="$CFLAGS -wd181"
  89 +# zero used for undefined preprocessing identifier
  90 +CFLAGS="$CFLAGS -wd193"
  91 +# the format string ends before this argument
  92 +CFLAGS="$CFLAGS -wd268"
  93 +# invalid format string conversion
  94 +CFLAGS="$CFLAGS -wd269"
  95 +# conversion from "long long" to "size_t" may lose significant bits
  96 +CFLAGS="$CFLAGS -wd810"
  97 +# parameter was never referenced
  98 +CFLAGS="$CFLAGS -wd869"
  99 +# attribute "unused" is only allowed in a function definition, warning on pTHX_
  100 +CFLAGS="$CFLAGS -wd1301"
  101 +
  102 +# STUB
  103 +# enumerated type mixed with another type
  104 +CFLAGS="$CFLAGS -wd188"
  105 +# controlling expression is constant
  106 +CFLAGS="$CFLAGS -wd279"
  107 +# operands are evaluated in unspecified order
  108 +CFLAGS="$CFLAGS -wd981"
  109 +# external definition with no prior declaration
  110 +CFLAGS="$CFLAGS -wd1418"
  111 +# external declaration in primary source file
  112 +CFLAGS="$CFLAGS -wd1419"
  113 +
  114 +case "$NGX_ICC_VER" in
  115 + 9.*)
  116 + # "cc" clobber ignored, warnings for Liunx's htonl()/htons()
  117 + CFLAGS="$CFLAGS -wd1469"
  118 + # explicit conversion of a 64-bit integral type to a smaller
  119 + # integral type
  120 + CFLAGS="$CFLAGS -wd1683"
  121 + # conversion from pointer to same-sized integral type,
  122 + # warning on offsetof()
  123 + CFLAGS="$CFLAGS -wd1684"
  124 + # floating-point equality and inequality comparisons are unreliable,
  125 + # warning on SvTRUE()
  126 + CFLAGS="$CFLAGS -wd1572"
  127 + ;;
  128 +
  129 + 8.*)
  130 + # "cc" clobber ignored, warnings for Liunx's htonl()/htons()
  131 + CFLAGS="$CFLAGS -wd1469"
  132 + # floating-point equality and inequality comparisons are unreliable,
  133 + # warning on SvTRUE()
  134 + CFLAGS="$CFLAGS -wd1572"
  135 + ;;
  136 +
  137 + *)
  138 + ;;
  139 +esac
  140 +
  141 +# stop on warning
  142 +CFLAGS="$CFLAGS -Werror"
  143 +
  144 +# debug
  145 +CFLAGS="$CFLAGS -g"
137 auto/cc/msvc
... ... @@ -0,0 +1,137 @@
  1 +
  2 +# Copyright (C) Igor Sysoev
  3 +
  4 +
  5 +# MSVC 6.0 SP2
  6 +# MSVC Toolkit 2003 (7.1)
  7 +# MSVC 2005 Express Edition SP1 (8.0)
  8 +
  9 +# optimizations
  10 +
  11 +# maximize speed, equivalent to -Og -Oi -Ot -Oy -Ob2 -Gs -GF -Gy
  12 +CFLAGS="$CFLAGS -O2"
  13 +
  14 +# enable global optimization
  15 +#CFLAGS="$CFLAGS -Og"
  16 +# enable intrinsic functions
  17 +#CFLAGS="$CFLAGS -Oi"
  18 +
  19 +# disable inline expansion
  20 +#CFLAGS="$CFLAGS -Ob0"
  21 +# explicit inline expansion
  22 +#CFLAGS="$CFLAGS -Ob1"
  23 +# explicit and implicit inline expansion
  24 +#CFLAGS="$CFLAGS -Ob2"
  25 +
  26 +# enable frame pointer omission
  27 +#CFLAGS="$CFLAGS -Oy"
  28 +# disable stack checking calls
  29 +#CFLAGS="$CFLAGS -Gs"
  30 +
  31 +# pools strings as read/write
  32 +#CFLAGS="$CFLAGS -Gf"
  33 +# pools strings as read-only
  34 +#CFLAGS="$CFLAGS -GF"
  35 +
  36 +
  37 +case $CPU in
  38 + pentium)
  39 + # optimize for Pentium and Athlon
  40 + CPU_OPT="-G5"
  41 + ;;
  42 +
  43 + pentiumpro)
  44 + # optimize for Pentium Pro, Pentium II and Pentium III
  45 + CPU_OPT="-G6"
  46 + ;;
  47 +
  48 + pentium4)
  49 + # optimize for Pentium 4, MSVC 7
  50 + CPU_OPT="-G7"
  51 + ;;
  52 +esac
  53 +
  54 +# __cdecl, default, must be used with OpenSSL, md5 asm, and sha1 asm
  55 +#CPU_OPT="$CPU_OPT -Gd"
  56 +# __stdcall
  57 +#CPU_OPT="$CPU_OPT -Gz"
  58 +# __fastcall
  59 +#CPU_OPT="$CPU_OPT -Gr"
  60 +
  61 +
  62 +CFLAGS="$CFLAGS $CPU_OPT"
  63 +
  64 +
  65 +# warnings
  66 +
  67 +CFLAGS="$CFLAGS -W4"
  68 +
  69 +# stop on warning
  70 +CFLAGS="$CFLAGS -WX"
  71 +
  72 +# disable logo
  73 +CFLAGS="$CFLAGS -nologo"
  74 +
  75 +
  76 +LINK="\$(CC)"
  77 +
  78 +# the link flags
  79 +CORE_LINK="$CORE_LINK -link -verbose:lib"
  80 +
  81 +# link with libcmt.lib, multithreaded
  82 +LIBC="-MT"
  83 +# link with msvcrt.dll
  84 +# however, MSVC Toolkit 2003 has no MSVCRT.LIB
  85 +#LIBC="-MD"
  86 +
  87 +CFLAGS="$CFLAGS $LIBC"
  88 +
  89 +CORE_LIBS="$CORE_LIBS kernel32.lib user32.lib"
  90 +
  91 +# Win32 GUI mode application
  92 +#CORE_LINK="$CORE_LINK -subsystem:windows -entry:mainCRTStartup"
  93 +
  94 +# debug
  95 +# msvc8 under Wine issues
  96 +# Program database manager mismatch; please check your installation
  97 +if [ $NGX_CC_NAME != msvc8 ]; then
  98 + CFLAGS="$CFLAGS -Zi"
  99 + CORE_LINK="$CORE_LINK -debug"
  100 +fi
  101 +
  102 +
  103 +# MSVC 2005 supports C99 variadic macros
  104 +if [ $NGX_CC_NAME = msvc8 ]; then
  105 + have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have
  106 +fi
  107 +
  108 +
  109 +# precompiled headers
  110 +CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch"
  111 +NGX_PCH="$NGX_OBJS/ngx_config.pch"
  112 +NGX_BUILD_PCH="-Ycngx_config.h -Fp$NGX_OBJS/ngx_config.pch"
  113 +NGX_USE_PCH="-Yungx_config.h -Fp$NGX_OBJS/ngx_config.pch"
  114 +
  115 +
  116 +# the resource file
  117 +NGX_RES="$NGX_OBJS/nginx.res"
  118 +NGX_RCC="rc -fo$NGX_RES \$(CORE_INCS) $NGX_WIN32_RC"
  119 +CORE_LINK="$NGX_RES $CORE_LINK"
  120 +
  121 +
  122 +ngx_objout="-Fo"
  123 +ngx_binout="-Fe"
  124 +ngx_objext="obj"
  125 +ngx_binext=".exe"
  126 +
  127 +ngx_long_start='@<<
  128 + '
  129 +ngx_long_end='<<'
  130 +ngx_long_regex_cont=' \
  131 + '
  132 +ngx_long_cont='
  133 + '
  134 +
  135 +# MSVC understand / in path
  136 +#ngx_regex_dirsep='\\'
  137 +#ngx_dirsep="\\"
92 auto/cc/name
... ... @@ -0,0 +1,92 @@
  1 +
  2 +# Copyright (C) Igor Sysoev
  3 +
  4 +
  5 +if [ "$NGX_PLATFORM" != win32 ]; then
  6 +
  7 + ngx_feature="C compiler"
  8 + ngx_feature_name=
  9 + ngx_feature_run=yes
  10 + ngx_feature_incs=
  11 + ngx_feature_path=
  12 + ngx_feature_libs=
  13 + ngx_feature_test=
  14 + . auto/feature
  15 +
  16 + if [ $ngx_found = no ]; then
  17 + echo
  18 + echo $0: error: C compiler $CC is not found
  19 + echo
  20 + exit 1
  21 + fi
  22 +
  23 +fi
  24 +
  25 +
  26 +if [ "$CC" = cl ]; then
  27 + if `$NGX_WINE $CC -v 2>&1 \
  28 + | grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14' \
  29 + >/dev/null 2>&1`; then
  30 +
  31 + NGX_CC_NAME=msvc8
  32 + echo " + using Microsoft Visual C++ 8 compiler"
  33 +
  34 + else if `$NGX_WINE $CC -v 2>&1 \
  35 + | grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13' \
  36 + >/dev/null 2>&1`; then
  37 +
  38 + NGX_CC_NAME=msvc7
  39 + echo " + using Microsoft Visual C++ 7 compiler"
  40 +
  41 + else
  42 + NGX_CC_NAME=msvc
  43 + echo " + using Microsoft Visual C++ compiler"
  44 + fi
  45 + fi
  46 +
  47 +else
  48 +if [ "$CC" = wcl386 ]; then
  49 + NGX_CC_NAME=owc
  50 + echo " + using Open Watcom C compiler"
  51 +
  52 +else
  53 +if [ "$CC" = bcc32 ]; then
  54 + NGX_CC_NAME=bcc
  55 + echo " + using Borland C++ compiler"
  56 +
  57 +else
  58 +if `$CC -v 2>&1 | grep 'gcc version' >/dev/null 2>&1`; then
  59 + NGX_CC_NAME=gcc
  60 + echo " + using GNU C compiler"
  61 +
  62 +else
  63 +if `$CC -V 2>&1 | grep '^Intel(R) C' >/dev/null 2>&1`; then
  64 + NGX_CC_NAME=icc
  65 + echo " + using Intel C++ compiler"
  66 +
  67 +else
  68 +if `$CC -V 2>&1 | grep 'Sun C' >/dev/null 2>&1`; then
  69 + NGX_CC_NAME=sunc
  70 + echo " + using Sun C compiler"
  71 +
  72 +else
  73 +if `$CC -V 2>&1 | grep '^Compaq C' >/dev/null 2>&1`; then
  74 + NGX_CC_NAME=ccc
  75 + echo " + using Compaq C compiler"
  76 +
  77 +else
  78 +if `$CC -V 2>&1 | grep '^aCC: ' >/dev/null 2>&1`; then
  79 + NGX_CC_NAME=acc
  80 + echo " + using HP aC++ compiler"
  81 +
  82 +else
  83 + NGX_CC_NAME=unknown
  84 +
  85 +fi # acc
  86 +fi # ccc
  87 +fi # sunc
  88 +fi # icc
  89 +fi # gcc
  90 +fi # bcc
  91 +fi # owc
  92 +fi # msvc
103 auto/cc/owc
... ... @@ -0,0 +1,103 @@
  1 +
  2 +# Copyright (C) Igor Sysoev
  3 +
  4 +
  5 +# Open Watcom C 1.0, 1.2, 1.3
  6 +
  7 +# optimizations
  8 +
  9 +# maximize speed
  10 +CFLAGS="$CFLAGS -ot"
  11 +# reorder instructions for best pipeline usage
  12 +CFLAGS="$CFLAGS -op"
  13 +# inline intrinsic functions
  14 +CFLAGS="$CFLAGS -oi"
  15 +# inline expansion
  16 +CFLAGS="$CFLAGS -oe"
  17 +# disable stack checking calls
  18 +CFLAGS="$CFLAGS -s"
  19 +
  20 +case $CPU in
  21 + pentium)
  22 + # optimize for Pentium and Athlon
  23 + # register-based arguments passing conventions
  24 + CPU_OPT="-5r"
  25 + # stack-based arguments passing conventions
  26 + #CPU_OPT="-5s"
  27 + ;;
  28 +
  29 + pentiumpro)
  30 + # optimize for Pentium Pro, Pentium II and Pentium III
  31 + # register-based arguments passing conventions
  32 + CPU_OPT="-6r"
  33 + # stack-based arguments passing conventions
  34 + #CPU_OPT="-6s"
  35 + ;;
  36 +esac
  37 +
  38 +CFLAGS="$CFLAGS $CPU_OPT"
  39 +
  40 +
  41 +# warnings
  42 +
  43 +# maximum level
  44 +CFLAGS="$CFLAGS -wx"
  45 +#CFLAGS="$CFLAGS -w3"
  46 +
  47 +# stop on warning
  48 +CFLAGS="$CFLAGS -we"
  49 +
  50 +# built target is NT
  51 +CFLAGS="$CFLAGS -bt=nt"
  52 +
  53 +# multithreaded
  54 +CFLAGS="$CFLAGS -bm"
  55 +
  56 +# debug
  57 +CFLAGS="$CFLAGS -d2"
  58 +
  59 +# quiet
  60 +CFLAGS="$CFLAGS -zq"
  61 +
  62 +# Open Watcom C 1.2
  63 +have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have
  64 +
  65 +
  66 +# the precompiled headers
  67 +CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch"
  68 +NGX_PCH="$NGX_OBJS/ngx_config.pch"
  69 +NGX_BUILD_PCH="-fhq=$NGX_OBJS/ngx_config.pch"
  70 +NGX_USE_PCH="-fh=$NGX_OBJS/ngx_config.pch"
  71 +
  72 +
  73 +# the link flags, built target is NT GUI mode application
  74 +#CORE_LINK="$CORE_LINK -l=nt_win"
  75 +
  76 +
  77 +# the resource file
  78 +NGX_RCC="wrc \$(CORE_INCS) -fo=$NGX_OBJS/nginx.res "
  79 +NGX_RCC="$NGX_RCC $NGX_WIN32_RC $NGX_OBJS/nginx.exe"
  80 +
  81 +
  82 +ngx_include_opt="-i="
  83 +ngx_objout="-fo"
  84 +ngx_binout="-fe="
  85 +ngx_objext="obj"
  86 +ngx_binext=".exe"
  87 +
  88 +ngx_regex_dirsep='\\'
  89 +ngx_dirsep="\\"
  90 +
  91 +ngx_long_start=' '
  92 +ngx_long_end=' '
  93 +ngx_long_regex_cont=' \&\
  94 + '
  95 +ngx_long_cont=' &
  96 + '
  97 +
  98 +ngx_regex_cont=' \&\
  99 + '
  100 +ngx_cont=' &
  101 + '
  102 +ngx_tab=' &
  103 + '
145 auto/cc/sunc
... ... @@ -0,0 +1,145 @@
  1 +
  2 +# Copyright (C) Igor Sysoev
  3 +
  4 +
  5 +# Sun C 5.7 Patch 117837-04 2005/05/11 Sun Studio 10
  6 +# Sun C 5.8 2005/10/13 Sun Studio 11
  7 +# Sun C 5.9 SunOS_i386 2007/05/03 Sun Studio 12
  8 +# Sun C 5.9 SunOS_sparc 2007/05/03
  9 +
  10 +NGX_SUNC_VER=`$CC -V 2>&1 | grep 'Sun C' 2>&1 \
  11 + | sed -e 's/^.* Sun C \(.*\)/\1/'`
  12 +
  13 +echo " + Sun C version: $NGX_SUNC_VER"
  14 +
  15 +have=NGX_COMPILER value="\"Sun C $NGX_SUNC_VER\"" . auto/define
  16 +
  17 +
  18 +cat << END > $NGX_AUTOTEST.c
  19 +
  20 +int main() { printf("%d", __SUNPRO_C); }
  21 +
  22 +END
  23 +
  24 +eval "$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c >> $NGX_ERR 2>&1"
  25 +
  26 +if [ -x $NGX_AUTOTEST ]; then
  27 + ngx_sunc_ver=`$NGX_AUTOTEST`
  28 +fi
  29 +
  30 +rm $NGX_AUTOTEST*
  31 +
  32 +# 1424 == 0x590, Sun Studio 12
  33 +
  34 +if [ "$ngx_sunc_ver" -ge 1424 ]; then
  35 + ngx_sparc32="-m32"
  36 + ngx_sparc64="-m64"
  37 + ngx_amd64="-m64"
  38 +
  39 +else
  40 + ngx_sparc32="-xarch=v8plus"
  41 + ngx_sparc64="-xarch=v9"
  42 + ngx_amd64="-xarch=amd64"
  43 +fi
  44 +
  45 +case "$NGX_MACHINE" in
  46 +
  47 + i86pc)
  48 + NGX_AUX=" src/os/unix/ngx_sunpro_x86.il"
  49 + ;;
  50 +
  51 + sun4u | sun4v)
  52 + NGX_AUX=" src/os/unix/ngx_sunpro_sparc64.il"
  53 + ;;
  54 +
  55 +esac
  56 +
  57 +
  58 +# optimizations
  59 +
  60 +IPO=-xipo
  61 +CFLAGS="$CFLAGS -fast $IPO"
  62 +CORE_LINK="$CORE_LINK -fast $IPO"
  63 +
  64 +
  65 +case $CPU in
  66 + pentium)
  67 + # optimize for Pentium and Athlon
  68 + CPU_OPT="-xchip=pentium"
  69 + ;;
  70 +
  71 + pentiumpro)
  72 + # optimize for Pentium Pro, Pentium II
  73 + CPU_OPT="-xchip=pentium_pro"
  74 + ;;
  75 +
  76 + pentium3)
  77 + # optimize for Pentium III
  78 + CPU_OPT="-xchip=pentium3"
  79 + #CPU_OPT="$CPU_OPT -xarch=sse"
  80 + CPU_OPT="$CPU_OPT -xcache=16/32/4:256/32/4"
  81 + ;;
  82 +
  83 + pentium4)
  84 + # optimize for Pentium 4
  85 + CPU_OPT="-xchip=pentium4"
  86 + #CPU_OPT="$CPU_OPT -xarch=sse2"
  87 + CPU_OPT="$CPU_OPT -xcache=8/64/4:256/128/8"
  88 + ;;
  89 +
  90 + opteron)
  91 + # optimize for Opteron
  92 + CPU_OPT="-xchip=opteron"
  93 + #CPU_OPT="$CPU_OPT -xarch=sse2"
  94 + CPU_OPT="$CPU_OPT -xcache=64/64/2:1024/64/16"
  95 + ;;
  96 +
  97 + sparc32)
  98 + # build 32-bit UltraSparc binary
  99 + CPU_OPT="$ngx_sparc32"
  100 + CORE_LINK="$CORE_LINK $ngx_sparc32"
  101 + CC_AUX_FLAGS="$CC_AUX_FLAGS $ngx_sparc32"
  102 + NGX_CPU_CACHE_LINE=64
  103 + ;;
  104 +
  105 + sparc64)
  106 + # build 64-bit UltraSparc binary
  107 + CPU_OPT="$ngx_sparc64"
  108 + CORE_LINK="$CORE_LINK $ngx_sparc64"
  109 + CC_AUX_FLAGS="$CC_AUX_FLAGS $ngx_sparc64"
  110 + NGX_CPU_CACHE_LINE=64
  111 + ;;
  112 +