1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

merge revision(s) c32375883a6,48bb0329eb3:

Update for autoconf 2.70

	---
	 configure.ac                         | 232 +++++++++++++++++------------------
	 tool/m4/ruby_check_builtin_setjmp.m4 |   8 +-
	 tool/m4/ruby_check_printf_prefix.m4  |   9 +-
	 tool/m4/ruby_check_setjmp.m4         |   6 +-
	 tool/m4/ruby_check_sysconf.m4        |   6 +-
	 tool/m4/ruby_cppoutfile.m4           |   4 +-
	 tool/m4/ruby_decl_attribute.m4       |   4 +-
	 tool/m4/ruby_dtrace_available.m4     |   2 +-
	 tool/m4/ruby_dtrace_postprocess.m4   |   2 +-
	 tool/m4/ruby_mingw32.m4              |   4 +-
	 tool/m4/ruby_stack_grow_direction.m4 |   4 +-
	 tool/m4/ruby_try_cflags.m4           |   2 +-
	 tool/m4/ruby_try_cxxflags.m4         |   2 +-
	 tool/m4/ruby_try_ldflags.m4          |   2 +-
	 14 files changed, 143 insertions(+), 144 deletions(-)

	Revert AC_PROG_CC_C99 for -std=gnu99 option to gcc 4.8

	---
	 configure.ac | 5 ++++-
	 1 file changed, 4 insertions(+), 1 deletion(-)
This commit is contained in:
Nobuyoshi Nakada 2021-04-06 16:07:16 +09:00 committed by nagachika
parent 6add6014d8
commit ce06c24b0c
14 changed files with 146 additions and 144 deletions

View file

@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
AC_INIT() AC_INIT
{ {
AC_CONFIG_AUX_DIR(tool) AC_CONFIG_AUX_DIR(tool)
AC_CONFIG_MACRO_DIRS(tool/m4) AC_CONFIG_MACRO_DIRS(tool/m4)
@ -168,7 +168,10 @@ rb_test_CFLAGS=${CFLAGS+yes}
rb_test_CXXFLAGS=${CXXFLAGS+yes} rb_test_CXXFLAGS=${CXXFLAGS+yes}
# BSD's ports and MacPorts prefix GNU binutils with 'g' # BSD's ports and MacPorts prefix GNU binutils with 'g'
AC_PROG_CC_C99
dnl Seems necessarily in order to add -std=gnu99 option for gcc 4.9.
m4_version_prereq([2.70], [], [AC_PROG_CC_C99])
AC_PROG_CXX AC_PROG_CXX
AC_PROG_CPP AC_PROG_CPP
AC_PROG_RANLIB AC_PROG_RANLIB
@ -237,6 +240,9 @@ AC_ARG_ENABLE(load-relative,
AS_HELP_STRING([--enable-load-relative], [resolve load paths at run time]), AS_HELP_STRING([--enable-load-relative], [resolve load paths at run time]),
[load_relative=$enableval]) [load_relative=$enableval])
# checks for UNIX variants that set C preprocessor variables
AC_USE_SYSTEM_EXTENSIONS
dnl Checks for programs. dnl Checks for programs.
cflagspat= cflagspat=
@ -276,12 +282,12 @@ AS_CASE(["$host_os:$build_os"],
AS_CASE(["$target_os"], AS_CASE(["$target_os"],
[darwin*], [ [darwin*], [
AC_MSG_CHECKING(if minimum required OS X version is supported) AC_MSG_CHECKING(if minimum required OS X version is supported)
AC_TRY_CPP([@%:@include <AvailabilityMacros.h> AC_PREPROC_IFELSE([AC_LANG_SOURCE([[@%:@include <AvailabilityMacros.h>
@%:@if MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_5 @%:@if MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_5
@%:@error pre OS X 10.5 @%:@error pre OS X 10.5
[!<===== pre OS X 10.5 =====>] [!<===== pre OS X 10.5 =====>]
@%:@endif @%:@endif
], ]])],
[macosx_min_required=yes], [macosx_min_required=yes],
[AC_MSG_RESULT(no) [AC_MSG_RESULT(no)
AC_MSG_ERROR([Unsupported OS X version is required])]) AC_MSG_ERROR([Unsupported OS X version is required])])
@ -392,8 +398,8 @@ AS_CASE(["$target_os"],
[mingw*], [ [mingw*], [
test "$rb_cv_msvcrt" = "" && unset rb_cv_msvcrt test "$rb_cv_msvcrt" = "" && unset rb_cv_msvcrt
AC_CACHE_CHECK(for mingw32 runtime DLL, rb_cv_msvcrt, [ AC_CACHE_CHECK(for mingw32 runtime DLL, rb_cv_msvcrt, [
AC_TRY_LINK([@%:@include <stdio.h>], AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include <stdio.h>]],
[FILE* volatile f = stdin; return 0;], [[FILE* volatile f = stdin; return 0;]])],
[rb_cv_msvcrt=`$OBJDUMP -p conftest$ac_exeext | [rb_cv_msvcrt=`$OBJDUMP -p conftest$ac_exeext |
tr A-Z a-z | tr A-Z a-z |
sed -n '/^[[ ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;}'`], sed -n '/^[[ ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;}'`],
@ -437,15 +443,12 @@ for prog in ${ac_tool_prefix:+${ac_tool_prefix}pkg-config} pkg-config; do
test -z "${PKG_CONFIG}" || break test -z "${PKG_CONFIG}" || break
done done
# checks for UNIX variants that set C preprocessor variables
AC_USE_SYSTEM_EXTENSIONS
AC_MSG_CHECKING([whether it is Android]) AC_MSG_CHECKING([whether it is Android])
AC_TRY_COMPILE([ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@ifdef __ANDROID__ @%:@ifdef __ANDROID__
@%:@error android @%:@error android
@%:@endif @%:@endif
], [], ]], [[]])],
[AC_MSG_RESULT(no)], [AC_MSG_RESULT(no)],
[ [
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
@ -492,7 +495,7 @@ AC_SUBST(CHDIR)
: "compiler section" && { : "compiler section" && {
RUBY_WERROR_FLAG([ RUBY_WERROR_FLAG([
AC_MSG_CHECKING([whether CFLAGS is valid]) AC_MSG_CHECKING([whether CFLAGS is valid])
AC_TRY_COMPILE([], [], AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[AC_MSG_RESULT(yes)], [AC_MSG_RESULT(yes)],
[ [
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
@ -508,7 +511,7 @@ RUBY_WERROR_FLAG([
echo '<?xml?><plist><dict><key>CFBundleIdentifier</key><string></string></dict></plist>' > Info.plist && echo '<?xml?><plist><dict><key>CFBundleIdentifier</key><string></string></dict></plist>' > Info.plist &&
: :
} || AC_MSG_ERROR([failed to make temporary directory]) } || AC_MSG_ERROR([failed to make temporary directory])
AC_TRY_LINK([], [], AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[AC_MSG_RESULT(yes)], [AC_MSG_RESULT(yes)],
[ [
cd .. && rm -fr tmp.$$.try_link cd .. && rm -fr tmp.$$.try_link
@ -713,13 +716,13 @@ AS_IF([test "$GCC" = yes], [
], [ ], [
CFLAGS="$CFLAGS -Werror -Wuninitialized" CFLAGS="$CFLAGS -Werror -Wuninitialized"
]) ])
AC_TRY_COMPILE([@%:@include <math.h> AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <math.h>
int foo(double x) int foo(double x)
{ {
int exp; int exp;
frexp(x, &exp); frexp(x, &exp);
return exp; return exp;
}], [if (foo(0.0)) return 1;], }]], [[if (foo(0.0)) return 1;]])],
[rb_cv_mingw64_broken_frexp_modf=no], [rb_cv_mingw64_broken_frexp_modf=no],
[rb_cv_mingw64_broken_frexp_modf=yes]) [rb_cv_mingw64_broken_frexp_modf=yes])
CFLAGS="$save_CFLAGS" CFLAGS="$save_CFLAGS"
@ -809,13 +812,13 @@ AS_IF([test "$GCC" = yes], [
AS_CASE(["$target_cpu"], [[i[3-6]86*]], [ AS_CASE(["$target_cpu"], [[i[3-6]86*]], [
AC_CACHE_CHECK([for __sync_val_compare_and_swap], [rb_cv_gcc_compiler_cas], [ AC_CACHE_CHECK([for __sync_val_compare_and_swap], [rb_cv_gcc_compiler_cas], [
AC_TRY_LINK([unsigned long atomic_var;], AC_LINK_IFELSE([AC_LANG_PROGRAM([[unsigned long atomic_var;]],
[__sync_val_compare_and_swap(&atomic_var, 0, 1);], [[__sync_val_compare_and_swap(&atomic_var, 0, 1);]])],
[rb_cv_gcc_compiler_cas=yes], [rb_cv_gcc_compiler_cas=yes],
[ [
save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -march=i486" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -march=i486"
AC_TRY_LINK([unsigned long atomic_var;], AC_LINK_IFELSE([AC_LANG_PROGRAM([[unsigned long atomic_var;]],
[__sync_val_compare_and_swap(&atomic_var, 0, 1);], [[__sync_val_compare_and_swap(&atomic_var, 0, 1);]])],
[rb_cv_gcc_compiler_cas=i486], [rb_cv_gcc_compiler_cas=i486],
[rb_cv_gcc_compiler_cas=no]) [rb_cv_gcc_compiler_cas=no])
CFLAGS="$save_CFLAGS" CFLAGS="$save_CFLAGS"
@ -842,7 +845,7 @@ test -z "${ac_env_CXXFLAGS_set}" -a -n "${cxxflags+set}" && eval CXXFLAGS="\"$cx
AC_CACHE_CHECK([whether compiler has statement and declarations in expressions], AC_CACHE_CHECK([whether compiler has statement and declarations in expressions],
rb_cv_have_stmt_and_decl_in_expr, rb_cv_have_stmt_and_decl_in_expr,
[AC_TRY_COMPILE([],[ __extension__ ({ int a = 0; a; }); ], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[ __extension__ ({ int a = 0; a; }); ]])],
[rb_cv_have_stmt_and_decl_in_expr=yes], [rb_cv_have_stmt_and_decl_in_expr=yes],
[rb_cv_have_stmt_and_decl_in_expr=no])]) [rb_cv_have_stmt_and_decl_in_expr=no])])
AS_IF([test "$rb_cv_have_stmt_and_decl_in_expr" = yes], [ AS_IF([test "$rb_cv_have_stmt_and_decl_in_expr" = yes], [
@ -863,12 +866,12 @@ AS_CASE(["$target_os"],
[freebsd*], [ [freebsd*], [
AC_CACHE_CHECK([whether pthread should be enabled by default], AC_CACHE_CHECK([whether pthread should be enabled by default],
rb_cv_enable_pthread_default, rb_cv_enable_pthread_default,
[AC_TRY_CPP([ [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
#include <osreldate.h> #include <osreldate.h>
#if __FreeBSD_version < 502102 #if __FreeBSD_version < 502102
#error pthread should be disabled on this platform #error pthread should be disabled on this platform
#endif #endif
], ]])],
rb_cv_enable_pthread_default=yes, rb_cv_enable_pthread_default=yes,
rb_cv_enable_pthread_default=no)]) rb_cv_enable_pthread_default=no)])
enable_pthread=$rb_cv_enable_pthread_default enable_pthread=$rb_cv_enable_pthread_default
@ -896,8 +899,8 @@ AS_CASE(["$target_os"],
RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT) RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT)
AC_CACHE_CHECK([whether syscall(2) is deprecated], rb_cv_syscall_deprecated, AC_CACHE_CHECK([whether syscall(2) is deprecated], rb_cv_syscall_deprecated,
[RUBY_WERROR_FLAG([ [RUBY_WERROR_FLAG([
AC_TRY_COMPILE([@%:@include <unistd.h>], AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <unistd.h>]],
[if (syscall(0)) return 1;], [[if (syscall(0)) return 1;]])],
[rb_cv_syscall_deprecated=no], [rb_cv_syscall_deprecated=no],
[rb_cv_syscall_deprecated=yes])])]) [rb_cv_syscall_deprecated=yes])])])
AS_IF([test $rb_cv_syscall_deprecated = yes], [ AS_IF([test $rb_cv_syscall_deprecated = yes], [
@ -924,7 +927,7 @@ AS_CASE(["$target_os"],
]) ])
with_setjmp_type=sigsetjmp # to hijack SIGCHLD handler with_setjmp_type=sigsetjmp # to hijack SIGCHLD handler
AC_CACHE_CHECK(for broken crypt with 8bit chars, rb_cv_broken_crypt, AC_CACHE_CHECK(for broken crypt with 8bit chars, rb_cv_broken_crypt,
[AC_TRY_RUN([ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
@ -961,7 +964,7 @@ main()
} }
return 0; return 0;
} }
], ]])],
rb_cv_broken_crypt=no, rb_cv_broken_crypt=no,
rb_cv_broken_crypt=yes, rb_cv_broken_crypt=yes,
rb_cv_broken_crypt=yes)]) rb_cv_broken_crypt=yes)])
@ -990,11 +993,11 @@ main()
[solaris*], [ LIBS="-lm $LIBS" [solaris*], [ LIBS="-lm $LIBS"
ac_cv_func_vfork=no ac_cv_func_vfork=no
AC_MSG_CHECKING(whether _XOPEN_SOURCE is already given) AC_MSG_CHECKING(whether _XOPEN_SOURCE is already given)
AC_TRY_COMPILE([#include <unistd.h> AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>
#ifndef _XOPEN_SOURCE #ifndef _XOPEN_SOURCE
#error _XOPEN_SOURCE is not defined #error _XOPEN_SOURCE is not defined
#endif #endif
], [], ]], [[]])],
[given_xopen_source=yes], [given_xopen_source=no]) [given_xopen_source=yes], [given_xopen_source=no])
AC_MSG_RESULT($given_xopen_source) AC_MSG_RESULT($given_xopen_source)
AS_IF([test $given_xopen_source = no], [ AS_IF([test $given_xopen_source = no], [
@ -1004,13 +1007,13 @@ main()
AS_IF([test x"$define_xopen_source" != x], [ AS_IF([test x"$define_xopen_source" != x], [
break break
]) ])
RUBY_WERROR_FLAG([AC_TRY_COMPILE([ RUBY_WERROR_FLAG([AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define _XOPEN_SOURCE ${tmp_xpg}00 #define _XOPEN_SOURCE ${tmp_xpg}00
#include <unistd.h> #include <unistd.h>
#ifndef _XPG${tmp_xpg} #ifndef _XPG${tmp_xpg}
#error _XPG${tmp_xpg} should be defined by _XOPEN_SOURCE=${tmp_xpg}00 #error _XPG${tmp_xpg} should be defined by _XOPEN_SOURCE=${tmp_xpg}00
#endif #endif
], [], ]], [[]])],
[define_xopen_source=${tmp_xpg}00], []) [define_xopen_source=${tmp_xpg}00], [])
]) ])
done done
@ -1128,7 +1131,8 @@ AS_IF([test -n "${rb_there_is_in_fact_no_gplusplus_but_autoconf_is_cheating_us}"
RUBY_WERROR_FLAG([ RUBY_WERROR_FLAG([
AC_MSG_CHECKING([whether CXXFLAGS is valid]) AC_MSG_CHECKING([whether CXXFLAGS is valid])
AC_LANG_PUSH(C++) AC_LANG_PUSH(C++)
AC_TRY_COMPILE([@%:@include <cstdio>], [], [AC_MSG_RESULT(yes)], [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <cstdio>]], [[]])],
[AC_MSG_RESULT(yes)],[
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
# The message mentions CXXFLAGS, but CPPFLAGS might also affects. # The message mentions CXXFLAGS, but CPPFLAGS might also affects.
AC_MSG_WARN([something wrong with CXXFLAGS="$CXXFLAGS"]) AC_MSG_WARN([something wrong with CXXFLAGS="$CXXFLAGS"])
@ -1326,8 +1330,8 @@ AC_CACHE_CHECK(packed struct attribute, rb_cv_packed_struct,
"__pragma(pack(push, 1)) x __pragma(pack(pop))" \ "__pragma(pack(push, 1)) x __pragma(pack(pop))" \
"x __attribute__((packed))" \ "x __attribute__((packed))" \
; do ; do
AC_TRY_COMPILE([@%:@define PACKED_STRUCT(x) $mac AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@define PACKED_STRUCT(x) $mac
PACKED_STRUCT(struct { int a; });], [], PACKED_STRUCT(struct { int a; });]], [[]])],
[rb_cv_packed_struct=$mac; break]) [rb_cv_packed_struct=$mac; break])
done]) done])
AS_IF([test "$rb_cv_packed_struct" != no], [ AS_IF([test "$rb_cv_packed_struct" != no], [
@ -1370,10 +1374,10 @@ RUBY_REPLACE_TYPE(clockid_t, [], CLOCKID, [@%:@ifdef HAVE_TIME_H
# 2006). The check below is redundant and should always success. Remain not # 2006). The check below is redundant and should always success. Remain not
# deleted for backward compat. # deleted for backward compat.
AC_CACHE_CHECK(for variable length macro, rb_cv_va_args_macro, AC_CACHE_CHECK(for variable length macro, rb_cv_va_args_macro,
[AC_TRY_COMPILE([ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
int foo(const char*); int foo(const char*);
@%:@define FOO(...) foo(@%:@__VA_ARGS__) @%:@define FOO(...) foo(@%:@__VA_ARGS__)
], [FOO(1);FOO(1,2);FOO(1,2,3);], ]], [[FOO(1);FOO(1,2);FOO(1,2,3);]])],
rb_cv_va_args_macro=yes, rb_cv_va_args_macro=yes,
rb_cv_va_args_macro=no)]) rb_cv_va_args_macro=no)])
AS_IF([test "$rb_cv_va_args_macro" = yes], [ AS_IF([test "$rb_cv_va_args_macro" = yes], [
@ -1391,7 +1395,7 @@ AS_IF([test "$rb_cv_va_args_macro" = yes], [
AC_CACHE_CHECK([if _Alignof() works], rb_cv_have__alignof,[ AC_CACHE_CHECK([if _Alignof() works], rb_cv_have__alignof,[
rb_cv_have__alignof=no rb_cv_have__alignof=no
RUBY_WERROR_FLAG([ RUBY_WERROR_FLAG([
AC_TRY_COMPILE([ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@ifdef HAVE_STDALIGN_H @%:@ifdef HAVE_STDALIGN_H
@%:@include <stdalign.h> @%:@include <stdalign.h>
@%:@endif @%:@endif
@ -1401,7 +1405,7 @@ AC_CACHE_CHECK([if _Alignof() works], rb_cv_have__alignof,[
@%:@ifndef __GNUC__ @%:@ifndef __GNUC__
@%:@define __extension__ @%:@define __extension__
@%:@endif @%:@endif
], [ ]], [[
typedef struct conftest_tag { typedef struct conftest_tag {
char _; char _;
double d; double d;
@ -1411,9 +1415,9 @@ AC_CACHE_CHECK([if _Alignof() works], rb_cv_have__alignof,[
? 1 : -1 ? 1 : -1
@:>@; @:>@;
return conftest_ary@<:@0@:>@; return conftest_ary@<:@0@:>@;
], [ ]])],[
rb_cv_have__alignof=yes rb_cv_have__alignof=yes
]) ],[])
]) ])
]) ])
AS_IF([test "$rb_cv_have__alignof" != no], [ AS_IF([test "$rb_cv_have__alignof" != no], [
@ -1476,8 +1480,8 @@ AS_IF([test "$GCC" = yes], [
AC_CACHE_CHECK([for function alias], [rb_cv_gcc_function_alias], AC_CACHE_CHECK([for function alias], [rb_cv_gcc_function_alias],
[rb_cv_gcc_function_alias=no [rb_cv_gcc_function_alias=no
for a in alias weak,alias; do for a in alias weak,alias; do
AC_TRY_LINK([void foo(void) {} AC_LINK_IFELSE([AC_LANG_PROGRAM([[void foo(void) {}
void bar(void) __attribute__(($a("foo")));], [bar()], void bar(void) __attribute__(($a("foo")));]], [[bar()]])],
[rb_cv_gcc_function_alias=$a; break]) [rb_cv_gcc_function_alias=$a; break])
done]) done])
AS_IF([test "$rb_cv_gcc_function_alias" != no], [ AS_IF([test "$rb_cv_gcc_function_alias" != no], [
@ -1489,14 +1493,14 @@ AS_IF([test "$GCC" = yes], [
]) ])
AC_CACHE_CHECK([for __atomic builtins], [rb_cv_gcc_atomic_builtins], [ AC_CACHE_CHECK([for __atomic builtins], [rb_cv_gcc_atomic_builtins], [
AC_TRY_LINK([unsigned int atomic_var;], AC_LINK_IFELSE([AC_LANG_PROGRAM([[unsigned int atomic_var;]],
[ [[
__atomic_exchange_n(&atomic_var, 0, __ATOMIC_SEQ_CST); __atomic_exchange_n(&atomic_var, 0, __ATOMIC_SEQ_CST);
__atomic_exchange_n(&atomic_var, 1, __ATOMIC_SEQ_CST); __atomic_exchange_n(&atomic_var, 1, __ATOMIC_SEQ_CST);
__atomic_fetch_add(&atomic_var, 1, __ATOMIC_SEQ_CST); __atomic_fetch_add(&atomic_var, 1, __ATOMIC_SEQ_CST);
__atomic_fetch_sub(&atomic_var, 1, __ATOMIC_SEQ_CST); __atomic_fetch_sub(&atomic_var, 1, __ATOMIC_SEQ_CST);
__atomic_or_fetch(&atomic_var, 1, __ATOMIC_SEQ_CST); __atomic_or_fetch(&atomic_var, 1, __ATOMIC_SEQ_CST);
], ]])],
[rb_cv_gcc_atomic_builtins=yes], [rb_cv_gcc_atomic_builtins=yes],
[rb_cv_gcc_atomic_builtins=no])]) [rb_cv_gcc_atomic_builtins=no])])
AS_IF([test "$rb_cv_gcc_atomic_builtins" = yes], [ AS_IF([test "$rb_cv_gcc_atomic_builtins" = yes], [
@ -1504,15 +1508,15 @@ AS_IF([test "$GCC" = yes], [
]) ])
AC_CACHE_CHECK([for __sync builtins], [rb_cv_gcc_sync_builtins], [ AC_CACHE_CHECK([for __sync builtins], [rb_cv_gcc_sync_builtins], [
AC_TRY_LINK([unsigned int atomic_var;], AC_LINK_IFELSE([AC_LANG_PROGRAM([[unsigned int atomic_var;]],
[ [[
__sync_lock_test_and_set(&atomic_var, 0); __sync_lock_test_and_set(&atomic_var, 0);
__sync_lock_test_and_set(&atomic_var, 1); __sync_lock_test_and_set(&atomic_var, 1);
__sync_fetch_and_add(&atomic_var, 1); __sync_fetch_and_add(&atomic_var, 1);
__sync_fetch_and_sub(&atomic_var, 1); __sync_fetch_and_sub(&atomic_var, 1);
__sync_or_and_fetch(&atomic_var, 1); __sync_or_and_fetch(&atomic_var, 1);
__sync_val_compare_and_swap(&atomic_var, 0, 1); __sync_val_compare_and_swap(&atomic_var, 0, 1);
], ]])],
[rb_cv_gcc_sync_builtins=yes], [rb_cv_gcc_sync_builtins=yes],
[rb_cv_gcc_sync_builtins=no])]) [rb_cv_gcc_sync_builtins=no])])
AS_IF([test "$rb_cv_gcc_sync_builtins" = yes], [ AS_IF([test "$rb_cv_gcc_sync_builtins" = yes], [
@ -1522,8 +1526,8 @@ AS_IF([test "$GCC" = yes], [
AC_CACHE_CHECK(for __builtin_unreachable, rb_cv_func___builtin_unreachable, AC_CACHE_CHECK(for __builtin_unreachable, rb_cv_func___builtin_unreachable,
[RUBY_WERROR_FLAG( [RUBY_WERROR_FLAG(
[AC_TRY_LINK([volatile int zero;], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[volatile int zero;]],
[if (zero) __builtin_unreachable();], [[if (zero) __builtin_unreachable();]])],
[rb_cv_func___builtin_unreachable=yes], [rb_cv_func___builtin_unreachable=yes],
[rb_cv_func___builtin_unreachable=no]) [rb_cv_func___builtin_unreachable=no])
]) ])
@ -1536,8 +1540,8 @@ AC_CACHE_CHECK(for exported function attribute, rb_cv_func_exported, [
rb_cv_func_exported=no rb_cv_func_exported=no
RUBY_WERROR_FLAG([ RUBY_WERROR_FLAG([
for mac in '__attribute__ ((__visibility__("default")))' '__declspec(dllexport)'; do for mac in '__attribute__ ((__visibility__("default")))' '__declspec(dllexport)'; do
AC_TRY_COMPILE([@%:@define RUBY_FUNC_EXPORTED $mac extern AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@define RUBY_FUNC_EXPORTED $mac extern
RUBY_FUNC_EXPORTED void conftest_attribute_check(void);], [], RUBY_FUNC_EXPORTED void conftest_attribute_check(void);]], [[]])],
[rb_cv_func_exported="$mac"; break]) [rb_cv_func_exported="$mac"; break])
done done
])]) ])])
@ -1564,8 +1568,8 @@ AC_CACHE_CHECK(for function name string predefined identifier,
rb_cv_function_name_string=no rb_cv_function_name_string=no
RUBY_WERROR_FLAG([ RUBY_WERROR_FLAG([
for func in __func__ __FUNCTION__; do for func in __func__ __FUNCTION__; do
AC_TRY_LINK([@%:@include <stdio.h>], AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include <stdio.h>]],
[puts($func);], [[puts($func);]])],
[rb_cv_function_name_string=$func [rb_cv_function_name_string=$func
break]) break])
done done
@ -1722,9 +1726,9 @@ AS_IF([test "x$rb_cv_type_int64_t" != xno], [
AC_CACHE_CHECK(for stack end address, rb_cv_stack_end_address, AC_CACHE_CHECK(for stack end address, rb_cv_stack_end_address,
[rb_cv_stack_end_address=no [rb_cv_stack_end_address=no
AC_TRY_LINK( AC_LINK_IFELSE([AC_LANG_PROGRAM(
[extern void *__libc_stack_end;], [[extern void *__libc_stack_end;]],
[if (!__libc_stack_end) return 1;], [[if (!__libc_stack_end) return 1;]])],
[rb_cv_stack_end_address="__libc_stack_end"]) [rb_cv_stack_end_address="__libc_stack_end"])
]) ])
AS_IF([test $rb_cv_stack_end_address != no], [ AS_IF([test $rb_cv_stack_end_address != no], [
@ -1752,14 +1756,14 @@ AS_CASE(["${target_cpu}-${target_os}:${target_archs}"],
AS_IF([test "x$ALLOCA" = "x"], [ AS_IF([test "x$ALLOCA" = "x"], [
AC_CACHE_CHECK([for dynamic size alloca], rb_cv_dynamic_alloca, [ AC_CACHE_CHECK([for dynamic size alloca], rb_cv_dynamic_alloca, [
for chk in ok __chkstk; do for chk in ok __chkstk; do
AC_TRY_LINK([ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
@%:@ifdef HAVE_ALLOCA_H @%:@ifdef HAVE_ALLOCA_H
@%:@include <alloca.h> @%:@include <alloca.h>
@%:@endif @%:@endif
void $chk() {} void $chk() {}
int dynamic_alloca_test; int dynamic_alloca_test;
int dynamic_alloca_result;], int dynamic_alloca_result;]],
[dynamic_alloca_result = alloca(dynamic_alloca_test) != 0;], [[dynamic_alloca_result = alloca(dynamic_alloca_test) != 0;]])],
[rb_cv_dynamic_alloca=$chk; break]) [rb_cv_dynamic_alloca=$chk; break])
done]) done])
AS_IF([test "x$rb_cv_dynamic_alloca" = "x__chkstk"], [ AS_IF([test "x$rb_cv_dynamic_alloca" = "x__chkstk"], [
@ -1811,9 +1815,9 @@ AC_CHECK_HEADERS(sys/pstat.h)
AC_CACHE_CHECK(for signbit, rb_cv_have_signbit, AC_CACHE_CHECK(for signbit, rb_cv_have_signbit,
[AC_TRY_LINK([ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <math.h> #include <math.h>
], [int v = signbit(-0.0);], ]], [[int v = signbit(-0.0);]])],
rb_cv_have_signbit=yes, rb_cv_have_signbit=yes,
rb_cv_have_signbit=no)]) rb_cv_have_signbit=no)])
AS_IF([test "$rb_cv_have_signbit" = yes], [ AS_IF([test "$rb_cv_have_signbit" = yes], [
@ -1971,7 +1975,7 @@ AS_CASE(["$ac_cv_func_memset_s:$ac_cv_func_qsort_s"], [*yes*],
AS_IF([test "$ac_cv_func_getcwd" = yes], [ AS_IF([test "$ac_cv_func_getcwd" = yes], [
AC_CACHE_CHECK(if getcwd allocates buffer if NULL is given, [rb_cv_getcwd_malloc], AC_CACHE_CHECK(if getcwd allocates buffer if NULL is given, [rb_cv_getcwd_malloc],
[AC_TRY_RUN([ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
@%:@include <stddef.h> @%:@include <stddef.h>
@%:@include <stdio.h> @%:@include <stdio.h>
@%:@ifdef HAVE_UNISTD_H @%:@ifdef HAVE_UNISTD_H
@ -1990,7 +1994,7 @@ main(int argc, char **argv)
if (!getcwd(NULL, 0)) return EXIT_FAILURE; if (!getcwd(NULL, 0)) return EXIT_FAILURE;
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
], ]])],
rb_cv_getcwd_malloc=yes, rb_cv_getcwd_malloc=yes,
rb_cv_getcwd_malloc=no, rb_cv_getcwd_malloc=no,
AS_CASE($target_os, AS_CASE($target_os,
@ -2038,21 +2042,21 @@ RUBY_CHECK_BUILTIN_FUNC(__builtin_trap, [__builtin_trap()])
AS_IF([test "$ac_cv_func_qsort_r" != no], [ AS_IF([test "$ac_cv_func_qsort_r" != no], [
AC_CACHE_CHECK(whether qsort_r is GNU version, rb_cv_gnu_qsort_r, AC_CACHE_CHECK(whether qsort_r is GNU version, rb_cv_gnu_qsort_r,
[AC_TRY_COMPILE([ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@include <stdlib.h> @%:@include <stdlib.h>
void (qsort_r)(void *base, size_t nmemb, size_t size, void (qsort_r)(void *base, size_t nmemb, size_t size,
int (*compar)(const void *, const void *, void *), int (*compar)(const void *, const void *, void *),
void *arg); void *arg);
],[ ], ]], [[ ]])],
[rb_cv_gnu_qsort_r=yes], [rb_cv_gnu_qsort_r=yes],
[rb_cv_gnu_qsort_r=no]) [rb_cv_gnu_qsort_r=no])
]) ])
AC_CACHE_CHECK(whether qsort_r is BSD version, rb_cv_bsd_qsort_r, AC_CACHE_CHECK(whether qsort_r is BSD version, rb_cv_bsd_qsort_r,
[AC_TRY_COMPILE([ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@include <stdlib.h> @%:@include <stdlib.h>
void (qsort_r)(void *base, size_t nmemb, size_t size, void (qsort_r)(void *base, size_t nmemb, size_t size,
void *arg, int (*compar)(void *, const void *, const void *)); void *arg, int (*compar)(void *, const void *, const void *));
],[ ], ]], [[ ]])],
[rb_cv_bsd_qsort_r=yes], [rb_cv_bsd_qsort_r=yes],
[rb_cv_bsd_qsort_r=no]) [rb_cv_bsd_qsort_r=no])
]) ])
@ -2067,7 +2071,7 @@ void (qsort_r)(void *base, size_t nmemb, size_t size,
AC_CACHE_CHECK(whether atan2 handles Inf as C99, rb_cv_atan2_inf_c99, [ AC_CACHE_CHECK(whether atan2 handles Inf as C99, rb_cv_atan2_inf_c99, [
AS_IF([test $ac_cv_func_atan2f:$ac_cv_func_atan2l = yes:yes], [ AS_IF([test $ac_cv_func_atan2f:$ac_cv_func_atan2l = yes:yes], [
AC_TRY_RUN([ AC_RUN_IFELSE([AC_LANG_SOURCE([[
@%:@include <math.h> @%:@include <math.h>
@%:@ifdef HAVE_UNISTD_H @%:@ifdef HAVE_UNISTD_H
@%:@include <unistd.h> @%:@include <unistd.h>
@ -2085,7 +2089,7 @@ main(int argc, char **argv)
if (fabs(atan2(INFINITY, INFINITY) - M_PI_4) <= 0.01) return EXIT_SUCCESS; if (fabs(atan2(INFINITY, INFINITY) - M_PI_4) <= 0.01) return EXIT_SUCCESS;
return EXIT_FAILURE; return EXIT_FAILURE;
} }
], ]])],
[rb_cv_atan2_inf_c99=yes], [rb_cv_atan2_inf_c99=yes],
[rb_cv_atan2_inf_c99=no], [rb_cv_atan2_inf_c99=no],
[AS_CASE($target_os, [mingw*|mswin*], [rb_cv_atan2_inf_c99=no], [rb_cv_atan2_inf_c99=yes])] [AS_CASE($target_os, [mingw*|mswin*], [rb_cv_atan2_inf_c99=no], [rb_cv_atan2_inf_c99=yes])]
@ -2114,9 +2118,9 @@ AS_IF([test x"$ac_cv_lib_rt_timer_settime" = xyes], [
]) ])
AC_CACHE_CHECK(for unsetenv returns a value, rb_cv_unsetenv_return_value, AC_CACHE_CHECK(for unsetenv returns a value, rb_cv_unsetenv_return_value,
[AC_TRY_COMPILE([ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdlib.h> #include <stdlib.h>
], [int v = unsetenv("foo");], ]], [[int v = unsetenv("foo");]])],
rb_cv_unsetenv_return_value=yes, rb_cv_unsetenv_return_value=yes,
rb_cv_unsetenv_return_value=no)]) rb_cv_unsetenv_return_value=no)])
AS_IF([test "$rb_cv_unsetenv_return_value" = no], [ AS_IF([test "$rb_cv_unsetenv_return_value" = no], [
@ -2134,21 +2138,21 @@ AS_IF([test "$use_setreuid" = yes], [
]) ])
AC_STRUCT_TIMEZONE AC_STRUCT_TIMEZONE
AC_CACHE_CHECK(for struct tm.tm_gmtoff, rb_cv_member_struct_tm_tm_gmtoff, AC_CACHE_CHECK(for struct tm.tm_gmtoff, rb_cv_member_struct_tm_tm_gmtoff,
[AC_TRY_COMPILE([ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@define _BSD_SOURCE @%:@define _BSD_SOURCE
@%:@define _DEFAULT_SOURCE @%:@define _DEFAULT_SOURCE
@%:@include <time.h> @%:@include <time.h>
], ]],
[struct tm t; t.tm_gmtoff = 3600;], [[struct tm t; t.tm_gmtoff = 3600;]])],
[rb_cv_member_struct_tm_tm_gmtoff=yes], [rb_cv_member_struct_tm_tm_gmtoff=yes],
[rb_cv_member_struct_tm_tm_gmtoff=no])]) [rb_cv_member_struct_tm_tm_gmtoff=no])])
AS_IF([test "$rb_cv_member_struct_tm_tm_gmtoff" = yes], [ AS_IF([test "$rb_cv_member_struct_tm_tm_gmtoff" = yes], [
AC_DEFINE(HAVE_STRUCT_TM_TM_GMTOFF) AC_DEFINE(HAVE_STRUCT_TM_TM_GMTOFF)
]) ])
AC_CACHE_CHECK(for external int daylight, rb_cv_have_daylight, AC_CACHE_CHECK(for external int daylight, rb_cv_have_daylight,
[AC_TRY_LINK([#include <time.h> [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>
int i;], int i;]],
[i = daylight;], [[i = daylight;]])],
rb_cv_have_daylight=yes, rb_cv_have_daylight=yes,
rb_cv_have_daylight=no)]) rb_cv_have_daylight=no)])
AS_IF([test "$rb_cv_have_daylight" = yes], [ AS_IF([test "$rb_cv_have_daylight" = yes], [
@ -2156,7 +2160,7 @@ AS_IF([test "$rb_cv_have_daylight" = yes], [
]) ])
AC_CACHE_CHECK(for negative time_t for gmtime(3), rb_cv_negative_time_t, AC_CACHE_CHECK(for negative time_t for gmtime(3), rb_cv_negative_time_t,
[AC_TRY_RUN([ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
@ -2186,7 +2190,7 @@ main()
check(gmtime(&t), 1, 12, 13, 20, 52); check(gmtime(&t), 1, 12, 13, 20, 52);
return 0; return 0;
} }
], ]])],
rb_cv_negative_time_t=yes, rb_cv_negative_time_t=yes,
rb_cv_negative_time_t=no, rb_cv_negative_time_t=no,
rb_cv_negative_time_t=yes)]) rb_cv_negative_time_t=yes)])
@ -2197,7 +2201,7 @@ AS_IF([test "$rb_cv_negative_time_t" = yes], [
# [ruby-dev:40910] overflow of time on FreeBSD # [ruby-dev:40910] overflow of time on FreeBSD
# http://www.freebsd.org/cgi/query-pr.cgi?pr=145341 # http://www.freebsd.org/cgi/query-pr.cgi?pr=145341
AC_CACHE_CHECK(for localtime(3) overflow correctly, rb_cv_localtime_overflow, AC_CACHE_CHECK(for localtime(3) overflow correctly, rb_cv_localtime_overflow,
[AC_TRY_RUN([ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
@ -2229,7 +2233,7 @@ main()
check(t); check(t);
return 0; return 0;
} }
], ]])],
rb_cv_localtime_overflow=yes, rb_cv_localtime_overflow=yes,
rb_cv_localtime_overflow=no, rb_cv_localtime_overflow=no,
rb_cv_localtime_overflow=no)]) rb_cv_localtime_overflow=no)])
@ -2242,7 +2246,7 @@ AS_IF([test "$ac_cv_func_sigprocmask" = yes && test "$ac_cv_func_sigaction" = ye
], [ ], [
AC_CHECK_FUNCS(sigsetmask) AC_CHECK_FUNCS(sigsetmask)
AC_CACHE_CHECK(for BSD signal semantics, rb_cv_bsd_signal, AC_CACHE_CHECK(for BSD signal semantics, rb_cv_bsd_signal,
[AC_TRY_RUN([ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h> #include <stdio.h>
#include <signal.h> #include <signal.h>
@ -2260,7 +2264,7 @@ main()
kill(getpid(), SIGINT); kill(getpid(), SIGINT);
return 0; return 0;
} }
], ]])],
rb_cv_bsd_signal=yes, rb_cv_bsd_signal=yes,
rb_cv_bsd_signal=no, rb_cv_bsd_signal=no,
rb_cv_bsd_signal=$ac_cv_func_sigsetmask)]) rb_cv_bsd_signal=$ac_cv_func_sigsetmask)])
@ -2306,7 +2310,7 @@ AS_IF([test "$rb_cv_rshift_sign" = yes], [
AS_IF([test "$ac_cv_func_copy_file_range" = no], [ AS_IF([test "$ac_cv_func_copy_file_range" = no], [
AC_CACHE_CHECK([for copy_file_range], AC_CACHE_CHECK([for copy_file_range],
rb_cv_use_copy_file_range, rb_cv_use_copy_file_range,
[AC_TRY_RUN([ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/syscall.h> #include <sys/syscall.h>
@ -2333,7 +2337,7 @@ main()
return 1; return 1;
#endif #endif
} }
], ]])],
[rb_cv_use_copy_file_range=yes], [rb_cv_use_copy_file_range=yes],
[rb_cv_use_copy_file_range=no], [rb_cv_use_copy_file_range=no],
[rb_cv_use_copy_file_range=no])]) [rb_cv_use_copy_file_range=no])])
@ -2474,13 +2478,13 @@ AS_IF([test x"$enable_pthread" = xyes], [
AC_MSG_WARN("Don't know how to find pthread library on your system -- thread support disabled") AC_MSG_WARN("Don't know how to find pthread library on your system -- thread support disabled")
]) ])
AC_CACHE_CHECK([whether pthread_t is scalar type], [rb_cv_scalar_pthread_t], [ AC_CACHE_CHECK([whether pthread_t is scalar type], [rb_cv_scalar_pthread_t], [
AC_TRY_COMPILE([ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@include <pthread.h> @%:@include <pthread.h>
], [ ]], [[
pthread_t thread_id; pthread_t thread_id;
thread_id = 0; thread_id = 0;
if (!thread_id) return 0; if (!thread_id) return 0;
], [rb_cv_scalar_pthread_t=yes], [rb_cv_scalar_pthread_t=no]) ]])],[rb_cv_scalar_pthread_t=yes],[rb_cv_scalar_pthread_t=no])
]) ])
AS_IF([test x"$rb_cv_scalar_pthread_t" = xyes], [ AS_IF([test x"$rb_cv_scalar_pthread_t" = xyes], [
: # RUBY_CHECK_SIZEOF(pthread_t, [void* int long], [], [@%:@include <pthread.h>]) : # RUBY_CHECK_SIZEOF(pthread_t, [void* int long], [], [@%:@include <pthread.h>])
@ -2506,14 +2510,14 @@ AS_IF([test x"$enable_pthread" = xyes], [
"(pthread_self(), \"%s\", name)" \ "(pthread_self(), \"%s\", name)" \
"(name)" \ "(name)" \
; do ; do
AC_TRY_COMPILE([ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@include <pthread.h> @%:@include <pthread.h>
@%:@ifdef HAVE_PTHREAD_NP_H @%:@ifdef HAVE_PTHREAD_NP_H
@%:@include <pthread_np.h> @%:@include <pthread_np.h>
@%:@endif @%:@endif
@%:@define SET_THREAD_NAME(name) pthread_setname_np${mac} @%:@define SET_THREAD_NAME(name) pthread_setname_np${mac}
], ]],
[if (SET_THREAD_NAME("conftest")) return 1;], [[if (SET_THREAD_NAME("conftest")) return 1;]])],
[rb_cv_func_pthread_setname_np_arguments="${mac}" [rb_cv_func_pthread_setname_np_arguments="${mac}"
break]) break])
done done
@ -2537,8 +2541,8 @@ AS_IF([test x"$enable_pthread" = xyes], [
AS_IF([test x"$ac_cv_header_ucontext_h" = xno], [ AS_IF([test x"$ac_cv_header_ucontext_h" = xno], [
AC_CACHE_CHECK([if signal.h defines ucontext_t], [rb_cv_ucontext_in_signal_h], AC_CACHE_CHECK([if signal.h defines ucontext_t], [rb_cv_ucontext_in_signal_h],
[AC_TRY_COMPILE([@%:@include <signal.h>], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <signal.h>]],
[size_t size = sizeof(ucontext_t);], [[size_t size = sizeof(ucontext_t);]])],
[rb_cv_ucontext_in_signal_h=yes], [rb_cv_ucontext_in_signal_h=no])]) [rb_cv_ucontext_in_signal_h=yes], [rb_cv_ucontext_in_signal_h=no])])
AS_IF([test x"$rb_cv_ucontext_in_signal_h" = xyes], [ AS_IF([test x"$rb_cv_ucontext_in_signal_h" = xyes], [
AC_DEFINE_UNQUOTED(UCONTEXT_IN_SIGNAL_H, 1) AC_DEFINE_UNQUOTED(UCONTEXT_IN_SIGNAL_H, 1)
@ -2546,14 +2550,14 @@ AS_IF([test x"$ac_cv_header_ucontext_h" = xno], [
]) ])
AS_IF([test x"$ac_cv_header_ucontext_h" = xyes -o x"$rb_cv_ucontext_in_signal_h" = xyes], [ AS_IF([test x"$ac_cv_header_ucontext_h" = xyes -o x"$rb_cv_ucontext_in_signal_h" = xyes], [
AC_CACHE_CHECK([if mcontext_t is a pointer], [rb_cv_mcontext_t_ptr], AC_CACHE_CHECK([if mcontext_t is a pointer], [rb_cv_mcontext_t_ptr],
[AC_TRY_COMPILE([ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@include <signal.h> @%:@include <signal.h>
@%:@ifdef HAVE_UCONTEXT_H @%:@ifdef HAVE_UCONTEXT_H
@%:@include <ucontext.h> @%:@include <ucontext.h>
@%:@endif @%:@endif
mcontext_t test(mcontext_t mc) {return mc+1;} mcontext_t test(mcontext_t mc) {return mc+1;}
], ]],
[test(0);], [[test(0);]])],
[rb_cv_mcontext_t_ptr=yes], [rb_cv_mcontext_t_ptr=no])]) [rb_cv_mcontext_t_ptr=yes], [rb_cv_mcontext_t_ptr=no])])
AS_IF([test x"$rb_cv_mcontext_t_ptr" = xyes], [ AS_IF([test x"$rb_cv_mcontext_t_ptr" = xyes], [
AC_DEFINE_UNQUOTED(DEFINE_MCONTEXT_PTR(mc, uc), mcontext_t mc = (uc)->uc_mcontext) AC_DEFINE_UNQUOTED(DEFINE_MCONTEXT_PTR(mc, uc), mcontext_t mc = (uc)->uc_mcontext)
@ -2567,7 +2571,7 @@ AS_IF([test x"$ac_cv_header_ucontext_h" = xyes -o x"$rb_cv_ucontext_in_signal_h"
AS_IF([test "$ac_cv_func_fork_works" = "yes" -a "$rb_with_pthread" = "yes"], [ AS_IF([test "$ac_cv_func_fork_works" = "yes" -a "$rb_with_pthread" = "yes"], [
AC_CACHE_CHECK([if fork works with pthread], rb_cv_fork_with_pthread, AC_CACHE_CHECK([if fork works with pthread], rb_cv_fork_with_pthread,
[AC_TRY_RUN([ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <pthread.h> #include <pthread.h>
@ -2623,7 +2627,7 @@ main(int argc, char *argv[])
} }
return EXIT_SUCCESS; return EXIT_SUCCESS;
}], }]])],
rb_cv_fork_with_pthread=yes, rb_cv_fork_with_pthread=yes,
rb_cv_fork_with_pthread=no, rb_cv_fork_with_pthread=no,
rb_cv_fork_with_pthread=yes)]) rb_cv_fork_with_pthread=yes)])
@ -2646,7 +2650,7 @@ AC_ARG_WITH(dln-a-out,
with_dln_a_out=no])], [with_dln_a_out=no]) with_dln_a_out=no])], [with_dln_a_out=no])
AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf, AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf,
[AC_TRY_LINK([],[], [ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[
AS_CASE(["`head -1 conftest$EXEEXT | tr -dc '\177ELF' | tr '\177' .`"], AS_CASE(["`head -1 conftest$EXEEXT | tr -dc '\177ELF' | tr '\177' .`"],
[.ELF*], [rb_cv_binary_elf=yes], [rb_cv_binary_elf=no])], [.ELF*], [rb_cv_binary_elf=yes], [rb_cv_binary_elf=no])],
rb_cv_binary_elf=no)]) rb_cv_binary_elf=no)])
@ -2923,7 +2927,7 @@ AC_CHECK_FUNCS(backtrace)
AS_IF([test "x$ac_cv_func_backtrace" = xyes], [ AS_IF([test "x$ac_cv_func_backtrace" = xyes], [
AC_CACHE_CHECK(for broken backtrace, rb_cv_broken_backtrace, AC_CACHE_CHECK(for broken backtrace, rb_cv_broken_backtrace,
[AC_TRY_RUN([ [AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -2972,7 +2976,7 @@ main(void)
a[0] = 1; a[0] = 1;
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
], ]])],
rb_cv_broken_backtrace=no, rb_cv_broken_backtrace=no,
rb_cv_broken_backtrace=yes, rb_cv_broken_backtrace=yes,
rb_cv_broken_backtrace=no)]) rb_cv_broken_backtrace=no)])
@ -2992,11 +2996,10 @@ AS_IF([test "$ac_cv_header_a_out_h" = yes], [
AS_IF([test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown], [ AS_IF([test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown], [
cat confdefs.h > config.h cat confdefs.h > config.h
AC_CACHE_CHECK(whether matz's dln works, rb_cv_dln_a_out, AC_CACHE_CHECK(whether matz's dln works, rb_cv_dln_a_out,
[AC_TRY_COMPILE([ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define USE_DLN_A_OUT #define USE_DLN_A_OUT
#include "dln.c" #include "dln.c"
], ]], [[]])],
[],
rb_cv_dln_a_out=yes, rb_cv_dln_a_out=yes,
rb_cv_dln_a_out=no)]) rb_cv_dln_a_out=no)])
AS_IF([test "$rb_cv_dln_a_out" = yes], [ AS_IF([test "$rb_cv_dln_a_out" = yes], [
@ -3069,10 +3072,10 @@ AS_IF([test "$with_dln_a_out" = yes], [
AC_ARG_WITH(ext, AC_ARG_WITH(ext,
AC_HELP_STRING([--with-ext=EXTS], AS_HELP_STRING([--with-ext=EXTS],
[pass to --with-ext option of extmk.rb])) [pass to --with-ext option of extmk.rb]))
AC_ARG_WITH(out-ext, AC_ARG_WITH(out-ext,
AC_HELP_STRING([--with-out-ext=EXTS], AS_HELP_STRING([--with-out-ext=EXTS],
[pass to --without-ext option of extmk.rb])) [pass to --without-ext option of extmk.rb]))
EXTSTATIC= EXTSTATIC=
AC_SUBST(EXTSTATIC)dnl AC_SUBST(EXTSTATIC)dnl
@ -3534,7 +3537,7 @@ AS_IF([test "$rb_with_pthread" = "yes"], [
THREAD_MODEL=pthread THREAD_MODEL=pthread
]) ])
AC_CACHE_CHECK([for prefix of external symbols], rb_cv_symbol_prefix, [ AC_CACHE_CHECK([for prefix of external symbols], rb_cv_symbol_prefix, [
AC_TRY_COMPILE([extern void conftest_external(void) {}], [], [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[extern void conftest_external(void) {}]], [[]])],[
rb_cv_symbol_prefix=`$NM conftest.$ac_objext | rb_cv_symbol_prefix=`$NM conftest.$ac_objext |
sed -n ['/.*T[ ]\([^ ]*\)conftest_external.*/!d;s//\1/p;q']` sed -n ['/.*T[ ]\([^ ]*\)conftest_external.*/!d;s//\1/p;q']`
], ],
@ -3545,7 +3548,7 @@ SYMBOL_PREFIX="$rb_cv_symbol_prefix"
test "x$SYMBOL_PREFIX" = xNONE && SYMBOL_PREFIX='' test "x$SYMBOL_PREFIX" = xNONE && SYMBOL_PREFIX=''
DLNOBJ=dln.o DLNOBJ=dln.o
AC_ARG_ENABLE(dln, AC_ARG_ENABLE(dln,
AC_HELP_STRING([--disable-dln], [disable dynamic link feature]), AS_HELP_STRING([--disable-dln], [disable dynamic link feature]),
[test "$enableval" = yes || DLNOBJ=dmydln.o]) [test "$enableval" = yes || DLNOBJ=dmydln.o])
AC_SUBST(DLNOBJ) AC_SUBST(DLNOBJ)
MINIDLNOBJ=dmydln.o MINIDLNOBJ=dmydln.o
@ -3677,13 +3680,12 @@ AS_IF([test "${universal_binary-no}" = yes ], [
AC_CACHE_CHECK([for architecture macros], rb_cv_architecture_macros, [ AC_CACHE_CHECK([for architecture macros], rb_cv_architecture_macros, [
mv confdefs.h confdefs1.h mv confdefs.h confdefs1.h
: > confdefs.h : > confdefs.h
AC_TRY_COMPILE([@%:@if defined __`echo ${universal_archnames} | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@if defined __`echo ${universal_archnames} |
sed 's/=[^ ]*//g;s/ /__ || defined __/g'`__ sed 's/=[^ ]*//g;s/ /__ || defined __/g'`__
@%:@else @%:@else
@%:@error @%:@error
>>>>>><<<<<< >>>>>><<<<<<
@%:@endif], [], @%:@endif]], [[]])],[
[
rb_cv_architecture_macros=yes rb_cv_architecture_macros=yes
mv -f confdefs1.h confdefs.h mv -f confdefs1.h confdefs.h
], [ ], [
@ -3696,16 +3698,17 @@ AS_IF([test "${universal_binary-no}" = yes ], [
CFLAGS="$new_cflags -arch $archs" CFLAGS="$new_cflags -arch $archs"
archs="__${archs}__" archs="__${archs}__"
AC_MSG_CHECKING([for macro ${archs} on ${cpu}]) AC_MSG_CHECKING([for macro ${archs} on ${cpu}])
AC_TRY_COMPILE([@%:@ifndef ${archs} AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@ifndef ${archs}
@%:@error @%:@error
@%:@endif], [], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) @%:@endif]], [[]])],
[AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
done done
mv -f confdefs1.h confdefs.h mv -f confdefs1.h confdefs.h
AC_MSG_ERROR([failed]) AC_MSG_ERROR([failed])
])]) ])])
AC_CACHE_CHECK(whether __ARCHITECTURE__ is available, rb_cv_architecture_available, AC_CACHE_CHECK(whether __ARCHITECTURE__ is available, rb_cv_architecture_available,
AC_TRY_COMPILE([@%:@include <stdio.h> AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <stdio.h>
const char arch[[]] = __ARCHITECTURE__;], [puts(arch);], const char arch[[]] = __ARCHITECTURE__;]], [[puts(arch);]])],
[rb_cv_architecture_available=yes], [rb_cv_architecture_available=no])) [rb_cv_architecture_available=yes], [rb_cv_architecture_available=no]))
]) ])
@ -4108,7 +4111,7 @@ AC_CONFIG_FILES(Makefile:template/Makefile.in, [
[EXEEXT='$EXEEXT' MAKE='${MAKE-make}' gnumake='$gnumake' GIT='$GIT']) [EXEEXT='$EXEEXT' MAKE='${MAKE-make}' gnumake='$gnumake' GIT='$GIT'])
AC_ARG_WITH([ruby-pc], AC_ARG_WITH([ruby-pc],
AC_HELP_STRING([--with-ruby-pc=FILENAME], [pc file basename]), AS_HELP_STRING([--with-ruby-pc=FILENAME], [pc file basename]),
[ruby_pc="$withval"], [ruby_pc="$withval"],
[ruby_pc="${RUBY_BASE_NAME}-${MAJOR}.${MINOR}.pc"]) [ruby_pc="${RUBY_BASE_NAME}-${MAJOR}.${MINOR}.pc"])
AC_SUBST(ruby_pc) AC_SUBST(ruby_pc)

View file

@ -8,18 +8,18 @@ AC_CACHE_CHECK(for __builtin_setjmp, ac_cv_func___builtin_setjmp,
ac_cv_func___builtin_setjmp=no ac_cv_func___builtin_setjmp=no
for cast in "" "(void **)"; do for cast in "" "(void **)"; do
RUBY_WERROR_FLAG( RUBY_WERROR_FLAG(
[AC_TRY_LINK([@%:@include <setjmp.h> [AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include <setjmp.h>
@%:@include <stdio.h> @%:@include <stdio.h>
jmp_buf jb; jmp_buf jb;
@%:@ifdef NORETURN @%:@ifdef NORETURN
NORETURN(void t(void)); NORETURN(void t(void));
@%:@endif @%:@endif
void t(void) {__builtin_longjmp($cast jb, 1);} void t(void) {__builtin_longjmp($cast jb, 1);}
int jump(void) {(void)(__builtin_setjmp($cast jb) ? 1 : 0); return 0;}], int jump(void) {(void)(__builtin_setjmp($cast jb) ? 1 : 0); return 0;}]],
[ [[
void (*volatile f)(void) = t; void (*volatile f)(void) = t;
if (!jump()) printf("%d\n", f != 0); if (!jump()) printf("%d\n", f != 0);
], ]])],
[ac_cv_func___builtin_setjmp="yes with cast ($cast)"]) [ac_cv_func___builtin_setjmp="yes with cast ($cast)"])
]) ])
test "$ac_cv_func___builtin_setjmp" = no || break test "$ac_cv_func___builtin_setjmp" = no || break

View file

@ -4,8 +4,7 @@ AC_CACHE_CHECK([for printf prefix for $1], [rb_cv_pri_prefix_]AS_TR_SH($1),[
[rb_cv_pri_prefix_]AS_TR_SH($1)=[NONE] [rb_cv_pri_prefix_]AS_TR_SH($1)=[NONE]
RUBY_WERROR_FLAG(RUBY_APPEND_OPTIONS(CFLAGS, $rb_cv_wsuppress_flags) RUBY_WERROR_FLAG(RUBY_APPEND_OPTIONS(CFLAGS, $rb_cv_wsuppress_flags)
for pri in $2; do for pri in $2; do
AC_TRY_COMPILE( AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <stdio.h>
[@%:@include <stdio.h>
@%:@include <stddef.h> @%:@include <stddef.h>
@%:@ifdef __GNUC__ @%:@ifdef __GNUC__
@%:@if defined __MINGW_PRINTF_FORMAT @%:@if defined __MINGW_PRINTF_FORMAT
@ -18,9 +17,9 @@ AC_CACHE_CHECK([for printf prefix for $1], [rb_cv_pri_prefix_]AS_TR_SH($1),[
@%:@else @%:@else
@%:@define PRINTF_ARGS(decl, string_index, first_to_check) decl @%:@define PRINTF_ARGS(decl, string_index, first_to_check) decl
@%:@endif @%:@endif
PRINTF_ARGS(void test_sprintf(const char*, ...), 1, 2);], PRINTF_ARGS(void test_sprintf(const char*, ...), 1, 2);]],
[printf("%]${pri}[d", (]$1[)42); [[printf("%]${pri}[d", (]$1[)42);
test_sprintf("%]${pri}[d", (]$1[)42);], test_sprintf("%]${pri}[d", (]$1[)42);]])],
[rb_cv_pri_prefix_]AS_TR_SH($1)[=[$pri]; break]) [rb_cv_pri_prefix_]AS_TR_SH($1)[=[$pri]; break])
done)]) done)])
AS_IF([test "[$rb_cv_pri_prefix_]AS_TR_SH($1)" != NONE], [ AS_IF([test "[$rb_cv_pri_prefix_]AS_TR_SH($1)" != NONE], [

View file

@ -2,14 +2,14 @@
# used for AC_ARG_WITH(setjmp-type) # used for AC_ARG_WITH(setjmp-type)
AC_DEFUN([RUBY_CHECK_SETJMP], [ AC_DEFUN([RUBY_CHECK_SETJMP], [
AC_CACHE_CHECK([for ]$1[ as a macro or function], ac_cv_func_$1, AC_CACHE_CHECK([for ]$1[ as a macro or function], ac_cv_func_$1,
[AC_TRY_COMPILE([ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@include <setjmp.h> @%:@include <setjmp.h>
]AC_INCLUDES_DEFAULT([$3])[ ]AC_INCLUDES_DEFAULT([$3])[
@%:@define JMPARGS_1 env @%:@define JMPARGS_1 env
@%:@define JMPARGS_2 env,1 @%:@define JMPARGS_2 env,1
@%:@define JMPARGS JMPARGS_]m4_ifval($2,2,1)[ @%:@define JMPARGS JMPARGS_]m4_ifval($2,2,1)[
], ]],
m4_ifval($2,$2,jmp_buf)[ env; $1(JMPARGS);], [m4_ifval($2,$2,jmp_buf)[ env; $1(JMPARGS);]])],
ac_cv_func_$1=yes, ac_cv_func_$1=yes,
ac_cv_func_$1=no)] ac_cv_func_$1=no)]
) )

View file

@ -1,9 +1,9 @@
# -*- Autoconf -*- # -*- Autoconf -*-
AC_DEFUN([RUBY_CHECK_SYSCONF], [dnl AC_DEFUN([RUBY_CHECK_SYSCONF], [dnl
AC_CACHE_CHECK([whether _SC_$1 is supported], rb_cv_have_sc_[]m4_tolower($1), AC_CACHE_CHECK([whether _SC_$1 is supported], rb_cv_have_sc_[]m4_tolower($1),
[AC_TRY_COMPILE([#include <unistd.h> [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>
], ]],
[_SC_$1 >= 0], [[_SC_$1 >= 0]])],
rb_cv_have_sc_[]m4_tolower($1)=yes, rb_cv_have_sc_[]m4_tolower($1)=yes,
rb_cv_have_sc_[]m4_tolower($1)=no) rb_cv_have_sc_[]m4_tolower($1)=no)
]) ])

View file

@ -4,8 +4,8 @@ AC_DEFUN([RUBY_CPPOUTFILE],
[save_CPPFLAGS="$CPPFLAGS" [save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS='-o conftest-1.i' CPPFLAGS='-o conftest-1.i'
rb_cv_cppoutfile=no rb_cv_cppoutfile=no
AC_TRY_CPP([test-for-cppout], AC_PREPROC_IFELSE([AC_LANG_SOURCE([[test-for-cppout]])],
[grep test-for-cppout conftest-1.i > /dev/null && rb_cv_cppoutfile=yes]) [grep test-for-cppout conftest-1.i > /dev/null && rb_cv_cppoutfile=yes])
CPPFLAGS="$save_CPPFLAGS" CPPFLAGS="$save_CPPFLAGS"
rm -f conftest*]) rm -f conftest*])
AS_IF([test "$rb_cv_cppoutfile" = yes], [ AS_IF([test "$rb_cv_cppoutfile" = yes], [

View file

@ -21,7 +21,7 @@ for mac in \
"__declspec(attrib_code) x" \ "__declspec(attrib_code) x" \
x; do x; do
m4_ifval([$4],mac="$mac"${rbcv_cond+" /* only if $rbcv_cond */"}) m4_ifval([$4],mac="$mac"${rbcv_cond+" /* only if $rbcv_cond */"})
AC_TRY_COMPILE( AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
m4_ifval([$4],${rbcv_cond+[@%:@if ]$rbcv_cond}) m4_ifval([$4],${rbcv_cond+[@%:@if ]$rbcv_cond})
[@%:@define ]attrib[](attrib_params)[ $mac] [@%:@define ]attrib[](attrib_params)[ $mac]
m4_ifval([$4],${rbcv_cond+[@%:@else]} m4_ifval([$4],${rbcv_cond+[@%:@else]}
@ -30,7 +30,7 @@ ${rbcv_cond+[@%:@endif]})
$6 $6
@%:@define mesg ("") @%:@define mesg ("")
@%:@define san "address" @%:@define san "address"
attrib[](attrib_params)[;], [], attrib[](attrib_params)[;]], [[]])],
[rbcv="$mac"; break]) [rbcv="$mac"; break])
done done
])]) ])])

View file

@ -7,7 +7,7 @@ AC_DEFUN([RUBY_DTRACE_AVAILABLE],
AS_FOR(opt, rb_dtrace_opt, ["-xnolibs" ""], [dnl AS_FOR(opt, rb_dtrace_opt, ["-xnolibs" ""], [dnl
AS_IF([$DTRACE opt -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null], AS_IF([$DTRACE opt -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null],
[], [continue]) [], [continue])
AC_TRY_COMPILE([@%:@include "conftest_provider.h"], [CONFTEST_FIRE();], AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include "conftest_provider.h"]], [[CONFTEST_FIRE();]])],
[], [continue]) [], [continue])
# DTrace is available on the system # DTrace is available on the system
rb_cv_dtrace_available=yes${rb_dtrace_opt:+"(opt)"} rb_cv_dtrace_available=yes${rb_dtrace_opt:+"(opt)"}

View file

@ -12,7 +12,7 @@ _PROBES
$DTRACE ${DTRACE_OPT} -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null && $DTRACE ${DTRACE_OPT} -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null &&
: :
}], [ }], [
AC_TRY_COMPILE([@%:@include "conftest_provider.h"], [CONFTEST_FIRE();], [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include "conftest_provider.h"]], [[CONFTEST_FIRE();]])],[
AS_IF([{ AS_IF([{
cp -p conftest.${ac_objext} conftest.${ac_objext}.save && cp -p conftest.${ac_objext} conftest.${ac_objext}.save &&
$DTRACE ${DTRACE_OPT} -G -s conftest_provider.d conftest.${ac_objext} 2>/dev/null && $DTRACE ${DTRACE_OPT} -G -s conftest_provider.d conftest.${ac_objext} 2>/dev/null &&

View file

@ -3,11 +3,11 @@ AC_DEFUN([RUBY_MINGW32],
[AS_CASE(["$host_os"], [AS_CASE(["$host_os"],
[cygwin*], [ [cygwin*], [
AC_CACHE_CHECK(for mingw32 environment, rb_cv_mingw32, AC_CACHE_CHECK(for mingw32 environment, rb_cv_mingw32,
[AC_TRY_CPP([ [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
#ifndef __MINGW32__ #ifndef __MINGW32__
# error # error
#endif #endif
], rb_cv_mingw32=yes,rb_cv_mingw32=no) ]])],[rb_cv_mingw32=yes],[rb_cv_mingw32=no])
rm -f conftest*]) rm -f conftest*])
AS_IF([test "$rb_cv_mingw32" = yes], [ AS_IF([test "$rb_cv_mingw32" = yes], [
target_os="mingw32" target_os="mingw32"

View file

@ -6,7 +6,7 @@ AS_CASE(["$1"],
[m68*|x86*|x64|i?86|ppc*|sparc*|alpha*], [ $2=-1], [m68*|x86*|x64|i?86|ppc*|sparc*|alpha*], [ $2=-1],
[hppa*], [ $2=+1], [hppa*], [ $2=+1],
[ [
AC_TRY_RUN([ AC_RUN_IFELSE([AC_LANG_SOURCE([[
/* recurse to get rid of inlining */ /* recurse to get rid of inlining */
static int static int
stack_growup_p(addr, n) stack_growup_p(addr, n)
@ -23,7 +23,7 @@ int main()
int x; int x;
return stack_growup_p(&x, 10); return stack_growup_p(&x, 10);
} }
], $2=-1, $2=+1, $2=0) ]])],[$2=-1],[$2=+1],[$2=0])
]) ])
eval stack_grow_dir=\$$2]) eval stack_grow_dir=\$$2])
eval $2=\$stack_grow_dir eval $2=\$stack_grow_dir

View file

@ -3,7 +3,7 @@ AC_DEFUN([RUBY_TRY_CFLAGS], [
AC_MSG_CHECKING([whether ]$1[ is accepted as CFLAGS]) AC_MSG_CHECKING([whether ]$1[ is accepted as CFLAGS])
RUBY_WERROR_FLAG([ RUBY_WERROR_FLAG([
CFLAGS="[$]CFLAGS $1" CFLAGS="[$]CFLAGS $1"
AC_TRY_COMPILE([$4], [$5], AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$4]], [[$5]])],
[$2 [$2
AC_MSG_RESULT(yes)], AC_MSG_RESULT(yes)],
[$3 [$3

View file

@ -5,7 +5,7 @@ AC_DEFUN([RUBY_TRY_CXXFLAGS], [
AC_MSG_CHECKING([whether ]$1[ is accepted as CXXFLAGS]) AC_MSG_CHECKING([whether ]$1[ is accepted as CXXFLAGS])
RUBY_WERROR_FLAG([ RUBY_WERROR_FLAG([
AC_LANG_PUSH([C++]) AC_LANG_PUSH([C++])
AC_TRY_LINK([$4], [$5], AC_LINK_IFELSE([AC_LANG_PROGRAM([[$4]], [[$5]])],
[$2 [$2
AC_MSG_RESULT(yes)], AC_MSG_RESULT(yes)],
[$3 [$3

View file

@ -4,7 +4,7 @@ AC_DEFUN([RUBY_TRY_LDFLAGS], [
LDFLAGS="[$]LDFLAGS $1" LDFLAGS="[$]LDFLAGS $1"
AC_MSG_CHECKING([whether $1 is accepted as LDFLAGS]) AC_MSG_CHECKING([whether $1 is accepted as LDFLAGS])
RUBY_WERROR_FLAG([ RUBY_WERROR_FLAG([
AC_TRY_LINK([$4], [$5], AC_LINK_IFELSE([AC_LANG_PROGRAM([[$4]], [[$5]])],
[$2 [$2
AC_MSG_RESULT(yes)], AC_MSG_RESULT(yes)],
[$3 [$3