linkage.m4 revision 169691
1dnl 2dnl This file contains macros for testing linkage. 3dnl 4 5dnl 6dnl Check to see if the (math function) argument passed is 7dnl declared when using the c++ compiler 8dnl ASSUMES argument is a math function with ONE parameter 9dnl 10dnl GLIBCXX_CHECK_MATH_DECL_1 11AC_DEFUN([GLIBCXX_CHECK_MATH_DECL_1], [ 12 AC_MSG_CHECKING([for $1 declaration]) 13 if test x${glibcxx_cv_func_$1_use+set} != xset; then 14 AC_CACHE_VAL(glibcxx_cv_func_$1_use, [ 15 AC_LANG_SAVE 16 AC_LANG_CPLUSPLUS 17 AC_TRY_COMPILE([#include <math.h> 18 #ifdef HAVE_IEEEFP_H 19 #include <ieeefp.h> 20 #endif 21 ], 22 [ $1(0);], 23 [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no]) 24 AC_LANG_RESTORE 25 ]) 26 fi 27 AC_MSG_RESULT($glibcxx_cv_func_$1_use) 28]) 29 30 31dnl 32dnl Define autoheader template for using the underscore functions 33dnl For each parameter, create a macro where if func doesn't exist, 34dnl but _func does, then it will "#define func _func". 35dnl 36dnl GLIBCXX_MAYBE_UNDERSCORED_FUNCS 37AC_DEFUN([GLIBCXX_MAYBE_UNDERSCORED_FUNCS], 38[AC_FOREACH([glibcxx_ufunc], [$1], 39 [AH_VERBATIM(_[]glibcxx_ufunc, 40[#if defined (]AS_TR_CPP(HAVE__[]glibcxx_ufunc)[) && ! defined (]AS_TR_CPP(HAVE_[]glibcxx_ufunc)[) 41# define ]AS_TR_CPP(HAVE_[]glibcxx_ufunc)[ 1 42# define ]glibcxx_ufunc[ _]glibcxx_ufunc[ 43#endif])]) 44]) 45 46 47dnl 48dnl Check to see if the (math function) argument passed is 49dnl 1) declared when using the c++ compiler 50dnl 2) has "C" linkage 51dnl 3) if not, see if 1) and 2) for argument prepended with '_' 52dnl 53dnl Define HAVE_CARGF etc if "cargf" is declared and links 54dnl 55dnl argument 1 is name of function to check 56dnl 57dnl ASSUMES argument is a math function with ONE parameter 58dnl 59dnl GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1 60AC_DEFUN([GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1], [ 61 GLIBCXX_CHECK_MATH_DECL_1($1) 62 if test x$glibcxx_cv_func_$1_use = x"yes"; then 63 AC_CHECK_FUNCS($1) 64 else 65 GLIBCXX_CHECK_MATH_DECL_1(_$1) 66 if test x$glibcxx_cv_func__$1_use = x"yes"; then 67 AC_CHECK_FUNCS(_$1) 68 fi 69 fi 70 GLIBCXX_MAYBE_UNDERSCORED_FUNCS($1) 71]) 72 73 74dnl 75dnl Like GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1, but does a bunch of 76dnl of functions at once. It's an all-or-nothing check -- either 77dnl HAVE_XYZ is defined for each of the functions, or for none of them. 78dnl Doing it this way saves significant configure time. 79AC_DEFUN([GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1], [ 80 define([funclist],patsubst($3,\(\w+\)\(\W*\),\1 ))dnl 81 AC_MSG_CHECKING([for $1 functions]) 82 AC_CACHE_VAL(glibcxx_cv_func_$2_use, [ 83 AC_LANG_SAVE 84 AC_LANG_CPLUSPLUS 85 AC_TRY_COMPILE([#include <math.h>], 86 patsubst(funclist,[\w+],[\& (0);]), 87 [glibcxx_cv_func_$2_use=yes], 88 [glibcxx_cv_func_$2_use=no]) 89 AC_LANG_RESTORE]) 90 AC_MSG_RESULT($glibcxx_cv_func_$2_use) 91 if test x$glibcxx_cv_func_$2_use = x"yes"; then 92 AC_CHECK_FUNCS(funclist) 93 else 94 AC_MSG_CHECKING([for _$1 functions]) 95 AC_CACHE_VAL(glibcxx_cv_func__$2_use, [ 96 AC_LANG_SAVE 97 AC_LANG_CPLUSPLUS 98 AC_TRY_COMPILE([#include <math.h>], 99 patsubst(funclist,[\w+],[_\& (0);]), 100 [glibcxx_cv_func__$2_use=yes], 101 [glibcxx_cv_func__$2_use=no]) 102 AC_LANG_RESTORE]) 103 AC_MSG_RESULT($glibcxx_cv_func__$2_use) 104 if test x$glibcxx_cv_func__$2_use = x"yes"; then 105 AC_CHECK_FUNCS(patsubst(funclist,[\w+],[_\&])) 106 fi 107 fi 108 GLIBCXX_MAYBE_UNDERSCORED_FUNCS(funclist) 109 undefine([funclist]) 110]) 111 112dnl 113dnl Check to see if the (math function) argument passed is 114dnl declared when using the c++ compiler 115dnl ASSUMES argument is a math function with TWO parameters 116dnl 117dnl GLIBCXX_CHECK_MATH_DECL_2 118AC_DEFUN([GLIBCXX_CHECK_MATH_DECL_2], [ 119 AC_MSG_CHECKING([for $1 declaration]) 120 if test x${glibcxx_cv_func_$1_use+set} != xset; then 121 AC_CACHE_VAL(glibcxx_cv_func_$1_use, [ 122 AC_LANG_SAVE 123 AC_LANG_CPLUSPLUS 124 AC_TRY_COMPILE([#include <math.h>], 125 [ $1(0, 0);], 126 [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no]) 127 AC_LANG_RESTORE 128 ]) 129 fi 130 AC_MSG_RESULT($glibcxx_cv_func_$1_use) 131]) 132 133dnl 134dnl Check to see if the (math function) argument passed is 135dnl 1) declared when using the c++ compiler 136dnl 2) has "C" linkage 137dnl 138dnl Define HAVE_CARGF etc if "cargf" is declared and links 139dnl 140dnl argument 1 is name of function to check 141dnl 142dnl ASSUMES argument is a math function with TWO parameters 143dnl 144dnl GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2 145AC_DEFUN([GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2], [ 146 GLIBCXX_CHECK_MATH_DECL_2($1) 147 if test x$glibcxx_cv_func_$1_use = x"yes"; then 148 AC_CHECK_FUNCS($1) 149 else 150 GLIBCXX_CHECK_MATH_DECL_2(_$1) 151 if test x$glibcxx_cv_func__$1_use = x"yes"; then 152 AC_CHECK_FUNCS(_$1) 153 fi 154 fi 155 GLIBCXX_MAYBE_UNDERSCORED_FUNCS($1) 156]) 157 158 159dnl 160dnl Check to see if the (math function) argument passed is 161dnl declared when using the c++ compiler 162dnl ASSUMES argument is a math function with THREE parameters 163dnl 164dnl GLIBCXX_CHECK_MATH_DECL_3 165AC_DEFUN([GLIBCXX_CHECK_MATH_DECL_3], [ 166 AC_MSG_CHECKING([for $1 declaration]) 167 if test x${glibcxx_cv_func_$1_use+set} != xset; then 168 AC_CACHE_VAL(glibcxx_cv_func_$1_use, [ 169 AC_LANG_SAVE 170 AC_LANG_CPLUSPLUS 171 AC_TRY_COMPILE([#include <math.h>], 172 [ $1(0, 0, 0);], 173 [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no]) 174 AC_LANG_RESTORE 175 ]) 176 fi 177 AC_MSG_RESULT($glibcxx_cv_func_$1_use) 178]) 179 180dnl 181dnl Check to see if the (math function) argument passed is 182dnl 1) declared when using the c++ compiler 183dnl 2) has "C" linkage 184dnl 185dnl Define HAVE_CARGF etc if "cargf" is declared and links 186dnl 187dnl argument 1 is name of function to check 188dnl 189dnl ASSUMES argument is a math function with THREE parameters 190dnl 191dnl GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3 192AC_DEFUN([GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3], [ 193 GLIBCXX_CHECK_MATH_DECL_3($1) 194 if test x$glibcxx_cv_func_$1_use = x"yes"; then 195 AC_CHECK_FUNCS($1) 196 else 197 GLIBCXX_CHECK_MATH_DECL_3(_$1) 198 if test x$glibcxx_cv_func__$1_use = x"yes"; then 199 AC_CHECK_FUNCS(_$1) 200 fi 201 fi 202 GLIBCXX_MAYBE_UNDERSCORED_FUNCS($1) 203]) 204 205 206dnl 207dnl Check to see if the (stdlib function) argument passed is 208dnl 1) declared when using the c++ compiler 209dnl 2) has "C" linkage 210dnl 211dnl argument 1 is name of function to check 212dnl 213dnl ASSUMES argument is a stdlib function without parameters 214dnl 215dnl GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_0 216AC_DEFUN([GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_0], [ 217 AC_MSG_CHECKING([for $1 declaration]) 218 if test x${glibcxx_cv_func_$1_use+set} != xset; then 219 AC_CACHE_VAL(glibcxx_cv_func_$1_use, [ 220 AC_LANG_SAVE 221 AC_LANG_CPLUSPLUS 222 AC_TRY_COMPILE([#include <stdlib.h>], 223 [ $1();], 224 [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no]) 225 AC_LANG_RESTORE 226 ]) 227 fi 228 AC_MSG_RESULT($glibcxx_cv_func_$1_use) 229 if test x$glibcxx_cv_func_$1_use = x"yes"; then 230 AC_CHECK_FUNCS($1) 231 fi 232]) 233 234 235dnl 236dnl Check to see if the (stdlib function) argument passed is 237dnl 1) declared when using the c++ compiler 238dnl 2) has "C" linkage 239dnl 240dnl argument 1 is name of function to check 241dnl 242dnl ASSUMES argument is a stdlib function with TWO parameters 243dnl 244dnl GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2 245AC_DEFUN([GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2], [ 246 AC_MSG_CHECKING([for $1 declaration]) 247 if test x${glibcxx_cv_func_$1_use+set} != xset; then 248 AC_CACHE_VAL(glibcxx_cv_func_$1_use, [ 249 AC_LANG_SAVE 250 AC_LANG_CPLUSPLUS 251 AC_TRY_COMPILE([#include <stdlib.h>], 252 [ $1(0, 0);], 253 [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no]) 254 AC_LANG_RESTORE 255 ]) 256 fi 257 AC_MSG_RESULT($glibcxx_cv_func_$1_use) 258 if test x$glibcxx_cv_func_$1_use = x"yes"; then 259 AC_CHECK_FUNCS($1) 260 fi 261 GLIBCXX_MAYBE_UNDERSCORED_FUNCS($1) 262]) 263 264 265dnl 266dnl Check to see if the (stdlib function) argument passed is 267dnl 1) declared when using the c++ compiler 268dnl 2) has "C" linkage 269dnl 270dnl argument 1 is name of function to check 271dnl 272dnl ASSUMES argument is a stdlib function with THREE parameters 273dnl 274dnl GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3 275AC_DEFUN([GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3], [ 276 AC_MSG_CHECKING([for $1 declaration]) 277 if test x${glibcxx_cv_func_$1_use+set} != xset; then 278 AC_CACHE_VAL(glibcxx_cv_func_$1_use, [ 279 AC_LANG_SAVE 280 AC_LANG_CPLUSPLUS 281 AC_TRY_COMPILE([#include <stdlib.h>], 282 [ $1(0, 0, 0);], 283 [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no]) 284 AC_LANG_RESTORE 285 ]) 286 fi 287 AC_MSG_RESULT($glibcxx_cv_func_$1_use) 288 if test x$glibcxx_cv_func_$1_use = x"yes"; then 289 AC_CHECK_FUNCS($1) 290 fi 291]) 292 293dnl 294dnl Because the builtins are picky picky picky about the arguments they take, 295dnl do an explict linkage tests here. 296dnl Check to see if the (math function) argument passed is 297dnl 1) declared when using the c++ compiler 298dnl 2) has "C" linkage 299dnl 300dnl Define HAVE_CARGF etc if "cargf" is declared and links 301dnl 302dnl argument 1 is name of function to check 303dnl 304dnl ASSUMES argument is a math function with ONE parameter 305dnl 306dnl GLIBCXX_CHECK_BUILTIN_MATH_DECL_LINKAGE_1 307AC_DEFUN([GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1], [ 308 AC_MSG_CHECKING([for $1 declaration]) 309 if test x${glibcxx_cv_func_$1_use+set} != xset; then 310 AC_CACHE_VAL(glibcxx_cv_func_$1_use, [ 311 AC_LANG_SAVE 312 AC_LANG_CPLUSPLUS 313 AC_TRY_COMPILE([#include <math.h>], 314 [ $1(0);], 315 [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no]) 316 AC_LANG_RESTORE 317 ]) 318 fi 319 AC_MSG_RESULT($glibcxx_cv_func_$1_use) 320 if test x$glibcxx_cv_func_$1_use = x"yes"; then 321 AC_MSG_CHECKING([for $1 linkage]) 322 if test x${glibcxx_cv_func_$1_link+set} != xset; then 323 AC_CACHE_VAL(glibcxx_cv_func_$1_link, [ 324 AC_TRY_LINK([#include <math.h>], 325 [ $1(0);], 326 [glibcxx_cv_func_$1_link=yes], [glibcxx_cv_func_$1_link=no]) 327 ]) 328 fi 329 AC_MSG_RESULT($glibcxx_cv_func_$1_link) 330 define([NAME], [translit([$1],[abcdefghijklmnopqrstuvwxyz], 331 [ABCDEFGHIJKLMNOPQRSTUVWXYZ])]) 332 if test x$glibcxx_cv_func_$1_link = x"yes"; then 333 AC_DEFINE([HAVE_]NAME, 1, [Define if the compiler/host combination has $1.]) 334 fi 335 undefine([NAME]) 336 fi 337]) 338 339 340dnl 341dnl Check to see what builtin math functions are supported 342dnl 343dnl check for __builtin_abs 344dnl check for __builtin_fabsf 345dnl check for __builtin_fabs 346dnl check for __builtin_fabl 347dnl check for __builtin_labs 348dnl check for __builtin_sqrtf 349dnl check for __builtin_sqrtl 350dnl check for __builtin_sqrt 351dnl check for __builtin_sinf 352dnl check for __builtin_sin 353dnl check for __builtin_sinl 354dnl check for __builtin_cosf 355dnl check for __builtin_cos 356dnl check for __builtin_cosl 357dnl 358dnl GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT 359AC_DEFUN([GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT], [ 360 dnl Test for builtin math functions. 361 dnl These are made in gcc/c-common.c 362 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs) 363 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf) 364 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs) 365 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl) 366 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs) 367 368 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf) 369 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrt) 370 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl) 371 372 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf) 373 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin) 374 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl) 375 376 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf) 377 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos) 378 GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl) 379]) 380 381dnl 382dnl Check to see what the underlying c library is like 383dnl These checks need to do two things: 384dnl 1) make sure the name is declared when using the c++ compiler 385dnl 2) make sure the name has "C" linkage 386dnl This might seem like overkill but experience has shown that it's not... 387dnl 388dnl Define HAVE_STRTOLD if "strtold" is declared and links 389dnl Define HAVE_STRTOF if "strtof" is declared and links 390dnl 391dnl GLIBCXX_CHECK_STDLIB_SUPPORT 392AC_DEFUN([GLIBCXX_CHECK_STDLIB_SUPPORT], [ 393 ac_test_CXXFLAGS="${CXXFLAGS+set}" 394 ac_save_CXXFLAGS="$CXXFLAGS" 395 CXXFLAGS='-fno-builtin -D_GNU_SOURCE' 396 397 GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold) 398 GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtof) 399 400 CXXFLAGS="$ac_save_CXXFLAGS" 401]) 402 403dnl 404dnl Check to see what the underlying c library or math library is like. 405dnl These checks need to do two things: 406dnl 1) make sure the name is declared when using the c++ compiler 407dnl 2) make sure the name has "C" linkage 408dnl This might seem like overkill but experience has shown that it's not... 409dnl 410dnl Define HAVE_CARGF etc if "cargf" is found. 411dnl 412dnl GLIBCXX_CHECK_MATH_SUPPORT 413AC_DEFUN([GLIBCXX_CHECK_MATH_SUPPORT], [ 414 ac_test_CXXFLAGS="${CXXFLAGS+set}" 415 ac_save_CXXFLAGS="$CXXFLAGS" 416 CXXFLAGS='-fno-builtin -D_GNU_SOURCE' 417 418 dnl Check libm 419 AC_CHECK_LIB(m, sin, libm="-lm") 420 ac_save_LIBS="$LIBS" 421 LIBS="$LIBS $libm" 422 423 dnl Check to see if certain C math functions exist. 424 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isinf) 425 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isnan) 426 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(finite) 427 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(copysign) 428 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3(sincos) 429 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(fpclass) 430 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(qfpclass) 431 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(hypot) 432 433 dnl Check to see if basic C math functions have float versions. 434 GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(float trig, 435 float_trig, 436 acosf asinf atanf \ 437 cosf sinf tanf \ 438 coshf sinhf tanhf) 439 GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(float round, 440 float_round, 441 ceilf floorf) 442 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(expf) 443 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isnanf) 444 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isinff) 445 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(atan2f) 446 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(fabsf) 447 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(fmodf) 448 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(frexpf) 449 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(hypotf) 450 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpf) 451 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(logf) 452 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(log10f) 453 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(modff) 454 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(modf) 455 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(powf) 456 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtf) 457 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3(sincosf) 458 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(finitef) 459 460 dnl Check to see if basic C math functions have long double versions. 461 GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(long double trig, 462 long_double_trig, 463 acosl asinl atanl \ 464 cosl sinl tanl \ 465 coshl sinhl tanhl) 466 GLIBCXX_CHECK_MATH_DECLS_AND_LINKAGES_1(long double round, 467 long_double_round, 468 ceill floorl) 469 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isnanl) 470 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(isinfl) 471 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(copysignl) 472 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(atan2l) 473 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(expl) 474 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(fabsl) 475 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(fmodl) 476 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(frexpl) 477 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(hypotl) 478 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(ldexpl) 479 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(logl) 480 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(log10l) 481 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(modfl) 482 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_2(powl) 483 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(sqrtl) 484 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_3(sincosl) 485 GLIBCXX_CHECK_MATH_DECL_AND_LINKAGE_1(finitel) 486 487 LIBS="$ac_save_LIBS" 488 CXXFLAGS="$ac_save_CXXFLAGS" 489]) 490 491 492dnl 493dnl Check to see if there is native support for complex 494dnl 495dnl Don't compile bits in math/* if native support exits. 496dnl 497dnl Define USE_COMPLEX_LONG_DOUBLE etc if "copysignl" is found. 498dnl 499dnl GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT 500AC_DEFUN([GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT], [ 501 dnl Check for complex versions of math functions of platform. This will 502 dnl always pass if libm is available, and fail if it isn't. If it is 503 dnl available, we assume we'll need it later, so add it to LIBS. 504 AC_CHECK_LIB(m, main) 505 AC_REPLACE_MATHFUNCS(copysignf) 506 507 dnl For __signbit to signbit conversions. 508 dnl Not sure why this is done, as these will be macros mostly. 509 dnl Should probably coordinate this with std_cmath.h. 510 AC_CHECK_FUNCS([__signbit], , [LIBMATHOBJS="$LIBMATHOBJS signbit.lo"]) 511 512 AC_CHECK_FUNCS([__signbitf], , [LIBMATHOBJS="$LIBMATHOBJS signbitf.lo"]) 513 514 dnl Compile the long double complex functions only if the function 515 dnl provides the non-complex long double functions that are needed. 516 dnl Currently this includes copysignl, which should be 517 dnl cached from the GLIBCXX_CHECK_MATH_SUPPORT macro, above. 518 if test x$ac_cv_func_copysignl = x"yes"; then 519 AC_CHECK_FUNCS([__signbitl], , [LIBMATHOBJS="$LIBMATHOBJS signbitl.lo"]) 520 fi 521 522 # Used in libmath/Makefile.am. 523 if test -n "$LIBMATHOBJS"; then 524 need_libmath=yes 525 fi 526 AC_SUBST(LIBMATHOBJS) 527]) 528 529 530# Check for functions in math library. 531# Ulrich Drepper <drepper@cygnus.com>, 1998. 532# 533# This file can be copied and used freely without restrictions. It can 534# be used in projects which are not available under the GNU Public License 535# but which still want to provide support for the GNU gettext functionality. 536# Please note that the actual code is *not* freely available. 537# 538# serial 1 539# 540dnl AC_REPLACE_MATHFUNCS(FUNCTION...) 541AC_DEFUN([AC_REPLACE_MATHFUNCS], 542[AC_CHECK_FUNCS([$1], , [LIBMATHOBJS="$LIBMATHOBJS ${ac_func}.lo"])]) 543