1 # copysignf.m4 serial 4
2 dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 AC_DEFUN([gl_FUNC_COPYSIGNF],
9 AC_REQUIRE([gl_MATH_H_DEFAULTS])
10 AC_REQUIRE([AC_CANONICAL_HOST])
12 dnl Persuade glibc <math.h> to declare copysignf().
13 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
15 dnl Determine COPYSIGNF_LIBM.
16 gl_MATHFUNC([copysignf], [float], [(float, float)],
21 float copysignf (float, float);
23 if test $gl_cv_func_copysignf_no_libm = yes \
24 || test $gl_cv_func_copysignf_in_libm = yes; then
26 dnl Also check whether it's declared.
27 dnl IRIX 6.5 has copysignf() in libm but doesn't declare it in <math.h>.
28 AC_CHECK_DECL([copysignf], , [HAVE_DECL_COPYSIGNF=0], [[#include <math.h>]])
32 dnl On HP-UX 11.31/ia64, cc has a built-in for copysignf that redirects
33 dnl to the symbol '_copysignf', defined in libm, not libc.
35 hpux*) COPYSIGNF_LIBM='-lm' ;;
39 AC_SUBST([COPYSIGNF_LIBM])