ARM: Clean up EABI-related configury
[glibc.git] / sysdeps / arm / preconfigure.ac
blobd78817b83e222ddc4bb7224b8fad69bb3e54bbd9
1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2 # Local preconfigure fragment for sysdeps/arm
4 case "$machine" in
5 arm*)
6   AC_TRY_COMPILE([
7 #if !__ARM_EABI__
8 #error
9 #endif], [], [], [AC_MSG_ERROR([Old ABI no longer supported])])
11   # If the compiler enables unwind tables by default, this causes
12   # problems with undefined symbols in -nostdlib link tests.  To
13   # avoid this, add -fno-unwind-tables here and remove it in
14   # sysdeps/arm/configure.ac after those tests have been run.
15   if test "${CFLAGS+set}" != "set"; then
16     CFLAGS="-g -O2"
17   fi
18   CFLAGS="$CFLAGS -fno-unwind-tables"
20   base_machine=arm
21   # Lets ask the compiler which ARM family we've got
22   # Unfortunately it doesn't define any flags for implementations
23   # that you might pass to -mcpu or -mtune
24   # Note if you add patterns here you must ensure that
25   # an appropriate directory exists in sysdeps/arm
26   archcppflag=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null |
27     sed -n 's/^#define \(__ARM_ARCH_[0-9].*__\) .*$/\1/p'`
29   case "x$archcppflag" in
30   x__ARM_ARCH_[89]*__)
31     machine=armv7
32     AC_MSG_NOTICE([Found compiler is configured for something newer than v7 - using v7])
33     ;;
35   x__ARM_ARCH_7A__)
36     machine=armv7
37     AC_MSG_NOTICE([Found compiler is configured for $machine])
38     ;;
40   x__ARM_ARCH_6T2__)
41     machine=armv6t2
42     AC_MSG_NOTICE([Found compiler is configured for $machine])
43     ;;
44   x__ARM_ARCH_6*__)
45     machine=armv6
46     AC_MSG_NOTICE([Found compiler is configured for $machine])
47     ;;
48   *)
49     machine=arm
50     AC_MSG_WARN([arm/preconfigure: Did not find ARM architecture type; using default])
51     ;;
52   esac
54   machine=arm/$machine
55 esac