ruby: fix build for uclibc
Backporting upstream fix. Closes #8051.
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
(cherry picked from commit f9b16dea51
)
This commit is contained in:
parent
017b74d359
commit
17a0279dd1
1 changed files with 98 additions and 0 deletions
|
@ -0,0 +1,98 @@
|
|||
Backported to 2.5.3
|
||||
|
||||
From 74f94b3e6ebf15b76f3b357e754095412b006e94 Mon Sep 17 00:00:00 2001
|
||||
From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
|
||||
Date: Fri, 8 Feb 2019 07:22:55 +0000
|
||||
Subject: [PATCH] configure.ac: check finite,isinf,isnan as macros first
|
||||
|
||||
[ruby-core:91487] [Bug #15595]
|
||||
|
||||
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
||||
---
|
||||
aclocal.m4 | 1 +
|
||||
configure.ac | 13 ++++---------
|
||||
tool/m4/ruby_replace_funcs.m4 | 13 +++++++++++++
|
||||
3 files changed, 18 insertions(+), 9 deletions(-)
|
||||
create mode 100644 tool/m4/ruby_replace_funcs.m4
|
||||
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -1189,9 +1189,6 @@ main()
|
||||
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
|
||||
@@ -1239,9 +1236,6 @@ main()
|
||||
[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
|
||||
@@ -2212,11 +2206,8 @@ AC_REPLACE_FUNCS(dup2)
|
||||
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(nextafter)
|
||||
@@ -2228,6 +2219,10 @@ AC_REPLACE_FUNCS(strlcpy)
|
||||
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)],
|
||||
--- /dev/null
|
||||
+++ b/tool/m4/ruby_replace_funcs.m4
|
||||
@@ -0,0 +1,13 @@
|
||||
+# -*- 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
|
||||
+])
|
||||
--- a/acinclude.m4
|
||||
+++ b/acinclude.m4
|
||||
@@ -44,3 +44,17 @@ AC_DEFUN([AC_MSG_RESULT], [dnl
|
||||
{ _AS_ECHO_LOG([result: $1])
|
||||
COLORIZE_RESULT([$1]); dnl
|
||||
}])
|
||||
+
|
||||
+# -*- 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
|
||||
+])
|
Loading…
Reference in a new issue