about summary refs log tree commit diff
path: root/configure
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2014-02-27 23:18:42 -0500
committerRich Felker <dalias@aerifal.cx>2014-02-27 23:18:42 -0500
commitb1683a1d6a4391ffef6ce12be9aa172d0f4f59bc (patch)
tree52eb1e9245808f14580e892073856b78e606dc13 /configure
parent5c27c4458f11adaba261353f84bcde4f79f0bdbd (diff)
downloadmusl-b1683a1d6a4391ffef6ce12be9aa172d0f4f59bc.tar.gz
musl-b1683a1d6a4391ffef6ce12be9aa172d0f4f59bc.tar.xz
musl-b1683a1d6a4391ffef6ce12be9aa172d0f4f59bc.zip
add nofpu subarchs to the sh arch, and properly detect compiler's fpu config
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure20
1 files changed, 18 insertions, 2 deletions
diff --git a/configure b/configure
index 1a092f52..572ea640 100755
--- a/configure
+++ b/configure
@@ -421,8 +421,24 @@ fi
 test "$ARCH" = "microblaze" && trycppif __MICROBLAZEEL__ "$t" \
 && SUBARCH=${SUBARCH}el
 
-test "$ARCH" = "sh" && trycppif __BIG_ENDIAN__ "$t" \
-&& SUBARCH=${SUBARCH}eb
+if test "$ARCH" = "sh" ; then
+trycppif __BIG_ENDIAN__ "$t" && SUBARCH=${SUBARCH}eb
+if trycppif __SH_FPU_ANY__ ; then
+# Some sh configurations are broken and replace double with float
+# rather than using softfloat when the fpu is present but only
+# supports single precision. Reject them.
+printf "checking whether compiler's double type is IEEE double... "
+echo 'typedef char dblcheck[(int)sizeof(double)-5];' >> "$tmpc"
+if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
+printf "yes\n"
+else
+printf "no\n"
+fail "$0: error: compiler's floating point configuration is unsupported"
+fi
+else
+SUBARCH=${SUBARCH}-nofpu
+fi
+fi
 
 test "$SUBARCH" \
 && printf "configured for %s variant: %s\n" "$ARCH" "$ARCH$SUBARCH"