conf 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. # Copyright (C) Igor Sysoev
  2. if [ $PCRE != NONE ]; then
  3. CORE_INCS="$CORE_INCS $PCRE"
  4. CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
  5. CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
  6. case "$NGX_CC_NAME" in
  7. msvc* | owc* | bcc)
  8. have=NGX_PCRE . auto/have
  9. have=PCRE_STATIC . auto/have
  10. CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
  11. LINK_DEPS="$LINK_DEPS $PCRE/pcre.lib"
  12. CORE_LIBS="$CORE_LIBS $PCRE/pcre.lib"
  13. ;;
  14. icc* )
  15. have=NGX_PCRE . auto/have
  16. CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
  17. LINK_DEPS="$LINK_DEPS $PCRE/.libs/libpcre.a"
  18. echo $ngx_n "checking for PCRE library ...$ngx_c"
  19. if [ -f $PCRE/pcre.h ]; then
  20. ngx_pcre_ver=`grep PCRE_MAJOR $PCRE/pcre.h \
  21. | sed -e 's/^.*PCRE_MAJOR.* \(.*\)$/\1/'`
  22. else if [ -f $PCRE/configure.in ]; then
  23. ngx_pcre_ver=`grep PCRE_MAJOR= $PCRE/configure.in \
  24. | sed -e 's/^.*=\(.*\)$/\1/'`
  25. else
  26. ngx_pcre_ver=`grep pcre_major, $PCRE/configure.ac \
  27. | sed -e 's/^.*pcre_major,.*\[\(.*\)\].*$/\1/'`
  28. fi
  29. fi
  30. echo " $ngx_pcre_ver major version found"
  31. # to allow -ipo optimization we link with the *.o but not library
  32. case "$ngx_pcre_ver" in
  33. 4|5)
  34. CORE_LIBS="$CORE_LIBS $PCRE/pcre.o"
  35. ;;
  36. 6)
  37. CORE_LIBS="$CORE_LIBS $PCRE/pcre_chartables.o"
  38. CORE_LIBS="$CORE_LIBS $PCRE/pcre_compile.o"
  39. CORE_LIBS="$CORE_LIBS $PCRE/pcre_exec.o"
  40. CORE_LIBS="$CORE_LIBS $PCRE/pcre_fullinfo.o"
  41. CORE_LIBS="$CORE_LIBS $PCRE/pcre_globals.o"
  42. CORE_LIBS="$CORE_LIBS $PCRE/pcre_tables.o"
  43. CORE_LIBS="$CORE_LIBS $PCRE/pcre_try_flipped.o"
  44. ;;
  45. *)
  46. CORE_LIBS="$CORE_LIBS $PCRE/pcre_chartables.o"
  47. CORE_LIBS="$CORE_LIBS $PCRE/pcre_compile.o"
  48. CORE_LIBS="$CORE_LIBS $PCRE/pcre_exec.o"
  49. CORE_LIBS="$CORE_LIBS $PCRE/pcre_fullinfo.o"
  50. CORE_LIBS="$CORE_LIBS $PCRE/pcre_globals.o"
  51. CORE_LIBS="$CORE_LIBS $PCRE/pcre_tables.o"
  52. CORE_LIBS="$CORE_LIBS $PCRE/pcre_try_flipped.o"
  53. CORE_LIBS="$CORE_LIBS $PCRE/pcre_newline.o"
  54. ;;
  55. esac
  56. ;;
  57. *)
  58. have=NGX_PCRE . auto/have
  59. CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
  60. LINK_DEPS="$LINK_DEPS $PCRE/.libs/libpcre.a"
  61. CORE_LIBS="$CORE_LIBS $PCRE/.libs/libpcre.a"
  62. ;;
  63. esac
  64. else
  65. if [ "$NGX_PLATFORM" != win32 ]; then
  66. PCRE=NO
  67. ngx_feature="PCRE library"
  68. ngx_feature_name="NGX_PCRE"
  69. ngx_feature_run=no
  70. ngx_feature_incs="#include <pcre.h>"
  71. ngx_feature_path=
  72. ngx_feature_libs="-lpcre"
  73. ngx_feature_test="pcre *re; re = pcre_compile(NULL, 0, NULL, 0, NULL)"
  74. . auto/feature
  75. if [ $ngx_found = no ]; then
  76. # FreeBSD port
  77. ngx_feature="PCRE library in /usr/local/"
  78. ngx_feature_path="/usr/local/include"
  79. if [ $NGX_RPATH = YES ]; then
  80. ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lpcre"
  81. else
  82. ngx_feature_libs="-L/usr/local/lib -lpcre"
  83. fi
  84. . auto/feature
  85. fi
  86. if [ $ngx_found = no ]; then
  87. # RedHat RPM, Solaris package
  88. ngx_feature="PCRE library in /usr/include/pcre/"
  89. ngx_feature_path="/usr/include/pcre"
  90. ngx_feature_libs="-lpcre"
  91. . auto/feature
  92. fi
  93. if [ $ngx_found = no ]; then
  94. # NetBSD port
  95. ngx_feature="PCRE library in /usr/pkg/"
  96. ngx_feature_path="/usr/pkg/include"
  97. if [ $NGX_RPATH = YES ]; then
  98. ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lpcre"
  99. else
  100. ngx_feature_libs="-L/usr/pkg/lib -lpcre"
  101. fi
  102. . auto/feature
  103. fi
  104. if [ $ngx_found = no ]; then
  105. # MacPorts
  106. ngx_feature="PCRE library in /opt/local/"
  107. ngx_feature_path="/opt/local/include"
  108. if [ $NGX_RPATH = YES ]; then
  109. ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lpcre"
  110. else
  111. ngx_feature_libs="-L/opt/local/lib -lpcre"
  112. fi
  113. . auto/feature
  114. fi
  115. if [ $ngx_found = yes ]; then
  116. CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
  117. CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
  118. CORE_INCS="$CORE_INCS $ngx_feature_path"
  119. CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
  120. PCRE=YES
  121. else
  122. cat << END
  123. $0: error: the HTTP rewrite module requires the PCRE library.
  124. You can either disable the module by using --without-http_rewrite_module
  125. option, or install the PCRE library into the system, or build the PCRE library
  126. statically from the source with nginx by using --with-pcre=<path> option.
  127. END
  128. exit 1
  129. fi
  130. fi
  131. fi