Mercurial > hg > nginx
annotate auto/endianness @ 4902:db9ce6fc9482 stable-1.2
Merge of r4870, r4871, r4890, r4895: minor fixes.
*) Made sure to initialize the entire ngx_file_t structure.
Found by Coverity.
*) Correct plural form for "path" in the whole source base.
*) Removed conditional compilation from waitpid() error test.
There are reports that call to a signal handler for an exited process
despite waitpid() already called for the process may happen on Linux
as well.
*) Style, parentheses instead of braces in misc/GNUMakefile.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 12 Nov 2012 18:39:51 +0000 |
parents | 47936d1c98e9 |
children |
rev | line source |
---|---|
4725
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
1 |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
2 # Copyright (C) Igor Sysoev |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
3 # Copyright (C) Nginx, Inc. |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
4 |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
5 |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
6 echo $ngx_n "checking for system byte ordering ...$ngx_c" |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
7 echo >> $NGX_ERR |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
8 echo "checking for system byte ordering" >> $NGX_ERR |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
9 |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
10 |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
11 cat << END > $NGX_AUTOTEST.c |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
12 |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
13 int main() { |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
14 int i = 0x11223344; |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
15 char *p; |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
16 |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
17 p = (char *) &i; |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
18 if (*p == 0x44) return 0; |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
19 return 1; |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
20 } |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
21 |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
22 END |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
23 |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
24 ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \ |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
25 -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs" |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
26 |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
27 eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1" |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
28 |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
29 if [ -x $NGX_AUTOTEST ]; then |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
30 if $NGX_AUTOTEST >/dev/null 2>&1; then |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
31 echo " little endian" |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
32 have=NGX_HAVE_LITTLE_ENDIAN . auto/have |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
33 else |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
34 echo " big endian" |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
35 fi |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
36 |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
37 rm $NGX_AUTOTEST* |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
38 |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
39 else |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
40 rm $NGX_AUTOTEST* |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
41 |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
42 echo |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
43 echo "$0: error: cannot detect system byte ordering" |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
44 exit 1 |
47936d1c98e9
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
45 fi |