[Bug #20494] Search non-default directories for GMP

Co-Authored-by: lish82 (Hiroki Katagiri)
This commit is contained in:
Nobuyoshi Nakada 2024-05-20 11:44:27 +09:00
Родитель eb410c9fde
Коммит 18eaf0be90
2 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -16,6 +16,7 @@ m4_include([tool/m4/ruby_append_option.m4])dnl
m4_include([tool/m4/ruby_append_options.m4])dnl
m4_include([tool/m4/ruby_check_builtin_func.m4])dnl
m4_include([tool/m4/ruby_check_builtin_setjmp.m4])dnl
m4_include([tool/m4/ruby_check_header.m4])dnl
m4_include([tool/m4/ruby_check_printf_prefix.m4])dnl
m4_include([tool/m4/ruby_check_setjmp.m4])dnl
m4_include([tool/m4/ruby_check_signedness.m4])dnl
@ -1375,7 +1376,7 @@ AS_CASE("$target_cpu", [x64|x86_64|i[3-6]86*], [
RUBY_UNIVERSAL_CHECK_HEADER([x86_64, i386], x86intrin.h)
AS_IF([test "x$with_gmp" != xno],
[AC_CHECK_HEADERS(gmp.h)
[RUBY_CHECK_HEADER(gmp.h)
AS_IF([test "x$ac_cv_header_gmp_h" != xno],
AC_SEARCH_LIBS([__gmpz_init], [gmp],
[AC_DEFINE(HAVE_LIBGMP, 1)]))])

Просмотреть файл

@ -0,0 +1,8 @@
dnl -*- Autoconf -*-
AC_DEFUN([RUBY_CHECK_HEADER],
[# RUBY_CHECK_HEADER($@)
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS m4_if([$5], [], [$INCFLAGS], [$5])"
AC_CHECK_HEADER([$1], [$2], [$3], [$4])
CPPFLAGS="$save_CPPFLAGS"
unset save_CPPFLAGS])