kumquat-buildroot/package/pixman/pixman-02-check-fe-divbyzero.patch
Thomas Petazzoni cb7c12f58c pixman: fix patch for FE_DIVBYZERO detection
In commit a9baea4345 ('pixman: add patch
to fix Microblaze build failure'), a patch is added to the pixman
package to avoid using the FE_DIVBYZERO definition when it is not
available. However, it was using the have_fe_divbyzero variable to
define or not HAVE_FEDIVBYZERO, while the AC_CHECK_DECL autoconf macro
sets the ac_cv_have_decl_FE_DIVBYZERO variable.

The end result was that the FE_DIVBYZERO macro was considered as never
being available. This commit fixes that by using the appropriate
variable.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-23 12:30:02 +01:00

42 lines
1.2 KiB
Diff

Add a check for FE_DIVBYZERO
Some architectures (namely Microblaze) do have fenv.h and
feenableexcept, but they don't have the FE_DIVBYZERO definition. This
patch adds a configure check for FE_DIVBYZERO, and only uses it if
it's available.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Index: b/configure.ac
===================================================================
--- a/configure.ac
+++ b/configure.ac
@@ -838,6 +838,11 @@
AC_DEFINE(HAVE_FEENABLEEXCEPT, 1, [Whether we have feenableexcept()])
fi
+AC_CHECK_DECL([FE_DIVBYZERO], [], [], [[#include <fenv.h>]])
+if test x$ac_cv_have_decl_FE_DIVBYZERO = xyes; then
+ AC_DEFINE(HAVE_FEDIVBYZERO, 1, [Whether we have FE_DIVBYZERO])
+fi
+
AC_CHECK_FUNC(gettimeofday, have_gettimeofday=yes, have_gettimeofday=no)
AC_CHECK_HEADER(sys/time.h, have_sys_time_h=yes, have_sys_time_h=no)
if test x$have_gettimeofday = xyes && test x$have_sys_time_h = xyes; then
Index: b/test/utils.c
===================================================================
--- a/test/utils.c
+++ b/test/utils.c
@@ -776,9 +776,11 @@
{
#ifdef HAVE_FENV_H
#ifdef HAVE_FEENABLEEXCEPT
+#ifdef HAVE_FE_DIVBYZERO
feenableexcept (FE_DIVBYZERO);
#endif
#endif
+#endif
}
void *