diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-05-20 11:44:27 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-05-20 13:54:08 +0900 |
| commit | 18eaf0be905e3e251423b42d6f4e56b7cae1bc3b (patch) | |
| tree | 20537ac10dadceda3da889a24b97aadd964d8c4d | |
| parent | eb410c9fde271886709873fe0eff3bb2e621eb2b (diff) | |
[Bug #20494] Search non-default directories for GMP
Co-Authored-by: lish82 (Hiroki Katagiri)
| -rw-r--r-- | configure.ac | 3 | ||||
| -rw-r--r-- | tool/m4/ruby_check_header.m4 | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index e9a452ebee..09f95b2bec 100644 --- a/configure.ac +++ b/configure.ac @@ -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)]))]) diff --git a/tool/m4/ruby_check_header.m4 b/tool/m4/ruby_check_header.m4 new file mode 100644 index 0000000000..171455549e --- /dev/null +++ b/tool/m4/ruby_check_header.m4 @@ -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]) |
