diff --git a/ChangeLog b/ChangeLog index f204909..234fb26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-06-13 Richard B. Kreckel + + * m4/general.m4 (CL_CANONICAL_HOST_CPU): Force host_cpu=i386 for x86_64 + if userland is 32 bit. + * include/cln/config.h.in: Simplify __x86_64__ selection. + * src/base/digitseq/cl_asm_x86_64_.cc: Remove. + 2006-06-09 Richard B. Kreckel * src/base/digitseq/cl_DS.h (struct DS): Change len type to uintC. diff --git a/include/cln/config.h.in b/include/cln/config.h.in index e31357e..3ef1e76 100644 --- a/include/cln/config.h.in +++ b/include/cln/config.h.in @@ -19,13 +19,9 @@ #undef __i386__ #endif -// Take care not to define both __i386__ and __x86_64__ on those systems with -// 64 bit kernel and 32 bit userland: #ifndef __x86_64__ -#ifndef __i386__ #undef __x86_64__ #endif -#endif #ifndef __m68k__ #undef __m68k__ diff --git a/m4/general.m4 b/m4/general.m4 index b9fa4ba..bb2f436 100644 --- a/m4/general.m4 +++ b/m4/general.m4 @@ -184,6 +184,23 @@ else host_cpu=sparc fi ;; +dnl AMD64 running Linux have 'uname -m' = "x86_64" even if userland is purely +dnl 32-bit. + x86_64 ) + AC_CACHE_CHECK([for 64-bit userland on x86-64], cl_cv_host_x86_64, [ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[[#if !defined __x86_64__ +# error __x86_64__ not defined +#endif +]]) +], [cl_cv_host_x86_64=yes], [cl_cv_host_x86_64=no]) +]) +if test $cl_cv_host_x86_64 = yes; then + host_cpu=x86_64 +else + host_cpu=i386 +fi + ;; esac dnl was AC_DEFINE_UNQUOTED(__${host_cpu}__) but KAI C++ 3.2d doesn't like this cat >> confdefs.h <