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