blob: 1a8cff3e8c68a958e92a60eee46397039d21b3fa [file] [log] [blame]
Brad Bishop64c979e2019-11-04 13:55:29 -05001From bd71b698bf733e6e93282cd2b1b93f51e1a33c7c Mon Sep 17 00:00:00 2001
Brad Bishop00e122a2019-10-05 11:10:57 -04002From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
3Date: Fri, 8 Feb 2019 07:22:55 +0000
Brad Bishop64c979e2019-11-04 13:55:29 -05004Subject: [PATCH 3/3] configure.ac: check finite,isinf,isnan as macros first
Brad Bishop00e122a2019-10-05 11:10:57 -04005MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9[ruby-core:91487] [Bug #15595]
10
11git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
12
13---
14Upstream-Status: Backport [https://github.com/ruby/ruby/commit/74f94b3e6ebf15b76f3b357e754095412b006e94]
Brad Bishop00e122a2019-10-05 11:10:57 -040015Signed-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
23diff --git a/aclocal.m4 b/aclocal.m4
Brad Bishop64c979e2019-11-04 13:55:29 -050024index b0fe3eb959..ed7d14ef63 100644
Brad Bishop00e122a2019-10-05 11:10:57 -040025--- a/aclocal.m4
26+++ b/aclocal.m4
Brad Bishop64c979e2019-11-04 13:55:29 -050027@@ -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 Bishop00e122a2019-10-05 11:10:57 -040031+m4_include([tool/m4/ruby_replace_funcs.m4])
Brad Bishop64c979e2019-11-04 13:55:29 -050032 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 Bishop00e122a2019-10-05 11:10:57 -040035diff --git a/configure.ac b/configure.ac
Brad Bishop64c979e2019-11-04 13:55:29 -050036index 2c4d2888d2..2691da6a3c 100644
Brad Bishop00e122a2019-10-05 11:10:57 -040037--- a/configure.ac
38+++ b/configure.ac
Brad Bishop64c979e2019-11-04 13:55:29 -050039@@ -946,9 +946,6 @@ main()
Brad Bishop00e122a2019-10-05 11:10:57 -040040 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 Bishop64c979e2019-11-04 13:55:29 -050049@@ -999,9 +996,6 @@ main()
Brad Bishop00e122a2019-10-05 11:10:57 -040050 [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 Bishop64c979e2019-11-04 13:55:29 -050059@@ -1724,11 +1718,8 @@ AC_REPLACE_FUNCS(dup2)
Brad Bishop00e122a2019-10-05 11:10:57 -040060 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 Bishop64c979e2019-11-04 13:55:29 -050070 AC_REPLACE_FUNCS(nan)
71@@ -1741,6 +1732,10 @@ AC_REPLACE_FUNCS(strlcpy)
Brad Bishop00e122a2019-10-05 11:10:57 -040072 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)],
82diff --git a/tool/m4/ruby_replace_funcs.m4 b/tool/m4/ruby_replace_funcs.m4
83new file mode 100644
84index 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--
1022.23.0.rc1
103