Skip to content

Commit 2b1ba32

Browse files
committed
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
1 parent 6291654 commit 2b1ba32

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

tool/m4/ruby_check_va_copy.m4

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# -*- Autoconf -*-
22
AC_DEFUN([RUBY_CHECK_VA_COPY], [
3-
if test "x$rb_cv_va_copy" = x; then
4-
AC_TRY_RUN(
5-
[#include <stdlib.h>
6-
#include <stdarg.h>
7-
#include <string.h>
8-
#define CONFTEST_VA_COPY(dst, src) $2
3+
AS_IF([test "x$rb_cv_va_copy" = x], [dnl
4+
AC_TRY_LINK(
5+
[@%:@include <stdlib.h>
6+
@%:@include <stdarg.h>
7+
@%:@include <string.h>
8+
@%:@define CONFTEST_VA_COPY(dst, src) $2
99
void
1010
conftest(int n, ...)
1111
{
@@ -19,16 +19,12 @@ conftest(int n, ...)
1919
for (i = 0; i < n; i++) if ((int)va_arg(ap, int) != n - i - 1) abort();
2020
va_end(ap);
2121
va_end(ap2);
22-
}
23-
int
24-
main()
25-
{
26-
conftest(10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
27-
exit(0);
2822
}],
29-
rb_cv_va_copy="$1",
30-
rb_cv_va_copy="",
31-
rb_cv_va_copy="")dnl
32-
fi
23+
[
24+
conftest(10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
25+
],
26+
[rb_cv_va_copy="$1"],
27+
[rb_cv_va_copy=""])dnl
28+
])dnl
3329
])dnl
3430
dnl

0 commit comments

Comments
 (0)