conf 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. # Copyright (C) Igor Sysoev
  2. # Copyright (C) Nginx, Inc.
  3. LINK="\$(CC)"
  4. MAIN_LINK=
  5. MODULE_LINK="-shared"
  6. ngx_include_opt="-I "
  7. ngx_compile_opt="-c"
  8. ngx_pic_opt="-fPIC"
  9. ngx_objout="-o "
  10. ngx_binout="-o "
  11. ngx_objext="o"
  12. ngx_binext=
  13. ngx_modext=".so"
  14. ngx_long_start=
  15. ngx_long_end=
  16. ngx_regex_dirsep="\/"
  17. ngx_dirsep='/'
  18. ngx_regex_cont=' \\\
  19. '
  20. ngx_cont=' \
  21. '
  22. ngx_tab=' \
  23. '
  24. ngx_spacer=
  25. ngx_long_regex_cont=$ngx_regex_cont
  26. ngx_long_cont=$ngx_cont
  27. . auto/cc/name
  28. if test -n "$CFLAGS"; then
  29. CC_TEST_FLAGS="$CFLAGS $NGX_CC_OPT"
  30. case $NGX_CC_NAME in
  31. ccc)
  32. # Compaq C V6.5-207
  33. ngx_include_opt="-I"
  34. ;;
  35. sunc)
  36. MAIN_LINK=
  37. MODULE_LINK="-G"
  38. case "$NGX_MACHINE" in
  39. i86pc)
  40. NGX_AUX=" src/os/unix/ngx_sunpro_x86.il"
  41. ;;
  42. sun4u | sun4v)
  43. NGX_AUX=" src/os/unix/ngx_sunpro_sparc64.il"
  44. ;;
  45. esac
  46. case $CPU in
  47. amd64)
  48. NGX_AUX=" src/os/unix/ngx_sunpro_amd64.il"
  49. ;;
  50. esac
  51. ;;
  52. esac
  53. else
  54. case $NGX_CC_NAME in
  55. gcc)
  56. # gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2
  57. # 3.0.4, 3.1.1, 3.2.3, 3.3.2, 3.3.3, 3.3.4, 3.4.0, 3.4.2
  58. # 4.0.0, 4.0.1, 4.1.0
  59. . auto/cc/gcc
  60. ;;
  61. clang)
  62. # Clang C compiler
  63. . auto/cc/clang
  64. ;;
  65. icc)
  66. # Intel C++ compiler 7.1, 8.0, 8.1
  67. . auto/cc/icc
  68. ;;
  69. sunc)
  70. # Sun C 5.7 Patch 117837-04 2005/05/11
  71. . auto/cc/sunc
  72. ;;
  73. ccc)
  74. # Compaq C V6.5-207
  75. . auto/cc/ccc
  76. ;;
  77. acc)
  78. # aCC: HP ANSI C++ B3910B A.03.55.02
  79. . auto/cc/acc
  80. ;;
  81. msvc*)
  82. # MSVC++ 6.0 SP2, MSVC++ Toolkit 2003
  83. . auto/cc/msvc
  84. ;;
  85. owc)
  86. # Open Watcom C 1.0, 1.2
  87. . auto/cc/owc
  88. ;;
  89. bcc)
  90. # Borland C++ 5.5
  91. . auto/cc/bcc
  92. ;;
  93. esac
  94. CC_TEST_FLAGS="$CC_TEST_FLAGS $NGX_CC_OPT"
  95. fi
  96. CFLAGS="$CFLAGS $NGX_CC_OPT"
  97. NGX_TEST_LD_OPT="$NGX_LD_OPT"
  98. if [ "$NGX_PLATFORM" != win32 ]; then
  99. if test -n "$NGX_LD_OPT"; then
  100. ngx_feature=--with-ld-opt=\"$NGX_LD_OPT\"
  101. ngx_feature_name=
  102. ngx_feature_run=no
  103. ngx_feature_incs=
  104. ngx_feature_path=
  105. ngx_feature_libs=
  106. ngx_feature_test=
  107. . auto/feature
  108. if [ $ngx_found = no ]; then
  109. echo $0: error: the invalid value in --with-ld-opt=\"$NGX_LD_OPT\"
  110. echo
  111. exit 1
  112. fi
  113. fi
  114. ngx_feature="-Wl,-E switch"
  115. ngx_feature_name=
  116. ngx_feature_run=no
  117. ngx_feature_incs=
  118. ngx_feature_path=
  119. ngx_feature_libs=-Wl,-E
  120. ngx_feature_test=
  121. . auto/feature
  122. if [ $ngx_found = yes ]; then
  123. MAIN_LINK="-Wl,-E"
  124. fi
  125. if [ "$NGX_CC_NAME" = "sunc" ]; then
  126. echo "checking for gcc builtin atomic operations ... disabled"
  127. else
  128. ngx_feature="gcc builtin atomic operations"
  129. ngx_feature_name=NGX_HAVE_GCC_ATOMIC
  130. ngx_feature_run=yes
  131. ngx_feature_incs=
  132. ngx_feature_path=
  133. ngx_feature_libs=
  134. ngx_feature_test="long n = 0;
  135. if (!__sync_bool_compare_and_swap(&n, 0, 1))
  136. return 1;
  137. if (__sync_fetch_and_add(&n, 1) != 1)
  138. return 1;
  139. if (n != 2)
  140. return 1;
  141. __sync_synchronize();"
  142. . auto/feature
  143. fi
  144. if [ "$NGX_CC_NAME" = "ccc" ]; then
  145. echo "checking for C99 variadic macros ... disabled"
  146. else
  147. ngx_feature="C99 variadic macros"
  148. ngx_feature_name="NGX_HAVE_C99_VARIADIC_MACROS"
  149. ngx_feature_run=yes
  150. ngx_feature_incs="#include <stdio.h>
  151. #define var(dummy, ...) sprintf(__VA_ARGS__)"
  152. ngx_feature_path=
  153. ngx_feature_libs=
  154. ngx_feature_test="char buf[30]; buf[0] = '0';
  155. var(0, buf, \"%d\", 1);
  156. if (buf[0] != '1') return 1"
  157. . auto/feature
  158. fi
  159. ngx_feature="gcc variadic macros"
  160. ngx_feature_name="NGX_HAVE_GCC_VARIADIC_MACROS"
  161. ngx_feature_run=yes
  162. ngx_feature_incs="#include <stdio.h>
  163. #define var(dummy, args...) sprintf(args)"
  164. ngx_feature_path=
  165. ngx_feature_libs=
  166. ngx_feature_test="char buf[30]; buf[0] = '0';
  167. var(0, buf, \"%d\", 1);
  168. if (buf[0] != '1') return 1"
  169. . auto/feature
  170. ngx_feature="gcc builtin 64 bit byteswap"
  171. ngx_feature_name="NGX_HAVE_GCC_BSWAP64"
  172. ngx_feature_run=no
  173. ngx_feature_incs=
  174. ngx_feature_path=
  175. ngx_feature_libs=
  176. ngx_feature_test="if (__builtin_bswap64(0)) return 1"
  177. . auto/feature
  178. # ngx_feature="inline"
  179. # ngx_feature_name=
  180. # ngx_feature_run=no
  181. # ngx_feature_incs="int inline f(void) { return 1 }"
  182. # ngx_feature_path=
  183. # ngx_feature_libs=
  184. # ngx_feature_test=
  185. # . auto/feature
  186. #
  187. # if [ $ngx_found = yes ]; then
  188. # fi
  189. fi