summaryrefslogtreecommitdiff
path: root/sysdeps/arm/preconfigure
blob: 59d776d5ca9376366a5d858fbd898078ce34df55 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
 # Local preconfigure fragment for sysdeps/arm

case "$machine" in
arm*)

cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

#if !__ARM_EABI__
#error
#endif
int
main ()
{

  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :

else
  as_fn_error $? "Old ABI no longer supported" "$LINENO" 5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

  # If the compiler enables unwind tables by default, this causes
  # problems with undefined symbols in -nostdlib link tests.  To
  # avoid this, add -fno-unwind-tables here and remove it in
  # sysdeps/arm/configure.ac after those tests have been run.
  if test "${CFLAGS+set}" != "set"; then
    CFLAGS="-g -O2"
  fi
  CFLAGS="$CFLAGS -fno-unwind-tables"

  base_machine=arm
  # Lets ask the compiler which ARM family we've got
  # Unfortunately it doesn't define any flags for implementations
  # that you might pass to -mcpu or -mtune
  # Note if you add patterns here you must ensure that
  # an appropriate directory exists in sysdeps/arm
  archcppflag=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null |
    sed -n 's/^#define \(__ARM_ARCH_[0-9].*__\) .*$/\1/p'`

  case "x$archcppflag" in
  x__ARM_ARCH_89*__)
    machine=armv7
    { $as_echo "$as_me:${as_lineno-$LINENO}: Found compiler is configured for something newer than v7 - using v7" >&5
$as_echo "$as_me: Found compiler is configured for something newer than v7 - using v7" >&6;}
    ;;

  x__ARM_ARCH_7A__)
    machine=armv7
    { $as_echo "$as_me:${as_lineno-$LINENO}: Found compiler is configured for $machine" >&5
$as_echo "$as_me: Found compiler is configured for $machine" >&6;}
    ;;

  x__ARM_ARCH_6T2__)
    machine=armv6t2
    { $as_echo "$as_me:${as_lineno-$LINENO}: Found compiler is configured for $machine" >&5
$as_echo "$as_me: Found compiler is configured for $machine" >&6;}
    ;;
  x__ARM_ARCH_6*__)
    machine=armv6
    { $as_echo "$as_me:${as_lineno-$LINENO}: Found compiler is configured for $machine" >&5
$as_echo "$as_me: Found compiler is configured for $machine" >&6;}
    ;;
  *)
    machine=arm
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: arm/preconfigure: Did not find ARM architecture type; using default" >&5
$as_echo "$as_me: WARNING: arm/preconfigure: Did not find ARM architecture type; using default" >&2;}
    ;;
  esac

  machine=arm/$machine
esac