cairo/build/configure.ac.system
Chris Wilson 477df1f550 [test] Clear expected floating point exceptions
test/invalid-matrix deliberately feeds garbage into the API to test our
error detection. This causes FPE to be raised during the course of the
test - so they are deliberately disable for the duration. However, the
exceptions were not being cleared and so the FPE could be triggered on
the next floating point operation. This was being masked during make check,
by the fact that each test is run in its own forked process and was only
observed when multiple tests were run in foreground mode.
2009-05-15 21:31:03 +01:00

133 lines
4 KiB
Text

dnl
dnl Non-failing checks for functions, headers, libraries, etc go here
dnl
dnl ====================================================================
dnl Feature checks
dnl ====================================================================
AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = "xyes")
CAIRO_BIGENDIAN
CAIRO_CHECK_NATIVE_ATOMIC_PRIMITIVES
CAIRO_CHECK_ATOMIC_OP_NEEDS_MEMORY_BARRIER
AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(size_t)
AC_MSG_CHECKING([for native Win32])
case "$host" in
*-*-mingw*)
cairo_os_win32=yes
;;
*)
cairo_os_win32=no
;;
esac
AC_MSG_RESULT([$cairo_os_win32])
AM_CONDITIONAL(OS_WIN32, test "$cairo_os_win32" = "yes")
AC_MSG_CHECKING([for Sun Solaris (non-POSIX ctime_r)])
case "$host" in
*-*-solaris*)
CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS"
solaris_posix_pthread=yes
;;
*)
solaris_posix_pthread=no
;;
esac
AC_MSG_RESULT([$solaris_posix_pthread])
dnl ====================================================================
dnl Library checks
dnl ====================================================================
AC_CHECK_LIBM
LIBS="$LIBS $LIBM"
AC_CHECK_LIB(rt, sched_yield, [RT_LIBS=-lrt], [RT_LIBS=])
CAIROPERF_LIBS=$RT_LIBS
AC_SUBST(CAIROPERF_LIBS)
dnl ====================================================================
dnl Header/function checks
dnl ====================================================================
dnl Checks for precise integer types
AC_CHECK_HEADERS([stdint.h inttypes.h sys/int_types.h])
AC_CHECK_TYPES([uint64_t, uint128_t])
dnl Check for socket support for any2ppm daemon
AC_CHECK_HEADERS([fcntl.h unistd.h signal.h sys/stat.h sys/socket.h sys/poll.h sys/un.h])
dnl check for CPU affinity support
AC_CHECK_HEADERS([sched.h],
[AC_CHECK_FUNCS([sched_getaffinity])])
dnl check for GNU-extensions to fenv
AC_CHECK_HEADER(fenv.h,
[AC_CHECK_FUNCS(feenableexcept fedisableexcept feclearexcept)])
dnl check for misc headers and functions
AC_CHECK_HEADERS([libgen.h byteswap.h signal.h setjmp.h])
AC_CHECK_FUNCS([vasnprintf link ctime_r drand48 flockfile ffs])
dnl check for win32 headers (this detects mingw as well)
AC_CHECK_HEADERS([windows.h], have_windows=yes, have_windows=no)
dnl Possible headers for mkdir
AC_CHECK_HEADERS([sys/stat.h io.h])
AC_CHECK_FUNC(mkdir,
[AC_MSG_CHECKING([mkdir variant])
mkdir_variant="unknown"
save_CFLAGS="$CFLAGS"
CFLAGS=$WARN_CFLAGS
AC_TRY_COMPILE([
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_IO_H
#include <io.h>
#endif
],
[mkdir ("hello.world", 0777)],
mkdir_variant="mkdir(path, mode)",
[AC_TRY_COMPILE([
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_IO_H
#include <io.h>
#endif
],
[mkdir ("hello.world")],
mkdir_variant="mkdir(path)")])
AC_MSG_RESULT([$mkdir_variant])
CFLAGS="$save_CFLAGS"
if test "x$mkdir_variant" = "xmkdir(path, mode)"; then
AC_DEFINE(HAVE_MKDIR, 2,
[Define to non-zero if your system has mkdir, and to 2 if your version of mkdir requires a mode parameter])
else
AC_DEFINE(HAVE_MKDIR, 1,
[Define to non-zero if your system has mkdir, and to 2 if your version of mkdir requires a mode parameter])
fi])
# check for GNU-extensions to fenv
AC_CHECK_HEADER(fenv.h, [AC_CHECK_FUNCS(feenableexcept fedisableexcept)])
dnl ===========================================================================
dnl
dnl Test for the tools required for building one big test binary
dnl
AC_MSG_CHECKING([for the constructor attribute])
cairo_has_constructor_attribute="no"
AC_TRY_LINK([static void __attribute__((constructor)) constructor(void) {}], [],
cairo_has_constructor_attribute="yes"
)
AC_MSG_RESULT([$cairo_has_constructor_attribute])
if test "x$cairo_has_constructor_attribute" = "xyes"; then
AC_DEFINE(CAIRO_HAS_CONSTRUCTOR_ATTRIBUTE, 1, [Define to 1 if your compiler supports __attribute__(constructor)])
fi
AM_CONDITIONAL(CAIRO_HAS_CONSTRUCTOR_ATTRIBUTE, test "x$cairo_has_constructor_attribute" = "xyes")
AC_CHECK_FUNCS(fork waitpid raise)