summaryrefslogtreecommitdiff
path: root/cpu/sysdeps/i386/preconfigure.ac
blob: 87bfc2da1e540cc4e01b930ad045c413f60a4535 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
dnl See acsite.m4 in the top-level source directory.
MCPU_PROVIDES
# Local preconfigure fragment for cpu/sysdeps/i386.

case "$machine" in
i@<:@4567@:>@86)
  base_machine=i386
  AC_CACHE_CHECK([whether $CC uses the i386 ILP32 data model],
                 [mcpu_cv_i386_ilp32], [dnl
    AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#ifndef __i386__
# error not i386
#endif
typedef char mcpu_int_must_be_4[(sizeof(int) == 4) ? 1 : -1];
typedef char mcpu_long_must_be_4[(sizeof(long) == 4) ? 1 : -1];
typedef char mcpu_ptr_must_be_4[(sizeof(void *) == 4) ? 1 : -1];
int main( void ) { return 0; }
    ]])], [mcpu_cv_i386_ilp32=yes], [mcpu_cv_i386_ilp32=no])
  ])
  if test "$mcpu_cv_i386_ilp32" != yes; then
    AC_MSG_ERROR([Not supported HOST $host: compiler does not use i386 ILP32 data model])
  fi
  machine=i386/$machine
  MCPU_HOST_DATA_MODEL=ILP32
  ;;
esac