From 2ce4783982022d727cf08cb8438ba2729fa4fed7 Mon Sep 17 00:00:00 2001
From: Martin Storsjo <martin@martin.st>
Date: Wed, 1 May 2013 23:05:54 +0300
Subject: [PATCH] configure: arm: Check __ARM_PCS_VFP if the float ABI hasn't
 been defined

The support for detecting hardfp toolchains in af9dd50e is a
step in the right direction, but that particular switch case
isn't executed at all if the toolchain variable is set.

This fixes cross building from x86 ubuntu to armhf ubuntu,
in configurations such as
"CROSS=arm-linux-gnueabihf- ./configure --target=armv7-linux-gcc".

Change-Id: I6f141361e40374fbab564f9196d90e598fe9a0f6
---
 build/make/configure.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/build/make/configure.sh b/build/make/configure.sh
index 23dc87f31a..e85a162a3f 100755
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -793,7 +793,13 @@ process_common_toolchain() {
             check_add_asflags --defsym ARCHITECTURE=${arch_int}
             tune_cflags="-mtune="
             if [ ${tgt_isa} == "armv7" ]; then
-                [ -z "${float_abi}" ] && float_abi=softfp
+                if [ -z "${float_abi}" ]; then
+                    check_cpp <<EOF && float_abi=hard || float_abi=softfp
+#ifndef __ARM_PCS_VFP
+#error "not hardfp"
+#endif
+EOF
+                fi
                 check_add_cflags  -march=armv7-a -mfloat-abi=${float_abi}
                 check_add_asflags -march=armv7-a -mfloat-abi=${float_abi}
 
-- 
GitLab