linkage.m4 revision 146897
137Srgrimesdnl 237Srgrimesdnl This file contains macros for testing linkage. 337Srgrimesdnl 4705Swollman 5705Swollmandnl 6705Swollmandnl Check to see if the (math function) argument passed is 77685Sachednl declared when using the c++ compiler 87685Sachednl ASSUMES argument is a math function with ONE parameter 939139Sobriendnl 1039139Sobriendnl GLIBCXX_CHECK_MATH_DECL_1 1139139SobrienAC_DEFUN([GLIBCXX_CHECK_MATH_DECL_1], [ 1239139Sobrien AC_MSG_CHECKING([for $1 declaration]) 1339139Sobrien if test x${glibcxx_cv_func_$1_use+set} != xset; then 1439139Sobrien AC_CACHE_VAL(glibcxx_cv_func_$1_use, [ 1539139Sobrien AC_LANG_SAVE 167685Sache AC_LANG_CPLUSPLUS 177685Sache AC_TRY_COMPILE([#include <math.h> 1837Srgrimes #ifdef HAVE_IEEEFP_H 1939139Sobrien #include <ieeefp.h> 20705Swollman #endif 21705Swollman ], 227685Sache [ $1(0);], 237685Sache [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no]) 2422009Sphk AC_LANG_RESTORE 257685Sache ]) 267685Sache fi 2722009Sphk AC_MSG_RESULT($glibcxx_cv_func_$1_use) 287685Sache]) 297685Sache 307685Sachednl 317685Sachednl Check to see if the (math function) argument passed is 3222009Sphkdnl 1) declared when using the c++ compiler 337685Sachednl 2) has "C" linkage 347685Sachednl 3) if not, see if 1) and 2) for argument prepended with '_' 3522009Sphkdnl 367685Sachednl Define HAVE_CARGF etc if "cargf" is declared and links 377685Sachednl 387685Sachednl argument 1 is name of function to check 397685Sachednl 407685Sachednl ASSUMES argument is a math function with ONE parameter 417685Sachednl 427685Sachednl GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1 437685SacheAC_DEFUN([GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1], [ 447685Sache GLIBCXX_CHECK_MATH_DECL_1($1) 457685Sache if test x$glibcxx_cv_func_$1_use = x"yes"; then 467685Sache AC_CHECK_FUNCS($1) 477685Sache else 487685Sache GLIBCXX_CHECK_MATH_DECL_1(_$1) 497685Sache if test x$glibcxx_cv_func__$1_use = x"yes"; then 507685Sache AC_CHECK_FUNCS(_$1) 517685Sache fi 527685Sache fi 537685Sache]) 5412493Speter 5512493Speter 567685Sachednl 577685Sachednl Like GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of 587685Sachednl of functions at once. It's an all-or-nothing check -- either 597685Sachednl HAVE_XYZ is defined for each of the functions, or for none of them. 607685Sachednl Doing it this way saves significant configure time. 617685SacheAC_DEFUN([GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1], [ 627685Sache AC_MSG_CHECKING([for $1 functions]) 637685Sache AC_CACHE_VAL(glibcxx_cv_func_$2_use, [ 647685Sache AC_LANG_SAVE 657685Sache AC_LANG_CPLUSPLUS 667685Sache AC_TRY_COMPILE([#include <math.h>], 677685Sache [ `for x in $3; do echo "$x (0);"; done` ], 687685Sache [glibcxx_cv_func_$2_use=yes], 697685Sache [glibcxx_cv_func_$2_use=no]) 707685Sache AC_LANG_RESTORE]) 717685Sache AC_MSG_RESULT($glibcxx_cv_func_$2_use) 727685Sache if test x$glibcxx_cv_func_$2_use = x"yes"; then 737685Sache AC_CHECK_FUNCS($3) 747685Sache fi 757685Sache]) 767685Sache 777685Sachednl 787685Sachednl Check to see if the (math function) argument passed is 797685Sachednl declared when using the c++ compiler 807685Sachednl ASSUMES argument is a math function with TWO parameters 817685Sachednl 827685Sachednl GLIBCXX_CHECK_MATH_DECL_2 837685SacheAC_DEFUN([GLIBCXX_CHECK_MATH_DECL_2], [ 847685Sache AC_MSG_CHECKING([for $1 declaration]) 857685Sache if test x${glibcxx_cv_func_$1_use+set} != xset; then 867685Sache AC_CACHE_VAL(glibcxx_cv_func_$1_use, [ 877685Sache AC_LANG_SAVE 887685Sache AC_LANG_CPLUSPLUS 897685Sache AC_TRY_COMPILE([#include <math.h>], 907685Sache [ $1(0, 0);], 917685Sache [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no]) 927685Sache AC_LANG_RESTORE 937685Sache ]) 9439139Sobrien fi 9539139Sobrien AC_MSG_RESULT($glibcxx_cv_func_$1_use) 967685Sache]) 977685Sache 987685Sachednl 997685Sachednl Check to see if the (math function) argument passed is 1007685Sachednl 1) declared when using the c++ compiler 1017685Sachednl 2) has "C" linkage 1027685Sachednl 1037685Sachednl Define HAVE_CARGF etc if "cargf" is declared and links 1047685Sachednl 1057685Sachednl argument 1 is name of function to check 1067685Sachednl 1077685Sachednl ASSUMES argument is a math function with TWO parameters 1087685Sachednl 1097685Sachednl GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2 1107685SacheAC_DEFUN([GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2], [ 1117685Sache GLIBCXX_CHECK_MATH_DECL_2($1) 1127685Sache if test x$glibcxx_cv_func_$1_use = x"yes"; then 1137685Sache AC_CHECK_FUNCS($1) 1147685Sache else 1157685Sache GLIBCXX_CHECK_MATH_DECL_2(_$1) 1167685Sache if test x$glibcxx_cv_func__$1_use = x"yes"; then 1177685Sache AC_CHECK_FUNCS(_$1) 1187685Sache fi 1197685Sache fi 1207685Sache]) 1217685Sache 1227685Sache 1237685Sachednl 1247685Sachednl Check to see if the (math function) argument passed is 1257685Sachednl declared when using the c++ compiler 1267685Sachednl ASSUMES argument is a math function with THREE parameters 1277685Sachednl 1287685Sachednl GLIBCXX_CHECK_MATH_DECL_3 1297685SacheAC_DEFUN([GLIBCXX_CHECK_MATH_DECL_3], [ 1307685Sache AC_MSG_CHECKING([for $1 declaration]) 13113583Spst if test x${glibcxx_cv_func_$1_use+set} != xset; then 13213583Spst AC_CACHE_VAL(glibcxx_cv_func_$1_use, [ 13313583Spst AC_LANG_SAVE 13413583Spst AC_LANG_CPLUSPLUS 1357685Sache AC_TRY_COMPILE([#include <math.h>], 1367685Sache [ $1(0, 0, 0);], 1377685Sache [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no]) 1387685Sache AC_LANG_RESTORE 1397685Sache ]) 1407685Sache fi 1417685Sache AC_MSG_RESULT($glibcxx_cv_func_$1_use) 1427685Sache]) 1437685Sache 1447685Sachednl 1457685Sachednl Check to see if the (math function) argument passed is 1467685Sachednl 1) declared when using the c++ compiler 1477685Sachednl 2) has "C" linkage 1487685Sachednl 1497685Sachednl Define HAVE_CARGF etc if "cargf" is declared and links 1507685Sachednl 1517685Sachednl argument 1 is name of function to check 1527685Sachednl 1537685Sachednl ASSUMES argument is a math function with THREE parameters 1547685Sachednl 1557685Sachednl GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3 1567685SacheAC_DEFUN([GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3], [ 1577685Sache GLIBCXX_CHECK_MATH_DECL_3($1) 1587685Sache if test x$glibcxx_cv_func_$1_use = x"yes"; then 1597685Sache AC_CHECK_FUNCS($1) 1607685Sache else 1617685Sache GLIBCXX_CHECK_MATH_DECL_3(_$1) 1627685Sache if test x$glibcxx_cv_func__$1_use = x"yes"; then 1637685Sache AC_CHECK_FUNCS(_$1) 1647685Sache fi 1657685Sache fi 1667685Sache]) 1677685Sache 1687685Sache 1697685Sachednl 1707685Sachednl Check to see if the (stdlib function) argument passed is 1717685Sachednl 1) declared when using the c++ compiler 1727685Sachednl 2) has "C" linkage 1737685Sachednl 1747685Sachednl argument 1 is name of function to check 1757685Sachednl 1767685Sachednl ASSUMES argument is a stdlib function without parameters 1777685Sachednl 1787685Sachednl GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_0 17939139SobrienAC_DEFUN([GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_0], [ 18039139Sobrien AC_MSG_CHECKING([for $1 declaration]) 1817685Sache if test x${glibcxx_cv_func_$1_use+set} != xset; then 1827685Sache AC_CACHE_VAL(glibcxx_cv_func_$1_use, [ 1837685Sache AC_LANG_SAVE 1847685Sache AC_LANG_CPLUSPLUS 1857685Sache AC_TRY_COMPILE([#include <stdlib.h>], 1867685Sache [ $1();], 1877685Sache [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no]) 1887685Sache AC_LANG_RESTORE 1897685Sache ]) 1907685Sache fi 1917685Sache AC_MSG_RESULT($glibcxx_cv_func_$1_use) 1927685Sache if test x$glibcxx_cv_func_$1_use = x"yes"; then 1937685Sache AC_CHECK_FUNCS($1) 1947685Sache fi 1957685Sache]) 1967685Sache 1977685Sache 1987685Sachednl 1997685Sachednl Check to see if the (stdlib function) argument passed is 2007685Sachednl 1) declared when using the c++ compiler 2017685Sachednl 2) has "C" linkage 2027685Sachednl 2037685Sachednl argument 1 is name of function to check 2047685Sachednl 2057685Sachednl ASSUMES argument is a stdlib function with TWO parameters 2067685Sachednl 2077685Sachednl GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2 2087685SacheAC_DEFUN([GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2], [ 2097685Sache AC_MSG_CHECKING([for $1 declaration]) 2107685Sache if test x${glibcxx_cv_func_$1_use+set} != xset; then 2117685Sache AC_CACHE_VAL(glibcxx_cv_func_$1_use, [ 21239139Sobrien AC_LANG_SAVE 21339139Sobrien AC_LANG_CPLUSPLUS 21428118Seivind AC_TRY_COMPILE([#include <stdlib.h>], 2157685Sache [ $1(0, 0);], 2167685Sache [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no]) 2177685Sache AC_LANG_RESTORE 2187685Sache ]) 2197685Sache fi 2207685Sache AC_MSG_RESULT($glibcxx_cv_func_$1_use) 2217685Sache if test x$glibcxx_cv_func_$1_use = x"yes"; then 2227685Sache AC_CHECK_FUNCS($1) 2237685Sache fi 2247685Sache]) 2257685Sache 2267685Sache 2277685Sachednl 2287685Sachednl Check to see if the (stdlib function) argument passed is 2297685Sachednl 1) declared when using the c++ compiler 2307685Sachednl 2) has "C" linkage 2317685Sachednl 2327685Sachednl argument 1 is name of function to check 2337685Sachednl 2347685Sachednl ASSUMES argument is a stdlib function with THREE parameters 2357685Sachednl 2367685Sachednl GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3 2377685SacheAC_DEFUN([GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3], [ 2387685Sache AC_MSG_CHECKING([for $1 declaration]) 2397685Sache if test x${glibcxx_cv_func_$1_use+set} != xset; then 2407685Sache AC_CACHE_VAL(glibcxx_cv_func_$1_use, [ 2417685Sache AC_LANG_SAVE 2427685Sache AC_LANG_CPLUSPLUS 2437685Sache AC_TRY_COMPILE([#include <stdlib.h>], 2447685Sache [ $1(0, 0, 0);], 2457685Sache [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no]) 2467685Sache AC_LANG_RESTORE 2477685Sache ]) 2487685Sache fi 2497685Sache AC_MSG_RESULT($glibcxx_cv_func_$1_use) 2507685Sache if test x$glibcxx_cv_func_$1_use = x"yes"; then 2517685Sache AC_CHECK_FUNCS($1) 2527685Sache fi 2537685Sache]) 2547685Sache 2557685Sachednl 2567685Sachednl Because the builtins are picky picky picky about the arguments they take, 2577685Sachednl do an explict linkage tests here. 2587685Sachednl Check to see if the (math function) argument passed is 2597685Sachednl 1) declared when using the c++ compiler 2607685Sachednl 2) has "C" linkage 2617685Sachednl 2627685Sachednl Define HAVE_CARGF etc if "cargf" is declared and links 2637685Sachednl 2647685Sachednl argument 1 is name of function to check 2657685Sachednl 2667685Sachednl ASSUMES argument is a math function with ONE parameter 2677685Sachednl 2687685Sachednl GLIBCXX_CHECK_BUILTIN_MATH_DECL_LINKAGE_1 2697685SacheAC_DEFUN([GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1], [ 2707685Sache AC_MSG_CHECKING([for $1 declaration]) 2717685Sache if test x${glibcxx_cv_func_$1_use+set} != xset; then 27239139Sobrien AC_CACHE_VAL(glibcxx_cv_func_$1_use, [ 27339139Sobrien AC_LANG_SAVE 2747685Sache AC_LANG_CPLUSPLUS 2757685Sache AC_TRY_COMPILE([#include <math.h>], 2767685Sache [ $1(0);], 2777685Sache [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no]) 2787685Sache AC_LANG_RESTORE 2797685Sache ]) 2807685Sache fi 2817685Sache AC_MSG_RESULT($glibcxx_cv_func_$1_use) 2827685Sache if test x$glibcxx_cv_func_$1_use = x"yes"; then 2837685Sache AC_MSG_CHECKING([for $1 linkage]) 2847685Sache if test x${glibcxx_cv_func_$1_link+set} != xset; then 2857685Sache AC_CACHE_VAL(glibcxx_cv_func_$1_link, [ 2867685Sache AC_TRY_LINK([#include <math.h>], 2877685Sache [ $1(0);], 28821468Spst [glibcxx_cv_func_$1_link=yes], [glibcxx_cv_func_$1_link=no]) 28921468Spst ]) 2907685Sache fi 2917685Sache AC_MSG_RESULT($glibcxx_cv_func_$1_link) 29239139Sobrien if test x$glibcxx_cv_func_$1_link = x"yes"; then 29339139Sobrien ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` 29439139Sobrien AC_DEFINE_UNQUOTED(${ac_tr_func}, 1, [Defined if $1 exists.]) 29539139Sobrien fi 2967685Sache fi 2977685Sache]) 2987685Sache 2997685Sache 3007685Sachednl 3017685Sachednl Check to see what builtin math functions are supported 30239139Sobriendnl 30339139Sobriendnl check for __builtin_abs 3047685Sachednl check for __builtin_fabsf 3057685Sachednl check for __builtin_fabs 3067685Sachednl check for __builtin_fabl 3077685Sachednl check for __builtin_labs 3087685Sachednl check for __builtin_sqrtf 3097685Sachednl check for __builtin_sqrtl 3107685Sachednl check for __builtin_sqrt 3117685Sachednl check for __builtin_sinf 3127685Sachednl check for __builtin_sin 3137685Sachednl check for __builtin_sinl 3147685Sachednl check for __builtin_cosf 3157685Sachednl check for __builtin_cos 3167685Sachednl check for __builtin_cosl 3177685Sachednl 3187685Sachednl GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT 3197685SacheAC_DEFUN([GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT], [ 3207685Sache dnl Test for builtin math functions. 3217685Sache dnl These are made in gcc/c-common.c 3227685Sache GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs) 3237685Sache GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf) 3247685Sache GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs) 3257685Sache GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl) 3267685Sache GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs) 3277685Sache 3287685Sache GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf) 3297685Sache GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrt) 3307685Sache GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl) 3317685Sache 3327685Sache GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf) 3337685Sache GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin) 3347685Sache GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl) 3357685Sache 3367685Sache GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf) 3377685Sache GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos) 3387685Sache GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl) 3397685Sache]) 3407685Sache 3417685Sachednl 3427685Sachednl Check to see what the underlying c library is like 3437685Sachednl These checks need to do two things: 3447685Sachednl 1) make sure the name is declared when using the c++ compiler 3457685Sachednl 2) make sure the name has "C" linkage 3467685Sachednl This might seem like overkill but experience has shown that it's not... 3477685Sachednl 3487685Sachednl Define HAVE_STRTOLD if "strtold" is declared and links 3497685Sachednl Define HAVE_STRTOF if "strtof" is declared and links 3507685Sachednl 3517685Sachednl GLIBCXX_CHECK_STDLIB_SUPPORT 3527685SacheAC_DEFUN([GLIBCXX_CHECK_STDLIB_SUPPORT], [ 3537685Sache ac_test_CXXFLAGS="${CXXFLAGS+set}" 3547685Sache ac_save_CXXFLAGS="$CXXFLAGS" 3557685Sache CXXFLAGS='-fno-builtin -D_GNU_SOURCE' 3567685Sache 3577685Sache GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold) 3587685Sache GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtof) 3597685Sache 3607685Sache CXXFLAGS="$ac_save_CXXFLAGS" 3617685Sache]) 36239139Sobrien 3637685Sachednl 3647685Sachednl Check to see what the underlying c library or math library is like. 3657685Sachednl These checks need to do two things: 3667685Sachednl 1) make sure the name is declared when using the c++ compiler 3677685Sachednl 2) make sure the name has "C" linkage 3687685Sachednl This might seem like overkill but experience has shown that it's not... 3697685Sachednl 3707685Sachednl Define HAVE_CARGF etc if "cargf" is found. 3717685Sachednl 3727685Sachednl GLIBCXX_CHECK_MATH_SUPPORT 3737685SacheAC_DEFUN([GLIBCXX_CHECK_MATH_SUPPORT], [ 3747685Sache ac_test_CXXFLAGS="${CXXFLAGS+set}" 3757685Sache ac_save_CXXFLAGS="$CXXFLAGS" 3767685Sache CXXFLAGS='-fno-builtin -D_GNU_SOURCE' 3777685Sache 3787685Sache dnl Check libm 3797685Sache AC_CHECK_LIB(m, sin, libm="-lm") 3807685Sache ac_save_LIBS="$LIBS" 3817685Sache LIBS="$LIBS $libm" 3827685Sache 3837685Sache dnl Check to see if certain C math functions exist. 3847685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isinf) 3857685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isnan) 3867685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(finite) 38739139Sobrien GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(copysign) 3887685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3(sincos) 3897685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass) 3907685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass) 3917685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(hypot) 3927685Sache 3937685Sache dnl Check to see if basic C math functions have float versions. 3947685Sache GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig, 3957685Sache float_trig, 3967685Sache acosf asinf atanf \ 3977685Sache cosf sinf tanf \ 3987685Sache coshf sinhf tanhf) 3997685Sache GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(float round, 4007685Sache float_round, 4017685Sache ceilf floorf) 4027685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(expf) 4037685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf) 4047685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isinff) 405705Swollman GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(atan2f) 4067685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf) 4077685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf) 4087685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf) 4097685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(hypotf) 4107685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf) 4117685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(logf) 4127685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(log10f) 4137685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(modff) 4147685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(powf) 4157685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtf) 4167685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3(sincosf) 4177685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(finitef) 4187685Sache 4197685Sache dnl Check to see if basic C math functions have long double versions. 4207685Sache GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig, 4217685Sache long_double_trig, 4227685Sache acosl asinl atanl \ 4237685Sache cosl sinl tanl \ 42439139Sobrien coshl sinhl tanhl) 42539139Sobrien GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round, 42639139Sobrien long_double_round, 42739139Sobrien ceill floorl) 42839139Sobrien GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl) 42939139Sobrien GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl) 4307685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(copysignl) 4317685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(atan2l) 4327685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(expl) 4337685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl) 4347685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl) 4357685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl) 4367685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(hypotl) 437705Swollman GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl) 4387685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(logl) 4397685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(log10l) 4407685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(modfl) 4417685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(powl) 44239139Sobrien GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtl) 44339139Sobrien GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl) 4447685Sache GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(finitel) 4457685Sache 4467685Sache dnl Some runtimes have these functions with a preceding underscore. Please 4477685Sache dnl keep this sync'd with the one above. And if you add any new symbol, 4487685Sache dnl please add the corresponding block in the @BOTTOM@ section of acconfig.h. 4497685Sache dnl Check to see if certain C math functions exist. 4507685Sache 4517685Sache dnl Check to see if basic C math functions have float versions. 4527685Sache GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(_float trig, 4537685Sache _float_trig, 4547685Sache _acosf _asinf _atanf \ 4557685Sache _cosf _sinf _tanf \ 4567685Sache _coshf _sinhf _tanhf) 4577685Sache GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(_float round, 45839139Sobrien _float_round, 45939139Sobrien _ceilf _floorf) 4607685Sache 4617685Sache dnl Check to see if basic C math functions have long double versions. 46239139Sobrien GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double trig, 46339139Sobrien _long_double_trig, 4647685Sache _acosl _asinl _atanl \ 4657685Sache _cosl _sinl _tanl \ 4667685Sache _coshl _sinhl _tanhl) 4677685Sache GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(_long double round, 46839139Sobrien _long_double_round, 46939139Sobrien _ceill _floorl) 47039139Sobrien 47139139Sobrien LIBS="$ac_save_LIBS" 47239139Sobrien CXXFLAGS="$ac_save_CXXFLAGS" 47339139Sobrien]) 47439139Sobrien 47539139Sobrien 47639139Sobriendnl 47739139Sobriendnl Check to see if there is native support for complex 47839139Sobriendnl 47939139Sobriendnl Don't compile bits in math/* if native support exits. 48039139Sobriendnl 48139139Sobriendnl Define USE_COMPLEX_LONG_DOUBLE etc if "copysignl" is found. 48239139Sobriendnl 48339139Sobriendnl GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT 48439139SobrienAC_DEFUN([GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT], [ 48539139Sobrien dnl Check for complex versions of math functions of platform. This will 48639139Sobrien dnl always pass if libm is available, and fail if it isn't. If it is 48739139Sobrien dnl available, we assume we'll need it later, so add it to LIBS. 48839139Sobrien AC_CHECK_LIB(m, main) 48939139Sobrien AC_REPLACE_MATHFUNCS(copysignf) 49039139Sobrien 49139139Sobrien dnl For __signbit to signbit conversions. 49239139Sobrien dnl Not sure why this is done, as these will be macros mostly. 49339139Sobrien dnl Should probably coordinate this with std_cmath.h. 49439139Sobrien AC_CHECK_FUNCS([__signbit], , [LIBMATHOBJS="$LIBMATHOBJS signbit.lo"]) 49539139Sobrien 49639139Sobrien AC_CHECK_FUNCS([__signbitf], , [LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"]) 49739139Sobrien 49839139Sobrien dnl Compile the long double complex functions only if the function 49939139Sobrien dnl provides the non-complex long double functions that are needed. 50039139Sobrien dnl Currently this includes copysignl, which should be 50139139Sobrien dnl cached from the GLIBCXX_CHECK_MATH_SUPPORT macro, above. 50239139Sobrien if test x$ac_cv_func_copysignl = x"yes"; then 50339139Sobrien AC_CHECK_FUNCS([__signbitl], , [LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"]) 50439139Sobrien fi 50539139Sobrien 50639139Sobrien # Used in libmath/Makefile.am. 50739139Sobrien if test -n "$LIBMATHOBJS"; then 50839139Sobrien need_libmath=yes 50939139Sobrien fi 51039139Sobrien AC_SUBST(LIBMATHOBJS) 51139139Sobrien]) 51239139Sobrien 51339139Sobrien 51439139Sobrien# Check for functions in math library. 51539139Sobrien# Ulrich Drepper <drepper@cygnus.com>, 1998. 51639139Sobrien# 51739139Sobrien# This file can be copied and used freely without restrictions. It can 51839139Sobrien# be used in projects which are not available under the GNU Public License 51939139Sobrien# but which still want to provide support for the GNU gettext functionality. 52039139Sobrien# Please note that the actual code is *not* freely available. 52139139Sobrien# 52239139Sobrien# serial 1 52339139Sobrien# 5247685Sachednl AC_REPLACE_MATHFUNCS(FUNCTION...) 5257685SacheAC_DEFUN([AC_REPLACE_MATHFUNCS], 5267685Sache[AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])]) 5277685Sache