2003-11-20 14:36:43 -03:00
|
|
|
|
2004-09-29 12:00:49 -04:00
|
|
|
# Copyright (C) Igor Sysoev
|
2012-02-05 17:02:59 -03:00
|
|
|
# Copyright (C) Nginx, Inc.
|
2004-09-29 12:00:49 -04:00
|
|
|
|
|
|
|
|
2004-10-21 12:34:38 -03:00
|
|
|
echo $ngx_n "checking for $ngx_type size ...$ngx_c"
|
|
|
|
|
|
|
|
cat << END >> $NGX_AUTOCONF_ERR
|
|
|
|
|
|
|
|
----------------------------------------
|
|
|
|
checking for $ngx_type size
|
|
|
|
|
|
|
|
END
|
2003-11-20 14:36:43 -03:00
|
|
|
|
2004-06-27 14:01:57 -04:00
|
|
|
ngx_size=
|
2003-11-20 14:36:43 -03:00
|
|
|
|
2003-12-14 17:10:27 -03:00
|
|
|
cat << END > $NGX_AUTOTEST.c
|
2003-11-20 14:36:43 -03:00
|
|
|
|
2004-01-28 12:22:37 -03:00
|
|
|
#include <sys/types.h>
|
2003-12-14 17:10:27 -03:00
|
|
|
#include <sys/time.h>
|
2004-10-21 12:34:38 -03:00
|
|
|
$NGX_INCLUDE_UNISTD_H
|
2004-06-27 14:01:57 -04:00
|
|
|
#include <signal.h>
|
|
|
|
#include <sys/resource.h>
|
2004-10-21 12:34:38 -03:00
|
|
|
$NGX_INCLUDE_INTTYPES_H
|
|
|
|
$NGX_INCLUDE_AUTO_CONFIG_H
|
2003-11-20 14:36:43 -03:00
|
|
|
|
2003-12-14 17:10:27 -03:00
|
|
|
int main() {
|
|
|
|
printf("%d", sizeof($ngx_type));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
END
|
|
|
|
|
2004-10-21 12:34:38 -03:00
|
|
|
|
2005-12-05 10:18:09 -03:00
|
|
|
ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
|
2005-11-15 10:30:52 -03:00
|
|
|
-o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
|
|
|
|
|
2004-10-21 12:34:38 -03:00
|
|
|
eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
|
|
|
|
|
2003-12-14 17:10:27 -03:00
|
|
|
|
|
|
|
if [ -x $NGX_AUTOTEST ]; then
|
2004-06-27 14:01:57 -04:00
|
|
|
ngx_size=`$NGX_AUTOTEST`
|
|
|
|
echo " $ngx_size bytes"
|
2003-11-20 14:36:43 -03:00
|
|
|
fi
|
|
|
|
|
2004-10-21 12:34:38 -03:00
|
|
|
|
|
|
|
rm -f $NGX_AUTOTEST
|
|
|
|
|
2003-11-20 14:36:43 -03:00
|
|
|
|
2004-06-27 14:01:57 -04:00
|
|
|
case $ngx_size in
|
2003-11-20 14:36:43 -03:00
|
|
|
4)
|
2003-12-14 17:10:27 -03:00
|
|
|
if [ "$ngx_type"="long" ]; then
|
2004-06-27 14:01:57 -04:00
|
|
|
ngx_max_value=2147483647L
|
2003-11-25 17:44:56 -03:00
|
|
|
else
|
2004-06-27 14:01:57 -04:00
|
|
|
ngx_max_value=2147483647
|
2003-11-25 17:44:56 -03:00
|
|
|
fi
|
2004-06-27 14:01:57 -04:00
|
|
|
|
2006-06-28 12:00:26 -04:00
|
|
|
ngx_max_len='(sizeof("-2147483648") - 1)'
|
2003-11-20 14:36:43 -03:00
|
|
|
;;
|
|
|
|
|
|
|
|
8)
|
2003-12-14 17:10:27 -03:00
|
|
|
if [ "$ngx_type"="long long" ]; then
|
2004-06-27 14:01:57 -04:00
|
|
|
ngx_max_value=9223372036854775807LL
|
2003-11-25 17:44:56 -03:00
|
|
|
else
|
2004-06-27 14:01:57 -04:00
|
|
|
ngx_max_value=9223372036854775807L
|
2003-11-25 17:44:56 -03:00
|
|
|
fi
|
2004-06-27 14:01:57 -04:00
|
|
|
|
2006-06-28 12:00:26 -04:00
|
|
|
ngx_max_len='(sizeof("-9223372036854775808") - 1)'
|
2003-11-20 14:36:43 -03:00
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
2003-12-14 17:10:27 -03:00
|
|
|
echo
|
|
|
|
echo "$0: error: can not detect $ngx_type size"
|
2004-10-21 12:34:38 -03:00
|
|
|
|
|
|
|
echo "----------" >> $NGX_AUTOCONF_ERR
|
|
|
|
cat $NGX_AUTOTEST.c >> $NGX_AUTOCONF_ERR
|
|
|
|
echo "----------" >> $NGX_AUTOCONF_ERR
|
|
|
|
echo $ngx_test >> $NGX_AUTOCONF_ERR
|
|
|
|
echo "----------" >> $NGX_AUTOCONF_ERR
|
|
|
|
|
2003-11-20 14:36:43 -03:00
|
|
|
exit 1
|
|
|
|
esac
|
2004-10-21 12:34:38 -03:00
|
|
|
|