You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.7 KiB

  1. From 74f94b3e6ebf15b76f3b357e754095412b006e94 Mon Sep 17 00:00:00 2001
  2. From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
  3. Date: Fri, 8 Feb 2019 07:22:55 +0000
  4. Subject: [PATCH] configure.ac: check finite,isinf,isnan as macros first
  5. [ruby-core:91487] [Bug #15595]
  6. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  7. ---
  8. aclocal.m4 | 1 +
  9. configure.ac | 13 ++++---------
  10. tool/m4/ruby_replace_funcs.m4 | 13 +++++++++++++
  11. 3 files changed, 18 insertions(+), 9 deletions(-)
  12. create mode 100644 tool/m4/ruby_replace_funcs.m4
  13. --- a/aclocal.m4
  14. +++ b/aclocal.m4
  15. @@ -35,6 +35,7 @@ m4_include([tool/m4/ruby_func_attribute.
  16. m4_include([tool/m4/ruby_mingw32.m4])
  17. m4_include([tool/m4/ruby_prepend_option.m4])
  18. m4_include([tool/m4/ruby_prog_gnu_ld.m4])
  19. +m4_include([tool/m4/ruby_replace_funcs.m4])
  20. m4_include([tool/m4/ruby_replace_type.m4])
  21. m4_include([tool/m4/ruby_rm_recursive.m4])
  22. m4_include([tool/m4/ruby_setjmp_type.m4])
  23. --- a/configure.ac
  24. +++ b/configure.ac
  25. @@ -946,9 +946,6 @@ main()
  26. ac_cv_func_fsync=yes
  27. ac_cv_func_seekdir=yes
  28. ac_cv_func_telldir=yes
  29. - ac_cv_func_isinf=yes
  30. - ac_cv_func_isnan=yes
  31. - ac_cv_func_finite=yes
  32. ac_cv_func_lchown=yes
  33. ac_cv_func_link=yes
  34. ac_cv_func_readlink=yes
  35. @@ -999,9 +996,6 @@ main()
  36. [netbsd*], [ LIBS="-lm $LIBS"
  37. ],
  38. [dragonfly*], [ LIBS="-lm $LIBS"
  39. - # isinf() and isnan() are macros on DragonFly.
  40. - ac_cv_func_isinf=yes
  41. - ac_cv_func_isnan=yes
  42. ],
  43. [aix*],[ LIBS="-lm $LIBS"
  44. ac_cv_func_round=no
  45. @@ -1724,11 +1718,8 @@ AC_REPLACE_FUNCS(dup2)
  46. AC_REPLACE_FUNCS(erf)
  47. AC_REPLACE_FUNCS(explicit_bzero)
  48. AC_REPLACE_FUNCS(ffs)
  49. -AC_REPLACE_FUNCS(finite)
  50. AC_REPLACE_FUNCS(flock)
  51. AC_REPLACE_FUNCS(hypot)
  52. -AC_REPLACE_FUNCS(isinf)
  53. -AC_REPLACE_FUNCS(isnan)
  54. AC_REPLACE_FUNCS(lgamma_r)
  55. AC_REPLACE_FUNCS(memmove)
  56. AC_REPLACE_FUNCS(nan)
  57. @@ -1741,6 +1732,10 @@ AC_REPLACE_FUNCS(strlcpy)
  58. AC_REPLACE_FUNCS(strstr)
  59. AC_REPLACE_FUNCS(tgamma)
  60. +RUBY_REPLACE_FUNC([finite], [@%:@include <math.h>])
  61. +RUBY_REPLACE_FUNC([isinf], [@%:@include <math.h>])
  62. +RUBY_REPLACE_FUNC([isnan], [@%:@include <math.h>])
  63. +
  64. # for missing/setproctitle.c
  65. AS_CASE(["$target_os"],
  66. [aix* | k*bsd*-gnu | kopensolaris*-gnu | linux* | darwin*], [AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)],
  67. --- /dev/null
  68. +++ b/tool/m4/ruby_replace_funcs.m4
  69. @@ -0,0 +1,13 @@
  70. +# -*- Autoconf -*-
  71. +dnl RUBY_REPLACE_FUNC [func] [included]
  72. +AC_DEFUN([RUBY_REPLACE_FUNC], [dnl
  73. + AC_CHECK_DECL([$1],dnl
  74. + [AC_DEFINE(AS_TR_CPP(HAVE_[$1]))],dnl
  75. + [AC_REPLACE_FUNCS($1)],dnl
  76. + [$2])dnl
  77. +])
  78. +
  79. +dnl RUBY_REPLACE_FUNCS [funcs] [included]
  80. +AC_DEFUN([RUBY_REPLACE_FUNCS] [dnl
  81. + m4_map_args_w([$1], [RUBY_REPLACE_FUNC(], [), [$2]])dnl
  82. +])