From bf3afa40e7d626f970f5330eea61abc4409403d9 Mon Sep 17 00:00:00 2001 From: Jeff Hobbs Date: Mon, 26 Apr 2004 16:28:44 +0000 Subject: [PATCH] * configure (regened): * tclconfig/tcl.m4 (TEA_TCL_64BIT_FLAGS): update to define TCL_WIDE_INT_IS_LONG when 'using long'. --- configure | 31 +++++++++++++++++++------------ tclconfig/tcl.m4 | 14 ++++++++++---- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/configure b/configure index 925dd47..8295181 100755 --- a/configure +++ b/configure @@ -3379,6 +3379,8 @@ echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6 echo $ECHO_N "(cached) $ECHO_C" >&6 else + tcl_cv_type_64bit=none + # See if the compiler knows natively about __int64 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ @@ -3407,18 +3409,19 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - tcl_cv_type_64bit=__int64 + tcl_type_64bit=__int64 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -tcl_cv_type_64bit=none - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +tcl_type_64bit="long long" +fi +rm -f conftest.$ac_objext conftest.$ac_ext + # See if we should use long anyway Note that we substitute in the + # type that is our current guess for a 64-bit type inside this check + # program, so it should be modified only carefully... + if test "$cross_compiling" = yes; then + : else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" @@ -3428,7 +3431,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include - int main() {exit(!(sizeof(long long) > sizeof(long)));} + int main() {exit(!(sizeof(${tcl_type_64bit}) > sizeof(long)));} _ACEOF rm -f conftest$ac_exeext @@ -3442,20 +3445,24 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - tcl_cv_type_64bit="long long" + tcl_cv_type_64bit=${tcl_type_64bit} else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +( exit $ac_status ) +: fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -fi -rm -f conftest.$ac_objext conftest.$ac_ext fi if test "${tcl_cv_type_64bit}" = none ; then + cat >>confdefs.h <<\_ACEOF +#define TCL_WIDE_INT_IS_LONG 1 +_ACEOF + echo "$as_me:$LINENO: result: using long" >&5 echo "${ECHO_T}using long" >&6 elif test "${tcl_cv_type_64bit}" = "__int64" ; then diff --git a/tclconfig/tcl.m4 b/tclconfig/tcl.m4 index dd506bc..e443b99 100644 --- a/tclconfig/tcl.m4 +++ b/tclconfig/tcl.m4 @@ -2418,12 +2418,18 @@ AC_DEFUN(TEA_TCL_EARLY_FLAGS,[ AC_DEFUN(TEA_TCL_64BIT_FLAGS, [ AC_MSG_CHECKING([for 64-bit integer type]) AC_CACHE_VAL(tcl_cv_type_64bit,[ + tcl_cv_type_64bit=none + # See if the compiler knows natively about __int64 AC_TRY_COMPILE(,[__int64 value = (__int64) 0;], - tcl_cv_type_64bit=__int64,tcl_cv_type_64bit=none - AC_TRY_RUN([#include - int main() {exit(!(sizeof(long long) > sizeof(long)));} - ], tcl_cv_type_64bit="long long"))]) + tcl_type_64bit=__int64, tcl_type_64bit="long long") + # See if we should use long anyway Note that we substitute in the + # type that is our current guess for a 64-bit type inside this check + # program, so it should be modified only carefully... + AC_TRY_RUN([#include + int main() {exit(!(sizeof(]${tcl_type_64bit}[) > sizeof(long)));} + ], tcl_cv_type_64bit=${tcl_type_64bit},:,:)]) if test "${tcl_cv_type_64bit}" = none ; then + AC_DEFINE(TCL_WIDE_INT_IS_LONG) AC_MSG_RESULT([using long]) elif test "${tcl_cv_type_64bit}" = "__int64" ; then # We actually want to use the default tcl.h checks in this -- 2.23.0