Mercurial > hg > nginx-vendor-current
comparison auto/endianess @ 0:f0b350454894 NGINX_0_1_0
nginx 0.1.0
*) The first public version.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 04 Oct 2004 00:00:00 +0400 |
parents | |
children | 4b2dafa26fe2 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0b350454894 |
---|---|
1 | |
2 # Copyright (C) Igor Sysoev | |
3 | |
4 | |
5 echo $ngx_n "checking for system endianess ..." $ngx_c | |
6 echo >> $NGX_ERR | |
7 echo "checking for system endianess" >> $NGX_ERR | |
8 | |
9 | |
10 cat << END > $NGX_AUTOTEST.c | |
11 | |
12 int main() { | |
13 int i = 0x11223344; | |
14 char *p; | |
15 | |
16 p = (char *) &i; | |
17 if (*p == 0x44) return 0; | |
18 return 1; | |
19 } | |
20 | |
21 END | |
22 | |
23 eval "${CC} -o $NGX_AUTOTEST $NGX_AUTOTEST.c >> $NGX_ERR 2>&1" | |
24 | |
25 if [ -x $NGX_AUTOTEST ]; then | |
26 if $NGX_AUTOTEST 2>&1 > /dev/null; then | |
27 echo " little endianess" | |
28 have=HAVE_LITTLE_ENDIAN . auto/have | |
29 else | |
30 echo " big endianess" | |
31 fi | |
32 | |
33 rm $NGX_AUTOTEST* | |
34 | |
35 else | |
36 rm $NGX_AUTOTEST* | |
37 | |
38 echo | |
39 echo "$0: error: can not detect system endianess" | |
40 exit 1 | |
41 fi |