warnings: fix compilation with old autoconf
[gnulib/ericb.git] / m4 / copysignl.m4
blob3e20cce20bc26d7bc44a45f14e7a2f10b05a1d38
1 # copysignl.m4 serial 3
2 dnl Copyright (C) 2011-2017 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_COPYSIGNL],
9   AC_REQUIRE([gl_MATH_H_DEFAULTS])
10   AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
12   dnl Persuade glibc <math.h> to declare copysignl().
13   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
15   dnl Determine COPYSIGNL_LIBM.
16   gl_MATHFUNC([copysignl], [long double], [(long double, long double)])
17   if test $gl_cv_func_copysignl_no_libm = no \
18      && test $gl_cv_func_copysignl_in_libm = no; then
19     HAVE_COPYSIGNL=0
20     if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then
21       AC_REQUIRE([gl_FUNC_COPYSIGN])
22       COPYSIGNL_LIBM="$COPYSIGN_LIBM"
23     else
24       COPYSIGNL_LIBM=
25     fi
26   fi
27   AC_SUBST([COPYSIGNL_LIBM])