This commit is contained in:
chris
2003-03-01 14:04:23 +00:00
parent 0d66972bef
commit 55aa26756b

View File

@@ -80,8 +80,7 @@ dnl
for type in u_int8_t u_int16_t u_int32_t ; do for type in u_int8_t u_int16_t u_int32_t ; do
AC_MSG_CHECKING([size of $type]) AC_MSG_CHECKING([size of $type])
defn="SIZEOF_"`echo $type | tr a-z A-Z` AC_RUN_IFELSE([
AC_TRY_RUN([
#include <sys/types.h> #include <sys/types.h>
#include <stdio.h> #include <stdio.h>
int main() { int main() {
@@ -91,14 +90,17 @@ int main() {
fprintf(f, "%d\n", sizeof($1)); fprintf(f, "%d\n", sizeof($1));
exit(0); exit(0);
} }
], [ ], [
x=`cat conftestval` x=`cat conftestval`
eval "size_$type=$x" eval "size_$type=$x"
AC_MSG_RESULT([$x]) AC_MSG_RESULT([$x])
], [ ], [
eval "size_$type=0" eval "size_$type=0"
AC_MSG_RESULT([unknown type]) AC_MSG_RESULT([unknown type])
]) ], [
eval "size_$type=0"
AC_MSG_RESULT([can't determine when cross-compiling])
])
done done
dnl Groan. Have to do things this way so that autoheader can do its thing.... dnl Groan. Have to do things this way so that autoheader can do its thing....
@@ -107,11 +109,13 @@ AC_DEFINE_UNQUOTED(SIZEOF_U_INT16_T, [$size_u_int16_t], [size of u_int16_t])
AC_DEFINE_UNQUOTED(SIZEOF_U_INT32_T, [$size_u_int32_t], [size of u_int32_t]) AC_DEFINE_UNQUOTED(SIZEOF_U_INT32_T, [$size_u_int32_t], [size of u_int32_t])
dnl If we already have these types, don't piss about any more.... dnl If we already have these types, don't piss about any more....
if test $size_u_int8_t != 1 -o $size_u_int16_t != 2 -o $size_u_int32_t != 4 ; then
if test $size_u_int8_t != 1 || test $size_u_int16_t != 2 || test $size_u_int32_t != 4 ; then
dnl XXXif test $size_u_int8_t != 1 -o $size_u_int16_t != 2 -o $size_u_int32_t != 4 ; then
do_int_types=1 do_int_types=1
AC_CHECK_HEADERS( AC_CHECK_HEADERS(
[stdint.h dnl C99 stdint.h dnl C99
sys/inttypes.h], dnl Solaris sys/inttypes.h, dnl Solaris
[do_int_types=0; break]) [do_int_types=0; break])
if test $do_int_types = 1 ; then if test $do_int_types = 1 ; then