fix extension
[nginx.git] / nginx / auto / lib / pcre / conf
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
10     case "$NGX_CC_NAME" in
11
12         msvc* | owc* | bcc)
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"
18         ;;
19
20         icc* )
21             have=NGX_PCRE . auto/have
22             CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
23
24             LINK_DEPS="$LINK_DEPS $PCRE/.libs/libpcre.a"
25
26             echo $ngx_n "checking for PCRE library ...$ngx_c"
27
28             if [ -f $PCRE/pcre.h ]; then
29                 ngx_pcre_ver=`grep PCRE_MAJOR $PCRE/pcre.h \
30                               | sed -e 's/^.*PCRE_MAJOR.* \(.*\)$/\1/'`
31
32             else if [ -f $PCRE/configure.in ]; then
33                 ngx_pcre_ver=`grep PCRE_MAJOR= $PCRE/configure.in \
34                               | sed -e 's/^.*=\(.*\)$/\1/'`
35
36             else
37                 ngx_pcre_ver=`grep pcre_major, $PCRE/configure.ac \
38                               | sed -e 's/^.*pcre_major,.*\[\(.*\)\].*$/\1/'`
39             fi
40             fi
41
42             echo " $ngx_pcre_ver major version found"
43
44             # to allow -ipo optimization we link with the *.o but not library
45
46             case "$ngx_pcre_ver" in
47                 4|5)
48                     CORE_LIBS="$CORE_LIBS $PCRE/pcre.o"
49                 ;;
50
51                 6)
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"
59                 ;;
60
61                 *)
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"
70                 ;;
71
72             esac
73         ;;
74
75         *)
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"
80         ;;
81
82     esac
83
84 else
85
86     if [ "$NGX_PLATFORM" != win32 ]; then
87
88         PCRE=NO
89
90         ngx_feature="PCRE library"
91         ngx_feature_name="NGX_PCRE"
92         ngx_feature_run=no
93         ngx_feature_incs="#include <pcre.h>"
94         ngx_feature_path=
95         ngx_feature_libs="-lpcre"
96         ngx_feature_test="pcre *re; re = pcre_compile(NULL, 0, NULL, 0, NULL)"
97         . auto/feature
98
99         if [ $ngx_found = no ]; then
100
101             # FreeBSD port
102
103             ngx_feature="PCRE library in /usr/local/"
104             ngx_feature_path="/usr/local/include"
105
106             if [ $NGX_RPATH = YES ]; then
107                 ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lpcre"
108             else
109                 ngx_feature_libs="-L/usr/local/lib -lpcre"
110             fi
111
112             . auto/feature
113         fi
114
115         if [ $ngx_found = no ]; then
116
117             # RedHat RPM, Solaris package
118
119             ngx_feature="PCRE library in /usr/include/pcre/"
120             ngx_feature_path="/usr/include/pcre"
121             ngx_feature_libs="-lpcre"
122
123             . auto/feature
124         fi
125
126         if [ $ngx_found = no ]; then
127
128             # NetBSD port
129
130             ngx_feature="PCRE library in /usr/pkg/"
131             ngx_feature_path="/usr/pkg/include"
132
133             if [ $NGX_RPATH = YES ]; then
134                 ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lpcre"
135             else
136                 ngx_feature_libs="-L/usr/pkg/lib -lpcre"
137             fi
138
139             . auto/feature
140         fi
141
142         if [ $ngx_found = no ]; then
143
144             # MacPorts
145
146             ngx_feature="PCRE library in /opt/local/"
147             ngx_feature_path="/opt/local/include"
148
149             if [ $NGX_RPATH = YES ]; then
150                 ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lpcre"
151             else
152                 ngx_feature_libs="-L/opt/local/lib -lpcre"
153             fi
154
155             . auto/feature
156         fi
157
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"
163             PCRE=YES
164         fi
165
166     fi
167 fi