temporarily disable elisp exception tests
[bpt/guile.git] / m4 / check-math-lib.m4
CommitLineData
005de2e8 1# check-math-lib.m4 serial 4
5e69ceb7 2dnl Copyright (C) 2007, 2009-2014 Free Software Foundation, Inc.
2e65b52f
LC
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6dnl
005de2e8 7dnl gl_CHECK_MATH_LIB (VARIABLE, EXPRESSION [, EXTRA-CODE])
2e65b52f
LC
8dnl
9dnl Sets the shell VARIABLE according to the libraries needed by EXPRESSION
10dnl to compile and link: to the empty string if no extra libraries are needed,
11dnl to "-lm" if -lm is needed, or to "missing" if it does not compile and
12dnl link either way.
13dnl
14dnl Example: gl_CHECK_MATH_LIB([ROUNDF_LIBM], [x = roundf (x);])
15AC_DEFUN([gl_CHECK_MATH_LIB], [
16 save_LIBS=$LIBS
17 $1=missing
18 for libm in "" "-lm"; do
19 LIBS="$save_LIBS $libm"
20 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
21 #ifndef __NO_MATH_INLINES
22 # define __NO_MATH_INLINES 1 /* for glibc */
23 #endif
24 #include <math.h>
005de2e8 25 $3
2e65b52f
LC
26 double x;]],
27 [$2])],
28 [$1=$libm
29break])
30 done
31 LIBS=$save_LIBS
32])