Re: [PATCH] for cross-compiling integral check

Stephen Paul Weber <[email protected]> Mon, 7 Jan 2013 17:14:26 -0500
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <20130107221426.GC1825@singpolyma-svelti>
--===============2829066659116603559==
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="Qz2CZ664xQdCRdPu"
Content-Disposition: inline


--Qz2CZ664xQdCRdPu
Content-Type: multipart/mixed; boundary="BI5RvnYi6R4T2M87"
Content-Disposition: inline


--BI5RvnYi6R4T2M87
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Somebody signing messages as Stephen Paul Weber wrote:
>I'm not 100% sure that the attached patch is the right solution, but it=20
>seems to work both on my local system as well as with my cross-compiler,=
=20
>and is not so dramatic as to remove the integralness check entirely.
>
>Feedback welcome.

It has been pointed out to me that I forgot to attach the patch.

Attached.

--=20
Stephen Paul Weber, @singpolyma
See <http://singpolyma.net> for how I prefer to be contacted
edition right joseph

--BI5RvnYi6R4T2M87
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0001-Possible-fix-for-detecting-Float-Double.patch"
Content-Transfer-Encoding: quoted-printable

=46rom ecefa87381ef47e71dc83a97ea55fa7ebd6d4481 Mon Sep 17 00:00:00 2001
=46rom: Stephen Paul Weber <[email protected]>
Date: Mon, 7 Jan 2013 16:50:34 -0500
Subject: [PATCH] Possible fix for detecting Float/Double

---
 aclocal.m4 |   74 +++++++++++++++++++++++++++++---------------------------=
----
 1 file changed, 36 insertions(+), 38 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 6e9801f..a038de8 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -126,49 +126,47 @@ AC_DEFUN([FPTOOLS_CHECK_HTYPE_ELSE],[
     AC_CACHE_VAL(AC_CV_NAME,[
         AC_CV_NAME_supported=3Dyes
         FP_COMPUTE_INT([HTYPE_IS_INTEGRAL],
-                       [(($1)((int)(($1)1.4))) =3D=3D (($1)1.4)],
-                       [FPTOOLS_HTYPE_INCLUDES],[AC_CV_NAME_supported=3Dno=
])
-        if test "$AC_CV_NAME_supported" =3D "yes"
+                       [($1)1.4],
+                       [FPTOOLS_HTYPE_INCLUDES],[HTYPE_IS_INTEGRAL=3D0])
+
+        if test "$HTYPE_IS_INTEGRAL" -eq 0
         then
-            if test "$HTYPE_IS_INTEGRAL" -eq 0
+            FP_COMPUTE_INT([HTYPE_IS_FLOAT],[sizeof($1) =3D=3D sizeof(floa=
t)],
+                           [FPTOOLS_HTYPE_INCLUDES],
+                           [AC_CV_NAME_supported=3Dno])
+            FP_COMPUTE_INT([HTYPE_IS_DOUBLE],[sizeof($1) =3D=3D sizeof(dou=
ble)],
+                           [FPTOOLS_HTYPE_INCLUDES],
+                           [AC_CV_NAME_supported=3Dno])
+            FP_COMPUTE_INT([HTYPE_IS_LDOUBLE],[sizeof($1) =3D=3D sizeof(lo=
ng double)],
+                           [FPTOOLS_HTYPE_INCLUDES],
+                           [AC_CV_NAME_supported=3Dno])
+            if test "$HTYPE_IS_FLOAT" -eq 1
+            then
+                AC_CV_NAME=3DFloat
+            elif test "$HTYPE_IS_DOUBLE" -eq 1
             then
-                FP_COMPUTE_INT([HTYPE_IS_FLOAT],[sizeof($1) =3D=3D sizeof(=
float)],
-                               [FPTOOLS_HTYPE_INCLUDES],
-                               [AC_CV_NAME_supported=3Dno])
-                FP_COMPUTE_INT([HTYPE_IS_DOUBLE],[sizeof($1) =3D=3D sizeof=
(double)],
-                               [FPTOOLS_HTYPE_INCLUDES],
-                               [AC_CV_NAME_supported=3Dno])
-                FP_COMPUTE_INT([HTYPE_IS_LDOUBLE],[sizeof($1) =3D=3D sizeo=
f(long double)],
-                               [FPTOOLS_HTYPE_INCLUDES],
-                               [AC_CV_NAME_supported=3Dno])
-                if test "$HTYPE_IS_FLOAT" -eq 1
-                then
-                    AC_CV_NAME=3DFloat
-                elif test "$HTYPE_IS_DOUBLE" -eq 1
-                then
-                    AC_CV_NAME=3DDouble
-                elif test "$HTYPE_IS_LDOUBLE" -eq 1
-                then
-                    AC_CV_NAME=3DLDouble
-                else
-                    AC_CV_NAME_supported=3Dno
-                fi
+                AC_CV_NAME=3DDouble
+            elif test "$HTYPE_IS_LDOUBLE" -eq 1
+            then
+                AC_CV_NAME=3DLDouble
             else
-                FP_COMPUTE_INT([HTYPE_IS_SIGNED],[(($1)(-1)) < (($1)0)],
-                               [FPTOOLS_HTYPE_INCLUDES],
-                               [AC_CV_NAME_supported=3Dno])
-                FP_COMPUTE_INT([HTYPE_SIZE],[sizeof($1) * 8],
-                               [FPTOOLS_HTYPE_INCLUDES],
-                               [AC_CV_NAME_supported=3Dno])
-                if test "$HTYPE_IS_SIGNED" -eq 0
-                then
-                    AC_CV_NAME=3D"Word$HTYPE_SIZE"
-                else
-                    AC_CV_NAME=3D"Int$HTYPE_SIZE"
-                fi
+                AC_CV_NAME_supported=3Dno
+            fi
+        else
+            FP_COMPUTE_INT([HTYPE_IS_SIGNED],[(($1)(-1)) < (($1)0)],
+                           [FPTOOLS_HTYPE_INCLUDES],
+                           [AC_CV_NAME_supported=3Dno])
+            FP_COMPUTE_INT([HTYPE_SIZE],[sizeof($1) * 8],
+                           [FPTOOLS_HTYPE_INCLUDES],
+                           [AC_CV_NAME_supported=3Dno])
+            if test "$HTYPE_IS_SIGNED" -eq 0
+            then
+                AC_CV_NAME=3D"Word$HTYPE_SIZE"
+            else
+                AC_CV_NAME=3D"Int$HTYPE_SIZE"
             fi
         fi
-        ])
+    ])
     if test "$AC_CV_NAME_supported" =3D no
     then
         $2
--=20
1.7.10.4


--BI5RvnYi6R4T2M87--

--Qz2CZ664xQdCRdPu
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBCAAGBQJQ60jBAAoJENEcKRHOUZzewUAP/iDaqtCNFO6RTL2Bs5seUCQS
zaXH2yslJmfD+cU3PE2kci7AwIKV+uVB0uhwFS0w8RWuTq3tYuzrxvma1m4KC8zt
kflq4TedLCqBF+K5T9+oUQtp5TcCdhOwuUkBu+bHuXs0DLHZahykzoFxI8RXTPOn
rKB1dbyblNRaIuU5Q5lUXWl7IS9sess7UlzJFAbusBrHyPb9M8OHZ0zJ5bO7CqCl
sofDQwRZUdUsEG3hkeY7Gw94/Z5AGXkkGgRSpMo9ZGilg9uiqHEv1Ix4UiAjnbQ7
wibKWaTX4+7gHaI0IsHG7JyL9F13gOcuTbjSP+Q8szvkHx3iQvPCn0OCF+kijx5/
WPfiq5pK0RWuns/PxoPBPln+e85PmiJJ9o3IO5cE/Uya79/Kgr4CtqIzYr/tRMKr
3GEaue8sK5pmMJda9voAPqnsWTOWodCkWY/mdwz6h0PRwMIuibhPXoRc8B5Clvpi
6p0X08h0XtXPlaUGylv8G0QCplCKyJ1c+B/2HicPjeJuEJNv83JH+i4+7S8P8Bgy
xEzVzk/AOqt4DyN/HkNT+MR7+8wW5PYruMfu5QY8g1oBQEp1V4m2vRZoS1hq+56X
WQB+b7n4e4M8LIqvDMTsrvRJ2Qb2VA5iRFtD5PlmnAvnnvh7JsDfAHHGWP60DIpT
WUFXgsJZ3gJ3vvSywEid
=1I0X
-----END PGP SIGNATURE-----

--Qz2CZ664xQdCRdPu--


--===============2829066659116603559==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

--===============2829066659116603559==--