]> www.ginac.de Git - cln.git/blob - m4/longdouble.m4
build: switch to ordinary auto* tools system.
[cln.git] / m4 / longdouble.m4
1 dnl Copyright (C) 1993-2006 Free Software Foundation, Inc.
2 dnl This file is free software, distributed under the terms of the GNU
3 dnl General Public License.  As a special exception to the GNU General
4 dnl Public License, this file may be distributed as part of a program
5 dnl that contains a configuration script generated by Autoconf, under
6 dnl the same distribution terms as the rest of that program.
7
8 dnl From Bruno Haible, Marcus Daniels, Paul Eggert.
9
10 AC_PREREQ(2.13)
11
12 AC_DEFUN([CL_LONGDOUBLE],
13 [AC_CACHE_CHECK(for long double type, cl_cv_c_longdouble, [
14 AC_TRY_RUN([
15 #include <stdlib.h>
16 int main()
17 { long double x = 2.7182818284590452354L; x = x*x; exit (x==0.0L); }
18 ],
19 cl_cv_c_longdouble=yes, cl_cv_c_longdouble=no, [
20 dnl When cross-compiling, use the test from gnulib.
21 AC_TRY_COMPILE([
22   /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
23   long double foo = 0.0;
24   /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
25   int array [2*(sizeof(long double) >= sizeof(double)) - 1];
26   ], , cl_cv_c_longdouble=yes, cl_cv_c_longdouble=no)])
27 ])
28 if test $cl_cv_c_longdouble = yes; then
29   AC_DEFINE(HAVE_LONGDOUBLE, ,[Define if compiler supports long double type])
30 fi
31 ])