Mercurial > hg > nginx
annotate auto/lib/pcre/make @ 9318:8149e6e3ea2a
Updated PCRE2 used for win32 builds.
Note that PCRE2 10.40 and newer versions require C99 support, as it now
uses "for (int i = 0; ...)" constructs[1], and thus cannot be compiled
with MSVC 2010 and older versions anymore.
[1] https://github.com/PCRE2Project/pcre2/issues/163
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 07 Aug 2024 03:59:13 +0300 |
parents | 0b5f12d5c531 |
children |
rev | line source |
---|---|
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
297
diff
changeset
|
1 |
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
297
diff
changeset
|
2 # Copyright (C) Igor Sysoev |
4412 | 3 # Copyright (C) Nginx, Inc. |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
297
diff
changeset
|
4 |
274
a1ea1ecc3eac
nginx-0.0.2-2004-03-01-23:00:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
5 |
7981 | 6 if [ $PCRE_LIBRARY = PCRE2 ]; then |
7 | |
8 # PCRE2 | |
9 | |
10 if [ $NGX_CC_NAME = msvc ]; then | |
11 | |
12 # With PCRE2, it is not possible to compile all sources. | |
13 # Since list of source files changes between versions, we | |
14 # test files which might not be present. | |
282
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
274
diff
changeset
|
15 |
7981 | 16 ngx_pcre_srcs="pcre2_auto_possess.c \ |
17 pcre2_chartables.c \ | |
18 pcre2_compile.c \ | |
19 pcre2_config.c \ | |
20 pcre2_context.c \ | |
21 pcre2_dfa_match.c \ | |
22 pcre2_error.c \ | |
23 pcre2_jit_compile.c \ | |
24 pcre2_maketables.c \ | |
25 pcre2_match.c \ | |
26 pcre2_match_data.c \ | |
27 pcre2_newline.c \ | |
28 pcre2_ord2utf.c \ | |
29 pcre2_pattern_info.c \ | |
30 pcre2_string_utils.c \ | |
31 pcre2_study.c \ | |
32 pcre2_substitute.c \ | |
33 pcre2_substring.c \ | |
34 pcre2_tables.c \ | |
35 pcre2_ucd.c \ | |
36 pcre2_valid_utf.c \ | |
37 pcre2_xclass.c" | |
38 | |
9318
8149e6e3ea2a
Updated PCRE2 used for win32 builds.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7981
diff
changeset
|
39 ngx_pcre_test="pcre2_chkdint.c \ |
8149e6e3ea2a
Updated PCRE2 used for win32 builds.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7981
diff
changeset
|
40 pcre2_convert.c \ |
7981 | 41 pcre2_extuni.c \ |
42 pcre2_find_bracket.c \ | |
43 pcre2_script_run.c \ | |
44 pcre2_serialize.c" | |
45 | |
46 for ngx_src in $ngx_pcre_test | |
47 do | |
48 if [ -f $PCRE/src/$ngx_src ]; then | |
49 ngx_pcre_srcs="$ngx_pcre_srcs $ngx_src" | |
50 fi | |
51 done | |
282
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
274
diff
changeset
|
52 |
7981 | 53 ngx_pcre_objs=`echo $ngx_pcre_srcs \ |
54 | sed -e "s#\([^ ]*\.\)c#\1$ngx_objext#g"` | |
55 | |
56 ngx_pcre_srcs=`echo $ngx_pcre_srcs \ | |
57 | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g"` | |
58 ngx_pcre_objs=`echo $ngx_pcre_objs \ | |
59 | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g"` | |
60 | |
61 cat << END >> $NGX_MAKEFILE | |
62 | |
63 PCRE_CFLAGS = -O2 -Ob1 -Oi -Gs $LIBC $CPU_OPT | |
64 PCRE_FLAGS = -DHAVE_CONFIG_H -DPCRE2_STATIC -DPCRE2_CODE_UNIT_WIDTH=8 \\ | |
65 -DHAVE_MEMMOVE | |
66 | |
67 PCRE_SRCS = $ngx_pcre_srcs | |
68 PCRE_OBJS = $ngx_pcre_objs | |
69 | |
70 $PCRE/src/pcre2.h: | |
71 cd $PCRE/src \\ | |
72 && copy /y config.h.generic config.h \\ | |
73 && copy /y pcre2.h.generic pcre2.h \\ | |
74 && copy /y pcre2_chartables.c.dist pcre2_chartables.c | |
297
ee394e997c77
nginx-0.0.3-2004-03-29-21:43:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
295
diff
changeset
|
75 |
7981 | 76 $PCRE/src/pcre2-8.lib: $PCRE/src/pcre2.h $NGX_MAKEFILE |
77 cd $PCRE/src \\ | |
78 && cl -nologo -c \$(PCRE_CFLAGS) -I . \$(PCRE_FLAGS) \$(PCRE_SRCS) \\ | |
79 && link -lib -out:pcre2-8.lib -verbose:lib \$(PCRE_OBJS) | |
80 | |
81 END | |
82 | |
83 else | |
84 | |
85 cat << END >> $NGX_MAKEFILE | |
86 | |
87 $PCRE/src/pcre2.h: $PCRE/Makefile | |
282
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
274
diff
changeset
|
88 |
7981 | 89 $PCRE/Makefile: $NGX_MAKEFILE |
90 cd $PCRE \\ | |
91 && if [ -f Makefile ]; then \$(MAKE) distclean; fi \\ | |
92 && CC="\$(CC)" CFLAGS="$PCRE_OPT" \\ | |
93 ./configure --disable-shared $PCRE_CONF_OPT | |
5360
3d2d3e1cf427
Win32: MinGW GCC compatibility.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5342
diff
changeset
|
94 |
7981 | 95 $PCRE/.libs/libpcre2-8.a: $PCRE/Makefile |
96 cd $PCRE \\ | |
97 && \$(MAKE) libpcre2-8.la | |
98 | |
99 END | |
100 | |
101 fi | |
282
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
274
diff
changeset
|
102 |
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
274
diff
changeset
|
103 |
7981 | 104 else |
105 | |
106 # PCRE | |
107 | |
108 case "$NGX_CC_NAME" in | |
109 | |
110 msvc) | |
111 ngx_makefile=makefile.msvc | |
112 ngx_opt="CPU_OPT=\"$CPU_OPT\" LIBC=$LIBC" | |
113 ngx_pcre="PCRE=\"$PCRE\"" | |
114 ;; | |
115 | |
116 owc) | |
117 ngx_makefile=makefile.owc | |
118 ngx_opt="CPU_OPT=\"$CPU_OPT\"" | |
119 ngx_pcre=`echo PCRE=\"$PCRE\" | sed -e "s/\//$ngx_regex_dirsep/g"` | |
120 ;; | |
282
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
274
diff
changeset
|
121 |
7981 | 122 bcc) |
123 ngx_makefile=makefile.bcc | |
124 ngx_opt="-DCPU_OPT=\"$CPU_OPT\"" | |
125 ngx_pcre=`echo \-DPCRE=\"$PCRE\" \ | |
126 | sed -e "s/\//$ngx_regex_dirsep/g"` | |
127 ;; | |
128 | |
129 *) | |
130 ngx_makefile= | |
131 ;; | |
132 | |
133 esac | |
134 | |
135 | |
136 if [ -n "$ngx_makefile" ]; then | |
137 | |
138 cat << END >> $NGX_MAKEFILE | |
297
ee394e997c77
nginx-0.0.3-2004-03-29-21:43:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
295
diff
changeset
|
139 |
5342
b3f6290a9401
Configure: pcre.lib dependencies fix.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
140 `echo "$PCRE/pcre.lib: $PCRE/pcre.h $NGX_MAKEFILE" \ |
b3f6290a9401
Configure: pcre.lib dependencies fix.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
141 | sed -e "s/\//$ngx_regex_dirsep/g"` |
2840
22c4c012c8c9
switch Win32 building to modern PCRE versions (starting from 7.1)
Igor Sysoev <igor@sysoev.ru>
parents:
2838
diff
changeset
|
142 \$(MAKE) -f auto/lib/pcre/$ngx_makefile $ngx_pcre $ngx_opt |
297
ee394e997c77
nginx-0.0.3-2004-03-29-21:43:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
295
diff
changeset
|
143 |
2840
22c4c012c8c9
switch Win32 building to modern PCRE versions (starting from 7.1)
Igor Sysoev <igor@sysoev.ru>
parents:
2838
diff
changeset
|
144 `echo "$PCRE/pcre.h:" | sed -e "s/\//$ngx_regex_dirsep/g"` |
22c4c012c8c9
switch Win32 building to modern PCRE versions (starting from 7.1)
Igor Sysoev <igor@sysoev.ru>
parents:
2838
diff
changeset
|
145 \$(MAKE) -f auto/lib/pcre/$ngx_makefile $ngx_pcre pcre.h |
297
ee394e997c77
nginx-0.0.3-2004-03-29-21:43:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
295
diff
changeset
|
146 |
467 | 147 END |
148 | |
7981 | 149 else |
282
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
274
diff
changeset
|
150 |
7981 | 151 cat << END >> $NGX_MAKEFILE |
467 | 152 |
1164
d201e0461c3c
fix make dependecies: pcre-6.5+ already has pcre.h
Igor Sysoev <igor@sysoev.ru>
parents:
523
diff
changeset
|
153 $PCRE/pcre.h: $PCRE/Makefile |
d201e0461c3c
fix make dependecies: pcre-6.5+ already has pcre.h
Igor Sysoev <igor@sysoev.ru>
parents:
523
diff
changeset
|
154 |
d201e0461c3c
fix make dependecies: pcre-6.5+ already has pcre.h
Igor Sysoev <igor@sysoev.ru>
parents:
523
diff
changeset
|
155 $PCRE/Makefile: $NGX_MAKEFILE |
467 | 156 cd $PCRE \\ |
523 | 157 && if [ -f Makefile ]; then \$(MAKE) distclean; fi \\ |
467 | 158 && CC="\$(CC)" CFLAGS="$PCRE_OPT" \\ |
4388
005fc2d5e84f
Added support for regex study and PCRE JIT (ticket #41) optimizations on
Valentin Bartenev <vbart@nginx.com>
parents:
2840
diff
changeset
|
159 ./configure --disable-shared $PCRE_CONF_OPT |
467 | 160 |
1164
d201e0461c3c
fix make dependecies: pcre-6.5+ already has pcre.h
Igor Sysoev <igor@sysoev.ru>
parents:
523
diff
changeset
|
161 $PCRE/.libs/libpcre.a: $PCRE/Makefile |
467 | 162 cd $PCRE \\ |
163 && \$(MAKE) libpcre.la | |
164 | |
165 END | |
166 | |
7981 | 167 fi |
168 | |
5360
3d2d3e1cf427
Win32: MinGW GCC compatibility.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5342
diff
changeset
|
169 fi |