0
|
1
|
|
2 # Copyright (C) Igor Sysoev
|
|
3
|
|
4
|
|
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"
|
|
9
|
4
|
10 case "$NGX_CC_NAME" in
|
0
|
11
|
10
|
12 msvc* | owc* | bcc)
|
4
|
13 have=NGX_PCRE . auto/have
|
0
|
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"
|
|
18 ;;
|
|
19
|
110
|
20 icc* | sunc )
|
4
|
21 have=NGX_PCRE . auto/have
|
0
|
22 CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
|
|
23
|
|
24 LINK_DEPS="$LINK_DEPS $PCRE/.libs/libpcre.a"
|
|
25
|
72
|
26 echo $ngx_n "checking for PCRE library ...$ngx_c"
|
|
27
|
|
28 ngx_pcre_ver=`grep PCRE_MAJOR= $PCRE/configure.in \
|
|
29 | sed -e 's/^.*=\(.*\)$/\1/'`
|
|
30
|
|
31 echo " $ngx_pcre_ver major version found"
|
|
32
|
0
|
33 # to allow -ipo optimization we link with the *.o but not library
|
72
|
34
|
|
35 case "$ngx_pcre_ver" in
|
|
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 *)
|
|
47 CORE_LIBS="$CORE_LIBS $PCRE/pcre.o"
|
|
48 ;;
|
|
49 esac
|
0
|
50 ;;
|
|
51
|
|
52 *)
|
4
|
53 have=NGX_PCRE . auto/have
|
0
|
54 CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
|
|
55 LINK_DEPS="$LINK_DEPS $PCRE/.libs/libpcre.a"
|
|
56 CORE_LIBS="$CORE_LIBS $PCRE/.libs/libpcre.a"
|
|
57 #CORE_LIBS="$CORE_LIBS -L $PCRE/.libs -lpcre"
|
|
58 ;;
|
|
59
|
|
60 esac
|
|
61
|
|
62 else
|
|
63
|
42
|
64 if [ "$NGX_PLATFORM" != win32 ]; then
|
4
|
65 PCRE=NO
|
0
|
66
|
4
|
67 ngx_feature="PCRE library"
|
18
|
68 ngx_feature_name="NGX_PCRE"
|
4
|
69 ngx_feature_run=no
|
|
70 ngx_feature_incs="#include <pcre.h>"
|
258
|
71 ngx_feature_path=
|
4
|
72 ngx_feature_libs="-lpcre"
|
|
73 ngx_feature_test="pcre *re; re = pcre_compile(NULL, 0, NULL, 0, NULL)"
|
|
74 . auto/feature
|
0
|
75
|
|
76 if [ $ngx_found = yes ]; then
|
|
77 CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
|
|
78 CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
|
4
|
79 CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
|
0
|
80 PCRE=YES
|
|
81 ngx_found=no
|
258
|
82
|
|
83 else
|
|
84 # FreeBSD port
|
|
85
|
|
86 ngx_feature="PCRE library in /usr/local/"
|
|
87 ngx_feature_name="NGX_PCRE"
|
|
88 ngx_feature_run=no
|
|
89 ngx_feature_incs="#include <pcre.h>"
|
|
90 ngx_feature_path="/usr/local/include"
|
|
91 ngx_feature_libs="-L /usr/local/lib -lpcre"
|
|
92 ngx_feature_test="pcre *re;
|
|
93 re = pcre_compile(NULL, 0, NULL, 0, NULL)"
|
|
94 . auto/feature
|
0
|
95 fi
|
258
|
96
|
|
97 if [ $ngx_found = yes ]; then
|
|
98 CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
|
|
99 CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
|
|
100 CORE_INCS="$CORE_INCS $ngx_feature_path"
|
|
101 CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
|
|
102 PCRE=YES
|
|
103 ngx_found=no
|
|
104
|
|
105 else
|
|
106 # Linux package
|
|
107
|
|
108 if [ $PCRE = NO ]; then
|
|
109
|
|
110 ngx_feature="PCRE library in /usr/include/pcre/"
|
|
111 ngx_feature_name="NGX_PCRE"
|
|
112 ngx_feature_run=no
|
|
113 ngx_feature_incs="#include <pcre.h>"
|
|
114 ngx_feature_path="/usr/include/pcre"
|
|
115 ngx_feature_libs="-lpcre"
|
|
116 ngx_feature_test="pcre *re;
|
|
117 re = pcre_compile(NULL, 0, NULL, 0, NULL)"
|
|
118 . auto/feature
|
|
119 fi
|
|
120 fi
|
|
121
|
|
122 if [ $ngx_found = yes ]; then
|
|
123 CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
|
|
124 CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
|
|
125 CORE_INCS="$CORE_INCS $ngx_feature_path"
|
|
126 CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
|
|
127 PCRE=YES
|
|
128 ngx_found=no
|
|
129
|
|
130 else
|
|
131 # NetBSD port
|
|
132
|
|
133 if [ $PCRE = NO ]; then
|
|
134
|
|
135 ngx_feature="PCRE library in /usr/pkg/"
|
|
136 ngx_feature_name="NGX_PCRE"
|
|
137 ngx_feature_run=no
|
|
138 ngx_feature_incs="#include <pcre.h>"
|
|
139 ngx_feature_path="/usr/pkg/include"
|
|
140 ngx_feature_libs="-L /usr/pkg/lib -lpcre"
|
|
141 ngx_feature_test="pcre *re;
|
|
142 re = pcre_compile(NULL, 0, NULL, 0, NULL)"
|
|
143 . auto/feature
|
|
144 fi
|
|
145 fi
|
|
146
|
|
147 if [ $ngx_found = yes ]; then
|
|
148 CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
|
|
149 CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
|
|
150 CORE_INCS="$CORE_INCS $ngx_feature_path"
|
|
151 CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
|
|
152 PCRE=YES
|
|
153 ngx_found=no
|
|
154 fi
|
|
155
|
0
|
156 fi
|
|
157 fi
|