Patchwork [V2] libgfortran: do not assume libm

login
register
mail settings
Submitter Tristan Gingold
Date March 22, 2012, 8:30 a.m.
Message ID <BB208731-93A2-45B4-95C4-C8179CB4FAC3@adacore.com>
Download mbox | patch
Permalink /patch/148188/
State New
Headers show

Comments

Tristan Gingold - March 22, 2012, 8:30 a.m.
Hi,

this is version 2 of the patch.

The initial problem is that libgfortran configure.ac used AC_CHECK_LIB([m]…) to check wether several math functions are available.  That doesn't work on VMS, because there is no such things as a libm.

It seems to me that there are no autoconf macro to check wether a function is available: AC_CHECK_FUNC[S] don't allow to specify additional include files (necessary on VMS as some math functions are renamed through macros), and AC_CHECK_DECL only checks the presence of the declaration (as pointed out by Ralf).

So I have finally learnt a little bit more about autoconf and added a new file: config/math.m4 (build machinery maintainer cc:)
libgfortran/configure.ac now uses the new GCC_CHECK_MATH_FUNC macro.

Bootstrapped without gfortran regressions on x86_64-darwin.

Ok for trunk ?

(I will submit a follow-up change in libquadmath once this change is approved).

Tristan.

config/
2012-03-22  Tristan Gingold  <gingold@adacore.com>

	* math.m4: New file.

libgfortran/
2012-03-22  Tristan Gingold  <gingold@adacore.com>

	* configure.ac: Use GCC_CHECK_MATH_FUNC for math functions.
	* acinclude.m4: Include ../config/math.m4
	* configure: Regenerate.
	* Makefile.in: Regenerate.
Paolo Bonzini - March 22, 2012, 10:06 a.m.
Il 22/03/2012 09:30, Tristan Gingold ha scritto:
> Hi,
> 
> this is version 2 of the patch.
> 
> The initial problem is that libgfortran configure.ac used AC_CHECK_LIB([m]…) to check wether several math functions are available.  That doesn't work on VMS, because there is no such things as a libm.
> 
> It seems to me that there are no autoconf macro to check wether a function is available: AC_CHECK_FUNC[S] don't allow to specify additional include files (necessary on VMS as some math functions are renamed through macros), and AC_CHECK_DECL only checks the presence of the declaration (as pointed out by Ralf).
> 
> So I have finally learnt a little bit more about autoconf and added a new file: config/math.m4 (build machinery maintainer cc:)
> libgfortran/configure.ac now uses the new GCC_CHECK_MATH_FUNC macro.
> 
> Bootstrapped without gfortran regressions on x86_64-darwin.
> 
> Ok for trunk ?
> 
> (I will submit a follow-up change in libquadmath once this change is approved).
> 
> Tristan.
> 
> config/
> 2012-03-22  Tristan Gingold  <gingold@adacore.com>
> 
> 	* math.m4: New file.
> 
> libgfortran/
> 2012-03-22  Tristan Gingold  <gingold@adacore.com>
> 
> 	* configure.ac: Use GCC_CHECK_MATH_FUNC for math functions.
> 	* acinclude.m4: Include ../config/math.m4
> 	* configure: Regenerate.
> 	* Makefile.in: Regenerate.

Ok.
Tobias Burnus - March 22, 2012, 8:57 p.m.
Paolo Bonzini wrote:
> Il 22/03/2012 09:30, Tristan Gingold ha scritto:
>> Bootstrapped without gfortran regressions on x86_64-darwin.
>> Ok for trunk ?
>>
>> (I will submit a follow-up change in libquadmath once this change is approved).
>>
>> config/
>> 2012-03-22  Tristan Gingold<gingold@adacore.com>
>>
>> 	* math.m4: New file.
>>
>> libgfortran/
>> 2012-03-22  Tristan Gingold<gingold@adacore.com>
>>
>> 	* configure.ac: Use GCC_CHECK_MATH_FUNC for math functions.
>> 	* acinclude.m4: Include ../config/math.m4
>> 	* configure: Regenerate.
>> 	* Makefile.in: Regenerate.
> Ok.

I have the feeling that you are still waiting for an expliciat gfortran 
approval - however, I think that a build maintainer's okay should be 
sufficient.

Thus, for what it is worth: I believe that patch is okay.

Tobias
Tristan Gingold - March 26, 2012, 8:44 a.m.
On Mar 22, 2012, at 11:06 AM, Paolo Bonzini wrote:

> Il 22/03/2012 09:30, Tristan Gingold ha scritto:
>> Hi,
>> 
>> this is version 2 of the patch.
>> 
>> The initial problem is that libgfortran configure.ac used AC_CHECK_LIB([m]…) to check wether several math functions are available.  That doesn't work on VMS, because there is no such things as a libm.
>> 
>> It seems to me that there are no autoconf macro to check wether a function is available: AC_CHECK_FUNC[S] don't allow to specify additional include files (necessary on VMS as some math functions are renamed through macros), and AC_CHECK_DECL only checks the presence of the declaration (as pointed out by Ralf).
>> 
>> So I have finally learnt a little bit more about autoconf and added a new file: config/math.m4 (build machinery maintainer cc:)
>> libgfortran/configure.ac now uses the new GCC_CHECK_MATH_FUNC macro.
>> 
>> Bootstrapped without gfortran regressions on x86_64-darwin.
>> 
>> Ok for trunk ?
>> 
>> (I will submit a follow-up change in libquadmath once this change is approved).
>> 
>> Tristan.
>> 
>> config/
>> 2012-03-22  Tristan Gingold  <gingold@adacore.com>
>> 
>> 	* math.m4: New file.
>> 
>> libgfortran/
>> 2012-03-22  Tristan Gingold  <gingold@adacore.com>
>> 
>> 	* configure.ac: Use GCC_CHECK_MATH_FUNC for math functions.
>> 	* acinclude.m4: Include ../config/math.m4
>> 	* configure: Regenerate.
>> 	* Makefile.in: Regenerate.
> 
> Ok.

Thanks, now committed.

Tristan.
Janne Blomqvist - March 26, 2012, 9:43 p.m.
On Mon, Mar 26, 2012 at 11:44, Tristan Gingold <gingold@adacore.com> wrote:
>
> On Mar 22, 2012, at 11:06 AM, Paolo Bonzini wrote:
>
>> Il 22/03/2012 09:30, Tristan Gingold ha scritto:
>>> Hi,
>>>
>>> this is version 2 of the patch.
>>>
>>> The initial problem is that libgfortran configure.ac used AC_CHECK_LIB([m]…) to check wether several math functions are available.  That doesn't work on VMS, because there is no such things as a libm.
>>>
>>> It seems to me that there are no autoconf macro to check wether a function is available: AC_CHECK_FUNC[S] don't allow to specify additional include files (necessary on VMS as some math functions are renamed through macros), and AC_CHECK_DECL only checks the presence of the declaration (as pointed out by Ralf).
>>>
>>> So I have finally learnt a little bit more about autoconf and added a new file: config/math.m4 (build machinery maintainer cc:)
>>> libgfortran/configure.ac now uses the new GCC_CHECK_MATH_FUNC macro.
>>>
>>> Bootstrapped without gfortran regressions on x86_64-darwin.
>>>
>>> Ok for trunk ?
>>>
>>> (I will submit a follow-up change in libquadmath once this change is approved).
>>>
>>> Tristan.
>>>
>>> config/
>>> 2012-03-22  Tristan Gingold  <gingold@adacore.com>
>>>
>>>      * math.m4: New file.
>>>
>>> libgfortran/
>>> 2012-03-22  Tristan Gingold  <gingold@adacore.com>
>>>
>>>      * configure.ac: Use GCC_CHECK_MATH_FUNC for math functions.
>>>      * acinclude.m4: Include ../config/math.m4
>>>      * configure: Regenerate.
>>>      * Makefile.in: Regenerate.
>>
>> Ok.
>
> Thanks, now committed.

On x86_64-unknown-linux-gnu bootstrap I see the following:


make[1]: Entering directory
`/home/janne/src/gfortran/trunk/objdir-git/x86_64-unknown-linux-gnu/libgfortran'
make  check-am
make[2]: Entering directory
`/home/janne/src/gfortran/trunk/objdir-git/x86_64-unknown-linux-gnu/libgfortran'
(CDPATH="${ZSH_VERSION+.}:" && cd ../../../trunk-git/libgfortran &&
/bin/bash /home/janne/src/gfortran/trunk/trunk-git/missing --run
autoheader)
true  DO=all multi-do # make
make[1]: Entering directory `/home/janne/src/gfortran/trunk/objdir-git/gcc'
Making a new config file...
echo "set tmpdir
/home/janne/src/gfortran/trunk/objdir-git/gcc/testsuite" >> ./site.tmp
autoheader: warning: missing template: HAVE_ACOS
autoheader: Use AC_DEFINE([HAVE_ACOS], [], [Description])
autoheader: warning: missing template: HAVE_ACOSF
autoheader: warning: missing template: HAVE_ACOSH
autoheader: warning: missing template: HAVE_ACOSHF
autoheader: warning: missing template: HAVE_ACOSHL
autoheader: warning: missing template: HAVE_ACOSL
autoheader: warning: missing template: HAVE_ASIN
autoheader: warning: missing template: HAVE_ASINF
autoheader: warning: missing template: HAVE_ASINH
autoheader: warning: missing template: HAVE_ASINHF
autoheader: warning: missing template: HAVE_ASINHL
autoheader: warning: missing template: HAVE_ASINL
autoheader: warning: missing template: HAVE_ATAN
autoheader: warning: missing template: HAVE_ATAN2
autoheader: warning: missing template: HAVE_ATAN2F
autoheader: warning: missing template: HAVE_ATAN2L
autoheader: warning: missing template: HAVE_ATANF
autoheader: warning: missing template: HAVE_ATANH
autoheader: warning: missing template: HAVE_ATANHF
autoheader: warning: missing template: HAVE_ATANHL
autoheader: warning: missing template: HAVE_ATANL
autoheader: warning: missing template: HAVE_CABS
autoheader: warning: missing template: HAVE_CABSF
autoheader: warning: missing template: HAVE_CABSL
autoheader: warning: missing template: HAVE_CACOS
autoheader: warning: missing template: HAVE_CACOSF
autoheader: warning: missing template: HAVE_CACOSH
autoheader: warning: missing template: HAVE_CACOSHF
autoheader: warning: missing template: HAVE_CACOSHL
autoheader: warning: missing template: HAVE_CACOSL
autoheader: warning: missing template: HAVE_CARG
autoheader: warning: missing template: HAVE_CARGF
autoheader: warning: missing template: HAVE_CARGL
autoheader: warning: missing template: HAVE_CASIN
autoheader: warning: missing template: HAVE_CASINF
autoheader: warning: missing template: HAVE_CASINH
autoheader: warning: missing template: HAVE_CASINHF
autoheader: warning: missing template: HAVE_CASINHL
autoheader: warning: missing template: HAVE_CASINL
autoheader: warning: missing template: HAVE_CATAN
autoheader: warning: missing template: HAVE_CATANF
autoheader: warning: missing template: HAVE_CATANH
autoheader: warning: missing template: HAVE_CATANHF
autoheader: warning: missing template: HAVE_CATANHL
autoheader: warning: missing template: HAVE_CATANL
autoheader: warning: missing template: HAVE_CCOS
autoheader: warning: missing template: HAVE_CCOSF
autoheader: warning: missing template: HAVE_CCOSH
autoheader: warning: missing template: HAVE_CCOSHF
autoheader: warning: missing template: HAVE_CCOSHL
autoheader: warning: missing template: HAVE_CCOSL
autoheader: warning: missing template: HAVE_CEIL
autoheader: warning: missing template: HAVE_CEILF
autoheader: warning: missing template: HAVE_CEILL
autoheader: warning: missing template: HAVE_CEXP
autoheader: warning: missing template: HAVE_CEXPF
autoheader: warning: missing template: HAVE_CEXPL
autoheader: warning: missing template: HAVE_CLOG10
autoheader: warning: missing template: HAVE_CLOG10F
autoheader: warning: missing template: HAVE_CLOG10L
autoheader: warning: missing template: HAVE_CLOGF
autoheader: warning: missing template: HAVE_CLOGL
autoheader: warning: missing template: HAVE_COPYSIGN
autoheader: warning: missing template: HAVE_COPYSIGNF
autoheader: warning: missing template: HAVE_COPYSIGNL
autoheader: warning: missing template: HAVE_COS
autoheader: warning: missing template: HAVE_COSF
autoheader: warning: missing template: HAVE_COSH
autoheader: warning: missing template: HAVE_COSHF
autoheader: warning: missing template: HAVE_COSHL
autoheader: warning: missing template: HAVE_COSL
autoheader: warning: missing template: HAVE_CPOW
autoheader: warning: missing template: HAVE_CPOWF
autoheader: warning: missing template: HAVE_CPOWL
autoheader: warning: missing template: HAVE_CSIN
autoheader: warning: missing template: HAVE_CSINF
autoheader: warning: missing template: HAVE_CSINH
autoheader: warning: missing template: HAVE_CSINHF
autoheader: warning: missing template: HAVE_CSINHL
autoheader: warning: missing template: HAVE_CSINL
autoheader: warning: missing template: HAVE_CSQRT
autoheader: warning: missing template: HAVE_CSQRTF
autoheader: warning: missing template: HAVE_CSQRTL
autoheader: warning: missing template: HAVE_CTAN
autoheader: warning: missing template: HAVE_CTANF
autoheader: warning: missing template: HAVE_CTANH
autoheader: warning: missing template: HAVE_CTANHF
autoheader: warning: missing template: HAVE_CTANHL
autoheader: warning: missing template: HAVE_CTANL
autoheader: warning: missing template: HAVE_ERF
autoheader: warning: missing template: HAVE_ERFC
autoheader: warning: missing template: HAVE_ERFCF
autoheader: warning: missing template: HAVE_ERFCL
autoheader: warning: missing template: HAVE_ERFF
autoheader: warning: missing template: HAVE_ERFL
autoheader: warning: missing template: HAVE_EXP
autoheader: warning: missing template: HAVE_EXPF
autoheader: warning: missing template: HAVE_EXPL
autoheader: warning: missing template: HAVE_FABS
autoheader: warning: missing template: HAVE_FABSF
autoheader: warning: missing template: HAVE_FABSL
autoheader: warning: missing template: HAVE_FLOOR
autoheader: warning: missing template: HAVE_FLOORF
autoheader: warning: missing template: HAVE_FLOORL
autoheader: warning: missing template: HAVE_FMOD
autoheader: warning: missing template: HAVE_FMODF
autoheader: warning: missing template: HAVE_FMODL
autoheader: warning: missing template: HAVE_FREXP
autoheader: warning: missing template: HAVE_FREXPF
autoheader: warning: missing template: HAVE_FREXPL
autoheader: warning: missing template: HAVE_HYPOT
autoheader: warning: missing template: HAVE_HYPOTF
autoheader: warning: missing template: HAVE_HYPOTL
autoheader: warning: missing template: HAVE_J0
autoheader: warning: missing template: HAVE_J0F
autoheader: warning: missing template: HAVE_J0L
autoheader: warning: missing template: HAVE_J1
autoheader: warning: missing template: HAVE_J1F
autoheader: warning: missing template: HAVE_J1L
autoheader: warning: missing template: HAVE_JN
autoheader: warning: missing template: HAVE_JNF
autoheader: warning: missing template: HAVE_JNL
autoheader: warning: missing template: HAVE_LDEXP
autoheader: warning: missing template: HAVE_LDEXPF
autoheader: warning: missing template: HAVE_LDEXPL
autoheader: warning: missing template: HAVE_LGAMMA
autoheader: warning: missing template: HAVE_LGAMMAF
autoheader: warning: missing template: HAVE_LGAMMAL
autoheader: warning: missing template: HAVE_LLROUND
autoheader: warning: missing template: HAVE_LLROUNDF
autoheader: warning: missing template: HAVE_LLROUNDL
autoheader: warning: missing template: HAVE_LOG
autoheader: warning: missing template: HAVE_LOG10
autoheader: warning: missing template: HAVE_LOG10F
autoheader: warning: missing template: HAVE_LOG10L
autoheader: warning: missing template: HAVE_LOGF
autoheader: warning: missing template: HAVE_LOGL
autoheader: warning: missing template: HAVE_LROUND
autoheader: warning: missing template: HAVE_LROUNDF
autoheader: warning: missing template: HAVE_LROUNDL
autoheader: warning: missing template: HAVE_NEXTAFTER
autoheader: warning: missing template: HAVE_NEXTAFTERF
autoheader: warning: missing template: HAVE_NEXTAFTERL
autoheader: warning: missing template: HAVE_POW
autoheader: warning: missing template: HAVE_POWF
autoheader: warning: missing template: HAVE_POWL
autoheader: warning: missing template: HAVE_ROUND
autoheader: warning: missing template: HAVE_ROUNDF
autoheader: warning: missing template: HAVE_ROUNDL
autoheader: warning: missing template: HAVE_SCALBN
autoheader: warning: missing template: HAVE_SCALBNF
autoheader: warning: missing template: HAVE_SCALBNL
autoheader: warning: missing template: HAVE_SIN
autoheader: warning: missing template: HAVE_SINF
autoheader: warning: missing template: HAVE_SINH
autoheader: warning: missing template: HAVE_SINHF
autoheader: warning: missing template: HAVE_SINHL
autoheader: warning: missing template: HAVE_SINL
autoheader: warning: missing template: HAVE_SQRT
autoheader: warning: missing template: HAVE_SQRTF
autoheader: warning: missing template: HAVE_SQRTL
autoheader: warning: missing template: HAVE_TAN
autoheader: warning: missing template: HAVE_TANF
autoheader: warning: missing template: HAVE_TANH
autoheader: warning: missing template: HAVE_TANHF
autoheader: warning: missing template: HAVE_TANHL
autoheader: warning: missing template: HAVE_TANL
autoheader: warning: missing template: HAVE_TGAMMA
autoheader: warning: missing template: HAVE_TGAMMAF
autoheader: warning: missing template: HAVE_TGAMMAL
autoheader: warning: missing template: HAVE_TRUNC
autoheader: warning: missing template: HAVE_TRUNCF
autoheader: warning: missing template: HAVE_TRUNCL
autoheader: warning: missing template: HAVE_Y0
autoheader: warning: missing template: HAVE_Y0F
autoheader: warning: missing template: HAVE_Y0L
autoheader: warning: missing template: HAVE_Y1
autoheader: warning: missing template: HAVE_Y1F
autoheader: warning: missing template: HAVE_Y1L
autoheader: warning: missing template: HAVE_YN
autoheader: warning: missing template: HAVE_YNF
autoheader: warning: missing template: HAVE_YNL
make[2]: *** [../../../trunk-git/libgfortran/config.h.in] Error 1
make[2]: Leaving directory
`/home/janne/src/gfortran/trunk/objdir-git/x86_64-unknown-linux-gnu/libgfortran'
make[1]: *** [check] Error 2
make[1]: Leaving directory
`/home/janne/src/gfortran/trunk/objdir-git/x86_64-unknown-linux-gnu/libgfortran'
make: *** [check-target-libgfortran] Error 2
make: *** Waiting for unfinished jobs....


Anybody else seeing something similar? The strange thing is that even
though there is an error the bootstrapping continues just fine. Though
I haven't had time to look into it deeper.
Tristan Gingold - March 27, 2012, 7:51 a.m.
On Mar 26, 2012, at 11:43 PM, Janne Blomqvist wrote:
[...]

> On x86_64-unknown-linux-gnu bootstrap I see the following:
> 
> 
> make[1]: Entering directory
> `/home/janne/src/gfortran/trunk/objdir-git/x86_64-unknown-linux-gnu/libgfortran'
> make  check-am
> make[2]: Entering directory
> `/home/janne/src/gfortran/trunk/objdir-git/x86_64-unknown-linux-gnu/libgfortran'
> (CDPATH="${ZSH_VERSION+.}:" && cd ../../../trunk-git/libgfortran &&
> /bin/bash /home/janne/src/gfortran/trunk/trunk-git/missing --run
> autoheader)
> true  DO=all multi-do # make
> make[1]: Entering directory `/home/janne/src/gfortran/trunk/objdir-git/gcc'
> Making a new config file...
> echo "set tmpdir
> /home/janne/src/gfortran/trunk/objdir-git/gcc/testsuite" >> ./site.tmp
> autoheader: warning: missing template: HAVE_ACOS
> autoheader: Use AC_DEFINE([HAVE_ACOS], [], [Description])
> autoheader: warning: missing template: HAVE_ACOSF

...

> autoheader: warning: missing template: HAVE_YNF
> autoheader: warning: missing template: HAVE_YNL
> make[2]: *** [../../../trunk-git/libgfortran/config.h.in] Error 1
> make[2]: Leaving directory
> `/home/janne/src/gfortran/trunk/objdir-git/x86_64-unknown-linux-gnu/libgfortran'
> make[1]: *** [check] Error 2
> make[1]: Leaving directory
> `/home/janne/src/gfortran/trunk/objdir-git/x86_64-unknown-linux-gnu/libgfortran'
> make: *** [check-target-libgfortran] Error 2
> make: *** Waiting for unfinished jobs....
> 
> 
> Anybody else seeing something similar? The strange thing is that even
> though there is an error the bootstrapping continues just fine. Though
> I haven't had time to look into it deeper.

Yes, I can reproduce that.  Autoheader returns 1 as exit status even for warnings.
I am investigating (I suppose that adding a description will fix the issue).

Tristan.

Patch

diff --git a/config/math.m4 b/config/math.m4
new file mode 100644
index 0000000..ceb29b4
--- /dev/null
+++ b/config/math.m4
@@ -0,0 +1,49 @@ 
+dnl GCC_CHECK_LIBM
+dnl
+dnl Check wether -lm is available.  This is a pre-requisite for
+dnl GCC_CHECK_MATH_FUNC so that it will link with -lm.
+AC_DEFUN([GCC_CHECK_LIBM],
+[AC_CHECK_LIB([m],[sin])])
+
+dnl GCC_CHECK_MATH_HEADERS
+dnl
+dnl Check for math.h and complex.h.  This is a pre-requisite for
+dnl GCC_CHECK_MATH_FUNC so that it includes the right headers.
+dnl (Some systems, such as AIX or OpenVMS may define macro for math
+dnl  functions).
+AC_DEFUN([GCC_CHECK_MATH_HEADERS],
+[AC_CHECK_HEADERS_ONCE(math.h complex.h)])
+
+dnl GCC_CHECK_MATH_FUNC([name],[if-present])
+dnl
+dnl Check wether math function NAME is available on the system (by compiling
+dnl and linking a C program) and run if-present on success.
+dnl
+dnl Note that OpenVMS system insists on including complex.h before math.h
+AC_DEFUN([GCC_CHECK_MATH_FUNC],
+[
+  AC_REQUIRE([GCC_CHECK_LIBM])
+  AC_REQUIRE([GCC_CHECK_MATH_HEADERS])
+  AC_CACHE_CHECK([for $1], [gcc_cv_math_func_$1],
+		 [AC_LINK_IFELSE([
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+#ifdef HAVE_MATH_H
+#include <math.h>
+#endif
+
+int (*ptr)() = (int (*)())$1;
+
+int
+main ()
+{
+  return 0;
+}
+],
+[gcc_cv_math_func_$1=yes],
+[gcc_cv_math_func_$1=no])])
+  if test $gcc_cv_math_func_$1 = yes; then
+    $2
+  fi
+])
diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4
index d4acf76..1b11e6a 100644
--- a/libgfortran/acinclude.m4
+++ b/libgfortran/acinclude.m4
@@ -1,5 +1,6 @@ 
 m4_include(../config/acx.m4)
 m4_include(../config/no-executables.m4)
+m4_include(../config/math.m4)
 
 dnl Check that we have a working GNU Fortran compiler
 AC_DEFUN([LIBGFOR_WORKING_GFORTRAN], [
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index 7011a93..0f29804 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -269,191 +269,191 @@  getcwd localtime_r gmtime_r strerror_r getpwuid_r ttyname_r clock_gettime \
 readlink getgid getpid getppid getuid geteuid umask)
 
 # Check for C99 (and other IEEE) math functions
-AC_CHECK_LIB([m],[acosf],[AC_DEFINE([HAVE_ACOSF],[1],[libm includes acosf])])
-AC_CHECK_LIB([m],[acos],[AC_DEFINE([HAVE_ACOS],[1],[libm includes acos])])
-AC_CHECK_LIB([m],[acosl],[AC_DEFINE([HAVE_ACOSL],[1],[libm includes acosl])])
-AC_CHECK_LIB([m],[acoshf],[AC_DEFINE([HAVE_ACOSHF],[1],[libm includes acoshf])])
-AC_CHECK_LIB([m],[acosh],[AC_DEFINE([HAVE_ACOSH],[1],[libm includes acosh])])
-AC_CHECK_LIB([m],[acoshl],[AC_DEFINE([HAVE_ACOSHL],[1],[libm includes acoshl])])
-AC_CHECK_LIB([m],[asinf],[AC_DEFINE([HAVE_ASINF],[1],[libm includes asinf])])
-AC_CHECK_LIB([m],[asin],[AC_DEFINE([HAVE_ASIN],[1],[libm includes asin])])
-AC_CHECK_LIB([m],[asinl],[AC_DEFINE([HAVE_ASINL],[1],[libm includes asinl])])
-AC_CHECK_LIB([m],[asinhf],[AC_DEFINE([HAVE_ASINHF],[1],[libm includes asinhf])])
-AC_CHECK_LIB([m],[asinh],[AC_DEFINE([HAVE_ASINH],[1],[libm includes asinh])])
-AC_CHECK_LIB([m],[asinhl],[AC_DEFINE([HAVE_ASINHL],[1],[libm includes asinhl])])
-AC_CHECK_LIB([m],[atan2f],[AC_DEFINE([HAVE_ATAN2F],[1],[libm includes atan2f])])
-AC_CHECK_LIB([m],[atan2],[AC_DEFINE([HAVE_ATAN2],[1],[libm includes atan2])])
-AC_CHECK_LIB([m],[atan2l],[AC_DEFINE([HAVE_ATAN2L],[1],[libm includes atan2l])])
-AC_CHECK_LIB([m],[atanf],[AC_DEFINE([HAVE_ATANF],[1],[libm includes atanf])])
-AC_CHECK_LIB([m],[atan],[AC_DEFINE([HAVE_ATAN],[1],[libm includes atan])])
-AC_CHECK_LIB([m],[atanl],[AC_DEFINE([HAVE_ATANL],[1],[libm includes atanl])])
-AC_CHECK_LIB([m],[atanhf],[AC_DEFINE([HAVE_ATANHF],[1],[libm includes atanhf])])
-AC_CHECK_LIB([m],[atanh],[AC_DEFINE([HAVE_ATANH],[1],[libm includes atanh])])
-AC_CHECK_LIB([m],[atanhl],[AC_DEFINE([HAVE_ATANHL],[1],[libm includes atanhl])])
-AC_CHECK_LIB([m],[cargf],[AC_DEFINE([HAVE_CARGF],[1],[libm includes cargf])])
-AC_CHECK_LIB([m],[carg],[AC_DEFINE([HAVE_CARG],[1],[libm includes carg])])
-AC_CHECK_LIB([m],[cargl],[AC_DEFINE([HAVE_CARGL],[1],[libm includes cargl])])
-AC_CHECK_LIB([m],[ceilf],[AC_DEFINE([HAVE_CEILF],[1],[libm includes ceilf])])
-AC_CHECK_LIB([m],[ceil],[AC_DEFINE([HAVE_CEIL],[1],[libm includes ceil])])
-AC_CHECK_LIB([m],[ceill],[AC_DEFINE([HAVE_CEILL],[1],[libm includes ceill])])
-AC_CHECK_LIB([m],[copysignf],[AC_DEFINE([HAVE_COPYSIGNF],[1],[libm includes copysignf])])
-AC_CHECK_LIB([m],[copysign],[AC_DEFINE([HAVE_COPYSIGN],[1],[libm includes copysign])])
-AC_CHECK_LIB([m],[copysignl],[AC_DEFINE([HAVE_COPYSIGNL],[1],[libm includes copysignl])])
-AC_CHECK_LIB([m],[cosf],[AC_DEFINE([HAVE_COSF],[1],[libm includes cosf])])
-AC_CHECK_LIB([m],[cos],[AC_DEFINE([HAVE_COS],[1],[libm includes cos])])
-AC_CHECK_LIB([m],[cosl],[AC_DEFINE([HAVE_COSL],[1],[libm includes cosl])])
-AC_CHECK_LIB([m],[ccosf],[AC_DEFINE([HAVE_CCOSF],[1],[libm includes ccosf])])
-AC_CHECK_LIB([m],[ccos],[AC_DEFINE([HAVE_CCOS],[1],[libm includes ccos])])
-AC_CHECK_LIB([m],[ccosl],[AC_DEFINE([HAVE_CCOSL],[1],[libm includes ccosl])])
-AC_CHECK_LIB([m],[coshf],[AC_DEFINE([HAVE_COSHF],[1],[libm includes coshf])])
-AC_CHECK_LIB([m],[cosh],[AC_DEFINE([HAVE_COSH],[1],[libm includes cosh])])
-AC_CHECK_LIB([m],[coshl],[AC_DEFINE([HAVE_COSHL],[1],[libm includes coshl])])
-AC_CHECK_LIB([m],[ccoshf],[AC_DEFINE([HAVE_CCOSHF],[1],[libm includes ccoshf])])
-AC_CHECK_LIB([m],[ccosh],[AC_DEFINE([HAVE_CCOSH],[1],[libm includes ccosh])])
-AC_CHECK_LIB([m],[ccoshl],[AC_DEFINE([HAVE_CCOSHL],[1],[libm includes ccoshl])])
-AC_CHECK_LIB([m],[expf],[AC_DEFINE([HAVE_EXPF],[1],[libm includes expf])])
-AC_CHECK_LIB([m],[exp],[AC_DEFINE([HAVE_EXP],[1],[libm includes exp])])
-AC_CHECK_LIB([m],[expl],[AC_DEFINE([HAVE_EXPL],[1],[libm includes expl])])
-AC_CHECK_LIB([m],[cexpf],[AC_DEFINE([HAVE_CEXPF],[1],[libm includes cexpf])])
-AC_CHECK_LIB([m],[cexp],[AC_DEFINE([HAVE_CEXP],[1],[libm includes cexp])])
-AC_CHECK_LIB([m],[cexpl],[AC_DEFINE([HAVE_CEXPL],[1],[libm includes cexpl])])
-AC_CHECK_LIB([m],[fabsf],[AC_DEFINE([HAVE_FABSF],[1],[libm includes fabsf])])
-AC_CHECK_LIB([m],[fabs],[AC_DEFINE([HAVE_FABS],[1],[libm includes fabs])])
-AC_CHECK_LIB([m],[fabsl],[AC_DEFINE([HAVE_FABSL],[1],[libm includes fabsl])])
-AC_CHECK_LIB([m],[cabsf],[AC_DEFINE([HAVE_CABSF],[1],[libm includes cabsf])])
-AC_CHECK_LIB([m],[cabs],[AC_DEFINE([HAVE_CABS],[1],[libm includes cabs])])
-AC_CHECK_LIB([m],[cabsl],[AC_DEFINE([HAVE_CABSL],[1],[libm includes cabsl])])
-AC_CHECK_LIB([m],[floorf],[AC_DEFINE([HAVE_FLOORF],[1],[libm includes floorf])])
-AC_CHECK_LIB([m],[floor],[AC_DEFINE([HAVE_FLOOR],[1],[libm includes floor])])
-AC_CHECK_LIB([m],[floorl],[AC_DEFINE([HAVE_FLOORL],[1],[libm includes floorl])])
-AC_CHECK_LIB([m],[fmodf],[AC_DEFINE([HAVE_FMODF],[1],[libm includes fmodf])])
-AC_CHECK_LIB([m],[fmod],[AC_DEFINE([HAVE_FMOD],[1],[libm includes fmod])])
-AC_CHECK_LIB([m],[fmodl],[AC_DEFINE([HAVE_FMODL],[1],[libm includes fmodl])])
-AC_CHECK_LIB([m],[frexpf],[AC_DEFINE([HAVE_FREXPF],[1],[libm includes frexpf])])
-AC_CHECK_LIB([m],[frexp],[AC_DEFINE([HAVE_FREXP],[1],[libm includes frexp])])
-AC_CHECK_LIB([m],[frexpl],[AC_DEFINE([HAVE_FREXPL],[1],[libm includes frexpl])])
-AC_CHECK_LIB([m],[hypotf],[AC_DEFINE([HAVE_HYPOTF],[1],[libm includes hypotf])])
-AC_CHECK_LIB([m],[hypot],[AC_DEFINE([HAVE_HYPOT],[1],[libm includes hypot])])
-AC_CHECK_LIB([m],[hypotl],[AC_DEFINE([HAVE_HYPOTL],[1],[libm includes hypotl])])
-AC_CHECK_LIB([m],[ldexpf],[AC_DEFINE([HAVE_LDEXPF],[1],[libm includes ldexpf])])
-AC_CHECK_LIB([m],[ldexp],[AC_DEFINE([HAVE_LDEXP],[1],[libm includes ldexp])])
-AC_CHECK_LIB([m],[ldexpl],[AC_DEFINE([HAVE_LDEXPL],[1],[libm includes ldexpl])])
-AC_CHECK_LIB([m],[logf],[AC_DEFINE([HAVE_LOGF],[1],[libm includes logf])])
-AC_CHECK_LIB([m],[log],[AC_DEFINE([HAVE_LOG],[1],[libm includes log])])
-AC_CHECK_LIB([m],[logl],[AC_DEFINE([HAVE_LOGL],[1],[libm includes logl])])
-AC_CHECK_LIB([m],[clogf],[AC_DEFINE([HAVE_CLOGF],[1],[libm includes clogf])])
-AC_CHECK_LIB([m],[clog],[AC_DEFINE([HAVE_CLOG],[1],[libm includes clog])])
-AC_CHECK_LIB([m],[clogl],[AC_DEFINE([HAVE_CLOGL],[1],[libm includes clogl])])
-AC_CHECK_LIB([m],[log10f],[AC_DEFINE([HAVE_LOG10F],[1],[libm includes log10f])])
-AC_CHECK_LIB([m],[log10],[AC_DEFINE([HAVE_LOG10],[1],[libm includes log10])])
-AC_CHECK_LIB([m],[log10l],[AC_DEFINE([HAVE_LOG10L],[1],[libm includes log10l])])
-AC_CHECK_LIB([m],[clog10f],[AC_DEFINE([HAVE_CLOG10F],[1],[libm includes clog10f])])
-AC_CHECK_LIB([m],[clog10],[AC_DEFINE([HAVE_CLOG10],[1],[libm includes clog10])])
-AC_CHECK_LIB([m],[clog10l],[AC_DEFINE([HAVE_CLOG10L],[1],[libm includes clog10l])])
-AC_CHECK_LIB([m],[nextafterf],[AC_DEFINE([HAVE_NEXTAFTERF],[1],[libm includes nextafterf])])
-AC_CHECK_LIB([m],[nextafter],[AC_DEFINE([HAVE_NEXTAFTER],[1],[libm includes nextafter])])
-AC_CHECK_LIB([m],[nextafterl],[AC_DEFINE([HAVE_NEXTAFTERL],[1],[libm includes nextafterl])])
-AC_CHECK_LIB([m],[powf],[AC_DEFINE([HAVE_POWF],[1],[libm includes powf])])
-AC_CHECK_LIB([m],[pow],[AC_DEFINE([HAVE_POW],[1],[libm includes pow])])
-AC_CHECK_LIB([m],[powl],[AC_DEFINE([HAVE_POWL],[1],[libm includes powl])])
-AC_CHECK_LIB([m],[cpowf],[AC_DEFINE([HAVE_CPOWF],[1],[libm includes cpowf])])
-AC_CHECK_LIB([m],[cpow],[AC_DEFINE([HAVE_CPOW],[1],[libm includes cpow])])
-AC_CHECK_LIB([m],[cpowl],[AC_DEFINE([HAVE_CPOWL],[1],[libm includes cpowl])])
-AC_CHECK_LIB([m],[roundf],[AC_DEFINE([HAVE_ROUNDF],[1],[libm includes roundf])])
-AC_CHECK_LIB([m],[round],[AC_DEFINE([HAVE_ROUND],[1],[libm includes round])])
-AC_CHECK_LIB([m],[roundl],[AC_DEFINE([HAVE_ROUNDL],[1],[libm includes roundl])])
-AC_CHECK_LIB([m],[lroundf],[AC_DEFINE([HAVE_LROUNDF],[1],[libm includes lroundf])])
-AC_CHECK_LIB([m],[lround],[AC_DEFINE([HAVE_LROUND],[1],[libm includes lround])])
-AC_CHECK_LIB([m],[lroundl],[AC_DEFINE([HAVE_LROUNDL],[1],[libm includes lroundl])])
-AC_CHECK_LIB([m],[llroundf],[AC_DEFINE([HAVE_LLROUNDF],[1],[libm includes llroundf])])
-AC_CHECK_LIB([m],[llround],[AC_DEFINE([HAVE_LLROUND],[1],[libm includes llround])])
-AC_CHECK_LIB([m],[llroundl],[AC_DEFINE([HAVE_LLROUNDL],[1],[libm includes llroundl])])
-AC_CHECK_LIB([m],[scalbnf],[AC_DEFINE([HAVE_SCALBNF],[1],[libm includes scalbnf])])
-AC_CHECK_LIB([m],[scalbn],[AC_DEFINE([HAVE_SCALBN],[1],[libm includes scalbn])])
-AC_CHECK_LIB([m],[scalbnl],[AC_DEFINE([HAVE_SCALBNL],[1],[libm includes scalbnl])])
-AC_CHECK_LIB([m],[sinf],[AC_DEFINE([HAVE_SINF],[1],[libm includes sinf])])
-AC_CHECK_LIB([m],[sin],[AC_DEFINE([HAVE_SIN],[1],[libm includes sin])])
-AC_CHECK_LIB([m],[sinl],[AC_DEFINE([HAVE_SINL],[1],[libm includes sinl])])
-AC_CHECK_LIB([m],[csinf],[AC_DEFINE([HAVE_CSINF],[1],[libm includes csinf])])
-AC_CHECK_LIB([m],[csin],[AC_DEFINE([HAVE_CSIN],[1],[libm includes csin])])
-AC_CHECK_LIB([m],[csinl],[AC_DEFINE([HAVE_CSINL],[1],[libm includes csinl])])
-AC_CHECK_LIB([m],[sinhf],[AC_DEFINE([HAVE_SINHF],[1],[libm includes sinhf])])
-AC_CHECK_LIB([m],[sinh],[AC_DEFINE([HAVE_SINH],[1],[libm includes sinh])])
-AC_CHECK_LIB([m],[sinhl],[AC_DEFINE([HAVE_SINHL],[1],[libm includes sinhl])])
-AC_CHECK_LIB([m],[csinhf],[AC_DEFINE([HAVE_CSINHF],[1],[libm includes csinhf])])
-AC_CHECK_LIB([m],[csinh],[AC_DEFINE([HAVE_CSINH],[1],[libm includes csinh])])
-AC_CHECK_LIB([m],[csinhl],[AC_DEFINE([HAVE_CSINHL],[1],[libm includes csinhl])])
-AC_CHECK_LIB([m],[sqrtf],[AC_DEFINE([HAVE_SQRTF],[1],[libm includes sqrtf])])
-AC_CHECK_LIB([m],[sqrt],[AC_DEFINE([HAVE_SQRT],[1],[libm includes sqrt])])
-AC_CHECK_LIB([m],[sqrtl],[AC_DEFINE([HAVE_SQRTL],[1],[libm includes sqrtl])])
-AC_CHECK_LIB([m],[csqrtf],[AC_DEFINE([HAVE_CSQRTF],[1],[libm includes csqrtf])])
-AC_CHECK_LIB([m],[csqrt],[AC_DEFINE([HAVE_CSQRT],[1],[libm includes csqrt])])
-AC_CHECK_LIB([m],[csqrtl],[AC_DEFINE([HAVE_CSQRTL],[1],[libm includes csqrtl])])
-AC_CHECK_LIB([m],[tanf],[AC_DEFINE([HAVE_TANF],[1],[libm includes tanf])])
-AC_CHECK_LIB([m],[tan],[AC_DEFINE([HAVE_TAN],[1],[libm includes tan])])
-AC_CHECK_LIB([m],[tanl],[AC_DEFINE([HAVE_TANL],[1],[libm includes tanl])])
-AC_CHECK_LIB([m],[ctanf],[AC_DEFINE([HAVE_CTANF],[1],[libm includes ctanf])])
-AC_CHECK_LIB([m],[ctan],[AC_DEFINE([HAVE_CTAN],[1],[libm includes ctan])])
-AC_CHECK_LIB([m],[ctanl],[AC_DEFINE([HAVE_CTANL],[1],[libm includes ctanl])])
-AC_CHECK_LIB([m],[tanhf],[AC_DEFINE([HAVE_TANHF],[1],[libm includes tanhf])])
-AC_CHECK_LIB([m],[tanh],[AC_DEFINE([HAVE_TANH],[1],[libm includes tanh])])
-AC_CHECK_LIB([m],[tanhl],[AC_DEFINE([HAVE_TANHL],[1],[libm includes tanhl])])
-AC_CHECK_LIB([m],[ctanhf],[AC_DEFINE([HAVE_CTANHF],[1],[libm includes ctanhf])])
-AC_CHECK_LIB([m],[ctanh],[AC_DEFINE([HAVE_CTANH],[1],[libm includes ctanh])])
-AC_CHECK_LIB([m],[ctanhl],[AC_DEFINE([HAVE_CTANHL],[1],[libm includes ctanhl])])
-AC_CHECK_LIB([m],[truncf],[AC_DEFINE([HAVE_TRUNCF],[1],[libm includes truncf])])
-AC_CHECK_LIB([m],[trunc],[AC_DEFINE([HAVE_TRUNC],[1],[libm includes trunc])])
-AC_CHECK_LIB([m],[truncl],[AC_DEFINE([HAVE_TRUNCL],[1],[libm includes truncl])])
-AC_CHECK_LIB([m],[erff],[AC_DEFINE([HAVE_ERFF],[1],[libm includes erff])])
-AC_CHECK_LIB([m],[erf],[AC_DEFINE([HAVE_ERF],[1],[libm includes erf])])
-AC_CHECK_LIB([m],[erfl],[AC_DEFINE([HAVE_ERFL],[1],[libm includes erfl])])
-AC_CHECK_LIB([m],[erfcf],[AC_DEFINE([HAVE_ERFCF],[1],[libm includes erfcf])])
-AC_CHECK_LIB([m],[erfc],[AC_DEFINE([HAVE_ERFC],[1],[libm includes erfc])])
-AC_CHECK_LIB([m],[erfcl],[AC_DEFINE([HAVE_ERFCL],[1],[libm includes erfcl])])
-AC_CHECK_LIB([m],[j0f],[AC_DEFINE([HAVE_J0F],[1],[libm includes j0f])])
-AC_CHECK_LIB([m],[j0],[AC_DEFINE([HAVE_J0],[1],[libm includes j0])])
-AC_CHECK_LIB([m],[j0l],[AC_DEFINE([HAVE_J0L],[1],[libm includes j0l])])
-AC_CHECK_LIB([m],[j1f],[AC_DEFINE([HAVE_J1F],[1],[libm includes j1f])])
-AC_CHECK_LIB([m],[j1],[AC_DEFINE([HAVE_J1],[1],[libm includes j1])])
-AC_CHECK_LIB([m],[j1l],[AC_DEFINE([HAVE_J1L],[1],[libm includes j1l])])
-AC_CHECK_LIB([m],[jnf],[AC_DEFINE([HAVE_JNF],[1],[libm includes jnf])])
-AC_CHECK_LIB([m],[jn],[AC_DEFINE([HAVE_JN],[1],[libm includes jn])])
-AC_CHECK_LIB([m],[jnl],[AC_DEFINE([HAVE_JNL],[1],[libm includes jnl])])
-AC_CHECK_LIB([m],[y0f],[AC_DEFINE([HAVE_Y0F],[1],[libm includes y0f])])
-AC_CHECK_LIB([m],[y0],[AC_DEFINE([HAVE_Y0],[1],[libm includes y0])])
-AC_CHECK_LIB([m],[y0l],[AC_DEFINE([HAVE_Y0L],[1],[libm includes y0l])])
-AC_CHECK_LIB([m],[y1f],[AC_DEFINE([HAVE_Y1F],[1],[libm includes y1f])])
-AC_CHECK_LIB([m],[y1],[AC_DEFINE([HAVE_Y1],[1],[libm includes y1])])
-AC_CHECK_LIB([m],[y1l],[AC_DEFINE([HAVE_Y1L],[1],[libm includes y1l])])
-AC_CHECK_LIB([m],[ynf],[AC_DEFINE([HAVE_YNF],[1],[libm includes ynf])])
-AC_CHECK_LIB([m],[yn],[AC_DEFINE([HAVE_YN],[1],[libm includes yn])])
-AC_CHECK_LIB([m],[ynl],[AC_DEFINE([HAVE_YNL],[1],[libm includes ynl])])
-AC_CHECK_LIB([m],[tgamma],[AC_DEFINE([HAVE_TGAMMA],[1],[libm includes tgamma])])
-AC_CHECK_LIB([m],[tgammaf],[AC_DEFINE([HAVE_TGAMMAF],[1],[libm includes tgammaf])])
-AC_CHECK_LIB([m],[tgammal],[AC_DEFINE([HAVE_TGAMMAL],[1],[libm includes tgammal])])
-AC_CHECK_LIB([m],[lgamma],[AC_DEFINE([HAVE_LGAMMA],[1],[libm includes lgamma])])
-AC_CHECK_LIB([m],[lgammaf],[AC_DEFINE([HAVE_LGAMMAF],[1],[libm includes lgammaf])])
-AC_CHECK_LIB([m],[lgammal],[AC_DEFINE([HAVE_LGAMMAL],[1],[libm includes lgammal])])
+GCC_CHECK_MATH_FUNC([acosf],[AC_DEFINE([HAVE_ACOSF],[1])])
+GCC_CHECK_MATH_FUNC([acos],[AC_DEFINE([HAVE_ACOS],[1])])
+GCC_CHECK_MATH_FUNC([acosl],[AC_DEFINE([HAVE_ACOSL],[1])])
+GCC_CHECK_MATH_FUNC([acoshf],[AC_DEFINE([HAVE_ACOSHF],[1])])
+GCC_CHECK_MATH_FUNC([acosh],[AC_DEFINE([HAVE_ACOSH],[1])])
+GCC_CHECK_MATH_FUNC([acoshl],[AC_DEFINE([HAVE_ACOSHL],[1])])
+GCC_CHECK_MATH_FUNC([asinf],[AC_DEFINE([HAVE_ASINF],[1])])
+GCC_CHECK_MATH_FUNC([asin],[AC_DEFINE([HAVE_ASIN],[1])])
+GCC_CHECK_MATH_FUNC([asinl],[AC_DEFINE([HAVE_ASINL],[1])])
+GCC_CHECK_MATH_FUNC([asinhf],[AC_DEFINE([HAVE_ASINHF],[1])])
+GCC_CHECK_MATH_FUNC([asinh],[AC_DEFINE([HAVE_ASINH],[1])])
+GCC_CHECK_MATH_FUNC([asinhl],[AC_DEFINE([HAVE_ASINHL],[1])])
+GCC_CHECK_MATH_FUNC([atan2f],[AC_DEFINE([HAVE_ATAN2F],[1])])
+GCC_CHECK_MATH_FUNC([atan2],[AC_DEFINE([HAVE_ATAN2],[1])])
+GCC_CHECK_MATH_FUNC([atan2l],[AC_DEFINE([HAVE_ATAN2L],[1])])
+GCC_CHECK_MATH_FUNC([atanf],[AC_DEFINE([HAVE_ATANF],[1])])
+GCC_CHECK_MATH_FUNC([atan],[AC_DEFINE([HAVE_ATAN],[1])])
+GCC_CHECK_MATH_FUNC([atanl],[AC_DEFINE([HAVE_ATANL],[1])])
+GCC_CHECK_MATH_FUNC([atanhf],[AC_DEFINE([HAVE_ATANHF],[1])])
+GCC_CHECK_MATH_FUNC([atanh],[AC_DEFINE([HAVE_ATANH],[1])])
+GCC_CHECK_MATH_FUNC([atanhl],[AC_DEFINE([HAVE_ATANHL],[1])])
+GCC_CHECK_MATH_FUNC([cargf],[AC_DEFINE([HAVE_CARGF],[1])])
+GCC_CHECK_MATH_FUNC([carg],[AC_DEFINE([HAVE_CARG],[1])])
+GCC_CHECK_MATH_FUNC([cargl],[AC_DEFINE([HAVE_CARGL],[1])])
+GCC_CHECK_MATH_FUNC([ceilf],[AC_DEFINE([HAVE_CEILF],[1])])
+GCC_CHECK_MATH_FUNC([ceil],[AC_DEFINE([HAVE_CEIL],[1])])
+GCC_CHECK_MATH_FUNC([ceill],[AC_DEFINE([HAVE_CEILL],[1])])
+GCC_CHECK_MATH_FUNC([copysignf],[AC_DEFINE([HAVE_COPYSIGNF],[1])])
+GCC_CHECK_MATH_FUNC([copysign],[AC_DEFINE([HAVE_COPYSIGN],[1])])
+GCC_CHECK_MATH_FUNC([copysignl],[AC_DEFINE([HAVE_COPYSIGNL],[1])])
+GCC_CHECK_MATH_FUNC([cosf],[AC_DEFINE([HAVE_COSF],[1])])
+GCC_CHECK_MATH_FUNC([cos],[AC_DEFINE([HAVE_COS],[1])])
+GCC_CHECK_MATH_FUNC([cosl],[AC_DEFINE([HAVE_COSL],[1])])
+GCC_CHECK_MATH_FUNC([ccosf],[AC_DEFINE([HAVE_CCOSF],[1])])
+GCC_CHECK_MATH_FUNC([ccos],[AC_DEFINE([HAVE_CCOS],[1])])
+GCC_CHECK_MATH_FUNC([ccosl],[AC_DEFINE([HAVE_CCOSL],[1])])
+GCC_CHECK_MATH_FUNC([coshf],[AC_DEFINE([HAVE_COSHF],[1])])
+GCC_CHECK_MATH_FUNC([cosh],[AC_DEFINE([HAVE_COSH],[1])])
+GCC_CHECK_MATH_FUNC([coshl],[AC_DEFINE([HAVE_COSHL],[1])])
+GCC_CHECK_MATH_FUNC([ccoshf],[AC_DEFINE([HAVE_CCOSHF],[1])])
+GCC_CHECK_MATH_FUNC([ccosh],[AC_DEFINE([HAVE_CCOSH],[1])])
+GCC_CHECK_MATH_FUNC([ccoshl],[AC_DEFINE([HAVE_CCOSHL],[1])])
+GCC_CHECK_MATH_FUNC([expf],[AC_DEFINE([HAVE_EXPF],[1])])
+GCC_CHECK_MATH_FUNC([exp],[AC_DEFINE([HAVE_EXP],[1])])
+GCC_CHECK_MATH_FUNC([expl],[AC_DEFINE([HAVE_EXPL],[1])])
+GCC_CHECK_MATH_FUNC([cexpf],[AC_DEFINE([HAVE_CEXPF],[1])])
+GCC_CHECK_MATH_FUNC([cexp],[AC_DEFINE([HAVE_CEXP],[1])])
+GCC_CHECK_MATH_FUNC([cexpl],[AC_DEFINE([HAVE_CEXPL],[1])])
+GCC_CHECK_MATH_FUNC([fabsf],[AC_DEFINE([HAVE_FABSF],[1])])
+GCC_CHECK_MATH_FUNC([fabs],[AC_DEFINE([HAVE_FABS],[1])])
+GCC_CHECK_MATH_FUNC([fabsl],[AC_DEFINE([HAVE_FABSL],[1])])
+GCC_CHECK_MATH_FUNC([cabsf],[AC_DEFINE([HAVE_CABSF],[1])])
+GCC_CHECK_MATH_FUNC([cabs],[AC_DEFINE([HAVE_CABS],[1])])
+GCC_CHECK_MATH_FUNC([cabsl],[AC_DEFINE([HAVE_CABSL],[1])])
+GCC_CHECK_MATH_FUNC([floorf],[AC_DEFINE([HAVE_FLOORF],[1])])
+GCC_CHECK_MATH_FUNC([floor],[AC_DEFINE([HAVE_FLOOR],[1])])
+GCC_CHECK_MATH_FUNC([floorl],[AC_DEFINE([HAVE_FLOORL],[1])])
+GCC_CHECK_MATH_FUNC([fmodf],[AC_DEFINE([HAVE_FMODF],[1])])
+GCC_CHECK_MATH_FUNC([fmod],[AC_DEFINE([HAVE_FMOD],[1])])
+GCC_CHECK_MATH_FUNC([fmodl],[AC_DEFINE([HAVE_FMODL],[1])])
+GCC_CHECK_MATH_FUNC([frexpf],[AC_DEFINE([HAVE_FREXPF],[1])])
+GCC_CHECK_MATH_FUNC([frexp],[AC_DEFINE([HAVE_FREXP],[1])])
+GCC_CHECK_MATH_FUNC([frexpl],[AC_DEFINE([HAVE_FREXPL],[1])])
+GCC_CHECK_MATH_FUNC([hypotf],[AC_DEFINE([HAVE_HYPOTF],[1])])
+GCC_CHECK_MATH_FUNC([hypot],[AC_DEFINE([HAVE_HYPOT],[1])])
+GCC_CHECK_MATH_FUNC([hypotl],[AC_DEFINE([HAVE_HYPOTL],[1])])
+GCC_CHECK_MATH_FUNC([ldexpf],[AC_DEFINE([HAVE_LDEXPF],[1])])
+GCC_CHECK_MATH_FUNC([ldexp],[AC_DEFINE([HAVE_LDEXP],[1])])
+GCC_CHECK_MATH_FUNC([ldexpl],[AC_DEFINE([HAVE_LDEXPL],[1])])
+GCC_CHECK_MATH_FUNC([logf],[AC_DEFINE([HAVE_LOGF],[1])])
+GCC_CHECK_MATH_FUNC([log],[AC_DEFINE([HAVE_LOG],[1])])
+GCC_CHECK_MATH_FUNC([logl],[AC_DEFINE([HAVE_LOGL],[1])])
+GCC_CHECK_MATH_FUNC([clogf],[AC_DEFINE([HAVE_CLOGF],[1])])
+GCC_CHECK_MATH_FUNC([clog],[AC_DEFINE([HAVE_CLOG],[1])])
+GCC_CHECK_MATH_FUNC([clogl],[AC_DEFINE([HAVE_CLOGL],[1])])
+GCC_CHECK_MATH_FUNC([log10f],[AC_DEFINE([HAVE_LOG10F],[1])])
+GCC_CHECK_MATH_FUNC([log10],[AC_DEFINE([HAVE_LOG10],[1])])
+GCC_CHECK_MATH_FUNC([log10l],[AC_DEFINE([HAVE_LOG10L],[1])])
+GCC_CHECK_MATH_FUNC([clog10f],[AC_DEFINE([HAVE_CLOG10F],[1])])
+GCC_CHECK_MATH_FUNC([clog10],[AC_DEFINE([HAVE_CLOG10],[1])])
+GCC_CHECK_MATH_FUNC([clog10l],[AC_DEFINE([HAVE_CLOG10L],[1])])
+GCC_CHECK_MATH_FUNC([nextafterf],[AC_DEFINE([HAVE_NEXTAFTERF],[1])])
+GCC_CHECK_MATH_FUNC([nextafter],[AC_DEFINE([HAVE_NEXTAFTER],[1])])
+GCC_CHECK_MATH_FUNC([nextafterl],[AC_DEFINE([HAVE_NEXTAFTERL],[1])])
+GCC_CHECK_MATH_FUNC([powf],[AC_DEFINE([HAVE_POWF],[1])])
+GCC_CHECK_MATH_FUNC([pow],[AC_DEFINE([HAVE_POW],[1])])
+GCC_CHECK_MATH_FUNC([powl],[AC_DEFINE([HAVE_POWL],[1])])
+GCC_CHECK_MATH_FUNC([cpowf],[AC_DEFINE([HAVE_CPOWF],[1])])
+GCC_CHECK_MATH_FUNC([cpow],[AC_DEFINE([HAVE_CPOW],[1])])
+GCC_CHECK_MATH_FUNC([cpowl],[AC_DEFINE([HAVE_CPOWL],[1])])
+GCC_CHECK_MATH_FUNC([roundf],[AC_DEFINE([HAVE_ROUNDF],[1])])
+GCC_CHECK_MATH_FUNC([round],[AC_DEFINE([HAVE_ROUND],[1])])
+GCC_CHECK_MATH_FUNC([roundl],[AC_DEFINE([HAVE_ROUNDL],[1])])
+GCC_CHECK_MATH_FUNC([lroundf],[AC_DEFINE([HAVE_LROUNDF],[1])])
+GCC_CHECK_MATH_FUNC([lround],[AC_DEFINE([HAVE_LROUND],[1])])
+GCC_CHECK_MATH_FUNC([lroundl],[AC_DEFINE([HAVE_LROUNDL],[1])])
+GCC_CHECK_MATH_FUNC([llroundf],[AC_DEFINE([HAVE_LLROUNDF],[1])])
+GCC_CHECK_MATH_FUNC([llround],[AC_DEFINE([HAVE_LLROUND],[1])])
+GCC_CHECK_MATH_FUNC([llroundl],[AC_DEFINE([HAVE_LLROUNDL],[1])])
+GCC_CHECK_MATH_FUNC([scalbnf],[AC_DEFINE([HAVE_SCALBNF],[1])])
+GCC_CHECK_MATH_FUNC([scalbn],[AC_DEFINE([HAVE_SCALBN],[1])])
+GCC_CHECK_MATH_FUNC([scalbnl],[AC_DEFINE([HAVE_SCALBNL],[1])])
+GCC_CHECK_MATH_FUNC([sinf],[AC_DEFINE([HAVE_SINF],[1])])
+GCC_CHECK_MATH_FUNC([sin],[AC_DEFINE([HAVE_SIN],[1])])
+GCC_CHECK_MATH_FUNC([sinl],[AC_DEFINE([HAVE_SINL],[1])])
+GCC_CHECK_MATH_FUNC([csinf],[AC_DEFINE([HAVE_CSINF],[1])])
+GCC_CHECK_MATH_FUNC([csin],[AC_DEFINE([HAVE_CSIN],[1])])
+GCC_CHECK_MATH_FUNC([csinl],[AC_DEFINE([HAVE_CSINL],[1])])
+GCC_CHECK_MATH_FUNC([sinhf],[AC_DEFINE([HAVE_SINHF],[1])])
+GCC_CHECK_MATH_FUNC([sinh],[AC_DEFINE([HAVE_SINH],[1])])
+GCC_CHECK_MATH_FUNC([sinhl],[AC_DEFINE([HAVE_SINHL],[1])])
+GCC_CHECK_MATH_FUNC([csinhf],[AC_DEFINE([HAVE_CSINHF],[1])])
+GCC_CHECK_MATH_FUNC([csinh],[AC_DEFINE([HAVE_CSINH],[1])])
+GCC_CHECK_MATH_FUNC([csinhl],[AC_DEFINE([HAVE_CSINHL],[1])])
+GCC_CHECK_MATH_FUNC([sqrtf],[AC_DEFINE([HAVE_SQRTF],[1])])
+GCC_CHECK_MATH_FUNC([sqrt],[AC_DEFINE([HAVE_SQRT],[1])])
+GCC_CHECK_MATH_FUNC([sqrtl],[AC_DEFINE([HAVE_SQRTL],[1])])
+GCC_CHECK_MATH_FUNC([csqrtf],[AC_DEFINE([HAVE_CSQRTF],[1])])
+GCC_CHECK_MATH_FUNC([csqrt],[AC_DEFINE([HAVE_CSQRT],[1])])
+GCC_CHECK_MATH_FUNC([csqrtl],[AC_DEFINE([HAVE_CSQRTL],[1])])
+GCC_CHECK_MATH_FUNC([tanf],[AC_DEFINE([HAVE_TANF],[1])])
+GCC_CHECK_MATH_FUNC([tan],[AC_DEFINE([HAVE_TAN],[1])])
+GCC_CHECK_MATH_FUNC([tanl],[AC_DEFINE([HAVE_TANL],[1])])
+GCC_CHECK_MATH_FUNC([ctanf],[AC_DEFINE([HAVE_CTANF],[1])])
+GCC_CHECK_MATH_FUNC([ctan],[AC_DEFINE([HAVE_CTAN],[1])])
+GCC_CHECK_MATH_FUNC([ctanl],[AC_DEFINE([HAVE_CTANL],[1])])
+GCC_CHECK_MATH_FUNC([tanhf],[AC_DEFINE([HAVE_TANHF],[1])])
+GCC_CHECK_MATH_FUNC([tanh],[AC_DEFINE([HAVE_TANH],[1])])
+GCC_CHECK_MATH_FUNC([tanhl],[AC_DEFINE([HAVE_TANHL],[1])])
+GCC_CHECK_MATH_FUNC([ctanhf],[AC_DEFINE([HAVE_CTANHF],[1])])
+GCC_CHECK_MATH_FUNC([ctanh],[AC_DEFINE([HAVE_CTANH],[1])])
+GCC_CHECK_MATH_FUNC([ctanhl],[AC_DEFINE([HAVE_CTANHL],[1])])
+GCC_CHECK_MATH_FUNC([truncf],[AC_DEFINE([HAVE_TRUNCF],[1])])
+GCC_CHECK_MATH_FUNC([trunc],[AC_DEFINE([HAVE_TRUNC],[1])])
+GCC_CHECK_MATH_FUNC([truncl],[AC_DEFINE([HAVE_TRUNCL],[1])])
+GCC_CHECK_MATH_FUNC([erff],[AC_DEFINE([HAVE_ERFF],[1])])
+GCC_CHECK_MATH_FUNC([erf],[AC_DEFINE([HAVE_ERF],[1])])
+GCC_CHECK_MATH_FUNC([erfl],[AC_DEFINE([HAVE_ERFL],[1])])
+GCC_CHECK_MATH_FUNC([erfcf],[AC_DEFINE([HAVE_ERFCF],[1])])
+GCC_CHECK_MATH_FUNC([erfc],[AC_DEFINE([HAVE_ERFC],[1])])
+GCC_CHECK_MATH_FUNC([erfcl],[AC_DEFINE([HAVE_ERFCL],[1])])
+GCC_CHECK_MATH_FUNC([j0f],[AC_DEFINE([HAVE_J0F],[1])])
+GCC_CHECK_MATH_FUNC([j0],[AC_DEFINE([HAVE_J0],[1])])
+GCC_CHECK_MATH_FUNC([j0l],[AC_DEFINE([HAVE_J0L],[1])])
+GCC_CHECK_MATH_FUNC([j1f],[AC_DEFINE([HAVE_J1F],[1])])
+GCC_CHECK_MATH_FUNC([j1],[AC_DEFINE([HAVE_J1],[1])])
+GCC_CHECK_MATH_FUNC([j1l],[AC_DEFINE([HAVE_J1L],[1])])
+GCC_CHECK_MATH_FUNC([jnf],[AC_DEFINE([HAVE_JNF],[1])])
+GCC_CHECK_MATH_FUNC([jn],[AC_DEFINE([HAVE_JN],[1])])
+GCC_CHECK_MATH_FUNC([jnl],[AC_DEFINE([HAVE_JNL],[1])])
+GCC_CHECK_MATH_FUNC([y0f],[AC_DEFINE([HAVE_Y0F],[1])])
+GCC_CHECK_MATH_FUNC([y0],[AC_DEFINE([HAVE_Y0],[1])])
+GCC_CHECK_MATH_FUNC([y0l],[AC_DEFINE([HAVE_Y0L],[1])])
+GCC_CHECK_MATH_FUNC([y1f],[AC_DEFINE([HAVE_Y1F],[1])])
+GCC_CHECK_MATH_FUNC([y1],[AC_DEFINE([HAVE_Y1],[1])])
+GCC_CHECK_MATH_FUNC([y1l],[AC_DEFINE([HAVE_Y1L],[1])])
+GCC_CHECK_MATH_FUNC([ynf],[AC_DEFINE([HAVE_YNF],[1])])
+GCC_CHECK_MATH_FUNC([yn],[AC_DEFINE([HAVE_YN],[1])])
+GCC_CHECK_MATH_FUNC([ynl],[AC_DEFINE([HAVE_YNL],[1])])
+GCC_CHECK_MATH_FUNC([tgamma],[AC_DEFINE([HAVE_TGAMMA],[1])])
+GCC_CHECK_MATH_FUNC([tgammaf],[AC_DEFINE([HAVE_TGAMMAF],[1])])
+GCC_CHECK_MATH_FUNC([tgammal],[AC_DEFINE([HAVE_TGAMMAL],[1])])
+GCC_CHECK_MATH_FUNC([lgamma],[AC_DEFINE([HAVE_LGAMMA],[1])])
+GCC_CHECK_MATH_FUNC([lgammaf],[AC_DEFINE([HAVE_LGAMMAF],[1])])
+GCC_CHECK_MATH_FUNC([lgammal],[AC_DEFINE([HAVE_LGAMMAL],[1])])
 
 # Check for GFORTRAN_C99_1.1 funcs
-AC_CHECK_LIB([m],[cacos],[AC_DEFINE([HAVE_CACOS],[1],[libm includes cacos])])
-AC_CHECK_LIB([m],[cacosf],[AC_DEFINE([HAVE_CACOSF],[1],[libm includes cacosf])])
-AC_CHECK_LIB([m],[cacosh],[AC_DEFINE([HAVE_CACOSH],[1],[libm includes cacosh])])
-AC_CHECK_LIB([m],[cacoshf],[AC_DEFINE([HAVE_CACOSHF],[1],[libm includes cacoshf])])
-AC_CHECK_LIB([m],[cacoshl],[AC_DEFINE([HAVE_CACOSHL],[1],[libm includes cacoshl])])
-AC_CHECK_LIB([m],[cacosl],[AC_DEFINE([HAVE_CACOSL],[1],[libm includes cacosl])])
-AC_CHECK_LIB([m],[casin],[AC_DEFINE([HAVE_CASIN],[1],[libm includes casin])])
-AC_CHECK_LIB([m],[casinf],[AC_DEFINE([HAVE_CASINF],[1],[libm includes casinf])])
-AC_CHECK_LIB([m],[casinh],[AC_DEFINE([HAVE_CASINH],[1],[libm includes casinh])])
-AC_CHECK_LIB([m],[casinhf],[AC_DEFINE([HAVE_CASINHF],[1],[libm includes casinhf])])
-AC_CHECK_LIB([m],[casinhl],[AC_DEFINE([HAVE_CASINHL],[1],[libm includes casinhl])])
-AC_CHECK_LIB([m],[casinl],[AC_DEFINE([HAVE_CASINL],[1],[libm includes casinl])])
-AC_CHECK_LIB([m],[catan],[AC_DEFINE([HAVE_CATAN],[1],[libm includes catan])])
-AC_CHECK_LIB([m],[catanf],[AC_DEFINE([HAVE_CATANF],[1],[libm includes catanf])])
-AC_CHECK_LIB([m],[catanh],[AC_DEFINE([HAVE_CATANH],[1],[libm includes catanh])])
-AC_CHECK_LIB([m],[catanhf],[AC_DEFINE([HAVE_CATANHF],[1],[libm includes catanhf])])
-AC_CHECK_LIB([m],[catanhl],[AC_DEFINE([HAVE_CATANHL],[1],[libm includes catanhl])])
-AC_CHECK_LIB([m],[catanl],[AC_DEFINE([HAVE_CATANL],[1],[libm includes catanl])])
+GCC_CHECK_MATH_FUNC([cacos],[AC_DEFINE([HAVE_CACOS],[1])])
+GCC_CHECK_MATH_FUNC([cacosf],[AC_DEFINE([HAVE_CACOSF],[1])])
+GCC_CHECK_MATH_FUNC([cacosh],[AC_DEFINE([HAVE_CACOSH],[1])])
+GCC_CHECK_MATH_FUNC([cacoshf],[AC_DEFINE([HAVE_CACOSHF],[1])])
+GCC_CHECK_MATH_FUNC([cacoshl],[AC_DEFINE([HAVE_CACOSHL],[1])])
+GCC_CHECK_MATH_FUNC([cacosl],[AC_DEFINE([HAVE_CACOSL],[1])])
+GCC_CHECK_MATH_FUNC([casin],[AC_DEFINE([HAVE_CASIN],[1])])
+GCC_CHECK_MATH_FUNC([casinf],[AC_DEFINE([HAVE_CASINF],[1])])
+GCC_CHECK_MATH_FUNC([casinh],[AC_DEFINE([HAVE_CASINH],[1])])
+GCC_CHECK_MATH_FUNC([casinhf],[AC_DEFINE([HAVE_CASINHF],[1])])
+GCC_CHECK_MATH_FUNC([casinhl],[AC_DEFINE([HAVE_CASINHL],[1])])
+GCC_CHECK_MATH_FUNC([casinl],[AC_DEFINE([HAVE_CASINL],[1])])
+GCC_CHECK_MATH_FUNC([catan],[AC_DEFINE([HAVE_CATAN],[1])])
+GCC_CHECK_MATH_FUNC([catanf],[AC_DEFINE([HAVE_CATANF],[1])])
+GCC_CHECK_MATH_FUNC([catanh],[AC_DEFINE([HAVE_CATANH],[1])])
+GCC_CHECK_MATH_FUNC([catanhf],[AC_DEFINE([HAVE_CATANHF],[1])])
+GCC_CHECK_MATH_FUNC([catanhl],[AC_DEFINE([HAVE_CATANHL],[1])])
+GCC_CHECK_MATH_FUNC([catanl],[AC_DEFINE([HAVE_CATANL],[1])])
 
 # On AIX, clog is present in libm as __clog
 AC_CHECK_LIB([m],[__clog],[AC_DEFINE([HAVE_CLOG],[1],[libm includes clog])])