diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-12-14 23:10:27 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-12-14 23:10:27 +0300 |
commit | dc867cd0fed793f86ce2b460f8c2ad069ddec1b5 (patch) | |
tree | 507db64a0a152c9ec99785a3ea887154ec4873b3 /auto/types | |
parent | 2b58fbf045acee349c323de8f50501f94c41c04d (diff) |
nginx-0.0.1-2003-12-14-23:10:27 import
Diffstat (limited to 'auto/types')
-rw-r--r-- | auto/types/sizeof | 54 | ||||
-rw-r--r-- | auto/types/typedef | 65 | ||||
-rw-r--r-- | auto/types/uintptr_t | 42 |
3 files changed, 95 insertions, 66 deletions
diff --git a/auto/types/sizeof b/auto/types/sizeof index 2e9e9b2ca..d015aeaec 100644 --- a/auto/types/sizeof +++ b/auto/types/sizeof @@ -1,44 +1,52 @@ -echo "checking for $NGX_TYPE size" +echo -n "checking for $ngx_type size ..." +echo >> $NGX_ERR +echo "checking for $ngx_type size" >> $NGX_ERR -NGX_BYTES= +ngx_bytes= -echo "#include <sys/types.h>" > autotest.c -echo "#include <sys/time.h>" >> autotest.c -echo "#include <sys/resource.h>" >> autotest.c -echo "$NGX_INTTYPES_H" >> autotest.c -echo "$NGX_AUTO_CONFIG" >> autotest.c -echo "int main() {" >> autotest.c -echo "printf(\"%d\", sizeof($NGX_TYPE));" >> autotest.c -echo "return 0; }" >> autotest.c +cat << END > $NGX_AUTOTEST.c -eval "$CC $CC_TEST_FLAGS -o autotest autotest.c > /dev/null 2>&1" +#include <sys/time.h> +#include <sys/resource.h> +$NGX_INTTYPES_H +$NGX_AUTO_CONFIG -if [ -x ./autotest ]; then - NGX_BYTES=`./autotest` - echo " + $NGX_TYPE is $NGX_BYTES bytes" +int main() { + printf("%d", sizeof($ngx_type)); + return 0; +} + +END + +eval "$CC $CC_TEST_FLAGS -o $NGX_AUTOTEST $NGX_AUTOTEST.c >> $NGX_ERR 2>&1" + +if [ -x $NGX_AUTOTEST ]; then + ngx_bytes=`$NGX_AUTOTEST` + echo " $ngx_bytes bytes" fi -rm autotest* +rm $NGX_AUTOTEST* -case $NGX_BYTES in +case $ngx_bytes in 4) - if [ "$NGX_TYPE"="long" ]; then - NGX_MAX_SIZE=2147483647L + if [ "$ngx_type"="long" ]; then + ngx_max_size=2147483647L else - NGX_MAX_SIZE=2147483647 + ngx_max_size=2147483647 fi ;; 8) - if [ "$NGX_TYPE"="long long" ]; then - NGX_MAX_SIZE=9223372036854775807LL + if [ "$ngx_type"="long long" ]; then + ngx_max_size=9223372036854775807LL else - NGX_MAX_SIZE=9223372036854775807L + ngx_max_size=9223372036854775807L fi ;; *) - echo "$0: error: can not detect $NGX_TYPE size" + echo + echo "$0: error: can not detect $ngx_type size" exit 1 esac diff --git a/auto/types/typedef b/auto/types/typedef index c3155c450..d093e01d7 100644 --- a/auto/types/typedef +++ b/auto/types/typedef @@ -1,45 +1,56 @@ -echo "checking for $NGX_TYPE" +echo -n "checking for $ngx_type ..." +echo >> $NGX_ERR +echo "checking for $ngx_type" >> $NGX_ERR -FOUND=NO +found=no -for TYPE in $NGX_TYPE $NGX_TYPES +for type in $ngx_type $ngx_types do - echo "#include <sys/types.h>" > autotest.c - echo "#include <sys/socket.h>" >> autotest.c - echo "#include <sys/time.h>" >> autotest.c - echo "#include <sys/resource.h>" >> autotest.c - echo "#include <netinet/in.h>" >> autotest.c - echo "$NGX_INTTYPES_H" >> autotest.c - echo "int main() { $TYPE i = 0; return 0; }" >> autotest.c - - eval "$CC -o autotest autotest.c > $NGX_ERR 2>&1" - - if [ -x autotest ]; then - if [ $TYPE = $NGX_TYPE ]; then - echo " + $NGX_TYPE found" - FOUND=YES + + cat << END > $NGX_AUTOTEST.c + +#include <sys/types.h> +#include <sys/socket.h> +#include <sys/time.h> +#include <sys/resource.h> +#include <netinet/in.h> +$NGX_INTTYPES_H + +int main() { + $type i = 0; + return 0; +} + +END + + eval "$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c >> $NGX_ERR 2>&1" + + if [ -x $NGX_AUTOTEST ]; then + if [ $type = $ngx_type ]; then + echo " found" + found=yes else - echo " + $TYPE used" - FOUND=$TYPE + echo ", $type used" + found=$type fi fi - rm autotest* + rm $NGX_AUTOTEST* - if [ $FOUND = NO ]; then - echo " + $TYPE not found" + if [ $found = no ]; then + echo -n " $type not found" else break fi done -if [ $FOUND = NO ]; then - echo "$0: error: can not define $NGX_TYPE" +if [ $found = no ]; then + echo + echo "$0: error: can not define $ngx_type" exit 1 fi -if [ $FOUND != YES ]; then - echo "typedef $FOUND $NGX_TYPE;" >> $NGX_AUTO_CONFIG_H - echo >> $NGX_AUTO_CONFIG_H +if [ $found != yes ]; then + echo "typedef $found $ngx_type;" >> $NGX_AUTO_CONFIG_H fi diff --git a/auto/types/uintptr_t b/auto/types/uintptr_t index 7c941c0bf..eb375b08d 100644 --- a/auto/types/uintptr_t +++ b/auto/types/uintptr_t @@ -1,27 +1,37 @@ -echo 'checking for uintptr_t' +echo -n "checking for uintptr_t ... " +echo >> $NGX_ERR +echo "checking for uintptr_t" >> $NGX_ERR -FOUND=NO +found=no -echo "#include <sys/types.h>" > autotest.c -echo "$NGX_INTTYPES_H" >> autotest.c -echo "int main() { uintptr_t i = 0; return 0; }" >> autotest.c +cat << END > $NGX_AUTOTEST.c -eval "$CC -o autotest autotest.c > /dev/null 2>&1" +#include <sys/types.h> +$NGX_INTTYPES_H -if [ -x autotest ]; then - echo " + uintptr_t found" - FOUND=YES +int main() { + uintptr_t i = 0; + return 0; +} + +END + +eval "$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c >> $NGX_ERR 2>&1" + +if [ -x $NGX_AUTOTEST ]; then + echo " uintptr_t found" + found=yes else - echo " + uintptr_t not found" + echo -n " uintptr_t not found" fi -rm autotest* +rm $NGX_AUTOTEST* + +if [ $found = no ]; then + found="uint`expr 8 \* $ngx_ptr_bytes`_t" + echo ", $found used" -if [ $FOUND = NO ]; then - FOUND="uint`expr 8 \* $NGX_PTR_BYTES`_t" - echo " + $FOUND used" - echo "typedef $FOUND uintptr_t;" >> $NGX_AUTO_CONFIG_H - echo >> $NGX_AUTO_CONFIG_H + echo "typedef $found uintptr_t;" >> $NGX_AUTO_CONFIG_H fi |