altfloat-0.2.2
[altfloat.git] / configure.ac
blobcb05f25e9a478ba725432dc52051dfba691ee5c9
1 dnl Copyright (C) 2009-2010 Nick Bowler
2 dnl Copying and distribution of this file, with or without modification,
3 dnl are permitted in any medium without royalty provided the copyright
4 dnl notice and this notice are preserved.  This file is offered as-is,
5 dnl without any warranty.
7 AC_PREREQ(2.62)
8 AC_INIT([altfloat],[0.2.2],[nbowler@draconx.ca])
9 AC_CONFIG_SRCDIR([altfloat.cabal])
10 AC_CONFIG_HEADER([config.h])
12 dnl We don't actually care, but this shuts up the warning.
13 AC_ARG_WITH([compiler], [AS_HELP_STRING([--with-compiler],
14         [specify which Haskell compiler to use])])
16 AC_PROG_CC_C99
18 dnl Cabal won't let us specify the C compiler, so we need this hack.
19 CC_OPTS=`echo $CC | sed 's/@<:@^@<:@:space:@:>@@:>@*//'`
20 AC_SUBST([CC_OPTS])
22 dnl Check for some C library functions.
23 replaced_libm=no
24 AC_DEFUN([CHECK_LIBM], [AC_SEARCH_LIBS([$1], [m], [], [dnl
25         replaced_libm=yes
26         AC_DEFINE([NEED_LIBM_]m4_toupper([$1]), [1],
27                 [Define to 1 if you do not have a working $1 function.])])])
28 CHECK_LIBM([nan])
29 CHECK_LIBM([log2])
30 CHECK_LIBM([exp2])
31 CHECK_LIBM([fma])
32 CHECK_LIBM([remquo])
34 AC_CONFIG_FILES([
35         altfloat.buildinfo
37 AC_OUTPUT
39 if test x"$replaced_libm" = x"yes"; then
40 echo
41 AC_MSG_WARN([
42 Your C library appears to not provide all C99 math functions.
43 Replacements will be built, but note that they may raise spurious
44 exceptions or their accuracy may deviate from applicable standards.])