Mercurial > hg > nginx
annotate auto/types/uintptr_t @ 4960:b39d947fcb82
Configure: better check for PCRE JIT.
On Mac OS X system toolchain by default prefers include files
from /usr/local/include, but libraries from /usr/lib. This might result in
various problems, in particular the one outlined below.
If the PCRE library is installed into /usr/local/, this results in pcre.h
being used from /usr/local/include (with PCRE_CONFIG_JIT defined), but
libpcre from /usr/lib (as shipped with the OS, without pcre_free_study()
symbol). As a result build fails as we use pcre_free_study() function
if we try to compile with PCRE JIT support.
Obvious workaround is to the root cause is to ask compiler to prefer
library from /usr/local/lib via ./configure --with-ld-opt="-L/usr/local/lib".
On the other hand, in any case it would be good to check if the function
we are going to use is available, hence the change.
See thread here for details:
http://mailman.nginx.org/pipermail/nginx-devel/2012-December/003074.html
Prodded by Piotr Sikora.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 12 Dec 2012 13:50:07 +0000 |
parents | 62d8db8c7157 |
children | 434548349838 |
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:
370
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:
370
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:
370
diff
changeset
|
4 |
192
31824be1fc66
nginx-0.0.1-2003-11-20-10:05:50 import; auto/configure
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
5 |
455 | 6 echo $ngx_n "checking for uintptr_t ...$ngx_c" |
4543
51744fa997c7
Fixed compilation warnings in configuration C tests.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
7 echo >> $NGX_AUTOCONF_ERR |
51744fa997c7
Fixed compilation warnings in configuration C tests.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
8 echo "checking for uintptr_t" >> $NGX_AUTOCONF_ERR |
192
31824be1fc66
nginx-0.0.1-2003-11-20-10:05:50 import; auto/configure
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
9 |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
10 found=no |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
11 |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
12 cat << END > $NGX_AUTOTEST.c |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
13 |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
14 #include <sys/types.h> |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
15 $NGX_INTTYPES_H |
192
31824be1fc66
nginx-0.0.1-2003-11-20-10:05:50 import; auto/configure
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
16 |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
17 int main() { |
4559
62d8db8c7157
Fixed more gcc46 warnings in configure tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4543
diff
changeset
|
18 uintptr_t i = 0; |
62d8db8c7157
Fixed more gcc46 warnings in configure tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4543
diff
changeset
|
19 return (int) i; |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
20 } |
192
31824be1fc66
nginx-0.0.1-2003-11-20-10:05:50 import; auto/configure
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
21 |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
22 END |
192
31824be1fc66
nginx-0.0.1-2003-11-20-10:05:50 import; auto/configure
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
23 |
4543
51744fa997c7
Fixed compilation warnings in configuration C tests.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
24 ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \ |
51744fa997c7
Fixed compilation warnings in configuration C tests.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
25 -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT" |
51744fa997c7
Fixed compilation warnings in configuration C tests.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
26 |
51744fa997c7
Fixed compilation warnings in configuration C tests.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
27 eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1" |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
28 |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
29 if [ -x $NGX_AUTOTEST ]; then |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
30 echo " uintptr_t found" |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
31 found=yes |
195
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
193
diff
changeset
|
32 else |
250
1903c6821958
nginx-0.0.2-2004-02-03-23:27:11 import
Igor Sysoev <igor@sysoev.ru>
parents:
210
diff
changeset
|
33 echo $ngx_n " uintptr_t not found" $ngx_c |
195
8dee38ea9117
nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
193
diff
changeset
|
34 fi |
192
31824be1fc66
nginx-0.0.1-2003-11-20-10:05:50 import; auto/configure
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
35 |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
36 rm $NGX_AUTOTEST* |
192
31824be1fc66
nginx-0.0.1-2003-11-20-10:05:50 import; auto/configure
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
37 |
31824be1fc66
nginx-0.0.1-2003-11-20-10:05:50 import; auto/configure
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
38 |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
39 if [ $found = no ]; then |
370
54f76b0b8dca
nginx-0.0.7-2004-06-27-22:01:57 import
Igor Sysoev <igor@sysoev.ru>
parents:
250
diff
changeset
|
40 found="uint`expr 8 \* $ngx_ptr_size`_t" |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
41 echo ", $found used" |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
42 |
1354
f69d1aab6a0f
make 64-bit ngx_int_t on 64-bit platforms
Igor Sysoev <igor@sysoev.ru>
parents:
455
diff
changeset
|
43 echo "typedef $found uintptr_t;" >> $NGX_AUTO_CONFIG_H |
f69d1aab6a0f
make 64-bit ngx_int_t on 64-bit platforms
Igor Sysoev <igor@sysoev.ru>
parents:
455
diff
changeset
|
44 echo "typedef $found intptr_t;" | sed -e 's/u//g' >> $NGX_AUTO_CONFIG_H |
192
31824be1fc66
nginx-0.0.1-2003-11-20-10:05:50 import; auto/configure
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
45 fi |