ruby-changes:54817
From: nobu <ko1@a...>
Date: Fri, 8 Feb 2019 16:23:00 +0900 (JST)
Subject: [ruby-changes:54817] nobu:r67036 (trunk): configure.ac: check finite, isinf, isnan as macros first
nobu 2019-02-08 16:22:55 +0900 (Fri, 08 Feb 2019) New Revision: 67036 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67036 Log: configure.ac: check finite,isinf,isnan as macros first [ruby-core:91487] [Bug #15595] Added files: trunk/tool/m4/ruby_replace_funcs.m4 Modified files: trunk/aclocal.m4 trunk/configure.ac Index: tool/m4/ruby_replace_funcs.m4 =================================================================== --- tool/m4/ruby_replace_funcs.m4 (nonexistent) +++ tool/m4/ruby_replace_funcs.m4 (revision 67036) @@ -0,0 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/tool/m4/ruby_replace_funcs.m4#L1 +# -*- Autoconf -*- +dnl RUBY_REPLACE_FUNC [func] [included] +AC_DEFUN([RUBY_REPLACE_FUNC], [dnl + AC_CHECK_DECL([$1],dnl + [AC_DEFINE(AS_TR_CPP(HAVE_[$1]))],dnl + [AC_REPLACE_FUNCS($1)],dnl + [$2])dnl +]) + +dnl RUBY_REPLACE_FUNCS [funcs] [included] +AC_DEFUN([RUBY_REPLACE_FUNCS] [dnl + m4_map_args_w([$1], [RUBY_REPLACE_FUNC(], [), [$2]])dnl +]) Index: aclocal.m4 =================================================================== --- aclocal.m4 (revision 67035) +++ aclocal.m4 (revision 67036) @@ -35,6 +35,7 @@ m4_include([tool/m4/ruby_func_attribute. https://github.com/ruby/ruby/blob/trunk/aclocal.m4#L35 m4_include([tool/m4/ruby_mingw32.m4]) m4_include([tool/m4/ruby_prepend_option.m4]) m4_include([tool/m4/ruby_prog_gnu_ld.m4]) +m4_include([tool/m4/ruby_replace_funcs.m4]) m4_include([tool/m4/ruby_replace_type.m4]) m4_include([tool/m4/ruby_rm_recursive.m4]) m4_include([tool/m4/ruby_setjmp_type.m4]) Index: configure.ac =================================================================== --- configure.ac (revision 67035) +++ configure.ac (revision 67036) @@ -941,9 +941,6 @@ main() https://github.com/ruby/ruby/blob/trunk/configure.ac#L941 ac_cv_func_fsync=yes ac_cv_func_seekdir=yes ac_cv_func_telldir=yes - ac_cv_func_isinf=yes - ac_cv_func_isnan=yes - ac_cv_func_finite=yes ac_cv_func_lchown=yes ac_cv_func_link=yes ac_cv_func_readlink=yes @@ -994,9 +991,6 @@ main() https://github.com/ruby/ruby/blob/trunk/configure.ac#L991 [netbsd*], [ LIBS="-lm $LIBS" ], [dragonfly*], [ LIBS="-lm $LIBS" - # isinf() and isnan() are macros on DragonFly. - ac_cv_func_isinf=yes - ac_cv_func_isnan=yes ], [aix*],[ LIBS="-lm $LIBS" ac_cv_func_round=no @@ -1721,11 +1715,8 @@ AC_REPLACE_FUNCS(dup2) https://github.com/ruby/ruby/blob/trunk/configure.ac#L1715 AC_REPLACE_FUNCS(erf) AC_REPLACE_FUNCS(explicit_bzero) AC_REPLACE_FUNCS(ffs) -AC_REPLACE_FUNCS(finite) AC_REPLACE_FUNCS(flock) AC_REPLACE_FUNCS(hypot) -AC_REPLACE_FUNCS(isinf) -AC_REPLACE_FUNCS(isnan) AC_REPLACE_FUNCS(lgamma_r) AC_REPLACE_FUNCS(memmove) AC_REPLACE_FUNCS(nan) @@ -1738,6 +1729,10 @@ AC_REPLACE_FUNCS(strlcpy) https://github.com/ruby/ruby/blob/trunk/configure.ac#L1729 AC_REPLACE_FUNCS(strstr) AC_REPLACE_FUNCS(tgamma) +RUBY_REPLACE_FUNC([finite], [@%:@include <math.h>]) +RUBY_REPLACE_FUNC([isinf], [@%:@include <math.h>]) +RUBY_REPLACE_FUNC([isnan], [@%:@include <math.h>]) + # for missing/setproctitle.c AS_CASE(["$target_os"], [aix* | k*bsd*-gnu | kopensolaris*-gnu | linux* | darwin*], [AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)], -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/