Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame^] | 1 | From bd71b698bf733e6e93282cd2b1b93f51e1a33c7c Mon Sep 17 00:00:00 2001 |
Brad Bishop | 00e122a | 2019-10-05 11:10:57 -0400 | [diff] [blame] | 2 | From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> |
| 3 | Date: Fri, 8 Feb 2019 07:22:55 +0000 |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame^] | 4 | Subject: [PATCH 3/3] configure.ac: check finite,isinf,isnan as macros first |
Brad Bishop | 00e122a | 2019-10-05 11:10:57 -0400 | [diff] [blame] | 5 | MIME-Version: 1.0 |
| 6 | Content-Type: text/plain; charset=UTF-8 |
| 7 | Content-Transfer-Encoding: 8bit |
| 8 | |
| 9 | [ruby-core:91487] [Bug #15595] |
| 10 | |
| 11 | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
| 12 | |
| 13 | --- |
| 14 | Upstream-Status: Backport [https://github.com/ruby/ruby/commit/74f94b3e6ebf15b76f3b357e754095412b006e94] |
Brad Bishop | 00e122a | 2019-10-05 11:10:57 -0400 | [diff] [blame] | 15 | Signed-off-by: André Draszik <andre.draszik@jci.com> |
| 16 | --- |
| 17 | aclocal.m4 | 1 + |
| 18 | configure.ac | 13 ++++--------- |
| 19 | tool/m4/ruby_replace_funcs.m4 | 13 +++++++++++++ |
| 20 | 3 files changed, 18 insertions(+), 9 deletions(-) |
| 21 | create mode 100644 tool/m4/ruby_replace_funcs.m4 |
| 22 | |
| 23 | diff --git a/aclocal.m4 b/aclocal.m4 |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame^] | 24 | index b0fe3eb959..ed7d14ef63 100644 |
Brad Bishop | 00e122a | 2019-10-05 11:10:57 -0400 | [diff] [blame] | 25 | --- a/aclocal.m4 |
| 26 | +++ b/aclocal.m4 |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame^] | 27 | @@ -35,6 +35,7 @@ m4_include([tool/m4/ruby_func_attribute.m4]) |
| 28 | m4_include([tool/m4/ruby_mingw32.m4]) |
| 29 | m4_include([tool/m4/ruby_prepend_option.m4]) |
| 30 | m4_include([tool/m4/ruby_prog_gnu_ld.m4]) |
Brad Bishop | 00e122a | 2019-10-05 11:10:57 -0400 | [diff] [blame] | 31 | +m4_include([tool/m4/ruby_replace_funcs.m4]) |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame^] | 32 | m4_include([tool/m4/ruby_replace_type.m4]) |
| 33 | m4_include([tool/m4/ruby_rm_recursive.m4]) |
| 34 | m4_include([tool/m4/ruby_setjmp_type.m4]) |
Brad Bishop | 00e122a | 2019-10-05 11:10:57 -0400 | [diff] [blame] | 35 | diff --git a/configure.ac b/configure.ac |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame^] | 36 | index 2c4d2888d2..2691da6a3c 100644 |
Brad Bishop | 00e122a | 2019-10-05 11:10:57 -0400 | [diff] [blame] | 37 | --- a/configure.ac |
| 38 | +++ b/configure.ac |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame^] | 39 | @@ -946,9 +946,6 @@ main() |
Brad Bishop | 00e122a | 2019-10-05 11:10:57 -0400 | [diff] [blame] | 40 | ac_cv_func_fsync=yes |
| 41 | ac_cv_func_seekdir=yes |
| 42 | ac_cv_func_telldir=yes |
| 43 | - ac_cv_func_isinf=yes |
| 44 | - ac_cv_func_isnan=yes |
| 45 | - ac_cv_func_finite=yes |
| 46 | ac_cv_func_lchown=yes |
| 47 | ac_cv_func_link=yes |
| 48 | ac_cv_func_readlink=yes |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame^] | 49 | @@ -999,9 +996,6 @@ main() |
Brad Bishop | 00e122a | 2019-10-05 11:10:57 -0400 | [diff] [blame] | 50 | [netbsd*], [ LIBS="-lm $LIBS" |
| 51 | ], |
| 52 | [dragonfly*], [ LIBS="-lm $LIBS" |
| 53 | - # isinf() and isnan() are macros on DragonFly. |
| 54 | - ac_cv_func_isinf=yes |
| 55 | - ac_cv_func_isnan=yes |
| 56 | ], |
| 57 | [aix*],[ LIBS="-lm $LIBS" |
| 58 | ac_cv_func_round=no |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame^] | 59 | @@ -1724,11 +1718,8 @@ AC_REPLACE_FUNCS(dup2) |
Brad Bishop | 00e122a | 2019-10-05 11:10:57 -0400 | [diff] [blame] | 60 | AC_REPLACE_FUNCS(erf) |
| 61 | AC_REPLACE_FUNCS(explicit_bzero) |
| 62 | AC_REPLACE_FUNCS(ffs) |
| 63 | -AC_REPLACE_FUNCS(finite) |
| 64 | AC_REPLACE_FUNCS(flock) |
| 65 | AC_REPLACE_FUNCS(hypot) |
| 66 | -AC_REPLACE_FUNCS(isinf) |
| 67 | -AC_REPLACE_FUNCS(isnan) |
| 68 | AC_REPLACE_FUNCS(lgamma_r) |
| 69 | AC_REPLACE_FUNCS(memmove) |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame^] | 70 | AC_REPLACE_FUNCS(nan) |
| 71 | @@ -1741,6 +1732,10 @@ AC_REPLACE_FUNCS(strlcpy) |
Brad Bishop | 00e122a | 2019-10-05 11:10:57 -0400 | [diff] [blame] | 72 | AC_REPLACE_FUNCS(strstr) |
| 73 | AC_REPLACE_FUNCS(tgamma) |
| 74 | |
| 75 | +RUBY_REPLACE_FUNC([finite], [@%:@include <math.h>]) |
| 76 | +RUBY_REPLACE_FUNC([isinf], [@%:@include <math.h>]) |
| 77 | +RUBY_REPLACE_FUNC([isnan], [@%:@include <math.h>]) |
| 78 | + |
| 79 | # for missing/setproctitle.c |
| 80 | AS_CASE(["$target_os"], |
| 81 | [aix* | k*bsd*-gnu | kopensolaris*-gnu | linux* | darwin*], [AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)], |
| 82 | diff --git a/tool/m4/ruby_replace_funcs.m4 b/tool/m4/ruby_replace_funcs.m4 |
| 83 | new file mode 100644 |
| 84 | index 0000000000..d0612e29a0 |
| 85 | --- /dev/null |
| 86 | +++ b/tool/m4/ruby_replace_funcs.m4 |
| 87 | @@ -0,0 +1,13 @@ |
| 88 | +# -*- Autoconf -*- |
| 89 | +dnl RUBY_REPLACE_FUNC [func] [included] |
| 90 | +AC_DEFUN([RUBY_REPLACE_FUNC], [dnl |
| 91 | + AC_CHECK_DECL([$1],dnl |
| 92 | + [AC_DEFINE(AS_TR_CPP(HAVE_[$1]))],dnl |
| 93 | + [AC_REPLACE_FUNCS($1)],dnl |
| 94 | + [$2])dnl |
| 95 | +]) |
| 96 | + |
| 97 | +dnl RUBY_REPLACE_FUNCS [funcs] [included] |
| 98 | +AC_DEFUN([RUBY_REPLACE_FUNCS] [dnl |
| 99 | + m4_map_args_w([$1], [RUBY_REPLACE_FUNC(], [), [$2]])dnl |
| 100 | +]) |
| 101 | -- |
| 102 | 2.23.0.rc1 |
| 103 | |