1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Extract RUBY_REQUIRE_FUNCS

This commit is contained in:
Nobuyoshi Nakada 2022-03-28 16:56:15 +09:00
parent 282baa6943
commit 2cb3efffcf
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
2 changed files with 15 additions and 7 deletions

View file

@ -34,6 +34,7 @@ m4_include([tool/m4/ruby_prepend_option.m4])dnl
m4_include([tool/m4/ruby_prog_gnu_ld.m4])dnl
m4_include([tool/m4/ruby_replace_funcs.m4])dnl
m4_include([tool/m4/ruby_replace_type.m4])dnl
m4_include([tool/m4/ruby_require_funcs.m4])dnl
m4_include([tool/m4/ruby_rm_recursive.m4])dnl
m4_include([tool/m4/ruby_setjmp_type.m4])dnl
m4_include([tool/m4/ruby_stack_grow_direction.m4])dnl
@ -1943,17 +1944,11 @@ AS_CASE(["$target_os"],[freebsd*],[
AC_REPLACE_FUNCS(close)
])
AC_DEFUN([RUBY_REQUIRE_FUNC], [
AC_CHECK_FUNCS([$1])
AS_IF([test "$ac_cv_func_[]AS_TR_SH($1)" = yes], [],
[AC_MSG_ERROR($1[() must be supported])])
])
# dup and dup2 are always available except for WASI
AS_CASE(["$target_os"],
[wasi*], [],
[
m4_map_args_w([dup dup2], [RUBY_REQUIRE_FUNC(], [)])
RUBY_REQUIRE_FUNCS(dup dup2)
]
)

View file

@ -0,0 +1,13 @@
dnl -*- Autoconf -*-
dnl RUBY_REQUIRE_FUNC [func] [included]
AC_DEFUN([RUBY_REQUIRE_FUNC], [
# RUBY_REQUIRE_FUNC([$1], [$2])
AC_CHECK_FUNCS([$1])
AS_IF([test "$ac_cv_func_[]AS_TR_SH($1)" = yes], [],
[AC_MSG_ERROR($1[() must be supported])])
])dnl
dnl
dnl RUBY_REQUIRE_FUNCS [funcs] [included]
AC_DEFUN([RUBY_REQUIRE_FUNCS], [dnl
m4_map_args_w([$1], [RUBY_REQUIRE_FUNC(], [), [$2]])dnl
])dnl