2 # Copyright (C) Igor Sysoev
5 if [ $PCRE != NONE ]; then
6 CORE_INCS="$CORE_INCS $PCRE"
7 CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
8 CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
10 case "$NGX_CC_NAME" in
13 have=NGX_PCRE . auto/have
14 have=PCRE_STATIC . auto/have
15 CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
16 LINK_DEPS="$LINK_DEPS $PCRE/pcre.lib"
17 CORE_LIBS="$CORE_LIBS $PCRE/pcre.lib"
21 have=NGX_PCRE . auto/have
22 CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
24 LINK_DEPS="$LINK_DEPS $PCRE/.libs/libpcre.a"
26 echo $ngx_n "checking for PCRE library ...$ngx_c"
28 if [ -f $PCRE/pcre.h ]; then
29 ngx_pcre_ver=`grep PCRE_MAJOR $PCRE/pcre.h \
30 | sed -e 's/^.*PCRE_MAJOR.* \(.*\)$/\1/'`
32 else if [ -f $PCRE/configure.in ]; then
33 ngx_pcre_ver=`grep PCRE_MAJOR= $PCRE/configure.in \
34 | sed -e 's/^.*=\(.*\)$/\1/'`
37 ngx_pcre_ver=`grep pcre_major, $PCRE/configure.ac \
38 | sed -e 's/^.*pcre_major,.*\[\(.*\)\].*$/\1/'`
42 echo " $ngx_pcre_ver major version found"
44 # to allow -ipo optimization we link with the *.o but not library
46 case "$ngx_pcre_ver" in
48 CORE_LIBS="$CORE_LIBS $PCRE/pcre.o"
52 CORE_LIBS="$CORE_LIBS $PCRE/pcre_chartables.o"
53 CORE_LIBS="$CORE_LIBS $PCRE/pcre_compile.o"
54 CORE_LIBS="$CORE_LIBS $PCRE/pcre_exec.o"
55 CORE_LIBS="$CORE_LIBS $PCRE/pcre_fullinfo.o"
56 CORE_LIBS="$CORE_LIBS $PCRE/pcre_globals.o"
57 CORE_LIBS="$CORE_LIBS $PCRE/pcre_tables.o"
58 CORE_LIBS="$CORE_LIBS $PCRE/pcre_try_flipped.o"
62 CORE_LIBS="$CORE_LIBS $PCRE/pcre_chartables.o"
63 CORE_LIBS="$CORE_LIBS $PCRE/pcre_compile.o"
64 CORE_LIBS="$CORE_LIBS $PCRE/pcre_exec.o"
65 CORE_LIBS="$CORE_LIBS $PCRE/pcre_fullinfo.o"
66 CORE_LIBS="$CORE_LIBS $PCRE/pcre_globals.o"
67 CORE_LIBS="$CORE_LIBS $PCRE/pcre_tables.o"
68 CORE_LIBS="$CORE_LIBS $PCRE/pcre_try_flipped.o"
69 CORE_LIBS="$CORE_LIBS $PCRE/pcre_newline.o"
76 have=NGX_PCRE . auto/have
77 CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
78 LINK_DEPS="$LINK_DEPS $PCRE/.libs/libpcre.a"
79 CORE_LIBS="$CORE_LIBS $PCRE/.libs/libpcre.a"
86 if [ "$NGX_PLATFORM" != win32 ]; then
90 ngx_feature="PCRE library"
91 ngx_feature_name="NGX_PCRE"
93 ngx_feature_incs="#include <pcre.h>"
95 ngx_feature_libs="-lpcre"
96 ngx_feature_test="pcre *re; re = pcre_compile(NULL, 0, NULL, 0, NULL)"
99 if [ $ngx_found = no ]; then
103 ngx_feature="PCRE library in /usr/local/"
104 ngx_feature_path="/usr/local/include"
106 if [ $NGX_RPATH = YES ]; then
107 ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lpcre"
109 ngx_feature_libs="-L/usr/local/lib -lpcre"
115 if [ $ngx_found = no ]; then
117 # RedHat RPM, Solaris package
119 ngx_feature="PCRE library in /usr/include/pcre/"
120 ngx_feature_path="/usr/include/pcre"
121 ngx_feature_libs="-lpcre"
126 if [ $ngx_found = no ]; then
130 ngx_feature="PCRE library in /usr/pkg/"
131 ngx_feature_path="/usr/pkg/include"
133 if [ $NGX_RPATH = YES ]; then
134 ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lpcre"
136 ngx_feature_libs="-L/usr/pkg/lib -lpcre"
142 if [ $ngx_found = no ]; then
146 ngx_feature="PCRE library in /opt/local/"
147 ngx_feature_path="/opt/local/include"
149 if [ $NGX_RPATH = YES ]; then
150 ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lpcre"
152 ngx_feature_libs="-L/opt/local/lib -lpcre"
158 if [ $ngx_found = yes ]; then
159 CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
160 CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
161 CORE_INCS="$CORE_INCS $ngx_feature_path"
162 CORE_LIBS="$CORE_LIBS $ngx_feature_libs"