packages feed

altfloat-0.2.2: configure.ac

dnl Copyright (C) 2009-2010 Nick Bowler
dnl Copying and distribution of this file, with or without modification,
dnl are permitted in any medium without royalty provided the copyright
dnl notice and this notice are preserved.  This file is offered as-is,
dnl without any warranty.

AC_PREREQ(2.62)
AC_INIT([altfloat],[0.2.2],[nbowler@draconx.ca])
AC_CONFIG_SRCDIR([altfloat.cabal])
AC_CONFIG_HEADER([config.h])

dnl We don't actually care, but this shuts up the warning.
AC_ARG_WITH([compiler], [AS_HELP_STRING([--with-compiler],
	[specify which Haskell compiler to use])])

AC_PROG_CC_C99

dnl Cabal won't let us specify the C compiler, so we need this hack.
CC_OPTS=`echo $CC | sed 's/@<:@^@<:@:space:@:>@@:>@*//'`
AC_SUBST([CC_OPTS])

dnl Check for some C library functions.
replaced_libm=no
AC_DEFUN([CHECK_LIBM], [AC_SEARCH_LIBS([$1], [m], [], [dnl
	replaced_libm=yes
	AC_DEFINE([NEED_LIBM_]m4_toupper([$1]), [1],
		[Define to 1 if you do not have a working $1 function.])])])
CHECK_LIBM([nan])
CHECK_LIBM([log2])
CHECK_LIBM([exp2])
CHECK_LIBM([fma])
CHECK_LIBM([remquo])

AC_CONFIG_FILES([
	altfloat.buildinfo
])
AC_OUTPUT

if test x"$replaced_libm" = x"yes"; then
echo
AC_MSG_WARN([
Your C library appears to not provide all C99 math functions.
Replacements will be built, but note that they may raise spurious
exceptions or their accuracy may deviate from applicable standards.])
fi