Detect hard/soft float in the same way as other ARM features
authorSimon Marlow <marlowsd@gmail.com>
Tue, 29 Jan 2013 11:53:35 +0000 (11:53 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 30 Jan 2013 20:25:52 +0000 (20:25 +0000)
aclocal.m4
configure.ac

index 7b185b9..0fe79cf 100644 (file)
@@ -379,10 +379,12 @@ AC_DEFUN([GET_ARM_ISA],
                         )],
                         [changequote(, )dnl
                          ARM_ISA_EXT="[VFPv2]"
-                         changequote([, ])dnl],
+                         changequote([, ])dnl
+                        ],
                         [changequote(, )dnl
                          ARM_ISA_EXT="[]"
-                         changequote([, ])dnl]
+                         changequote([, ])dnl
+                        ]
                 )],
                 [changequote(, )dnl
                  ARM_ISA=ARMv7
@@ -390,6 +392,33 @@ AC_DEFUN([GET_ARM_ISA],
                  changequote([, ])dnl
                 ])
         ])
+
+        AC_COMPILE_IFELSE(
+               [AC_LANG_PROGRAM(
+                       [],
+                       [#if defined(__SOFTFP__)
+                            return 0;
+                       #else
+                            not softfp
+                       #endif]
+               )],
+               [changequote(, )dnl
+                ARM_ABI="SOFT"
+                changequote([, ])dnl
+               ],
+               [AC_COMPILE_IFELSE(
+                    [AC_LANG_PROGRAM(
+                       [],
+                       [#if defined(__ARM_PCS_VFP)
+                            return 0;
+                       #else
+                            no hard float ABI
+                       #endif]
+                    )],
+                    [ARM_ABI="HARD"],
+                    [ARM_ABI="SOFTFP"]
+               )]
+        )
 ])
 
 
index 02f327f..29b240f 100644 (file)
@@ -207,19 +207,6 @@ AC_CANONICAL_BUILD
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
 
-# Testing ARM ABI
-# required for code generation (LLVM options)
-ARM_ABI=SOFT
-
-case $target in
-     arm*-*-linux-gnueabihf | arm*-linux-gnueabihf)
-     ARM_ABI=HARD
-     ;;
-     arm*-*-linux-gnueabi | arm*-linux-gnueabi)
-     ARM_ABI=SOFTFP
-     ;;
-esac
-
 FPTOOLS_SET_PLATFORM_VARS
 
 # Verify that the installed (bootstrap) GHC is capable of generating