view auto/endianess @ 567:1af2fcb3be8a release-0.3.5

nginx-0.3.5-RELEASE import *) Bugfix: the segmentation fault may occurred if the IMAP/POP3 login was changed by authorization server; the bug had appeared in 0.2.2. *) Bugfix: the accept mutex did not work and all connections were handled by one process; the bug had appeared in 0.3.3. *) Bugfix: the timeout did not work if the "rtsig" method and the "timer_resolution" directive were used.
author Igor Sysoev <igor@sysoev.ru>
date Fri, 21 Oct 2005 19:12:18 +0000
parents 2ff194b74f1e
children 4d9ea73a627a
line wrap: on
line source


# Copyright (C) Igor Sysoev


echo $ngx_n "checking for system endianess ...$ngx_c"
echo >> $NGX_ERR
echo "checking for system endianess" >> $NGX_ERR


cat << END > $NGX_AUTOTEST.c

int main() {
    int i = 0x11223344;
    char *p;

    p = (char *) &i;
    if (*p == 0x44) return 0;
    return 1;
}

END

eval "${CC} -o $NGX_AUTOTEST $NGX_AUTOTEST.c >> $NGX_ERR 2>&1"

if [ -x $NGX_AUTOTEST ]; then
    if $NGX_AUTOTEST 2>&1 > /dev/null; then
        echo " little endianess"
        have=NGX_HAVE_LITTLE_ENDIAN . auto/have
    else
        echo " big endianess"
    fi

    rm $NGX_AUTOTEST*

else
    rm $NGX_AUTOTEST*

    echo
    echo "$0: error: can not detect system endianess"
    exit 1
fi