ruby-changes:50317
From: nobu <ko1@a...>
Date: Fri, 16 Feb 2018 23:35:12 +0900 (JST)
Subject: [ruby-changes:50317] nobu:r62432 (trunk): ruby_check_va_copy.m4: for cross compiling
nobu 2018-02-16 23:35:06 +0900 (Fri, 16 Feb 2018) New Revision: 62432 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62432 Log: 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. Modified files: trunk/tool/m4/ruby_check_va_copy.m4 Index: tool/m4/ruby_check_va_copy.m4 =================================================================== --- tool/m4/ruby_check_va_copy.m4 (revision 62431) +++ tool/m4/ruby_check_va_copy.m4 (revision 62432) @@ -1,11 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/tool/m4/ruby_check_va_copy.m4#L1 # -*- Autoconf -*- AC_DEFUN([RUBY_CHECK_VA_COPY], [ - if test "x$rb_cv_va_copy" = x; then - AC_TRY_RUN( -[#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#define CONFTEST_VA_COPY(dst, src) $2 + AS_IF([test "x$rb_cv_va_copy" = x], [dnl + AC_TRY_LINK( +[@%:@include <stdlib.h> +@%:@include <stdarg.h> +@%:@include <string.h> +@%:@define CONFTEST_VA_COPY(dst, src) $2 void conftest(int n, ...) { @@ -19,16 +19,12 @@ conftest(int n, ...) https://github.com/ruby/ruby/blob/trunk/tool/m4/ruby_check_va_copy.m4#L19 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/