"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "configure.ac" between
ruby-2.7.3.tar.gz and ruby-2.7.4.tar.gz

About: Ruby is an interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). Stable release of 2.7 series.

configure.ac  (ruby-2.7.3):configure.ac  (ruby-2.7.4)
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)
AC_PREREQ(2.67) AC_PREREQ(2.67)
dnl override AC_CHECKING dnl override AC_CHECKING
dnl placed here due to aclocal(1)'s dnl placed here due to aclocal(1)'s
dnl ignoring this definition in separate files dnl ignoring this definition in separate files
AC_DEFUN([AC_CHECKING],[dnl AC_DEFUN([AC_CHECKING],[dnl
skipping to change at line 153 skipping to change at line 153
entirely, then the package will be built only for the entirely, then the package will be built only for the
target platform]), target platform]),
[target_archs="$withval"], [unset target_archs]) [target_archs="$withval"], [unset target_archs])
AC_ARG_ENABLE(load-relative, 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])
AC_ARG_PROGRAM AC_ARG_PROGRAM
# checks for UNIX variants that set C preprocessor variables
AC_USE_SYSTEM_EXTENSIONS
dnl Checks for programs. dnl Checks for programs.
cflagspat= cflagspat=
test -z "$optflags" || test -z "$optflags" ||
cflagspat="$cflagspat;s|"`eval echo '"'"${optflags}"'"' | sed 's/[[][|.*]]/\ \&/g;s/^ */ /;s/ *$/ /'`'| |g' cflagspat="$cflagspat;s|"`eval echo '"'"${optflags}"'"' | sed 's/[[][|.*]]/\ \&/g;s/^ */ /;s/ *$/ /'`'| |g'
test -z "$debugflags" || test -z "$debugflags" ||
cflagspat="$cflagspat;s|"`eval echo '"'"${debugflags}"'"' | sed 's/[[][|.*]] /\\&/g;s/^ */ /;s/ *$/ /'`'| |g' cflagspat="$cflagspat;s|"`eval echo '"'"${debugflags}"'"' | sed 's/[[][|.*]] /\\&/g;s/^ */ /;s/ *$/ /'`'| |g'
test -z "$warnflags" || test -z "$warnflags" ||
cflagspat="$cflagspat;s|"`eval echo '"'"${warnflags}"'"' | sed 's/[[][|.*]]/ \\&/g;s/^ */ /;s/ *$/ /'`'| |g' cflagspat="$cflagspat;s|"`eval echo '"'"${warnflags}"'"' | sed 's/[[][|.*]]/ \\&/g;s/^ */ /;s/ *$/ /'`'| |g'
AS_IF([test -z "${CFLAGS+set}"], [ AS_IF([test -z "${CFLAGS+set}"], [
skipping to change at line 180 skipping to change at line 183
dnl cxxflags="$cxxflags "'${optflags} ${debugflags} ${warnflags}' dnl cxxflags="$cxxflags "'${optflags} ${debugflags} ${warnflags}'
dnl ]) dnl ])
AS_CASE(["$host_os:$build_os"], AS_CASE(["$host_os:$build_os"],
[darwin*:darwin*], [ [darwin*:darwin*], [
AC_CHECK_TOOLS(CC, [clang gcc cc]) AC_CHECK_TOOLS(CC, [clang gcc cc])
# Following Apple deployed clang are broken # Following Apple deployed clang are broken
# clang version 1.0 (http://llvm.org/svn/llvm-project/cfe/tags/Apple/clang-2 3 exported) # clang version 1.0 (http://llvm.org/svn/llvm-project/cfe/tags/Apple/clang-2 3 exported)
# Apple clang version 2.0 (tags/Apple/clang-137) (based on LLVM 2.9svn) # Apple clang version 2.0 (tags/Apple/clang-137) (based on LLVM 2.9svn)
# Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn) # Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)
AS_IF([! $CC -E -xc - <<SRC >/dev/null], [ AC_PREPROC_IFELSE(
@%:@if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ [AC_LANG_PROGRAM([
< 3 @%:@if defined __APPLE_CC__ && defined __clang_major__ && __clang_maj
@%:@error premature clang or__ < 3
@%:@endif @%:@error premature clang
SRC @%:@endif
AC_MSG_ERROR([clang version 3.0 or later is required]) ])],
[],
[AC_MSG_ERROR([clang version 3.0 or later is required])
])], ])],
[openbsd*:openbsd*], [ [openbsd*:openbsd*], [
AC_CHECK_TOOLS(CC, [cc]) AC_CHECK_TOOLS(CC, [cc])
]) ])
AS_IF([test x"${build}" != x"${host}"], [ AS_IF([test x"${build}" != x"${host}"], [
AC_CHECK_TOOL(CC, gcc) AC_CHECK_TOOL(CC, gcc)
]) ])
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])
AS_CASE([$CC], AS_CASE([$CC],
[gcc-*], [ [gcc-*], [
gcc_prefix=gcc- gcc_suffix=`echo "$CC" | sed 's/^gcc//'` gcc_prefix=gcc- gcc_suffix=`echo "$CC" | sed 's/^gcc//'`
AC_PROG_CXX(g++${gcc_suffix})], AC_PROG_CXX(g++${gcc_suffix})],
[clang-*|clang], [ [clang-*|clang], [
gcc_prefix=clang- gcc_suffix=`echo "$CC" | sed 's/^clang//'` gcc_prefix=clang- gcc_suffix=`echo "$CC" | sed 's/^clang//'`
AC_PROG_CXX(clang++${gcc_suffix})], AC_PROG_CXX(clang++${gcc_suffix})],
[gcc_prefix= gcc_suffix=]) [gcc_prefix= gcc_suffix=])
dnl Select the appropriate C++ compiler in OS X dnl Select the appropriate C++ compiler in OS X
skipping to change at line 226 skipping to change at line 233
]) ])
AC_MSG_RESULT([$CXX])], AC_MSG_RESULT([$CXX])],
[openbsd*:*], [ [openbsd*:*], [
AC_CHECK_TOOLS(CXX, [c++]) AC_CHECK_TOOLS(CXX, [c++])
]) ])
test -z "$CXX" || ac_cv_prog_CXX="$CXX" test -z "$CXX" || ac_cv_prog_CXX="$CXX"
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])])
AC_MSG_RESULT(${macosx_min_required}) AC_MSG_RESULT(${macosx_min_required})
]) ])
AC_PROG_CXX AC_PROG_CXX
RUBY_MINGW32 RUBY_MINGW32
AC_PROG_GCC_TRADITIONAL AC_PROG_GCC_TRADITIONAL
AC_SUBST(GCC) AC_SUBST(GCC)
skipping to change at line 362 skipping to change at line 369
AC_CHECK_TOOL(DLLWRAP, dllwrap) AC_CHECK_TOOL(DLLWRAP, dllwrap)
target=`echo $target | sed "s/^$target_cpu-/-/"` target=`echo $target | sed "s/^$target_cpu-/-/"`
target_alias=`echo $target_alias | sed "s/^$target_cpu-/-/"` target_alias=`echo $target_alias | sed "s/^$target_cpu-/-/"`
target_cpu=`echo $target_cpu | sed s/i.86/i386/` target_cpu=`echo $target_cpu | sed s/i.86/i386/`
AS_CASE(["$target"], [-*], [ target="$target_cpu${target}"]) AS_CASE(["$target"], [-*], [ target="$target_cpu${target}"])
AS_CASE(["$target_alias"], [-*], [ target_alias="$target_cpu${target_alias}" ]) AS_CASE(["$target_alias"], [-*], [ target_alias="$target_cpu${target_alias}" ])
AS_CASE(["$target_os"], 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;}'`],
[rb_cv_msvcrt=msvcrt]) [rb_cv_msvcrt=msvcrt])
test "$rb_cv_msvcrt" = "" && rb_cv_msvcrt=msvcrt]) test "$rb_cv_msvcrt" = "" && rb_cv_msvcrt=msvcrt])
RT_VER=`echo "$rb_cv_msvcrt" | tr -cd [0-9]` RT_VER=`echo "$rb_cv_msvcrt" | tr -cd [0-9]`
test "$RT_VER" = "" && RT_VER=60 test "$RT_VER" = "" && RT_VER=60
AC_DEFINE_UNQUOTED(RUBY_MSVCRT_VERSION, $RT_VER) AC_DEFINE_UNQUOTED(RUBY_MSVCRT_VERSION, $RT_VER)
sysconfdir= sysconfdir=
]) ])
skipping to change at line 406 skipping to change at line 413
AS_IF([test "$cross_compiling:$ac_cv_prog_DTRACE" = no: -a -n "$ac_tool_prefix"] , [ AS_IF([test "$cross_compiling:$ac_cv_prog_DTRACE" = no: -a -n "$ac_tool_prefix"] , [
AC_CHECK_PROG([DTRACE], [dtrace], [dtrace]) AC_CHECK_PROG([DTRACE], [dtrace], [dtrace])
]) ])
AC_CHECK_PROGS(DOT, dot) AC_CHECK_PROGS(DOT, dot)
AC_CHECK_PROGS(DOXYGEN, doxygen) AC_CHECK_PROGS(DOXYGEN, doxygen)
AC_CHECK_PROG(PKG_CONFIG, pkg-config, [pkg-config], [], [], AC_CHECK_PROG(PKG_CONFIG, pkg-config, [pkg-config], [], [],
[`"$as_dir/$ac_word$ac_exec_ext" --print-errors --version > /dev/null 2>&1 | | echo "$as_dir/$ac_word$ac_exec_ext"`]) [`"$as_dir/$ac_word$ac_exec_ext" --print-errors --version > /dev/null 2>&1 | | echo "$as_dir/$ac_word$ac_exec_ext"`])
# checks for UNIX variants that set C preprocessor variables
AC_USE_SYSTEM_EXTENSIONS
AC_SUBST(RM, ['rm -f']) AC_SUBST(RM, ['rm -f'])
AC_SUBST(CP, ['cp']) AC_SUBST(CP, ['cp'])
RMDIRS='$(top_srcdir)/tool/rmdirs' RMDIRS='$(top_srcdir)/tool/rmdirs'
RMDIR=rmdir RMDIR=rmdir
mkdir "rmdirs_$$_test" "rmdirs_$$_test/a" mkdir "rmdirs_$$_test" "rmdirs_$$_test/a"
rmdir --ignore-fail-on-non-empty "rmdirs_$$_test" 2>/dev/null && rmdir --ignore-fail-on-non-empty "rmdirs_$$_test" 2>/dev/null &&
RMDIR='rmdir --ignore-fail-on-non-empty' RMDIR='rmdir --ignore-fail-on-non-empty'
$RMDIR -p "rmdirs_$$_test/a" 2>/dev/null && $RMDIR -p "rmdirs_$$_test/a" 2>/dev/null &&
{ test -d "rmdirs_$$_test" || RMDIRS="$RMDIR -p"; } { test -d "rmdirs_$$_test" || RMDIRS="$RMDIR -p"; }
rmdir "rmdirs_$$_test/a" "rmdirs_$$_test" 2>/dev/null rmdir "rmdirs_$$_test/a" "rmdirs_$$_test" 2>/dev/null
skipping to change at line 444 skipping to change at line 448
CHDIR=cd CHDIR=cd
]) ])
rm -fr conf$$.dir rm -fr conf$$.dir
AC_MSG_RESULT([$CHDIR]) AC_MSG_RESULT([$CHDIR])
AC_SUBST(CHDIR) 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)
AC_MSG_ERROR([something wrong with CFLAGS="$CFLAGS"]) AC_MSG_ERROR([something wrong with CFLAGS="$CFLAGS"])
] ]
) )
AC_MSG_CHECKING([whether LDFLAGS is valid]) AC_MSG_CHECKING([whether LDFLAGS is valid])
{ {
mkdir tmp.$$.try_link && mkdir tmp.$$.try_link &&
cd tmp.$$.try_link && cd tmp.$$.try_link &&
cp ../confdefs.h . && cp ../confdefs.h . &&
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
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
AC_MSG_ERROR([something wrong with LDFLAGS="$LDFLAGS"]) AC_MSG_ERROR([something wrong with LDFLAGS="$LDFLAGS"])
] ]
) )
cd .. && rm -fr tmp.$$.try_link cd .. && rm -fr tmp.$$.try_link
]) ])
skipping to change at line 642 skipping to change at line 646
# considered uninitialized unexpectedly. # considered uninitialized unexpectedly.
AC_CACHE_CHECK([whether frexp and modf are broken], AC_CACHE_CHECK([whether frexp and modf are broken],
rb_cv_mingw64_broken_frexp_modf, rb_cv_mingw64_broken_frexp_modf,
[ [
save_CFLAGS="$CFLAGS" save_CFLAGS="$CFLAGS"
AS_IF([test "$particular_werror_flags" = "yes"], [ AS_IF([test "$particular_werror_flags" = "yes"], [
CFLAGS="$CFLAGS -Werror=uninitialized" CFLAGS="$CFLAGS -Werror=uninitialized"
], [ ], [
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"
]) ])
AS_IF([test "$rb_cv_mingw64_broken_frexp_modf" = yes], [ AS_IF([test "$rb_cv_mingw64_broken_frexp_modf" = yes], [
AC_DEFINE(RUBY_MINGW64_BROKEN_FREXP_MODF) AC_DEFINE(RUBY_MINGW64_BROKEN_FREXP_MODF)
]) ])
], ],
[cygwin*|darwin*|netbsd*], [ [cygwin*|darwin*|netbsd*], [
# need lgamma_r(), finite() # need lgamma_r(), finite()
skipping to change at line 738 skipping to change at line 742
for oflag in -fno-fast-math; do for oflag in -fno-fast-math; do
RUBY_TRY_CFLAGS($oflag, [RUBY_APPEND_OPTION(CFLAGS, $oflag)]) RUBY_TRY_CFLAGS($oflag, [RUBY_APPEND_OPTION(CFLAGS, $oflag)])
done done
for oflag in -fexcess-precision=standard -fp-model\ precise; do for oflag in -fexcess-precision=standard -fp-model\ precise; do
RUBY_TRY_CFLAGS($oflag, [RUBY_APPEND_OPTION(XCFLAGS, $oflag)]) RUBY_TRY_CFLAGS($oflag, [RUBY_APPEND_OPTION(XCFLAGS, $oflag)])
done done
]) ])
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"
]) ])
]) ])
AS_IF([test "$rb_cv_gcc_compiler_cas" = i486], [ARCH_FLAG="-march=i486"]) AS_IF([test "$rb_cv_gcc_compiler_cas" = i486], [ARCH_FLAG="-march=i486"])
]) ])
AC_ARG_WITH(opt-dir, AC_ARG_WITH(opt-dir,
AS_HELP_STRING([--with-opt-dir=DIR-LIST], AS_HELP_STRING([--with-opt-dir=DIR-LIST],
skipping to change at line 771 skipping to change at line 775
LDFLAGS_OPTDIR="$val" LDFLAGS_OPTDIR="$val"
OPT_DIR="$withval" OPT_DIR="$withval"
], [OPT_DIR=]) ], [OPT_DIR=])
test -z "${ac_env_CFLAGS_set}" -a -n "${cflags+set}" && eval CFLAGS="\"$cflags $ ARCH_FLAG\"" test -z "${ac_env_CFLAGS_set}" -a -n "${cflags+set}" && eval CFLAGS="\"$cflags $ ARCH_FLAG\""
test -z "${ac_env_CXXFLAGS_set}" -a -n "${cxxflags+set}" && eval CXXFLAGS="\"$cx xflags $ARCH_FLAG\"" test -z "${ac_env_CXXFLAGS_set}" -a -n "${cxxflags+set}" && eval CXXFLAGS="\"$cx xflags $ARCH_FLAG\""
} }
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], [
AC_DEFINE(HAVE_STMT_AND_DECL_IN_EXPR) AC_DEFINE(HAVE_STMT_AND_DECL_IN_EXPR)
]) ])
: "header and library section" && { : "header and library section" && {
AC_ARG_WITH(winnt-ver, AC_ARG_WITH(winnt-ver,
AS_HELP_STRING([--with-winnt-ver=0xXXXX], [target Windows NT version (default to 0x0600)]), AS_HELP_STRING([--with-winnt-ver=0xXXXX], [target Windows NT version (default to 0x0600)]),
[with_winnt_ver="$withval"], [with_winnt_ver="0x0600"]) [with_winnt_ver="$withval"], [with_winnt_ver="0x0600"])
AS_CASE(["$target_os"], AS_CASE(["$target_os"],
[mingw*], [ [mingw*], [
RUBY_APPEND_OPTION(CPPFLAGS, -D_WIN32_WINNT=$with_winnt_ver) RUBY_APPEND_OPTION(CPPFLAGS, -D_WIN32_WINNT=$with_winnt_ver)
RUBY_APPEND_OPTION(CPPFLAGS, -D__MINGW_USE_VC2005_COMPAT) RUBY_APPEND_OPTION(CPPFLAGS, -D__MINGW_USE_VC2005_COMPAT)
]) ])
AS_CASE(["$target_os"], 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
], ],
[mingw*], [ [mingw*], [
enable_pthread=no enable_pthread=no
], ],
[ [
enable_pthread=yes enable_pthread=yes
]) ])
skipping to change at line 825 skipping to change at line 829
AS_CASE(["$target_os"], AS_CASE(["$target_os"],
[nextstep*], [ ], [nextstep*], [ ],
[openstep*], [ ], [openstep*], [ ],
[rhapsody*], [ ], [rhapsody*], [ ],
[darwin*], [ [darwin*], [
ORIG_LIBS="$LIBS" ORIG_LIBS="$LIBS"
RUBY_PREPEND_OPTION(LIBS, -lobjc) RUBY_PREPEND_OPTION(LIBS, -lobjc)
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.
[if (syscall(0)) return 1;], h>]],
[[if (syscall(0)) retu
rn 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], [
ac_cv_func___syscall=no ac_cv_func___syscall=no
ac_cv_func_syscall=no ac_cv_func_syscall=no
ac_cv_header_sys_syscall_h=no ac_cv_header_sys_syscall_h=no
ac_cv_header_syscall_h=no ac_cv_header_syscall_h=no
]) ])
ac_cv_func_getcontext=no ac_cv_func_getcontext=no
ac_cv_func_setcontext=no ac_cv_func_setcontext=no
skipping to change at line 853 skipping to change at line 857
done done
ac_cv_type_getgroups=gid_t # getgroups() on Rosetta fills garbage ac_cv_type_getgroups=gid_t # getgroups() on Rosetta fills garbage
ac_cv_lib_crypt_crypt=no ac_cv_lib_crypt_crypt=no
ac_cv_func_fdatasync=no # Mac OS X wrongly reports it has fdatasy nc() ac_cv_func_fdatasync=no # Mac OS X wrongly reports it has fdatasy nc()
ac_cv_func_vfork=no ac_cv_func_vfork=no
AS_IF([test $gcc_major -lt 4 -o \( $gcc_major -eq 4 -a $gcc_minor -lt 3 \)], [ AS_IF([test $gcc_major -lt 4 -o \( $gcc_major -eq 4 -a $gcc_minor -lt 3 \)], [
ac_cv_func___builtin_setjmp=no ac_cv_func___builtin_setjmp=no
]) ])
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_cry pt, AC_CACHE_CHECK(for broken crypt with 8bit chars, rb_cv_broken_cry pt,
[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>
void void
broken_crypt(const char *salt, const char *buf1, const char *buf2) broken_crypt(const char *salt, const char *buf1, const char *buf2)
{ {
#if 0 #if 0
printf("%.2x%.2x: %s -> %s\n", (unsigned char)salt[0], (unsigned char)salt[1 ], printf("%.2x%.2x: %s -> %s\n", (unsigned char)salt[0], (unsigned char)salt[1 ],
buf1+2, buf2+2); buf1+2, buf2+2);
skipping to change at line 890 skipping to change at line 894
} }
salt[0] = salt[1] = ' '; salt[0] = salt[1] = ' ';
strcpy(buf, crypt("", salt)); strcpy(buf, crypt("", salt));
salt[0] = salt[1] = 0x80 | ' '; salt[0] = salt[1] = 0x80 | ' ';
if (strcmp(buf, s = crypt("", salt))) { if (strcmp(buf, s = crypt("", salt))) {
broken_crypt(salt, buf, s); broken_crypt(salt, buf, s);
return 1; return 1;
} }
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)])
AS_IF([test "$rb_cv_broken_crypt" = yes], [ AS_IF([test "$rb_cv_broken_crypt" = yes], [
AC_DEFINE(BROKEN_CRYPT, 1) AC_DEFINE(BROKEN_CRYPT, 1)
]) ])
POSTLINK="" POSTLINK=""
AC_CHECK_PROGS(codesign, codesign) AC_CHECK_PROGS(codesign, codesign)
AC_CHECK_PROGS(dsymutil, dsymutil) AC_CHECK_PROGS(dsymutil, dsymutil)
AS_IF([test -n "$codesign"], [ AS_IF([test -n "$codesign"], [
skipping to change at line 919 skipping to change at line 923
]) ])
AC_CHECK_HEADERS(crt_externs.h, [], [], [ AC_CHECK_HEADERS(crt_externs.h, [], [], [
#include <crt_externs.h> #include <crt_externs.h>
]) ])
], ],
[hpux*], [ LIBS="-lm $LIBS" [hpux*], [ LIBS="-lm $LIBS"
ac_cv_c_inline=no], ac_cv_c_inline=no],
[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], [
AC_MSG_CHECKING(appropriate _XOPEN_SOURCE value to define) AC_MSG_CHECKING(appropriate _XOPEN_SOURCE value to define)
define_xopen_source="" define_xopen_source=""
for tmp_xpg in 7 6 5; do for tmp_xpg in 7 6 5; do
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
AS_IF([test x"$define_xopen_source" = x], [ AS_IF([test x"$define_xopen_source" = x], [
define_xopen_source=no define_xopen_source=no
]) ])
AC_MSG_RESULT($define_xopen_source) AC_MSG_RESULT($define_xopen_source)
AS_IF([test x"$define_xopen_source" != xno], [ AS_IF([test x"$define_xopen_source" != xno], [
RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE=$define_xopen_s ource) RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE=$define_xopen_s ource)
]) ])
skipping to change at line 1233 skipping to change at line 1237
RUBY_CHECK_SIZEOF(double) RUBY_CHECK_SIZEOF(double)
RUBY_CHECK_SIZEOF(time_t, [long "long long"], [], [@%:@include <time.h>]) RUBY_CHECK_SIZEOF(time_t, [long "long long"], [], [@%:@include <time.h>])
RUBY_CHECK_SIZEOF(clock_t, [], [], [@%:@include <time.h>]) RUBY_CHECK_SIZEOF(clock_t, [], [], [@%:@include <time.h>])
AC_CACHE_CHECK(packed struct attribute, rb_cv_packed_struct, AC_CACHE_CHECK(packed struct attribute, rb_cv_packed_struct,
[rb_cv_packed_struct=no [rb_cv_packed_struct=no
for mac in \ for mac in \
"__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], [
AC_DEFINE_UNQUOTED([PACKED_STRUCT(x)], [$rb_cv_packed_struct]) AC_DEFINE_UNQUOTED([PACKED_STRUCT(x)], [$rb_cv_packed_struct])
RUBY_TRY_CFLAGS(-Wno-address-of-packed-member, [AC_DEFINE(USE_UNALIGNED_MEMB ER_ACCESS)]) RUBY_TRY_CFLAGS(-Wno-address-of-packed-member, [AC_DEFINE(USE_UNALIGNED_MEMB ER_ACCESS)])
], [ ], [
AC_DEFINE_UNQUOTED([PACKED_STRUCT(x)], x) AC_DEFINE_UNQUOTED([PACKED_STRUCT(x)], x)
]) ])
AS_IF([test "x$ac_cv_type_long_long" = xyes], [ AS_IF([test "x$ac_cv_type_long_long" = xyes], [
skipping to change at line 1274 skipping to change at line 1278
]) ])
RUBY_REPLACE_TYPE(off_t, [], OFFT) RUBY_REPLACE_TYPE(off_t, [], OFFT)
RUBY_REPLACE_TYPE(clockid_t, [], CLOCKID, [@%:@ifdef HAVE_TIME_H RUBY_REPLACE_TYPE(clockid_t, [], CLOCKID, [@%:@ifdef HAVE_TIME_H
@%:@ include <time.h> @%:@ include <time.h>
@%:@endif @%:@endif
@%:@ifdef HAVE_SYS_TIME_H @%:@ifdef HAVE_SYS_TIME_H
@%:@ include <sys/time.h> @%:@ include <sys/time.h>
@%:@endif]) @%:@endif])
AC_CACHE_CHECK(for prototypes, rb_cv_have_prototypes, AC_CACHE_CHECK(for prototypes, rb_cv_have_prototypes,
[AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int foo(int x) { return 0; }]], [[return foo(10);]])],
rb_cv_have_prototypes=yes, rb_cv_have_prototypes=yes,
rb_cv_have_prototypes=no)]) rb_cv_have_prototypes=no)])
AS_IF([test "$rb_cv_have_prototypes" = yes], [ AS_IF([test "$rb_cv_have_prototypes" = yes], [
AC_DEFINE(HAVE_PROTOTYPES) AC_DEFINE(HAVE_PROTOTYPES)
]) ])
AC_CACHE_CHECK(token paste string, rb_cv_tokenpaste, AC_CACHE_CHECK(token paste string, rb_cv_tokenpaste,
[AC_TRY_COMPILE([@%:@define paste(a,b) a@%:@@%:@b], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@define paste(a,b) a@%:@@%:@b]],
[int xy = 1; return paste(x,y);], [[int xy = 1; return paste(x,y);]])],
rb_cv_tokenpaste=ansi, rb_cv_tokenpaste=ansi,
rb_cv_tokenpaste=knr)]) rb_cv_tokenpaste=knr)])
AS_IF([test "$rb_cv_tokenpaste" = ansi], [ AS_IF([test "$rb_cv_tokenpaste" = ansi], [
AC_DEFINE(TOKEN_PASTE(x,y),[x@%:@@%:@y]) AC_DEFINE(TOKEN_PASTE(x,y),[x@%:@@%:@y])
], [ ], [
AC_DEFINE(TOKEN_PASTE(x,y),[x/**/y]) AC_DEFINE(TOKEN_PASTE(x,y),[x/**/y])
]) ])
AC_CACHE_CHECK(stringization, rb_cv_stringization, [ AC_CACHE_CHECK(stringization, rb_cv_stringization, [
rb_cv_stringization=no rb_cv_stringization=no
skipping to change at line 1328 skipping to change at line 1332
"be" "concatenated."; "be" "concatenated.";
], [sizeof(concatenated_literal) == 26])], ], [sizeof(concatenated_literal) == 26])],
[rb_cv_string_literal_concatenation=yes], [rb_cv_string_literal_concatenation=yes],
[rb_cv_string_literal_concatenation=no])] [rb_cv_string_literal_concatenation=no])]
) )
AS_IF([test "$rb_cv_string_literal_concatenation" = no], [ AS_IF([test "$rb_cv_string_literal_concatenation" = no], [
AC_MSG_ERROR([No string literal concatenation]) AC_MSG_ERROR([No string literal concatenation])
]) ])
AC_CACHE_CHECK(for variable length prototypes and stdarg.h, rb_cv_stdarg, AC_CACHE_CHECK(for variable length prototypes and stdarg.h, rb_cv_stdarg,
[AC_TRY_COMPILE([ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdarg.h> #include <stdarg.h>
int foo(int x, ...) { int foo(int x, ...) {
va_list va; va_list va;
va_start(va, x); va_start(va, x);
va_arg(va, int); va_arg(va, int);
va_arg(va, char *); va_arg(va, char *);
va_arg(va, double); va_arg(va, double);
return 0; return 0;
} }
], [return foo(10, "", 3.14);], ]], [[return foo(10, "", 3.14);]])],
rb_cv_stdarg=yes, rb_cv_stdarg=yes,
rb_cv_stdarg=no)]) rb_cv_stdarg=no)])
AS_IF([test "$rb_cv_stdarg" = yes], [ AS_IF([test "$rb_cv_stdarg" = yes], [
AC_DEFINE(HAVE_STDARG_PROTOTYPES) AC_DEFINE(HAVE_STDARG_PROTOTYPES)
]) ])
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(int x, ...); int foo(int x, ...);
@%:@define FOO(a, ...) foo(a, @%:@@%:@__VA_ARGS__) @%:@define FOO(a, ...) foo(a, @%:@@%:@__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], [
AC_DEFINE(HAVE_VA_ARGS_MACRO) AC_DEFINE(HAVE_VA_ARGS_MACRO)
]) ])
AC_CACHE_CHECK([for alignas() syntax], rb_cv_have_alignas, [ AC_CACHE_CHECK([for alignas() syntax], rb_cv_have_alignas, [
rb_cv_have_alignas=no rb_cv_have_alignas=no
RUBY_WERROR_FLAG([ RUBY_WERROR_FLAG([
for attr in \ for attr in \
"_Alignas(x)" \ "_Alignas(x)" \
"alignas(x)" \ "alignas(x)" \
"@<:@@<:@alignas(x)@:>@@:>@" \ "@<:@@<:@alignas(x)@:>@@:>@" \
"__declspec(aligned(x))" \ "__declspec(aligned(x))" \
"__attribute__((__aligned__(x)))" \ "__attribute__((__aligned__(x)))" \
; ;
do do
# C11 _Alignas and GCC __attribute__((__aligned__)) behave # C11 _Alignas and GCC __attribute__((__aligned__)) behave
# slightly differently. What we want is GCC's. Check that # slightly differently. What we want is GCC's. Check that
# here by something C11 does not allow (`struct ALIGNAS ...`) # here by something C11 does not allow (`struct ALIGNAS ...`)
AC_TRY_COMPILE( AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
[@%:@define ALIGNAS(x) $attr [@%:@define ALIGNAS(x) $attr
struct ALIGNAS(128) conftest_tag { int foo; } foo; ], [], struct ALIGNAS(128) conftest_tag { int foo; } foo; ]], [[]])],
[rb_cv_have_alignas="$attr"; break], []) [rb_cv_have_alignas="$attr"; break], [])
done done
])]) ])])
AS_IF([test "$rb_cv_have_alignas" != no], [ AS_IF([test "$rb_cv_have_alignas" != no], [
AC_DEFINE_UNQUOTED([RUBY_ALIGNAS(x)], $rb_cv_have_alignas) AC_DEFINE_UNQUOTED([RUBY_ALIGNAS(x)], $rb_cv_have_alignas)
]) ])
AC_CACHE_CHECK([for alignof() syntax], rb_cv_have_alignof,[ AC_CACHE_CHECK([for alignof() syntax], rb_cv_have_alignof,[
rb_cv_have_alignof=no rb_cv_have_alignof=no
RUBY_WERROR_FLAG([ RUBY_WERROR_FLAG([
for expr in \ for expr in \
"alignof" \ "alignof" \
"_Alignof" \ "_Alignof" \
"__alignof" \ "__alignof" \
"__alignof__" \ "__alignof__" \
; ;
do do
AC_TRY_COMPILE([ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@ifdef HAVE_STDALIGN_H @%:@ifdef HAVE_STDALIGN_H
@%:@include <stdalign.h> @%:@include <stdalign.h>
@%:@endif],[return (int)$expr(int);], @%:@endif]],[[return (int)$expr(int);]])],
[rb_cv_have_alignof="$expr"; break], []) [rb_cv_have_alignof="$expr"; break], [])
done done
])]) ])])
AS_IF([test "$rb_cv_have_alignof" != no], [ AS_IF([test "$rb_cv_have_alignof" != no], [
AC_DEFINE_UNQUOTED(RUBY_ALIGNOF, $rb_cv_have_alignof) AC_DEFINE_UNQUOTED(RUBY_ALIGNOF, $rb_cv_have_alignof)
]) ])
RUBY_FUNC_ATTRIBUTE(__const__, CONSTFUNC) RUBY_FUNC_ATTRIBUTE(__const__, CONSTFUNC)
RUBY_FUNC_ATTRIBUTE(__pure__, PUREFUNC) RUBY_FUNC_ATTRIBUTE(__pure__, PUREFUNC)
RUBY_FUNC_ATTRIBUTE(__noreturn__, NORETURN) RUBY_FUNC_ATTRIBUTE(__noreturn__, NORETURN)
skipping to change at line 1447 skipping to change at line 1451
RUBY_FUNC_ATTRIBUTE(__stdcall__, FUNC_STDCALL, rb_cv_func_stdcall, ${if_i386} ) RUBY_FUNC_ATTRIBUTE(__stdcall__, FUNC_STDCALL, rb_cv_func_stdcall, ${if_i386} )
RUBY_FUNC_ATTRIBUTE(__cdecl__, FUNC_CDECL, rb_cv_func_cdecl, ${if_i386} ) RUBY_FUNC_ATTRIBUTE(__cdecl__, FUNC_CDECL, rb_cv_func_cdecl, ${if_i386} )
RUBY_FUNC_ATTRIBUTE(__fastcall__, FUNC_FASTCALL, rb_cv_func_fastcall, ${if_i386} ) RUBY_FUNC_ATTRIBUTE(__fastcall__, FUNC_FASTCALL, rb_cv_func_fastcall, ${if_i386} )
RUBY_FUNC_ATTRIBUTE(__optimize__("O0"), FUNC_UNOPTIMIZED, rb_cv_func_unoptimized ) RUBY_FUNC_ATTRIBUTE(__optimize__("O0"), FUNC_UNOPTIMIZED, rb_cv_func_unoptimized )
RUBY_FUNC_ATTRIBUTE(__optimize__("-Os","-fomit-frame-pointer"), FUNC_MINIMIZED, rb_cv_func_minimized) RUBY_FUNC_ATTRIBUTE(__optimize__("-Os","-fomit-frame-pointer"), FUNC_MINIMIZED, rb_cv_func_minimized)
AS_IF([test "$GCC" = yes], [ 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], [
AC_DEFINE(HAVE_ATTRIBUTE_FUNCTION_ALIAS) AC_DEFINE(HAVE_ATTRIBUTE_FUNCTION_ALIAS)
AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args)], AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args)],
[type prot __attribute__(($rb_cv_gcc_function_alias(@% :@name)));]) [type prot __attribute__(($rb_cv_gcc_function_alias(@% :@name)));])
AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION_VOID(prot, name, args)], AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION_VOID(prot, name, args)],
[RUBY_ALIAS_FUNCTION_TYPE(void, prot, name, args)]) [RUBY_ALIAS_FUNCTION_TYPE(void, prot, name, args)])
]) ])
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], [
AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS) AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS)
]) ])
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], [
AC_DEFINE(HAVE_GCC_SYNC_BUILTINS) AC_DEFINE(HAVE_GCC_SYNC_BUILTINS)
]) ])
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])
]) ])
]) ])
AS_IF([test "$rb_cv_func___builtin_unreachable" = yes], [ AS_IF([test "$rb_cv_func___builtin_unreachable" = yes], [
AC_DEFINE_UNQUOTED(UNREACHABLE, [__builtin_unreachable()]) AC_DEFINE_UNQUOTED(UNREACHABLE, [__builtin_unreachable()])
]) ])
]) ])
AC_CACHE_CHECK(for exported function attribute, rb_cv_func_exported, [ 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
])]) ])])
AS_IF([test "$rb_cv_func_exported" != no], [ AS_IF([test "$rb_cv_func_exported" != no], [
AC_DEFINE_UNQUOTED(RUBY_FUNC_EXPORTED, [$rb_cv_func_exported extern]) AC_DEFINE_UNQUOTED(RUBY_FUNC_EXPORTED, [$rb_cv_func_exported extern])
]) ])
RUBY_DECL_ATTRIBUTE([__nonnull__(n)], [RUBY_FUNC_NONNULL(n,x)], [rb_cv_func_nonn ull], RUBY_DECL_ATTRIBUTE([__nonnull__(n)], [RUBY_FUNC_NONNULL(n,x)], [rb_cv_func_nonn ull],
[], [function], [ [], [function], [
@%:@define x int conftest_attribute_check(void *p) @%:@define x int conftest_attribute_check(void *p)
@%:@define n 1 @%:@define n 1
skipping to change at line 1531 skipping to change at line 1535
RUBY_APPEND_OPTION(XCFLAGS, -DRUBY_EXPORT) RUBY_APPEND_OPTION(XCFLAGS, -DRUBY_EXPORT)
AC_ARG_ENABLE(mathn, AC_ARG_ENABLE(mathn,
AS_HELP_STRING([--disable-mathn], [disable canonicalization for mathn]), AS_HELP_STRING([--disable-mathn], [disable canonicalization for mathn]),
[mathn=$enableval], [mathn=yes]) [mathn=$enableval], [mathn=yes])
test "x$mathn" = xyes || mathn= test "x$mathn" = xyes || mathn=
AC_SUBST(MATHN, $mathn) AC_SUBST(MATHN, $mathn)
AC_CACHE_CHECK(for function name string predefined identifier, AC_CACHE_CHECK(for function name string predefined identifier,
rb_cv_function_name_string, rb_cv_function_name_string,
[rb_cv_function_name_string=no [AS_CASE(["$target_os"],[openbsd*],[
RUBY_WERROR_FLAG([ rb_cv_function_name_string=__func__
for func in __func__ __FUNCTION__; do ],[
AC_TRY_LINK([@%:@include <stdio.h>], rb_cv_function_name_string=no
[puts($func);], RUBY_WERROR_FLAG([
[rb_cv_function_name_string=$func for func in __func__ __FUNCTION__; do
break]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include <stdio.h>]],
done [[puts($func);]])],
])] [rb_cv_function_name_string=$func
break])
done
])])]
) )
AS_IF([test "$rb_cv_function_name_string" != no], [ AS_IF([test "$rb_cv_function_name_string" != no], [
AC_DEFINE_UNQUOTED(RUBY_FUNCTION_NAME_STRING, [$rb_cv_function_name_string]) AC_DEFINE_UNQUOTED(RUBY_FUNCTION_NAME_STRING, [$rb_cv_function_name_string])
]) ])
AC_CACHE_CHECK(if enum over int is allowed, rb_cv_enum_over_int, [ AC_CACHE_CHECK(if enum over int is allowed, rb_cv_enum_over_int, [
rb_cv_enum_over_int=no rb_cv_enum_over_int=no
AS_IF([test "x$ac_cv_type_long_long" = xyes], [ AS_IF([test "x$ac_cv_type_long_long" = xyes], [
type="unsigned long long" max="ULLONG_MAX" type="unsigned long long" max="ULLONG_MAX"
], [ ], [
skipping to change at line 1600 skipping to change at line 1607
ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=yes} ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=yes}
]) ])
AC_TYPE_SIZE_T AC_TYPE_SIZE_T
RUBY_CHECK_SIGNEDNESS(size_t, [AC_MSG_ERROR(size_t is signed)], [], RUBY_CHECK_SIGNEDNESS(size_t, [AC_MSG_ERROR(size_t is signed)], [],
[@%:@include <sys/types.h>]) [@%:@include <sys/types.h>])
RUBY_CHECK_SIZEOF(size_t, [int long void*], [], [@%:@include <sys/types.h>]) RUBY_CHECK_SIZEOF(size_t, [int long void*], [], [@%:@include <sys/types.h>])
RUBY_CHECK_SIZEOF(ptrdiff_t, size_t, [], [@%:@include <stddef.h>]) RUBY_CHECK_SIZEOF(ptrdiff_t, size_t, [], [@%:@include <stddef.h>])
RUBY_CHECK_PRINTF_PREFIX(size_t, z) RUBY_CHECK_PRINTF_PREFIX(size_t, z)
RUBY_CHECK_PRINTF_PREFIX(ptrdiff_t, t) RUBY_CHECK_PRINTF_PREFIX(ptrdiff_t, t)
AC_STRUCT_ST_BLKSIZE AC_CHECK_MEMBERS([struct stat.st_blksize])
AC_STRUCT_ST_BLOCKS AC_CHECK_MEMBERS([struct stat.st_blocks])
AC_STRUCT_ST_RDEV AC_CHECK_MEMBERS([struct stat.st_rdev])
RUBY_CHECK_SIZEOF([struct stat.st_size], [off_t int long "long long"], [], [@%:@ include <sys/stat.h>]) RUBY_CHECK_SIZEOF([struct stat.st_size], [off_t int long "long long"], [], [@%:@ include <sys/stat.h>])
AS_IF([test "$ac_cv_member_struct_stat_st_blocks" = yes], [ AS_IF([test "$ac_cv_member_struct_stat_st_blocks" = yes], [
RUBY_CHECK_SIZEOF([struct stat.st_blocks], [off_t int long "long long"], [], [@%:@include <sys/stat.h>]) RUBY_CHECK_SIZEOF([struct stat.st_blocks], [off_t int long "long long"], [], [@%:@include <sys/stat.h>])
]) ])
RUBY_CHECK_SIZEOF([struct stat.st_ino], [long "long long"], [], [@%:@include <sy s/stat.h>]) RUBY_CHECK_SIZEOF([struct stat.st_ino], [long "long long"], [], [@%:@include <sy s/stat.h>])
AC_CHECK_MEMBERS([struct stat.st_atim]) AC_CHECK_MEMBERS([struct stat.st_atim])
AC_CHECK_MEMBERS([struct stat.st_atimespec]) AC_CHECK_MEMBERS([struct stat.st_atimespec])
AC_CHECK_MEMBERS([struct stat.st_atimensec]) AC_CHECK_MEMBERS([struct stat.st_atimensec])
AC_CHECK_MEMBERS([struct stat.st_mtim]) AC_CHECK_MEMBERS([struct stat.st_mtim])
AC_CHECK_MEMBERS([struct stat.st_mtimespec]) AC_CHECK_MEMBERS([struct stat.st_mtimespec])
skipping to change at line 1691 skipping to change at line 1698
AS_IF([test "x$rb_cv_type_intptr_t" != xno], [ AS_IF([test "x$rb_cv_type_intptr_t" != xno], [
RUBY_CHECK_PRINTF_PREFIX(intptr_t, '' ll I64 l, PTR) RUBY_CHECK_PRINTF_PREFIX(intptr_t, '' ll I64 l, PTR)
]) ])
RUBY_DEFINT(ssize_t, size_t, [], [@%:@include <sys/types.h>]) dnl may differ fr om int, so not use AC_TYPE_SSIZE_T. RUBY_DEFINT(ssize_t, size_t, [], [@%:@include <sys/types.h>]) dnl may differ fr om int, so not use AC_TYPE_SSIZE_T.
AS_IF([test "x$rb_cv_type_int64_t" != xno], [ AS_IF([test "x$rb_cv_type_int64_t" != xno], [
RUBY_CHECK_PRINTF_PREFIX(int64_t, ll I64 l, 64) RUBY_CHECK_PRINTF_PREFIX(int64_t, ll I64 l, 64)
]) ])
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], [
AC_DEFINE_UNQUOTED(STACK_END_ADDRESS, $rb_cv_stack_end_address) AC_DEFINE_UNQUOTED(STACK_END_ADDRESS, $rb_cv_stack_end_address)
]) ])
dnl Checks for library functions. dnl Checks for library functions.
AC_TYPE_GETGROUPS AC_TYPE_GETGROUPS
AC_TYPE_SIGNAL AC_DEFINE(RETSIGTYPE, void)
AS_CASE(["${target_cpu}-${target_os}:${target_archs}"], AS_CASE(["${target_cpu}-${target_os}:${target_archs}"],
[powerpc-darwin*], [ [powerpc-darwin*], [
AC_LIBSOURCES(alloca.c) AC_LIBSOURCES(alloca.c)
AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.${ac_objext}]) AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.${ac_objext}])
AC_DEFINE(C_ALLOCA) AC_DEFINE(C_ALLOCA)
AC_DEFINE_UNQUOTED(alloca, alloca) AC_DEFINE_UNQUOTED(alloca, alloca)
], ],
[universal-darwin*:*ppc*], [ [universal-darwin*:*ppc*], [
AC_LIBSOURCES(alloca.c) AC_LIBSOURCES(alloca.c)
AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.${ac_objext}]) AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.${ac_objext}])
RUBY_DEFINE_IF([defined __powerpc__], C_ALLOCA, 1) RUBY_DEFINE_IF([defined __powerpc__], C_ALLOCA, 1)
RUBY_DEFINE_IF([defined __powerpc__], alloca, alloca) RUBY_DEFINE_IF([defined __powerpc__], alloca, alloca)
], ],
[ [
AC_FUNC_ALLOCA AC_FUNC_ALLOCA
]) ])
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"], [
AC_DEFINE_UNQUOTED(RUBY_ALLOCA_CHKSTK, _$rb_cv_dynamic_alloca) AC_DEFINE_UNQUOTED(RUBY_ALLOCA_CHKSTK, _$rb_cv_dynamic_alloca)
AS_CASE("$target_cpu", AS_CASE("$target_cpu",
[x64|x86_64], [ [x64|x86_64], [
AC_SUBST([ALLOCA], [\${LIBOBJDIR}x86_64-chkstk.${ac_objext}]) AC_SUBST([ALLOCA], [\${LIBOBJDIR}x86_64-chkstk.${ac_objext}])
],) ],)
]) ])
]) ])
skipping to change at line 1780 skipping to change at line 1787
RUBY_REPLACE_FUNC([isnan], [@%:@include <math.h>]) RUBY_REPLACE_FUNC([isnan], [@%:@include <math.h>])
# for missing/setproctitle.c # for missing/setproctitle.c
AS_CASE(["$target_os"], AS_CASE(["$target_os"],
[aix* | k*bsd*-gnu | kopensolaris*-gnu | linux* | darwin*], [AC_DEFINE(SPT_TYPE, SPT_REUSEARGV)], [aix* | k*bsd*-gnu | kopensolaris*-gnu | linux* | darwin*], [AC_DEFINE(SPT_TYPE, SPT_REUSEARGV)],
[hpux*], [AC_DEFINE(SPT_TYPE,SPT_PSTAT) ], [hpux*], [AC_DEFINE(SPT_TYPE,SPT_PSTAT) ],
[]) [])
AC_CHECK_HEADERS(sys/pstat.h) 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], [
AC_DEFINE(HAVE_SIGNBIT) AC_DEFINE(HAVE_SIGNBIT)
], [ ], [
AC_LIBOBJ([signbit]) AC_LIBOBJ([signbit])
]) ])
AC_FUNC_FORK AC_FUNC_FORK
skipping to change at line 1938 skipping to change at line 1945
AC_CHECK_FUNCS(waitpid) AC_CHECK_FUNCS(waitpid)
AS_IF([test "x$ac_cv_member_struct_statx_stx_btime" = xyes], AS_IF([test "x$ac_cv_member_struct_statx_stx_btime" = xyes],
[AC_CHECK_FUNCS(statx)]) [AC_CHECK_FUNCS(statx)])
AS_CASE(["$ac_cv_func_memset_s:$ac_cv_func_qsort_s"], [*yes*], AS_CASE(["$ac_cv_func_memset_s:$ac_cv_func_qsort_s"], [*yes*],
[RUBY_DEFINE_IF([!defined __STDC_WANT_LIB_EXT1__], [__STDC_WANT_LIB_EXT1__], 1)]) [RUBY_DEFINE_IF([!defined __STDC_WANT_LIB_EXT1__], [__STDC_WANT_LIB_EXT1__], 1)])
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_ma lloc], AC_CACHE_CHECK(if getcwd allocates buffer if NULL is given, [rb_cv_getcwd_ma lloc],
[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
@%:@include <unistd.h> @%:@include <unistd.h>
@%:@endif @%:@endif
@%:@ifndef EXIT_SUCCESS @%:@ifndef EXIT_SUCCESS
@%:@define EXIT_SUCCESS 0 @%:@define EXIT_SUCCESS 0
@%:@endif @%:@endif
@%:@ifndef EXIT_FAILURE @%:@ifndef EXIT_FAILURE
@%:@define EXIT_FAILURE 1 @%:@define EXIT_FAILURE 1
@%:@endif @%:@endif
int int
main(int argc, char **argv) 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,
[linux*|darwin*|*bsd|cygwin*|mingw*|mswin*], [linux*|darwin*|*bsd|cygwin*|mingw*|mswin*],
[rb_cv_getcwd_malloc=yes], [rb_cv_getcwd_malloc=yes],
[rb_cv_getcwd_malloc=no]))]) [rb_cv_getcwd_malloc=no]))])
AS_IF([test "$rb_cv_getcwd_malloc" = no], [AC_DEFINE(NO_GETCWD_MALLOC, 1)]) AS_IF([test "$rb_cv_getcwd_malloc" = no], [AC_DEFINE(NO_GETCWD_MALLOC, 1)])
]) ])
AS_IF([test "$ac_cv_func_crypt_r" = yes], AS_IF([test "$ac_cv_func_crypt_r" = yes],
skipping to change at line 2005 skipping to change at line 2012
RUBY_CHECK_BUILTIN_FUNC(__builtin_choose_expr_constant_p, [ RUBY_CHECK_BUILTIN_FUNC(__builtin_choose_expr_constant_p, [
[int x[__extension__(__builtin_choose_expr(__builtin_constant_p(1), 1, -1))] ]; [int x[__extension__(__builtin_choose_expr(__builtin_constant_p(1), 1, -1))] ];
[int y[__extension__(__builtin_choose_expr(__builtin_constant_p(foo), -1, 1) )]]; [int y[__extension__(__builtin_choose_expr(__builtin_constant_p(foo), -1, 1) )]];
]) ])
]) ])
RUBY_CHECK_BUILTIN_FUNC(__builtin_types_compatible_p, [__builtin_types_compatibl e_p(int, int)]) RUBY_CHECK_BUILTIN_FUNC(__builtin_types_compatible_p, [__builtin_types_compatibl e_p(int, int)])
RUBY_CHECK_BUILTIN_FUNC(__builtin_trap, [__builtin_trap()]) 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])
]) ])
AS_CASE("$rb_cv_gnu_qsort_r:$rb_cv_bsd_qsort_r", AS_CASE("$rb_cv_gnu_qsort_r:$rb_cv_bsd_qsort_r",
[yes:no], [ [yes:no], [
AC_DEFINE(HAVE_GNU_QSORT_R, 1) AC_DEFINE(HAVE_GNU_QSORT_R, 1)
], ],
[no:yes], [ [no:yes], [
AC_DEFINE(HAVE_BSD_QSORT_R, 1) AC_DEFINE(HAVE_BSD_QSORT_R, 1)
]) ])
]) ])
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>
@%:@endif @%:@endif
@%:@ifndef EXIT_SUCCESS @%:@ifndef EXIT_SUCCESS
@%:@define EXIT_SUCCESS 0 @%:@define EXIT_SUCCESS 0
@%:@endif @%:@endif
@%:@ifndef EXIT_FAILURE @%:@ifndef EXIT_FAILURE
@%:@define EXIT_FAILURE 1 @%:@define EXIT_FAILURE 1
@%:@endif @%:@endif
int int
main(int argc, char **argv) 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_at an2_inf_c99=yes])] [AS_CASE($target_os, [mingw*|mswin*], [rb_cv_atan2_inf_c99=no], [rb_cv_at an2_inf_c99=yes])]
) )
], [rb_cv_atan2_inf_c99=no]) ], [rb_cv_atan2_inf_c99=no])
]) ])
AS_IF([test "x$rb_cv_atan2_inf_c99" = xyes], [AC_DEFINE(ATAN2_INF_C99)]) AS_IF([test "x$rb_cv_atan2_inf_c99" = xyes], [AC_DEFINE(ATAN2_INF_C99)])
# Some platform need -lrt for clock_gettime, but the other don't. # Some platform need -lrt for clock_gettime, but the other don't.
AS_IF([test x"$ac_cv_func_clock_gettime" != xyes], [ AS_IF([test x"$ac_cv_func_clock_gettime" != xyes], [
skipping to change at line 2081 skipping to change at line 2088
AC_CHECK_LIB([rt], [timer_create]) AC_CHECK_LIB([rt], [timer_create])
AC_CHECK_LIB([rt], [timer_settime]) AC_CHECK_LIB([rt], [timer_settime])
AS_IF([test x"$ac_cv_lib_rt_timer_create" = xyes], [ AS_IF([test x"$ac_cv_lib_rt_timer_create" = xyes], [
AC_DEFINE(HAVE_TIMER_CREATE, 1) AC_DEFINE(HAVE_TIMER_CREATE, 1)
]) ])
AS_IF([test x"$ac_cv_lib_rt_timer_settime" = xyes], [ AS_IF([test x"$ac_cv_lib_rt_timer_settime" = xyes], [
AC_DEFINE(HAVE_TIMER_SETTIME, 1) AC_DEFINE(HAVE_TIMER_SETTIME, 1)
]) ])
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], [
AC_DEFINE(VOID_UNSETENV) AC_DEFINE(VOID_UNSETENV)
]) ])
# End of setjmp check. # End of setjmp check.
AC_ARG_ENABLE(setreuid, AC_ARG_ENABLE(setreuid,
AS_HELP_STRING([--enable-setreuid], [use setreuid()/setregid() according to need even if obsolete]), AS_HELP_STRING([--enable-setreuid], [use setreuid()/setregid() according to need even if obsolete]),
[use_setreuid=$enableval]) [use_setreuid=$enableval])
AS_IF([test "$use_setreuid" = yes], [ AS_IF([test "$use_setreuid" = yes], [
AC_DEFINE(USE_SETREUID) AC_DEFINE(USE_SETREUID)
AC_DEFINE(USE_SETREGID) AC_DEFINE(USE_SETREGID)
]) ])
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], [
AC_DEFINE(HAVE_DAYLIGHT) AC_DEFINE(HAVE_DAYLIGHT)
]) ])
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>
void void
check(tm, y, m, d, h, s) check(tm, y, m, d, h, s)
struct tm *tm; struct tm *tm;
int y, m, d, h, s; int y, m, d, h, s;
{ {
if (!tm || if (!tm ||
tm->tm_year != y || tm->tm_year != y ||
skipping to change at line 2153 skipping to change at line 2160
main() main()
{ {
time_t t = -1; time_t t = -1;
struct tm *tm; struct tm *tm;
check(gmtime(&t), 69, 12, 31, 23, 59); check(gmtime(&t), 69, 12, 31, 23, 59);
t = ~(time_t)0 << 31; t = ~(time_t)0 << 31;
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)])
AS_IF([test "$rb_cv_negative_time_t" = yes], [ AS_IF([test "$rb_cv_negative_time_t" = yes], [
AC_DEFINE(NEGATIVE_TIME_T) AC_DEFINE(NEGATIVE_TIME_T)
]) ])
# [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>
void void
check(time_t t1) check(time_t t1)
{ {
struct tm *tm; struct tm *tm;
time_t t2; time_t t2;
tm = localtime(&t1); tm = localtime(&t1);
if (!tm) if (!tm)
skipping to change at line 2196 skipping to change at line 2203
if (~(time_t)0 <= 0) { if (~(time_t)0 <= 0) {
t = (((time_t)1) << (sizeof(time_t) * 8 - 2)); t = (((time_t)1) << (sizeof(time_t) * 8 - 2));
t |= t - 1; t |= t - 1;
} }
else { else {
t = ~(time_t)0; t = ~(time_t)0;
} }
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)])
AS_IF([test "$rb_cv_localtime_overflow" = no], [ AS_IF([test "$rb_cv_localtime_overflow" = no], [
AC_DEFINE(LOCALTIME_OVERFLOW_PROBLEM) AC_DEFINE(LOCALTIME_OVERFLOW_PROBLEM)
]) ])
AS_IF([test "$ac_cv_func_sigprocmask" = yes && test "$ac_cv_func_sigaction" = ye s], [ AS_IF([test "$ac_cv_func_sigprocmask" = yes && test "$ac_cv_func_sigaction" = ye s], [
AC_DEFINE(POSIX_SIGNAL) AC_DEFINE(POSIX_SIGNAL)
], [ ], [
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>
void void
sig_handler(dummy) sig_handler(dummy)
int dummy; int dummy;
{ {
} }
int int
main() main()
{ {
signal(SIGINT, sig_handler); signal(SIGINT, sig_handler);
kill(getpid(), SIGINT); kill(getpid(), SIGINT);
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)])
AS_IF([test "$rb_cv_bsd_signal" = yes], [ AS_IF([test "$rb_cv_bsd_signal" = yes], [
AC_DEFINE(BSD_SIGNAL) AC_DEFINE(BSD_SIGNAL)
]) ])
]) ])
AC_CHECK_TYPES([sig_t],[],[],[@%:@include <signal.h>]) AC_CHECK_TYPES([sig_t],[],[],[@%:@include <signal.h>])
skipping to change at line 2396 skipping to change at line 2403
AC_CHECK_HEADERS(pthread_np.h, [], [], [@%:@include <pthread.h>]) AC_CHECK_HEADERS(pthread_np.h, [], [], [@%:@include <pthread.h>])
AS_CASE(["$pthread_lib:$target_os"], AS_CASE(["$pthread_lib:$target_os"],
[c:*], [], [c:*], [],
[root:*], [], [root:*], [],
[c_r:*|*:openbsd*|*:mirbsd*], [LIBS="-pthread $LIBS"], [c_r:*|*:openbsd*|*:mirbsd*], [LIBS="-pthread $LIBS"],
[LIBS="-l$pthread_lib $LIBS"]) [LIBS="-l$pthread_lib $LIBS"])
], [ ], [
AC_MSG_WARN("Don't know how to find pthread library on your system -- thr ead support disabled") AC_MSG_WARN("Don't know how to find pthread library on your system -- thr ead 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 <pthr ead.h>]) : # RUBY_CHECK_SIZEOF(pthread_t, [void* int long], [], [@%:@include <pthr ead.h>])
], [ ], [
AC_DEFINE(NON_SCALAR_THREAD_ID) AC_DEFINE(NON_SCALAR_THREAD_ID)
]) ])
AC_CHECK_FUNCS(sched_yield pthread_attr_setinheritsched \ AC_CHECK_FUNCS(sched_yield pthread_attr_setinheritsched \
pthread_attr_get_np pthread_attr_getstack pthread_attr_getguardsize \ pthread_attr_get_np pthread_attr_getstack pthread_attr_getguardsize \
pthread_get_stackaddr_np pthread_get_stacksize_np \ pthread_get_stackaddr_np pthread_get_stacksize_np \
thr_stksegment pthread_stackseg_np pthread_getthrds_np \ thr_stksegment pthread_stackseg_np pthread_getthrds_np \
skipping to change at line 2428 skipping to change at line 2435
AC_CACHE_CHECK([arguments of pthread_setname_np], [rb_cv_func_pthread_set name_np_arguments], AC_CACHE_CHECK([arguments of pthread_setname_np], [rb_cv_func_pthread_set name_np_arguments],
[rb_cv_func_pthread_setname_np_arguments= [rb_cv_func_pthread_setname_np_arguments=
# Linux,AIX, (pthread_self(), name) # Linux,AIX, (pthread_self(), name)
# NetBSD (pthread_self(), \"%s\", name) # NetBSD (pthread_self(), \"%s\", name)
# Darwin (name) # Darwin (name)
for mac in \ for mac in \
"(pthread_self(), name)" \ "(pthread_self(), name)" \
"(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
] ]
) )
AS_IF([test -n "${rb_cv_func_pthread_setname_np_arguments}"], [ AS_IF([test -n "${rb_cv_func_pthread_setname_np_arguments}"], [
set_current_thread_name="pthread_setname_np${rb_cv_func_pthread_setna me_np_arguments}" set_current_thread_name="pthread_setname_np${rb_cv_func_pthread_setna me_np_arguments}"
]) ])
], [test "$ac_cv_func_pthread_set_name_np" = yes], [ ], [test "$ac_cv_func_pthread_set_name_np" = yes], [
set_current_thread_name="pthread_set_name_np(pthread_self(), name)" set_current_thread_name="pthread_set_name_np(pthread_self(), name)"
skipping to change at line 2459 skipping to change at line 2466
AS_CASE([$set_current_thread_name], AS_CASE([$set_current_thread_name],
[*'pthread_self()'*], [ [*'pthread_self()'*], [
set_another_thread_name=`echo "$set_current_thread_name" | sed 's /pthread_self()/thid/'` set_another_thread_name=`echo "$set_current_thread_name" | sed 's /pthread_self()/thid/'`
AC_DEFINE_UNQUOTED(SET_ANOTHER_THREAD_NAME(thid,name), $set_anoth er_thread_name) AC_DEFINE_UNQUOTED(SET_ANOTHER_THREAD_NAME(thid,name), $set_anoth er_thread_name)
]) ])
]) ])
]) ])
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)
]) ])
]) ])
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)
], [ ], [
AC_DEFINE_UNQUOTED(DEFINE_MCONTEXT_PTR(mc, uc), mcontext_t *mc = &(uc)->u c_mcontext) AC_DEFINE_UNQUOTED(DEFINE_MCONTEXT_PTR(mc, uc), mcontext_t *mc = &(uc)->u c_mcontext)
]) ])
AS_IF([test x"$rb_with_pthread" = xyes], [ AS_IF([test x"$rb_with_pthread" = xyes], [
AC_CHECK_FUNCS(getcontext setcontext) AC_CHECK_FUNCS(getcontext setcontext)
]) ])
]) ])
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>
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <signal.h> #include <signal.h>
#ifndef EXIT_SUCCESS #ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0 #define EXIT_SUCCESS 0
#endif #endif
skipping to change at line 2545 skipping to change at line 2552
return EXIT_FAILURE; return EXIT_FAILURE;
} }
if (!WIFEXITED(loc) || WEXITSTATUS(loc) != EXIT_SUCCESS) if (!WIFEXITED(loc) || WEXITSTATUS(loc) != EXIT_SUCCESS)
return EXIT_FAILURE; return EXIT_FAILURE;
} }
else { else {
if (use_threads()) return EXIT_FAILURE; if (use_threads()) return EXIT_FAILURE;
} }
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)])
test x$rb_cv_fork_with_pthread = xyes || AC_DEFINE(CANNOT_FORK_WITH_PTHREAD) test x$rb_cv_fork_with_pthread = xyes || AC_DEFINE(CANNOT_FORK_WITH_PTHREAD)
]) ])
} }
: "runtime section" && { : "runtime section" && {
dnl wheather use dln_a_out or not dnl wheather use dln_a_out or not
AC_ARG_WITH(dln-a-out, AC_ARG_WITH(dln-a-out,
skipping to change at line 2568 skipping to change at line 2575
AS_CASE([$withval], AS_CASE([$withval],
[yes], [ [yes], [
AS_IF([test "$enable_shared" = yes], [ AS_IF([test "$enable_shared" = yes], [
AC_MSG_ERROR(dln_a_out can not make shared library) AC_MSG_ERROR(dln_a_out can not make shared library)
]) ])
with_dln_a_out=yes], with_dln_a_out=yes],
[ [
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)])
AS_IF([test "$rb_cv_binary_elf" = yes], [ AS_IF([test "$rb_cv_binary_elf" = yes], [
AC_DEFINE(USE_ELF) AC_DEFINE(USE_ELF)
AS_IF([test "$with_dln_a_out" = yes], [ AS_IF([test "$with_dln_a_out" = yes], [
AC_MSG_ERROR(dln_a_out does not work with ELF) AC_MSG_ERROR(dln_a_out does not work with ELF)
]) ])
AC_CHECK_HEADERS([elf.h elf_abi.h]) AC_CHECK_HEADERS([elf.h elf_abi.h])
skipping to change at line 2842 skipping to change at line 2849
[*-freebsd*|x86_64-netbsd*], [ [*-freebsd*|x86_64-netbsd*], [
AC_CHECK_HEADERS([execinfo.h]) AC_CHECK_HEADERS([execinfo.h])
AS_IF([test "x$ac_cv_header_execinfo_h" = xyes], [ AS_IF([test "x$ac_cv_header_execinfo_h" = xyes], [
AC_CHECK_LIB([execinfo], [backtrace]) AC_CHECK_LIB([execinfo], [backtrace])
AC_CHECK_LIB([unwind], [unw_backtrace]) AC_CHECK_LIB([unwind], [unw_backtrace])
])]) ])])
AC_CHECK_FUNCS(backtrace) 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>
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#include <execinfo.h> #include <execinfo.h>
#define TRACE_SIZE 256 #define TRACE_SIZE 256
skipping to change at line 2890 skipping to change at line 2897
} }
memset(&sa, 0, sizeof(struct sigaction)); memset(&sa, 0, sizeof(struct sigaction));
sigemptyset(&sa.sa_mask); sigemptyset(&sa.sa_mask);
sa.sa_sigaction = sigsegv; sa.sa_sigaction = sigsegv;
sa.sa_flags |= SA_SIGINFO; sa.sa_flags |= SA_SIGINFO;
sa.sa_flags |= SA_ONSTACK; sa.sa_flags |= SA_ONSTACK;
sigaction(SIGSEGV, &sa, NULL); sigaction(SIGSEGV, &sa, NULL);
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)])
AS_IF([test "$rb_cv_broken_backtrace" = yes], [ AS_IF([test "$rb_cv_broken_backtrace" = yes], [
AC_DEFINE(BROKEN_BACKTRACE, 1) AC_DEFINE(BROKEN_BACKTRACE, 1)
]) ])
]) ])
AC_ARG_WITH(valgrind, AC_ARG_WITH(valgrind,
AS_HELP_STRING([--without-valgrind],[disable valgrind memcheck support]) , AS_HELP_STRING([--without-valgrind],[disable valgrind memcheck support]) ,
[], with_valgrind=yes) [], with_valgrind=yes)
AS_IF([test x$with_valgrind != xno], AS_IF([test x$with_valgrind != xno],
[AC_CHECK_HEADERS(valgrind/memcheck.h)]) [AC_CHECK_HEADERS(valgrind/memcheck.h)])
dln_a_out_works=no dln_a_out_works=no
AS_IF([test "$ac_cv_header_a_out_h" = yes], [ 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], [
dln_a_out_works=yes dln_a_out_works=yes
AC_DEFINE(USE_DLN_A_OUT) AC_DEFINE(USE_DLN_A_OUT)
]) ])
]) ])
]) ])
AS_IF([test "$dln_a_out_works" = yes], [ AS_IF([test "$dln_a_out_works" = yes], [
skipping to change at line 2980 skipping to change at line 2986
AC_CHECK_TOOL(STRIP, strip, :)dnl AC_CHECK_TOOL(STRIP, strip, :)dnl
]) ])
AS_CASE(["$target_os"], AS_CASE(["$target_os"],
[linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu], [ [linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu], [
STRIP="$STRIP -S -x"], STRIP="$STRIP -S -x"],
[darwin*], [ [darwin*], [
STRIP="$STRIP -A -n"]) STRIP="$STRIP -A -n"])
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
AC_ARG_WITH(static-linked-ext, AC_ARG_WITH(static-linked-ext,
AS_HELP_STRING([--with-static-linked-ext], [link external modules sta tically]), AS_HELP_STRING([--with-static-linked-ext], [link external modules sta tically]),
[AS_CASE([$withval],[yes],[STATIC=;EXTSTATIC=static],[no],[],[EXTSTA TIC="$withval"])]) [AS_CASE([$withval],[yes],[STATIC=;EXTSTATIC=static],[no],[],[EXTSTA TIC="$withval"])])
AS_CASE([",$EXTSTATIC,"], [,static,|*,enc,*], [ AS_CASE([",$EXTSTATIC,"], [,static,|*,enc,*], [
ENCOBJS='enc/encinit.$(OBJEXT) enc/libenc.$(LIBEXT) enc/libtrans.$(LIBEXT)' ENCOBJS='enc/encinit.$(OBJEXT) enc/libenc.$(LIBEXT) enc/libtrans.$(LIBEXT)'
EXTOBJS='ext/extinit.$(OBJEXT)' EXTOBJS='ext/extinit.$(OBJEXT)'
AC_DEFINE_UNQUOTED(EXTSTATIC, 1) AC_DEFINE_UNQUOTED(EXTSTATIC, 1)
skipping to change at line 3442 skipping to change at line 3448
[INSTALL_STATIC_LIBRARY=$enableval], [INSTALL_STATIC_LIBRARY=$enableval],
AS_IF([test x"$enable_shared" = xyes], AS_IF([test x"$enable_shared" = xyes],
[INSTALL_STATIC_LIBRARY=no], [INSTALL_STATIC_LIBRARY=no],
[INSTALL_STATIC_LIBRARY=yes])) [INSTALL_STATIC_LIBRARY=yes]))
AC_SUBST(INSTALL_STATIC_LIBRARY) AC_SUBST(INSTALL_STATIC_LIBRARY)
AS_IF([test "$rb_with_pthread" = "yes"], [ 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']`
], ],
[rb_cv_symbol_prefix='']) [rb_cv_symbol_prefix=''])
test -n "$rb_cv_symbol_prefix" || rb_cv_symbol_prefix=NONE test -n "$rb_cv_symbol_prefix" || rb_cv_symbol_prefix=NONE
]) ])
SYMBOL_PREFIX="$rb_cv_symbol_prefix" 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
AS_CASE(["$target_os"], AS_CASE(["$target_os"],
[linux*], [ [linux*], [
], ],
[netbsd*], [ [netbsd*], [
RUBY_APPEND_OPTION(CFLAGS, -pipe) RUBY_APPEND_OPTION(CFLAGS, -pipe)
], ],
skipping to change at line 3585 skipping to change at line 3591
AC_MSG_ERROR(no candidate for safe null command) AC_MSG_ERROR(no candidate for safe null command)
]) ])
AC_MSG_RESULT($NULLCMD) AC_MSG_RESULT($NULLCMD)
]) ])
AC_SUBST(NULLCMD) AC_SUBST(NULLCMD)
AS_IF([test "${universal_binary-no}" = yes ], [ 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_arch names} |
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
], [ ], [
rb_cv_architecture_macros=no rb_cv_architecture_macros=no
archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'` archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
new_cflags=`echo "$CFLAGS" | sed "s|$archflagpat"'||'` new_cflags=`echo "$CFLAGS" | sed "s|$archflagpat"'||'`
for archs in ${universal_archnames}; do for archs in ${universal_archnames}; do
cpu=${archs@%:@*=} cpu=${archs@%:@*=}
archs=${archs%=*} archs=${archs%=*}
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_ava ilable, AC_CACHE_CHECK(whether __ARCHITECTURE__ is available, rb_cv_architecture_ava ilable,
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]))
]) ])
: ${MJIT_LDSHARED=`echo "$LDSHARED" | sed ['s|\$(LD)|'"${LD}"'|g;s|\$(CC)|$(MJIT _CC)|g']`} : ${MJIT_LDSHARED=`echo "$LDSHARED" | sed ['s|\$(LD)|'"${LD}"'|g;s|\$(CC)|$(MJIT _CC)|g']`}
MAINLIBS="$LIBS" MAINLIBS="$LIBS"
LIBS=$ORIG_LIBS LIBS=$ORIG_LIBS
AS_IF([test -n "${LIBS}"], [ AS_IF([test -n "${LIBS}"], [
libspat=`echo "${LIBS}" | sed 's/[[][|.*$^]]/\\&/g;s/^ */ /;s/^ *$/ /'` libspat=`echo "${LIBS}" | sed 's/[[][|.*$^]]/\\&/g;s/^ */ /;s/^ *$/ /'`
MAINFLAGS=`echo " $MAINLIBS " | sed "s|$libspat"'||;s/^ *//;s/ *$//'` MAINFLAGS=`echo " $MAINLIBS " | sed "s|$libspat"'||;s/^ *//;s/ *$//'`
skipping to change at line 4016 skipping to change at line 4022
], [ ], [
tmpgmk=$tmpmk tmpgmk=$tmpmk
]) && ]) &&
test -z "`${MAKE-make} -f $tmpgmk info-program | grep '^PROGRAM=ruby$'`" && test -z "`${MAKE-make} -f $tmpgmk info-program | grep '^PROGRAM=ruby$'`" &&
echo 'ruby: $(PROGRAM);' >> $tmpmk echo 'ruby: $(PROGRAM);' >> $tmpmk
test "$tmpmk" = "$tmpgmk" || rm -f "$tmpgmk" test "$tmpmk" = "$tmpgmk" || rm -f "$tmpgmk"
]) && mv -f $tmpmk Makefile], ]) && mv -f $tmpmk Makefile],
[EXEEXT='$EXEEXT' gnumake='$gnumake' GIT='$GIT']) [EXEEXT='$EXEEXT' 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)
AC_SUBST(exec, [exec]) AC_SUBST(exec, [exec])
AC_ARG_WITH(destdir, AC_ARG_WITH(destdir,
AS_HELP_STRING([--with-destdir=DESTDIR], [specify default directory t o install]), AS_HELP_STRING([--with-destdir=DESTDIR], [specify default directory t o install]),
[DESTDIR="$withval"]) [DESTDIR="$withval"])
AC_SUBST(DESTDIR) AC_SUBST(DESTDIR)
 End of changes. 94 change blocks. 
134 lines changed or deleted 143 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)