X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fatanl.m4;h=646e13cbc6b078e0bc0d1b74e03cde7d02a7a3aa;hb=6b168421262adda71eed4cca137c34c1a9d6b981;hp=82c9cd409139cb5ba10a1ce9e7dd33a914858189;hpb=d959bf1ca51cddcd5810a1be44e3391c8965dd59;p=gnulib.git diff --git a/m4/atanl.m4 b/m4/atanl.m4 index 82c9cd409..646e13cbc 100644 --- a/m4/atanl.m4 +++ b/m4/atanl.m4 @@ -1,5 +1,5 @@ -# atanl.m4 serial 5 -dnl Copyright (C) 2010-2011 Free Software Foundation, Inc. +# atanl.m4 serial 7 +dnl Copyright (C) 2010-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -7,6 +7,8 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_ATANL], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) + AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) + dnl Persuade glibc to declare atanl(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) @@ -20,8 +22,10 @@ AC_DEFUN([gl_FUNC_ATANL], # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include + long double (*funcptr) (long double) = atanl; long double x;]], - [[return atanl (x) > 1;]])], + [[return funcptr (x) > 1 + || atanl (x) > 1;]])], [gl_cv_func_atanl_no_libm=yes], [gl_cv_func_atanl_no_libm=no]) ]) @@ -37,8 +41,10 @@ AC_DEFUN([gl_FUNC_ATANL], # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include + long double (*funcptr) (long double) = atanl; long double x;]], - [[return atanl (x) > 1;]])], + [[return funcptr (x) > 1 + || atanl (x) > 1;]])], [gl_cv_func_atanl_in_libm=yes], [gl_cv_func_atanl_in_libm=no]) LIBS="$save_LIBS" @@ -56,12 +62,17 @@ AC_DEFUN([gl_FUNC_ATANL], HAVE_DECL_ATANL=0 HAVE_ATANL=0 dnl Find libraries needed to link lib/atanl.c. - AC_REQUIRE([gl_FUNC_ISNANL]) - dnl Append $ISNANL_LIBM to ATANL_LIBM, avoiding gratuitous duplicates. - case " $ATANL_LIBM " in - *" $ISNANL_LIBM "*) ;; - *) ATANL_LIBM="$ATANL_LIBM $ISNANL_LIBM" ;; - esac + if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then + AC_REQUIRE([gl_FUNC_ATAN]) + ATANL_LIBM="$ATAN_LIBM" + else + AC_REQUIRE([gl_FUNC_ISNANL]) + dnl Append $ISNANL_LIBM to ATANL_LIBM, avoiding gratuitous duplicates. + case " $ATANL_LIBM " in + *" $ISNANL_LIBM "*) ;; + *) ATANL_LIBM="$ATANL_LIBM $ISNANL_LIBM" ;; + esac + fi fi AC_SUBST([ATANL_LIBM]) ])