Mercurial > hg > nginx-quic
annotate auto/lib/libatomic/conf @ 3944:f1f194ceab16
fix segfault if cache key is larger than upstream buffer size
patch by Lanshun Zhou
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 19 Jul 2011 11:24:16 +0000 |
parents | 5d17022a1e88 |
children | d620f497c50f |
rev | line source |
---|---|
3363 | 1 |
2 # Copyright (C) Igor Sysoev | |
3 | |
4 | |
5 if [ $NGX_LIBATOMIC != YES ]; then | |
6 | |
7 have=NGX_HAVE_LIBATOMIC . auto/have | |
8 CORE_INCS="$CORE_INCS $NGX_LIBATOMIC/src" | |
9 LINK_DEPS="$LINK_DEPS $NGX_LIBATOMIC/src/libatomic_ops.a" | |
10 CORE_LIBS="$CORE_LIBS $NGX_LIBATOMIC/src/libatomic_ops.a" | |
11 | |
12 else | |
13 | |
14 ngx_feature="atomic_ops library" | |
15 ngx_feature_name=NGX_HAVE_LIBATOMIC | |
3366 | 16 ngx_feature_run=yes |
3378
5d17022a1e88
fix libatomic usage on arm, cris, hppa, m68k, and sparc platforms
Igor Sysoev <igor@sysoev.ru>
parents:
3366
diff
changeset
|
17 ngx_feature_incs="#define AO_REQUIRE_CAS |
5d17022a1e88
fix libatomic usage on arm, cris, hppa, m68k, and sparc platforms
Igor Sysoev <igor@sysoev.ru>
parents:
3366
diff
changeset
|
18 #include <atomic_ops.h>" |
3363 | 19 ngx_feature_path= |
20 ngx_feature_libs="-latomic_ops" | |
3366 | 21 ngx_feature_test="long n = 0; |
22 if (!AO_compare_and_swap(&n, 0, 1)) | |
23 return 1; | |
24 if (AO_fetch_and_add(&n, 1) != 1) | |
25 return 1; | |
26 if (n != 2) | |
27 return 1; | |
3363 | 28 AO_nop();" |
29 . auto/feature | |
30 | |
31 if [ $ngx_found = yes ]; then | |
32 CORE_LIBS="$CORE_LIBS $ngx_feature_libs" | |
33 else | |
34 | |
35 cat << END | |
36 | |
37 $0: error: libatomic_ops library was not found. | |
38 | |
39 END | |
40 exit 1 | |
41 fi | |
42 fi |