0
|
1
|
|
2 # Copyright (C) Igor Sysoev
|
|
3
|
|
4
|
|
5 if [ $PCRE != NONE ]; then
|
|
6 CORE_INCS="$CORE_INCS $PCRE"
|
|
7
|
4
|
8 case "$NGX_CC_NAME" in
|
0
|
9
|
10
|
10 msvc* | owc* | bcc)
|
4
|
11 have=NGX_PCRE . auto/have
|
0
|
12 have=PCRE_STATIC . auto/have
|
|
13 CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
|
|
14 LINK_DEPS="$LINK_DEPS $PCRE/pcre.lib"
|
|
15 CORE_LIBS="$CORE_LIBS $PCRE/pcre.lib"
|
|
16 ;;
|
|
17
|
320
|
18 icc* )
|
4
|
19 have=NGX_PCRE . auto/have
|
0
|
20 CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
|
|
21
|
|
22 LINK_DEPS="$LINK_DEPS $PCRE/.libs/libpcre.a"
|
|
23
|
72
|
24 echo $ngx_n "checking for PCRE library ...$ngx_c"
|
|
25
|
320
|
26 if [ -f $PCRE/pcre.h ]; then
|
274
|
27 ngx_pcre_ver=`grep PCRE_MAJOR $PCRE/pcre.h \
|
|
28 | sed -e 's/^.*PCRE_MAJOR.* \(.*\)$/\1/'`
|
|
29
|
322
|
30 else if [ -f $PCRE/configure.in ]; then
|
274
|
31 ngx_pcre_ver=`grep PCRE_MAJOR= $PCRE/configure.in \
|
|
32 | sed -e 's/^.*=\(.*\)$/\1/'`
|
320
|
33
|
|
34 else
|
|
35 ngx_pcre_ver=`grep pcre_major, $PCRE/configure.ac \
|
|
36 | sed -e 's/^.*pcre_major,.*\[\(.*\)\].*$/\1/'`
|
|
37 fi
|
274
|
38 fi
|
72
|
39
|
|
40 echo " $ngx_pcre_ver major version found"
|
|
41
|
0
|
42 # to allow -ipo optimization we link with the *.o but not library
|
72
|
43
|
|
44 case "$ngx_pcre_ver" in
|
274
|
45 4|5)
|
|
46 CORE_LIBS="$CORE_LIBS $PCRE/pcre.o"
|
|
47 ;;
|
|
48
|
72
|
49 6)
|
|
50 CORE_LIBS="$CORE_LIBS $PCRE/pcre_chartables.o"
|
|
51 CORE_LIBS="$CORE_LIBS $PCRE/pcre_compile.o"
|
|
52 CORE_LIBS="$CORE_LIBS $PCRE/pcre_exec.o"
|
|
53 CORE_LIBS="$CORE_LIBS $PCRE/pcre_fullinfo.o"
|
|
54 CORE_LIBS="$CORE_LIBS $PCRE/pcre_globals.o"
|
|
55 CORE_LIBS="$CORE_LIBS $PCRE/pcre_tables.o"
|
|
56 CORE_LIBS="$CORE_LIBS $PCRE/pcre_try_flipped.o"
|
|
57 ;;
|
|
58
|
|
59 *)
|
274
|
60 CORE_LIBS="$CORE_LIBS $PCRE/pcre_chartables.o"
|
|
61 CORE_LIBS="$CORE_LIBS $PCRE/pcre_compile.o"
|
|
62 CORE_LIBS="$CORE_LIBS $PCRE/pcre_exec.o"
|
|
63 CORE_LIBS="$CORE_LIBS $PCRE/pcre_fullinfo.o"
|
|
64 CORE_LIBS="$CORE_LIBS $PCRE/pcre_globals.o"
|
|
65 CORE_LIBS="$CORE_LIBS $PCRE/pcre_tables.o"
|
|
66 CORE_LIBS="$CORE_LIBS $PCRE/pcre_try_flipped.o"
|
|
67 CORE_LIBS="$CORE_LIBS $PCRE/pcre_newline.o"
|
72
|
68 ;;
|
274
|
69
|
72
|
70 esac
|
0
|
71 ;;
|
|
72
|
|
73 *)
|
4
|
74 have=NGX_PCRE . auto/have
|
0
|
75 CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
|
|
76 LINK_DEPS="$LINK_DEPS $PCRE/.libs/libpcre.a"
|
|
77 CORE_LIBS="$CORE_LIBS $PCRE/.libs/libpcre.a"
|
|
78 ;;
|
|
79
|
|
80 esac
|
|
81
|
656
|
82
|
|
83 if [ $PCRE_JIT = YES ]; then
|
|
84 have=NGX_HAVE_PCRE_JIT . auto/have
|
|
85 PCRE_CONF_OPT="$PCRE_CONF_OPT --enable-jit"
|
|
86 fi
|
|
87
|
0
|
88 else
|
|
89
|
42
|
90 if [ "$NGX_PLATFORM" != win32 ]; then
|
376
|
91
|
4
|
92 PCRE=NO
|
0
|
93
|
4
|
94 ngx_feature="PCRE library"
|
18
|
95 ngx_feature_name="NGX_PCRE"
|
4
|
96 ngx_feature_run=no
|
|
97 ngx_feature_incs="#include <pcre.h>"
|
258
|
98 ngx_feature_path=
|
4
|
99 ngx_feature_libs="-lpcre"
|
|
100 ngx_feature_test="pcre *re; re = pcre_compile(NULL, 0, NULL, 0, NULL)"
|
|
101 . auto/feature
|
0
|
102
|
376
|
103 if [ $ngx_found = no ]; then
|
258
|
104
|
|
105 # FreeBSD port
|
|
106
|
|
107 ngx_feature="PCRE library in /usr/local/"
|
|
108 ngx_feature_path="/usr/local/include"
|
336
|
109
|
|
110 if [ $NGX_RPATH = YES ]; then
|
|
111 ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lpcre"
|
|
112 else
|
|
113 ngx_feature_libs="-L/usr/local/lib -lpcre"
|
|
114 fi
|
|
115
|
376
|
116 . auto/feature
|
|
117 fi
|
|
118
|
|
119 if [ $ngx_found = no ]; then
|
|
120
|
392
|
121 # RedHat RPM, Solaris package
|
376
|
122
|
|
123 ngx_feature="PCRE library in /usr/include/pcre/"
|
|
124 ngx_feature_path="/usr/include/pcre"
|
|
125 ngx_feature_libs="-lpcre"
|
|
126
|
|
127 . auto/feature
|
|
128 fi
|
|
129
|
|
130 if [ $ngx_found = no ]; then
|
|
131
|
|
132 # NetBSD port
|
|
133
|
|
134 ngx_feature="PCRE library in /usr/pkg/"
|
|
135 ngx_feature_path="/usr/pkg/include"
|
|
136
|
|
137 if [ $NGX_RPATH = YES ]; then
|
|
138 ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lpcre"
|
|
139 else
|
|
140 ngx_feature_libs="-L/usr/pkg/lib -lpcre"
|
|
141 fi
|
|
142
|
|
143 . auto/feature
|
|
144 fi
|
|
145
|
|
146 if [ $ngx_found = no ]; then
|
|
147
|
|
148 # MacPorts
|
|
149
|
|
150 ngx_feature="PCRE library in /opt/local/"
|
|
151 ngx_feature_path="/opt/local/include"
|
|
152
|
|
153 if [ $NGX_RPATH = YES ]; then
|
|
154 ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lpcre"
|
|
155 else
|
|
156 ngx_feature_libs="-L/opt/local/lib -lpcre"
|
|
157 fi
|
|
158
|
258
|
159 . auto/feature
|
0
|
160 fi
|
258
|
161
|
|
162 if [ $ngx_found = yes ]; then
|
|
163 CORE_INCS="$CORE_INCS $ngx_feature_path"
|
|
164 CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
|
|
165 PCRE=YES
|
586
|
166 fi
|
656
|
167
|
|
168 if [ $PCRE == YES ]; then
|
|
169 ngx_feature="PCRE JIT support"
|
|
170 ngx_feature_name="NGX_HAVE_PCRE_JIT"
|
|
171 ngx_feature_test="int jit = 0;
|
|
172 pcre_config(PCRE_CONFIG_JIT, &jit);
|
|
173 if (jit != 1) return 1;"
|
|
174 . auto/feature
|
|
175
|
|
176 if [ $ngx_found = yes ]; then
|
|
177 PCRE_JIT=YES
|
|
178 fi
|
|
179 fi
|
586
|
180 fi
|
496
|
181
|
586
|
182 if [ $PCRE != YES ]; then
|
496
|
183 cat << END
|
|
184
|
|
185 $0: error: the HTTP rewrite module requires the PCRE library.
|
|
186 You can either disable the module by using --without-http_rewrite_module
|
|
187 option, or install the PCRE library into the system, or build the PCRE library
|
|
188 statically from the source with nginx by using --with-pcre=<path> option.
|
|
189
|
|
190 END
|
586
|
191 exit 1
|
|
192 fi
|
496
|
193
|
0
|
194 fi
|