* ChangeLog: Fix misspelling
[gnulib.git] / m4 / cbrt.m4
blob1dcdbe843860b20443c9f5f9c6055414285f43c4
1 # cbrt.m4
2 # serial 3
3 dnl Copyright (C) 2012-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 AC_DEFUN([gl_FUNC_CBRT],
10   AC_REQUIRE([gl_MATH_H_DEFAULTS])
12   dnl Persuade glibc <math.h> to declare cbrt().
13   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
15   dnl Determine CBRT_LIBM.
16   gl_COMMON_DOUBLE_MATHFUNC([cbrt])
18   dnl Test whether cbrt() exists.
19   saved_LIBS="$LIBS"
20   LIBS="$LIBS $CBRT_LIBM"
21   AC_CHECK_FUNCS([cbrt])
22   LIBS="$saved_LIBS"
23   if test $ac_cv_func_cbrt = no; then
24     HAVE_CBRT=0
25     dnl Find libraries needed to link lib/cbrt.c.
26     AC_REQUIRE([gl_FUNC_FABS])
27     AC_REQUIRE([gl_FUNC_FREXP])
28     AC_REQUIRE([gl_FUNC_LDEXP])
29     CBRT_LIBM=
30     dnl Append $FABS_LIBM to CBRT_LIBM, avoiding gratuitous duplicates.
31     case " $CBRT_LIBM " in
32       *" $FABS_LIBM "*) ;;
33       *) CBRT_LIBM="$CBRT_LIBM $FABS_LIBM" ;;
34     esac
35     dnl Append $FREXP_LIBM to CBRT_LIBM, avoiding gratuitous duplicates.
36     case " $CBRT_LIBM " in
37       *" $FREXP_LIBM "*) ;;
38       *) CBRT_LIBM="$CBRT_LIBM $FREXP_LIBM" ;;
39     esac
40     dnl Append $LDEXP_LIBM to CBRT_LIBM, avoiding gratuitous duplicates.
41     case " $CBRT_LIBM " in
42       *" $LDEXP_LIBM "*) ;;
43       *) CBRT_LIBM="$CBRT_LIBM $LDEXP_LIBM" ;;
44     esac
45   fi