summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-16 14:35:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-16 14:35:06 +0000
commit2b1ba3251489f5e545aa8ea0798dbce0428617ce (patch)
treec65702a1680d5b94fd6477f85225c9ce3afcdf85 /tool
parent62916542b2c04df45ee153f0851cd811dbf02388 (diff)
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
Diffstat (limited to 'tool')
-rw-r--r--tool/m4/ruby_check_va_copy.m428
1 files changed, 12 insertions, 16 deletions
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 <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, ...)
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