Commit 15338240 authored by Daniel Kochmański's avatar Daniel Kochmański

buildsystem: improve checks for floats

We do not check for c99-mandated functions for long float (we only
check for the type). We also check for complex numbers in a separate
function and define ECL_COMPLEX_FLOAT when found.
parent 7c6de43e
dnl -*- autoconf -*-
dnl --------------------------------------------------------------
dnl check existence of long double and supporting functions
dnl check existence of long double
AC_DEFUN([ECL_LONG_DOUBLE],[
if test "$enable_longdouble" != "no" ; then
AC_CHECK_TYPES([long double],[enable_longdouble=yes],[enable_longdouble=no])
if test "$enable_longdouble" != "no" ; then
AC_CHECK_FUNCS([sinl cosl tanl logl expl powl ldexpl frexpl],[],[enable_longdouble=no; break])
if test "$enable_longdouble" != "no" ; then
AC_DEFINE([ECL_LONG_FLOAT], [], [ECL_LONG_FLOAT])
fi
fi
fi
])
if test "$enable_longdouble" != "no" ; then
AC_CHECK_TYPES([long double],
[enable_longdouble=yes, AC_DEFINE([ECL_LONG_FLOAT], [], [ECL_LONG_FLOAT])]
[enable_longdouble=no])
fi])
dnl --------------------------------------------------------------
dnl check for existence of complex float
AC_DEFUN([ECL_COMPLEX_C99],[
if test "$enable_c99complex" != "no" ; then
AC_CHECK_TYPES([float complex, double complex, long complex],
[enable_c99complex=yes, AC_DEFINE([ECL_COMPLEX_FLOAT], [], [ECL_COMPLEX_FLOAT])],
[enable_c99complex=no],
[#include <complex.h>])
fi])
dnl --------------------------------------------------------------
dnl http://autoconf-archive.cryp.to/ac_c_long_long_.html
......
......@@ -740,7 +740,6 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
......@@ -867,7 +866,6 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
......@@ -1120,15 +1118,6 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
......@@ -1266,7 +1255,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir
libdir localedir mandir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
......@@ -1419,7 +1408,6 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
......@@ -1474,7 +1462,8 @@ Optional Features:
enable support for unicode (default=32)
--enable-longdouble include support for long double (yes|no|auto,
default=AUTO)
--enable-c99complex include support for C complex type (default=NO)
--enable-c99complex include support for c99 complex floats
(default=auto)
--enable-smallcons use small (2 words) cons types. Requires
Boehm-Weiser gc. (default=YES)
--enable-gengc use generational garbage collection. Requires
......@@ -2981,7 +2970,7 @@ fi
if test "${enable_c99complex+set}" = set; then :
enableval=$enable_c99complex; enable_c99complex=${enableval}
else
enable_c99complex=no
enable_c99complex=auto
fi
......@@ -8230,43 +8219,37 @@ $as_echo "no" >&6; }
fi
if test "$enable_longdouble" != "no" ; then
ac_fn_c_check_type "$LINENO" "long double" "ac_cv_type_long_double" "$ac_includes_default"
if test "$enable_longdouble" != "no" ; then
ac_fn_c_check_type "$LINENO" "long double" "ac_cv_type_long_double" "$ac_includes_default"
if test "x$ac_cv_type_long_double" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LONG_DOUBLE 1
_ACEOF
enable_longdouble=yes
else
enable_longdouble=no
enable_longdouble=yes,
$as_echo "#define ECL_LONG_FLOAT /**/" >>confdefs.h
enable_longdouble=no
fi
if test "$enable_longdouble" != "no" ; then
for ac_func in sinl cosl tanl logl expl powl ldexpl frexpl
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
else
enable_longdouble=no; break
fi
done
if test "$enable_c99complex" != "no" ; then
ac_fn_c_check_type "$LINENO" "float complex" "ac_cv_type_float_complex" "#include <complex.h>
"
if test "x$ac_cv_type_float_complex" = xyes; then :
if test "$enable_longdouble" != "no" ; then
cat >>confdefs.h <<_ACEOF
#define HAVE_FLOAT_COMPLEX 1
_ACEOF
$as_echo "#define ECL_LONG_FLOAT /**/" >>confdefs.h
enable_c99complex=yes,
$as_echo "#define ECL_COMPLEX_FLOAT /**/" >>confdefs.h
else
enable_c99complex=no
fi
fi
fi
if test "$enable_c99complex" != "no" ; then
ac_fn_c_check_type "$LINENO" "double complex" "ac_cv_type_double_complex" "#include <complex.h>
"
if test "x$ac_cv_type_double_complex" = xyes; then :
......@@ -8275,20 +8258,28 @@ cat >>confdefs.h <<_ACEOF
#define HAVE_DOUBLE_COMPLEX 1
_ACEOF
enable_c99complex=yes,
$as_echo "#define ECL_COMPLEX_FLOAT /**/" >>confdefs.h
else
enable_c99complex=no
fi
ac_fn_c_check_type "$LINENO" "float complex" "ac_cv_type_float_complex" "#include <complex.h>
ac_fn_c_check_type "$LINENO" "long complex" "ac_cv_type_long_complex" "#include <complex.h>
"
if test "x$ac_cv_type_float_complex" = xyes; then :
if test "x$ac_cv_type_long_complex" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_FLOAT_COMPLEX 1
#define HAVE_LONG_COMPLEX 1
_ACEOF
enable_c99complex=yes,
$as_echo "#define ECL_COMPLEX_FLOAT /**/" >>confdefs.h
else
enable_c99complex=no
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stack growns downwards" >&5
......
......@@ -237,9 +237,9 @@ AC_ARG_ENABLE(longdouble,
AC_ARG_ENABLE(c99complex,
AS_HELP_STRING( [--enable-c99complex],
[include support for C complex type]
[(default=NO)]),
[enable_c99complex=${enableval}], [enable_c99complex=no])
[include support for c99 complex floats]
[(default=auto)]),
[enable_c99complex=${enableval}], [enable_c99complex=auto])
AC_ARG_ENABLE(smallcons,
AS_HELP_STRING( [--enable-smallcons],
......@@ -715,9 +715,7 @@ ECL_FILE_STRUCTURE
ECL_FPE_MODEL
ECL_SSE
ECL_LONG_DOUBLE
if test "$enable_c99complex" != "no" ; then
AC_CHECK_TYPES([double complex, float complex],[],[],[#include <complex.h>])
fi
ECL_COMPLEX_C99
dnl -----------------------------------------------------------------------
dnl Study the call conventions
......
......@@ -15,6 +15,9 @@
/* Use CMU Common-Lisp's FORMAT routine */
#undef ECL_CMU_FORMAT
/* ECL_COMPLEX_FLOAT */
#undef ECL_COMPLEX_FLOAT
/* Do we use C or C++ compiler to compile ecl? */
#undef ECL_CXX_CORE
......@@ -99,9 +102,6 @@
/* Define to 1 if you have the `coshf' function. */
#undef HAVE_COSHF
/* Define to 1 if you have the `cosl' function. */
#undef HAVE_COSL
/* Define to 1 if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
......@@ -120,9 +120,6 @@
/* Define to 1 if you have the `expf' function. */
#undef HAVE_EXPF
/* Define to 1 if you have the `expl' function. */
#undef HAVE_EXPL
/* Define to 1 if you have the `fabsf' function. */
#undef HAVE_FABSF
......@@ -153,9 +150,6 @@
/* Define to 1 if you have the `frexpf' function. */
#undef HAVE_FREXPF
/* Define to 1 if you have the `frexpl' function. */
#undef HAVE_FREXPL
/* Define to 1 if you have the `fseeko' function. */
#undef HAVE_FSEEKO
......@@ -189,9 +183,6 @@
/* Define to 1 if you have the `ldexpf' function. */
#undef HAVE_LDEXPF
/* Define to 1 if you have the `ldexpl' function. */
#undef HAVE_LDEXPL
/* HAVE_LIBFFI */
#undef HAVE_LIBFFI
......@@ -219,8 +210,8 @@
/* Define to 1 if you have the `logf' function. */
#undef HAVE_LOGF
/* Define to 1 if you have the `logl' function. */
#undef HAVE_LOGL
/* Define to 1 if the system has the type `long complex'. */
#undef HAVE_LONG_COMPLEX
/* Define to 1 if the system has the type `long double'. */
#undef HAVE_LONG_DOUBLE
......@@ -271,9 +262,6 @@
/* Define to 1 if you have the `powf' function. */
#undef HAVE_POWF
/* Define to 1 if you have the `powl' function. */
#undef HAVE_POWL
/* Define to 1 if the system has the type `pthread_rwlock_t'. */
#undef HAVE_PTHREAD_RWLOCK_T
......@@ -314,9 +302,6 @@
/* Define to 1 if you have the `sinhf' function. */
#undef HAVE_SINHF
/* Define to 1 if you have the `sinl' function. */
#undef HAVE_SINL
/* Define to 1 if you have the `socket' function. */
#undef HAVE_SOCKET
......@@ -407,9 +392,6 @@
/* Define to 1 if you have the `tanhf' function. */
#undef HAVE_TANHF
/* Define to 1 if you have the `tanl' function. */
#undef HAVE_TANL
/* Define to 1 if you have the `times' function. */
#undef HAVE_TIMES
......
......@@ -203,8 +203,7 @@ typedef unsigned char ecl_base_char;
/* compiler understands long double */
#undef ECL_LONG_FLOAT
/* compiler understands complex */
#undef HAVE_DOUBLE_COMPLEX
#undef HAVE_FLOAT_COMPLEX
#undef ECL_COMPLEX_FLOAT
/* do we want NaNs and Infs */
#undef ECL_IEEE_FP
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment