From 2b1ba3251489f5e545aa8ea0798dbce0428617ce Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 16 Feb 2018 14:35:06 +0000 Subject: ruby_check_va_copy.m4: for cross compiling * tool/m4/ruby_check_va_copy.m4 (RUBY_CHECK_VA_COPY): use AC_TRY_LINK instead of AC_TRY_RUN for cross compiling. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/m4/ruby_check_va_copy.m4 | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'tool') diff --git a/tool/m4/ruby_check_va_copy.m4 b/tool/m4/ruby_check_va_copy.m4 index 4672d1852c..99d11b5fb9 100644 --- a/tool/m4/ruby_check_va_copy.m4 +++ b/tool/m4/ruby_check_va_copy.m4 @@ -1,11 +1,11 @@ # -*- Autoconf -*- AC_DEFUN([RUBY_CHECK_VA_COPY], [ - if test "x$rb_cv_va_copy" = x; then - AC_TRY_RUN( -[#include -#include -#include -#define CONFTEST_VA_COPY(dst, src) $2 + AS_IF([test "x$rb_cv_va_copy" = x], [dnl + AC_TRY_LINK( +[@%:@include +@%:@include +@%:@include +@%:@define CONFTEST_VA_COPY(dst, src) $2 void conftest(int n, ...) { @@ -19,16 +19,12 @@ conftest(int n, ...) for (i = 0; i < n; i++) if ((int)va_arg(ap, int) != n - i - 1) abort(); va_end(ap); va_end(ap2); -} -int -main() -{ - conftest(10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); - exit(0); }], - rb_cv_va_copy="$1", - rb_cv_va_copy="", - rb_cv_va_copy="")dnl - fi +[ + conftest(10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); +], + [rb_cv_va_copy="$1"], + [rb_cv_va_copy=""])dnl + ])dnl ])dnl dnl -- cgit v1.2.3