From 0085407514811e9ce51237ea767c7e2c1d2eddbe Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Wed, 10 Oct 2007 14:43:12 +0000 Subject: [PATCH] Fix __u64 and __s64 checks. --- configure | 108 ++++++++++++++++++++++++++++++++++++++++----------- configure.ac | 26 +++++-------- 2 files changed, 96 insertions(+), 38 deletions(-) diff --git a/configure b/configure index f35ab68..9c6efe4 100755 --- a/configure +++ b/configure @@ -27820,17 +27820,9 @@ fi done - for b in 8 16 32 64; do - for s in s u; do - ensc_libnl_stdint_type= - if test x"$s" = xu; then - ensc_libnl_stdint_type=u - fi - ensc_libnl_stdint_type="${ensc_libnl_stdint_type}int${b}_t" - as_ac_Type=`echo "ac_cv_type___${s}${b}" | $as_tr_sh` -echo "$as_me:$LINENO: checking for __${s}${b}" >&5 -echo $ECHO_N "checking for __${s}${b}... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Type+set}\" = set"; then + echo "$as_me:$LINENO: checking for __s64" >&5 +echo $ECHO_N "checking for __s64... $ECHO_C" >&6 +if test "${ac_cv_type___s64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -27844,13 +27836,87 @@ $ac_includes_default # include #endif +int +main () +{ +if ((__s64 *) 0) + return 0; +if (sizeof (__s64)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type___s64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type___s64=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type___s64" >&5 +echo "${ECHO_T}$ac_cv_type___s64" >&6 +if test $ac_cv_type___s64 = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE___S64 1 +_ACEOF + + : +else + +cat >>confdefs.h <<_ACEOF +#define __s64 int64_t +_ACEOF + +fi + + echo "$as_me:$LINENO: checking for __u64" >&5 +echo $ECHO_N "checking for __u64... $ECHO_C" >&6 +if test "${ac_cv_type___u64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#ifdef HAVE_ASM_TYPES_H +# include +#endif int main () { -if ((__${s}${b} *) 0) +if ((__u64 *) 0) return 0; -if (sizeof (__${s}${b})) +if (sizeof (__u64)) return 0; ; return 0; @@ -27878,34 +27944,32 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - eval "$as_ac_Type=yes" + ac_cv_type___u64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Type=no" +ac_cv_type___u64=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Type'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Type'}'`" >&6 -if test `eval echo '${'$as_ac_Type'}'` = yes; then +echo "$as_me:$LINENO: result: $ac_cv_type___u64" >&5 +echo "${ECHO_T}$ac_cv_type___u64" >&6 +if test $ac_cv_type___u64 = yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE___${s}${b}" | $as_tr_cpp` 1 +#define HAVE___U64 1 _ACEOF : else cat >>confdefs.h <<_ACEOF -#define __${s}${b} $ensc_libnl_stdint_type +#define __u64 uint64_t _ACEOF fi - done - done fi if test x"$ensc_have_libnl" = xyes; then diff --git a/configure.ac b/configure.ac index c9eccaf..eb3c145 100644 --- a/configure.ac +++ b/configure.ac @@ -351,24 +351,18 @@ fi if test x"$ensc_have_libnl" = xyes; then AC_CHECK_HEADERS([asm/types.h stdint.h], [ : ], [ ensc_have_libnl=no ]) - for b in 8 16 32 64; do - for s in s u; do - ensc_libnl_stdint_type= - if test x"$s" = xu; then - ensc_libnl_stdint_type=u - fi - ensc_libnl_stdint_type="${ensc_libnl_stdint_type}int${b}_t" - AC_CHECK_TYPES([__${s}${b}], [ : ], - [AC_DEFINE_UNQUOTED([__${s}${b}], - [$ensc_libnl_stdint_type], - [__${s}${b} type])], - [AC_INCLUDES_DEFAULT() + AC_CHECK_TYPES([__s64], [ : ], [AC_DEFINE_UNQUOTED([__s64], [int64_t], + [Define this to a signed 64-bit integer type])], + [AC_INCLUDES_DEFAULT() #ifdef HAVE_ASM_TYPES_H # include -#endif] - ) - done - done +#endif]) + AC_CHECK_TYPES([__u64], [ : ], [AC_DEFINE_UNQUOTED([__u64], [uint64_t], + [Define this to an unsigned 64-bit integer type])], + [AC_INCLUDES_DEFAULT() +#ifdef HAVE_ASM_TYPES_H +# include +#endif]) fi if test x"$ensc_have_libnl" = xyes; then -- 2.43.0