1998-01-16 15:13:05 +03:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_INIT
|
2012-08-21 20:18:10 +04:00
|
|
|
{
|
2009-05-22 15:48:52 +04:00
|
|
|
AC_CONFIG_AUX_DIR(tool)
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2013-04-01 13:41:42 +04:00
|
|
|
AC_PREREQ(2.67)
|
2002-03-14 09:23:46 +03:00
|
|
|
|
2020-04-05 04:56:28 +03:00
|
|
|
tooldir="$srcdir/tool"
|
|
|
|
|
2013-02-28 16:35:56 +04:00
|
|
|
AC_DISABLE_OPTION_CHECKING
|
|
|
|
|
2021-04-17 13:14:21 +03:00
|
|
|
m4_include([tool/m4/_colorize_result_prepare.m4])dnl
|
|
|
|
m4_include([tool/m4/ac_msg_result.m4])dnl
|
|
|
|
m4_include([tool/m4/colorize_result.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_append_option.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_append_options.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_check_builtin_func.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_check_builtin_setjmp.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_check_printf_prefix.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_check_setjmp.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_check_signedness.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_check_sizeof.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_check_sysconf.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_cppoutfile.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_decl_attribute.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_default_arch.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_define_if.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_defint.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_dtrace_available.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_dtrace_postprocess.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_func_attribute.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_mingw32.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_prepend_option.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_prog_gnu_ld.m4])dnl
|
2022-07-07 07:20:10 +03:00
|
|
|
m4_include([tool/m4/ruby_prog_makedirs.m4])dnl
|
2021-04-17 13:14:21 +03:00
|
|
|
m4_include([tool/m4/ruby_replace_funcs.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_replace_type.m4])dnl
|
2022-03-28 10:56:15 +03:00
|
|
|
m4_include([tool/m4/ruby_require_funcs.m4])dnl
|
2021-04-17 13:14:21 +03:00
|
|
|
m4_include([tool/m4/ruby_rm_recursive.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_setjmp_type.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_stack_grow_direction.m4])dnl
|
2021-10-28 09:48:45 +03:00
|
|
|
m4_include([tool/m4/ruby_thread.m4])dnl
|
2021-04-17 13:14:21 +03:00
|
|
|
m4_include([tool/m4/ruby_try_cflags.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_try_cxxflags.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_try_ldflags.m4])dnl
|
|
|
|
m4_include([tool/m4/ruby_universal_arch.m4])dnl
|
2022-01-15 17:10:48 +03:00
|
|
|
m4_include([tool/m4/ruby_wasm_tools.m4])dnl
|
2021-04-17 13:14:21 +03:00
|
|
|
m4_include([tool/m4/ruby_werror_flag.m4])dnl
|
2021-03-17 12:52:53 +03:00
|
|
|
|
2021-04-17 13:14:21 +03:00
|
|
|
AC_ARG_VAR([cflags], [additional CFLAGS (ignored when CFLAGS is given)])dnl
|
|
|
|
AC_ARG_VAR([cppflags], [additional CPPFLAGS (ignored when CPPFLAGS is given)])dnl
|
|
|
|
AC_ARG_VAR([cxxflags], [additional CXXFLAGS (ignored when CXXFLAGS is given)])dnl
|
2015-11-18 03:25:29 +03:00
|
|
|
|
2018-03-24 17:28:45 +03:00
|
|
|
: "environment section" && {
|
2017-04-10 04:46:24 +03:00
|
|
|
HAVE_BASERUBY=yes
|
2019-10-20 10:16:54 +03:00
|
|
|
BASERUBY_VERSION=
|
2007-08-16 11:48:49 +04:00
|
|
|
AC_ARG_WITH(baseruby,
|
2009-11-01 10:23:05 +03:00
|
|
|
AS_HELP_STRING([--with-baseruby=RUBY], [use RUBY as baseruby; RUBY is the pathname of ruby]),
|
2017-04-10 04:22:49 +03:00
|
|
|
[AS_CASE(["$withval"],
|
2017-04-10 04:46:24 +03:00
|
|
|
[*ruby*],[BASERUBY=$withval],
|
2017-04-10 04:22:49 +03:00
|
|
|
[no],[HAVE_BASERUBY=no],
|
|
|
|
[AC_MSG_ERROR(need ruby)])
|
2007-08-16 11:48:49 +04:00
|
|
|
],
|
|
|
|
[
|
2015-12-13 10:41:01 +03:00
|
|
|
AC_PATH_PROG([BASERUBY], [ruby], [false])
|
2007-08-16 11:48:49 +04:00
|
|
|
])
|
2020-03-03 23:24:02 +03:00
|
|
|
AS_IF([test "$HAVE_BASERUBY" != no -a "`RUBYOPT=- $BASERUBY --disable=gems -e 'print 42 if RUBY_VERSION > "2.2"' 2>/dev/null`" = 42], [
|
2022-09-02 21:21:23 +03:00
|
|
|
AS_CASE(["$build_os"], [mingw*], [
|
|
|
|
# Can MSys shell run a command with a drive letter?
|
|
|
|
RUBYOPT=- `cygpath -ma "$BASERUBY"` --disable=gems -e exit 2>/dev/null || HAVE_BASERUBY=no
|
|
|
|
])
|
2020-05-10 21:17:08 +03:00
|
|
|
BASERUBY="$BASERUBY --disable=gems"
|
|
|
|
BASERUBY_VERSION=`$BASERUBY -v`
|
2018-04-03 11:29:51 +03:00
|
|
|
$BASERUBY -C "$srcdir" tool/downloader.rb -d tool -e gnu config.guess config.sub >&AS_MESSAGE_FD
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2014-11-06 13:53:04 +03:00
|
|
|
HAVE_BASERUBY=no
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2022-09-02 21:21:23 +03:00
|
|
|
AS_IF([test "$HAVE_BASERUBY" = no], [
|
2022-09-06 07:45:45 +03:00
|
|
|
AS_IF([test "$cross_compiling" = yes], [AC_MSG_ERROR([executable host ruby is required for cross-compiling])])
|
2022-09-02 21:21:23 +03:00
|
|
|
BASERUBY="echo executable host ruby is required. use --with-baseruby option.; false"
|
|
|
|
])
|
2007-08-16 16:16:14 +04:00
|
|
|
AC_SUBST(BASERUBY)
|
2014-11-06 13:53:04 +03:00
|
|
|
AC_SUBST(HAVE_BASERUBY)
|
2007-08-16 11:48:49 +04:00
|
|
|
|
2017-04-18 08:56:34 +03:00
|
|
|
: ${GIT=git}
|
2017-04-10 04:22:48 +03:00
|
|
|
HAVE_GIT=yes
|
|
|
|
AC_ARG_WITH(git,
|
|
|
|
AS_HELP_STRING([--without-git], [never use git]),
|
|
|
|
[AS_CASE([$withval],
|
|
|
|
[no], [GIT=never-use HAVE_GIT=no],
|
2017-04-18 08:56:34 +03:00
|
|
|
[yes], [],
|
2017-04-10 04:22:48 +03:00
|
|
|
[GIT=$withval])])
|
|
|
|
AS_IF([test x"$HAVE_GIT" = xyes], [command -v "$GIT" > /dev/null || HAVE_GIT=no])
|
|
|
|
AC_SUBST(GIT)
|
|
|
|
AC_SUBST(HAVE_GIT)
|
|
|
|
|
2018-12-28 05:12:34 +03:00
|
|
|
eval `sed -n -e ['s/^@%:@define RUBY_[A-Z_]*VERSION_\([A-Z][A-Z][A-Z_0-9]*\) \([0-9][0-9]*\)$/\1=\2/p'] \
|
2022-07-12 10:44:57 +03:00
|
|
|
-e ['s/^@%:@define \(RUBY_ABI_VERSION\) \([0-9][0-9]*\).*/\1=\2/p'] \
|
2018-12-28 05:12:34 +03:00
|
|
|
-e ['s/^@%:@define \(RUBY_PATCHLEVEL\) \(.*\)/\1=\2/p'] \
|
2022-07-12 10:44:57 +03:00
|
|
|
$srcdir/include/ruby/internal/abi.h \
|
2018-12-28 05:12:34 +03:00
|
|
|
$srcdir/include/ruby/version.h $srcdir/version.h`
|
2009-02-05 08:26:22 +03:00
|
|
|
for v in MAJOR MINOR TEENY; do
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([eval "test \"\$$v\" = ''"], [
|
2009-02-05 08:26:22 +03:00
|
|
|
AC_MSG_ERROR(could not determine $v number from version.h)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2009-02-05 08:26:22 +03:00
|
|
|
done
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_SUBST(MAJOR)
|
|
|
|
AC_SUBST(MINOR)
|
|
|
|
AC_SUBST(TEENY)
|
2017-09-25 09:31:38 +03:00
|
|
|
AC_SUBST(RUBY_API_VERSION, '$(MAJOR).$(MINOR)')
|
2018-12-28 06:09:29 +03:00
|
|
|
AC_SUBST(RUBY_PROGRAM_VERSION, '$(MAJOR).$(MINOR).$(TEENY)')
|
2022-07-12 10:44:57 +03:00
|
|
|
AS_CASE([$RUBY_PATCHLEVEL], [-*], [
|
|
|
|
AC_DEFINE_UNQUOTED(RUBY_ABI_VERSION, [${RUBY_ABI_VERSION}])
|
|
|
|
], [RUBY_ABI_VERSION=])
|
2018-12-28 06:09:29 +03:00
|
|
|
|
2020-08-20 04:19:13 +03:00
|
|
|
AS_IF([test "$program_prefix" = NONE], [
|
|
|
|
program_prefix=
|
|
|
|
])
|
|
|
|
AS_IF([test "$prefix" -ef .], [
|
|
|
|
AC_MSG_ERROR(--prefix cannot be the current working directory.)
|
|
|
|
])
|
|
|
|
RUBY_BASE_NAME=`echo ruby | sed "$program_transform_name"`
|
|
|
|
RUBYW_BASE_NAME=`echo rubyw | sed "$program_transform_name"`
|
|
|
|
AC_SUBST(RUBY_BASE_NAME)
|
|
|
|
AC_SUBST(RUBYW_BASE_NAME)
|
|
|
|
AC_SUBST(RUBY_VERSION_NAME, '${RUBY_BASE_NAME}-${ruby_version}')
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
dnl checks for alternative programs
|
2011-08-03 21:49:22 +04:00
|
|
|
AC_CANONICAL_BUILD
|
2020-08-19 05:36:06 +03:00
|
|
|
AC_CANONICAL_HOST
|
|
|
|
AC_CANONICAL_TARGET
|
2021-01-22 12:29:26 +03:00
|
|
|
AS_CASE(["$target_cpu-$target_os"],
|
|
|
|
[aarch64-darwin*], [
|
|
|
|
target_cpu=arm64
|
2021-01-22 16:29:17 +03:00
|
|
|
AS_CASE(["$target_vendor"], [unknown], [target_vendor=apple target=${target/-unknown-/-apple-}])
|
|
|
|
target="${target/aarch64/arm64}"
|
|
|
|
target_alias="${target_alias/aarch64/arm64}"
|
2021-01-22 12:29:26 +03:00
|
|
|
])
|
|
|
|
|
2020-08-20 04:19:13 +03:00
|
|
|
AC_ARG_PROGRAM
|
2013-04-24 21:23:36 +04:00
|
|
|
RUBY_RM_RECURSIVE
|
2009-03-31 10:17:38 +04:00
|
|
|
AC_ARG_WITH(gcc,
|
|
|
|
AS_HELP_STRING([--without-gcc], [never use gcc]),
|
|
|
|
[
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE([$withval],
|
2010-01-21 09:10:16 +03:00
|
|
|
[no], [: ${CC=cc}],
|
|
|
|
[yes], [: ${CC=gcc}],
|
|
|
|
[CC=$withval])])
|
1998-01-16 15:13:05 +03:00
|
|
|
dnl If the user switches compilers, we can't believe the cache
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"], [
|
2002-04-19 11:39:40 +04:00
|
|
|
AC_MSG_ERROR(cached CC is different -- throw away $cache_file
|
1998-01-16 15:13:05 +03:00
|
|
|
(it is also a good idea to do 'make clean' before compiling))
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2022-01-15 17:10:48 +03:00
|
|
|
|
|
|
|
RUBY_WASM_TOOLS
|
|
|
|
|
2021-06-14 03:34:25 +03:00
|
|
|
AS_CASE(["${build_os}"],
|
|
|
|
[linux*|cygwin*|msys*], [
|
|
|
|
# Naruse prefers GCC on Linux
|
2020-08-31 08:49:56 +03:00
|
|
|
AC_CHECK_TOOLS([CC], [gcc clang cc])
|
2021-06-14 03:34:25 +03:00
|
|
|
],
|
|
|
|
[solaris*], [
|
|
|
|
# Clang on Solaris is largely untested.
|
|
|
|
# https://bugs.ruby-lang.org/issues/17949
|
|
|
|
AC_CHECK_TOOLS([CC], [cc gcc])
|
2020-08-31 08:49:56 +03:00
|
|
|
], [
|
2020-08-19 05:36:06 +03:00
|
|
|
# OpenBSD wants to prefer cc over gcc.
|
|
|
|
# See https://github.com/ruby/ruby/pull/2443
|
|
|
|
AC_CHECK_TOOLS([CC], [cl.exe clang cc gcc c99 /usr/ucb/cc])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_ARG_VAR([AR], [Archiver command])
|
|
|
|
AC_ARG_VAR([AS], [Assembler command])
|
|
|
|
AC_ARG_VAR([CC], [C compiler command])
|
|
|
|
AC_ARG_VAR([CXX], [C++ compiler command])
|
|
|
|
AC_ARG_VAR([LD], [Linker command])
|
|
|
|
AC_ARG_VAR([NM], [Symbol list command])
|
|
|
|
AC_ARG_VAR([OBJCOPY], [Objcopy command])
|
|
|
|
AC_ARG_VAR([OBJDUMP], [Objdump command])
|
|
|
|
AC_ARG_VAR([RANLIB], [Ranlib command])
|
|
|
|
AC_ARG_VAR([STRIP], [Strip command])
|
|
|
|
|
|
|
|
# We don't want to bother things like `ccache gcc`, `clang -shared-libgcc`, ...
|
|
|
|
set rb_dummy ${CC}
|
|
|
|
rb_CC=$2
|
2022-02-16 17:00:15 +03:00
|
|
|
AC_DEFUN([RUBY_CHECK_PROG_FOR_CC], [
|
|
|
|
rb_prog=`echo "${rb_CC}" | sed "$2"`
|
|
|
|
AC_CHECK_PROG([$1], [$rb_prog], [$rb_prog])
|
|
|
|
])
|
2020-08-19 05:36:06 +03:00
|
|
|
AS_CASE(["/${rb_CC} "],
|
|
|
|
[*@<:@\ /@:>@"cc "*], [
|
|
|
|
# Don't try g++/clang++ when CC=cc
|
2022-02-16 17:00:15 +03:00
|
|
|
AC_CHECK_PROGS([CXX], [cl.exe CC c++])
|
2020-08-19 05:36:06 +03:00
|
|
|
],
|
|
|
|
[*icc*], [
|
|
|
|
# Intel C++ has interprocedural optimizations. It tends to come with its
|
|
|
|
# own linker etc.
|
2022-02-16 17:00:15 +03:00
|
|
|
RUBY_CHECK_PROG_FOR_CC([AR], [s/icc/xiar/])
|
|
|
|
RUBY_CHECK_PROG_FOR_CC([CXX], [s/icc/icpc/])
|
|
|
|
RUBY_CHECK_PROG_FOR_CC([LD], [s/icc/xild/])
|
2020-08-19 05:36:06 +03:00
|
|
|
],
|
|
|
|
[*gcc*], [
|
2022-02-16 17:00:15 +03:00
|
|
|
# Ditto for GCC.
|
|
|
|
RUBY_CHECK_PROG_FOR_CC([LD], [s/gcc/ld/])
|
|
|
|
RUBY_CHECK_PROG_FOR_CC([AR], [s/gcc/gcc-ar/])
|
|
|
|
RUBY_CHECK_PROG_FOR_CC([CXX], [s/gcc/g++/])
|
|
|
|
RUBY_CHECK_PROG_FOR_CC([NM], [s/gcc/gcc-nm/])
|
|
|
|
RUBY_CHECK_PROG_FOR_CC([RANLIB], [s/gcc/gcc-ranlib/])
|
2020-08-19 05:36:06 +03:00
|
|
|
],
|
|
|
|
[*clang*], [
|
2022-02-16 17:00:15 +03:00
|
|
|
# Ditto for LLVM. Note however that llvm-as is a LLVM-IR to LLVM bitcode
|
2020-08-19 05:36:06 +03:00
|
|
|
# assembler that does not target your machine native binary.
|
|
|
|
: ${LD:="${CC}"} # ... try -fuse-ld=lld ?
|
2022-02-16 17:00:15 +03:00
|
|
|
RUBY_CHECK_PROG_FOR_CC([AR], [s/clang/llvm-ar/])
|
|
|
|
# RUBY_CHECK_PROG_FOR_CC([AS], [s/clang/llvm-as/])
|
|
|
|
RUBY_CHECK_PROG_FOR_CC([CXX], [s/clang/clang++/])
|
|
|
|
RUBY_CHECK_PROG_FOR_CC([NM], [s/clang/llvm-nm/])
|
|
|
|
RUBY_CHECK_PROG_FOR_CC([OBJCOPY], [s/clang/llvm-objcopy/])
|
|
|
|
RUBY_CHECK_PROG_FOR_CC([OBJDUMP], [s/clang/llvm-objdump/])
|
|
|
|
RUBY_CHECK_PROG_FOR_CC([RANLIB], [s/clang/llvm-ranlib/])
|
|
|
|
RUBY_CHECK_PROG_FOR_CC([STRIP], [s/clang/llvm-strip/])
|
2020-08-19 05:36:06 +03:00
|
|
|
])
|
|
|
|
AS_UNSET(rb_CC)
|
|
|
|
AS_UNSET(rb_dummy)
|
|
|
|
|
|
|
|
AS_CASE(["${build_os}"],
|
|
|
|
[solaris*], [
|
|
|
|
AC_PATH_TOOL([LD], [ld], [/usr/ccs/bin/ld], [/usr/ccs/bin:$PATH])
|
|
|
|
],
|
|
|
|
[aix*], [
|
|
|
|
AC_PATH_TOOL([NM], [nm], [/usr/ccs/bin/nm], [/usr/ccs/bin:$PATH])
|
|
|
|
])
|
|
|
|
AS_CASE(["${target_os}"],
|
2021-01-31 08:27:15 +03:00
|
|
|
[cygwin*|msys*|mingw*], [
|
2020-08-19 05:36:06 +03:00
|
|
|
ac_cv_prog_ac_ct_OBJCOPY=":"
|
|
|
|
])
|
|
|
|
|
2020-08-21 17:31:28 +03:00
|
|
|
rb_test_CFLAGS=${CFLAGS+yes}
|
|
|
|
rb_test_CXXFLAGS=${CXXFLAGS+yes}
|
|
|
|
|
2020-08-19 05:36:06 +03:00
|
|
|
# BSD's ports and MacPorts prefix GNU binutils with 'g'
|
2020-12-12 18:03:06 +03:00
|
|
|
|
|
|
|
dnl Seems necessarily in order to add -std=gnu99 option for gcc 4.9.
|
2021-09-30 12:24:37 +03:00
|
|
|
m4_version_prereq([2.70], [AC_PROG_CC], [AC_PROG_CC_C99])
|
2020-12-12 18:03:06 +03:00
|
|
|
|
2020-08-19 05:36:06 +03:00
|
|
|
AC_PROG_CXX
|
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_RANLIB
|
|
|
|
AC_CHECK_TOOLS([AR], [gar ar])
|
|
|
|
AC_CHECK_TOOLS([AS], [gas as])
|
|
|
|
AC_CHECK_TOOLS([LD], [gld ld]) # ... try gold ?
|
|
|
|
AC_CHECK_TOOLS([NM], [gnm nm])
|
|
|
|
AC_CHECK_TOOLS([OBJCOPY], [gobjcopy objcopy])
|
|
|
|
AC_CHECK_TOOLS([OBJDUMP], [gobjdump objdump])
|
|
|
|
AC_CHECK_TOOLS([STRIP], [gstrip strip], [:])
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2020-08-21 17:31:28 +03:00
|
|
|
AS_IF([test ! $rb_test_CFLAGS], [AS_UNSET(CFLAGS)]); AS_UNSET(rb_test_CFLAGS)
|
|
|
|
AS_IF([test ! $rb_test_CXXFLAGS], [AS_UNSET(CXXFLAGS)]); AS_UNSET(rb_save_CXXFLAGS)
|
|
|
|
|
2020-09-03 09:06:56 +03:00
|
|
|
AS_IF([test "${CXX}" = "g++" -a -z "${GXX}"], [
|
|
|
|
# AC_PROG_CXX sets $CXX to "g++" when it purposefully finds that there is
|
|
|
|
# _no_ g++. This brain-damaged design must be worked around. Thankfully,
|
|
|
|
# similar thing doesn't happen for AC_PROG_CC.
|
2020-12-15 10:57:28 +03:00
|
|
|
rb_there_is_in_fact_no_gplusplus_but_autoconf_is_cheating_us=true
|
2020-09-03 09:06:56 +03:00
|
|
|
])
|
|
|
|
|
2013-02-20 13:02:28 +04:00
|
|
|
test x"$target_alias" = x &&
|
2004-06-12 06:17:24 +04:00
|
|
|
target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'`
|
2006-05-24 18:52:10 +04:00
|
|
|
ac_install_sh='' # unusable for extension libraries.
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2013-11-19 18:38:52 +04:00
|
|
|
AC_ARG_WITH(os-version-style,
|
|
|
|
AS_HELP_STRING([--with-os-version-style=TYPE],
|
|
|
|
[OS version number for target and target_os [[full]]]
|
|
|
|
[(full|teeny|minor+0|minor|major+0|major|none)]),
|
2014-03-17 08:05:32 +04:00
|
|
|
[os_version_style=$withval],
|
|
|
|
[os_version_style=full
|
|
|
|
AS_CASE($target_os, [[*[0-9].*]],
|
|
|
|
[AS_CASE([`/usr/bin/ruby -e 'puts RUBY_PLATFORM' 2>/dev/null`],
|
|
|
|
[[*-*[0-9].*.0]], [os_version_style=minor+0],
|
|
|
|
[[*-*[0-9].*.*]], [os_version_style=full],
|
|
|
|
[[*-*[0-9].0] ], [os_version_style=major+0],
|
|
|
|
[[*-*[0-9].*] ], [os_version_style=minor],
|
|
|
|
[[*-*[0-9]] ], [os_version_style=major],
|
|
|
|
)])
|
|
|
|
])
|
2013-11-19 18:38:52 +04:00
|
|
|
os_version_style_transform=
|
|
|
|
AS_CASE("${os_version_style}",
|
|
|
|
[full|teeny], [],
|
|
|
|
[minor+0], [os_version_style_transform=['s/\([0-9]\.[0-9][0-9]*\)\.[0-9][.0-9]*$/\1.0/']],
|
|
|
|
[minor], [os_version_style_transform=['s/\([0-9]\.[0-9][0-9]*\)\.[0-9][.0-9]*$/\1/']],
|
|
|
|
[major+0], [os_version_style_transform=['s/\([0-9]\)\.[0-9][.0-9]*$/\1.0/']],
|
|
|
|
[major], [os_version_style_transform=['s/\([0-9]\)\.[0-9][.0-9]*$/\1/']],
|
2019-12-12 16:37:31 +03:00
|
|
|
[none], [os_version_style_transform=['s/[0-9]*\.[0-9][.0-9]*$//']],
|
2013-11-19 18:38:52 +04:00
|
|
|
[AC_MSG_ERROR(unknown --with-os-version-style: $withval)])
|
|
|
|
AS_IF([test -z "$target_alias" -a -n "$os_version_style_transform"],
|
|
|
|
[
|
|
|
|
target=`echo ${target} | sed "$os_version_style_transform"`
|
|
|
|
target_os=`echo ${target_os} | sed "$os_version_style_transform"`
|
|
|
|
])
|
|
|
|
|
2009-03-31 10:17:38 +04:00
|
|
|
AC_ARG_WITH(arch,
|
2011-11-27 12:26:54 +04:00
|
|
|
AS_HELP_STRING([--with-arch=ARCHS],
|
2009-03-31 10:17:38 +04:00
|
|
|
[build an Apple/NeXT Multi Architecture Binary (MAB);
|
* gc.c (Init_stack): stack region is far smaller than usual if
pthread is used.
* marshal.c (w_extended): singleton methods should not be checked
when dumping via marshal_dump() or _dump(). [ruby-talk:85909]
* file.c (getcwdofdrv): avoid using getcwd() directly, use
my_getcwd() instead.
* merged NeXT, OpenStep, Rhapsody ports patch from Eric Sunshine
<sunshine@sunshineco.com>. [ruby-core:01596]
* marshal.c (w_object): LINK check earlier than anything else,
i.e. do not dump TYPE_IVAR for already dumped objects.
(ruby-bugs PR#1220)
* eval.c (rb_eval): call "inherited" only when a new class is
generated; not on reopening.
* eval.c (eval): prepend error position in evaluating string to
* configure.in: revived NextStep, OpenStep, and Rhapsody ports which
had become unbuildable; enhanced --enable-fat-binary option so that
it accepts a list of desired architectures (rather than assuming a
fixed list), or defaults to a platform-appropriate list if user does
not provide an explicit list; made the default list of architectures
for MAB (fat binary) more comprehensive; now uses -fno-common even
when building the interpreter (in addition to using it for
extensions), thus allowing the interpreter to be embedded into a
plugin module of an external project (in addition to allowing
embedding directly into an application); added checks for
<netinet/in_systm.h> (needed by `socket' extension) and getcwd(); now
ensures that -I/usr/local/include is employed when extensions'
extconf.rb scripts invoke have_header() since extension checks on
NextStep and OpenStep will fail without it if the desired resource
resides in the /usr/local tree; fixed formatting of --help message.
* Makefile.in: $(LIBRUBY_A) rule now deletes the archive before
invoking $(AR) since `ar' on Apple/NeXT can not "update" MAB archives
(see configure's --enable-fat-binary option); added rule for new
missing/getcwd.c.
* defines.h: fixed endian handling during MAB build (see configure's
--enable-fat-binary option) to ensure that all portions of the
project see the correct WORDS_BIGENDIAN value (some extension modules
were getting the wrong endian setting); added missing constants
GETPGRP_VOID, WNOHANG, WUNTRACED, X_OK, and type pid_t for NextStep
and OpenStep; removed unnecessary and problematic HAVE_SYS_WAIT_H
define in NeXT section.
* dir.c: do not allow NAMLEN() macro to trust dirent::d_namlen on
NextStep since, on some installations, this value always resolves
uselessly to zero.
* dln.c: added error reporting to NextStep extension loader since the
previous behavior of failing silently was not useful; now ensures
that NSLINKMODULE_OPTION_BINDNOW compatibility constant is defined
for OpenStep and Rhapsody; no longer includes <mach-o/dyld.h> twice
on Rhapsody since this header lacks multiple-include protection,
which resulted in "redefinition" compilation errors.
* main.c: also create hard reference to objc_msgSend() on NeXT
platforms (in addition to Apple platforms).
* lib/mkmf.rb: now exports XCFLAGS from configure script to extension
makefiles so that extensions can be built MAB (see configure's
--enable-fat-binary option); also utilize XCFLAGS in cc_command()
(but not cpp_command() because MAB flags are incompatible with
direct invocation of `cpp').
* ext/curses/extconf.rb: now additionally checks for presence of these
curses functions which are not present on NextStep or Openstep:
bkgd(), bkgdset(), color(), curs(), getbkgd(), init(), scrl(), set(),
setscrreg(), wattroff(), wattron(), wattrset(), wbkgd(), wbkgdset(),
wscrl(), wsetscrreg()
* ext/curses/curses.c: added appropriate #ifdef's for additional set of
curses functions now checked by extconf.rb; fixed curses_bkgd() and
window_bkgd() to correctly return boolean result rather than numeric
result; fixed window_getbkgd() to correctly signal an error by
returning nil rather than -1.
* ext/etc/etc.c: setup_passwd() and setup_group() now check for null
pointers before invoking rb_tainted_str_new2() upon fields extracted
from `struct passwd' and `struct group' since null pointers in some
fields are common on NextStep/OpenStep (especially so for the
`pw_comment' field) and rb_tainted_str_new2() throws an exception
when it receives a null pointer.
* ext/pty/pty.c: include "util.h" for strdup()/ruby_strdup() for
platforms such as NextStep and OpenStep which lack strdup().
* ext/socket/getaddrinfo.c: cast first argument of getservbyname(),
gethostbyaddr(), and gethostbyname() from (const char*) to non-const
(char*) for older platforms such as NextStep and OpenStep.
* ext/socket/socket.c: include "util.h" for strdup()/ruby_strdup() for
platforms such as NextStep and OpenStep which lack strdup(); include
<netinet/in_systm.h> if present for NextStep and OpenStep; cast first
argument of gethostbyaddr() and getservbyname() from (const char*) to
non-const (char*) for older platforms.
* ext/syslog/syslog.c: include "util.h" for strdup()/ruby_strdup() for
platforms such as NextStep and OpenStep which lack strdup().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-22 07:00:03 +03:00
|
|
|
ARCHS is a comma-delimited list of architectures for
|
2009-02-07 12:02:50 +03:00
|
|
|
which to build; if this option is disabled or omitted
|
|
|
|
entirely, then the package will be built only for the
|
2009-03-31 10:17:38 +04:00
|
|
|
target platform]),
|
2009-02-07 12:02:50 +03:00
|
|
|
[target_archs="$withval"], [unset target_archs])
|
2009-09-15 07:01:28 +04:00
|
|
|
|
2009-03-09 18:06:22 +03:00
|
|
|
AC_ARG_ENABLE(load-relative,
|
2009-03-31 10:17:38 +04:00
|
|
|
AS_HELP_STRING([--enable-load-relative], [resolve load paths at run time]),
|
2009-03-09 18:06:22 +03:00
|
|
|
[load_relative=$enableval])
|
|
|
|
|
2020-12-12 16:55:09 +03:00
|
|
|
# checks for UNIX variants that set C preprocessor variables
|
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
dnl Checks for programs.
|
2000-02-01 06:12:21 +03:00
|
|
|
|
2009-10-10 13:59:19 +04:00
|
|
|
cflagspat=
|
|
|
|
test -z "$optflags" ||
|
|
|
|
cflagspat="$cflagspat;s|"`eval echo '"'"${optflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g'
|
|
|
|
test -z "$debugflags" ||
|
|
|
|
cflagspat="$cflagspat;s|"`eval echo '"'"${debugflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g'
|
2019-01-16 03:48:42 +03:00
|
|
|
test -z "$warnflags" ||
|
2009-10-10 13:59:19 +04:00
|
|
|
cflagspat="$cflagspat;s|"`eval echo '"'"${warnflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/ *$/ /'`'| |g'
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test -z "${CFLAGS+set}"], [
|
2009-10-10 13:59:19 +04:00
|
|
|
cflags=`echo " $cflags " | sed "$cflagspat;s/^ *//;s/ *$//"`
|
2009-04-06 15:16:15 +04:00
|
|
|
orig_cflags="$cflags"
|
2009-04-06 18:16:10 +04:00
|
|
|
cflags="$cflags "'${optflags} ${debugflags} ${warnflags}'
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2019-09-06 12:43:10 +03:00
|
|
|
dnl AS_IF([test -z "${CXXFLAGS+set}"], [
|
|
|
|
dnl cxxflags=`echo " $cxxflags " | sed "$cflagspat;s/^ *//;s/ *$//"`
|
|
|
|
dnl orig_cxxflags="$cxxflags"
|
|
|
|
dnl cxxflags="$cxxflags "'${optflags} ${debugflags} ${warnflags}'
|
|
|
|
dnl ])
|
2009-04-06 18:16:10 +04:00
|
|
|
|
2012-08-03 14:21:22 +04:00
|
|
|
AS_CASE(["$host_os:$build_os"],
|
|
|
|
[darwin*:darwin*], [
|
2013-03-31 23:18:41 +04:00
|
|
|
# Following Apple deployed clang are broken
|
|
|
|
# clang version 1.0 (http://llvm.org/svn/llvm-project/cfe/tags/Apple/clang-23 exported)
|
|
|
|
# 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)
|
2020-11-16 11:42:15 +03:00
|
|
|
AC_PREPROC_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([
|
|
|
|
@%:@if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3
|
|
|
|
@%:@error premature clang
|
|
|
|
@%:@endif
|
|
|
|
])],
|
|
|
|
[],
|
|
|
|
[AC_MSG_ERROR([clang version 3.0 or later is required])])
|
2020-08-19 05:36:06 +03:00
|
|
|
])
|
2016-06-05 16:09:43 +03:00
|
|
|
|
2019-08-19 19:11:28 +03:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[darwin*], [
|
|
|
|
AC_MSG_CHECKING(if minimum required OS X version is supported)
|
2022-05-22 10:49:48 +03:00
|
|
|
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[@%:@include <AvailabilityMacros.h>
|
2019-08-19 19:11:28 +03:00
|
|
|
@%:@if MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_5
|
|
|
|
@%:@error pre OS X 10.5
|
|
|
|
[!<===== pre OS X 10.5 =====>]
|
|
|
|
@%:@endif
|
2020-12-12 16:55:09 +03:00
|
|
|
]])],
|
2022-05-22 09:26:42 +03:00
|
|
|
[AC_MSG_RESULT(yes)],
|
2019-08-19 19:11:28 +03:00
|
|
|
[AC_MSG_RESULT(no)
|
|
|
|
AC_MSG_ERROR([Unsupported OS X version is required])])
|
2022-05-22 10:49:48 +03:00
|
|
|
AC_CACHE_CHECK([if thread-local storage is supported], [rb_cv_tls_supported],
|
|
|
|
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[int __thread conftest;]])],
|
|
|
|
[rb_cv_tls_supported=yes],
|
|
|
|
[rb_cv_tls_supported=no])])
|
|
|
|
AS_IF([test x"$rb_cv_tls_supported" != xyes],
|
|
|
|
[AC_DEFINE(RB_THREAD_LOCAL_SPECIFIER_IS_UNSUPPORTED)])
|
2019-08-19 19:11:28 +03:00
|
|
|
])
|
|
|
|
|
2012-08-03 12:27:04 +04:00
|
|
|
RUBY_MINGW32
|
2009-09-12 12:31:44 +04:00
|
|
|
AC_SUBST(GCC)
|
2012-05-16 09:39:06 +04:00
|
|
|
AC_SUBST(LD)
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$GCC" = yes], [
|
2007-04-17 21:17:15 +04:00
|
|
|
linker_flag=-Wl,
|
2011-07-23 19:57:21 +04:00
|
|
|
: ${optflags=-O3}
|
2013-04-05 18:08:21 +04:00
|
|
|
gcc_major=`echo =__GNUC__ | $CC -E -xc - | sed '/^=/!d;s///'`
|
2014-10-29 05:48:25 +03:00
|
|
|
gcc_minor=`echo =__GNUC_MINOR__ | $CC -E -xc - | sed '/^=/!d;s///'`
|
2013-04-05 18:08:21 +04:00
|
|
|
test -n "$gcc_major" || gcc_major=0
|
2014-10-29 05:48:25 +03:00
|
|
|
test -n "$gcc_minor" || gcc_minor=0
|
2019-08-25 17:08:13 +03:00
|
|
|
icc_version=`echo =__ICC | $CC -E -xc - | sed '/^=/!d;s///;/^__ICC/d'`
|
2017-12-15 12:43:40 +03:00
|
|
|
test -n "$icc_version" || icc_version=0
|
2013-04-05 14:29:42 +04:00
|
|
|
# RUBY_APPEND_OPTIONS(XCFLAGS, ["-include ruby/config.h" "-include ruby/missing.h"])
|
2022-06-18 07:40:46 +03:00
|
|
|
|
2022-06-18 07:46:40 +03:00
|
|
|
AS_IF([test "$gcc_major" -lt 4], [
|
2022-06-18 07:40:46 +03:00
|
|
|
AC_MSG_ERROR([too old GCC: $gcc_major.$gcc_minor])
|
|
|
|
])
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2007-04-17 21:17:15 +04:00
|
|
|
linker_flag=
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2000-02-01 06:12:21 +03:00
|
|
|
|
2002-10-04 09:18:05 +04:00
|
|
|
RUBY_PROG_GNU_LD
|
2002-09-23 15:01:49 +04:00
|
|
|
RUBY_CPPOUTFILE
|
|
|
|
|
2003-11-30 12:33:03 +03:00
|
|
|
: ${OUTFLAG='-o '}
|
2007-12-24 06:49:56 +03:00
|
|
|
: ${COUTFLAG=${OUTFLAG}}
|
2016-07-11 19:30:03 +03:00
|
|
|
: ${CSRCFLAG=''}
|
2002-09-15 16:57:21 +04:00
|
|
|
AC_SUBST(OUTFLAG)
|
2007-12-24 06:49:56 +03:00
|
|
|
AC_SUBST(COUTFLAG)
|
2016-07-11 19:30:03 +03:00
|
|
|
AC_SUBST(CSRCFLAG)
|
2002-09-15 16:57:21 +04:00
|
|
|
|
2018-11-06 15:08:54 +03:00
|
|
|
: ${MJIT_CC=$CC}
|
|
|
|
AS_IF([test "x$cross_compiling" = xno], [
|
2018-11-09 16:00:03 +03:00
|
|
|
AC_PATH_PROG([MJIT_CC], ${MJIT_CC})
|
2020-01-02 20:00:58 +03:00
|
|
|
|
|
|
|
# if $CC is in /usr/lib/ccache/$CC, search original $CC (disable ccache)
|
2020-01-02 22:39:34 +03:00
|
|
|
AS_IF([echo $RUBY_DEBUG | grep ci > /dev/null &&
|
|
|
|
echo $MJIT_CC | grep ^/usr/lib/ccache > /dev/null], [
|
2020-01-02 20:00:58 +03:00
|
|
|
PATH=`echo $PATH | sed "s/\/usr\/lib\/ccache://"` MJIT_CC=`which $CC`])
|
|
|
|
|
2018-11-07 17:27:27 +03:00
|
|
|
AS_CASE([$target_os],
|
2018-11-21 12:11:06 +03:00
|
|
|
[*mingw*], [command -v cygpath > /dev/null && MJIT_CC=`cygpath -ma $MJIT_CC`])
|
2018-11-06 15:08:54 +03:00
|
|
|
shift 2
|
|
|
|
MJIT_CC="$MJIT_CC${1+ }$*"
|
|
|
|
])
|
|
|
|
|
2018-09-21 16:52:03 +03:00
|
|
|
AS_CASE(["$build_os"],
|
|
|
|
[darwin1*.*], [
|
|
|
|
# Xcode linker warns for deprecated architecture and wrongly
|
|
|
|
# installed TBD files.
|
|
|
|
CC_WRAPPER=""
|
2018-11-04 02:10:57 +03:00
|
|
|
echo 'int main(void) {return 0;}' > conftest.c
|
|
|
|
AS_IF([$CC -framework Foundation -o conftest conftest.c 2>&1 |
|
|
|
|
grep '^ld: warning: text-based stub file' >/dev/null], [
|
2020-04-05 04:56:28 +03:00
|
|
|
CC_WRAPPER=`cd -P "${tooldir}" && pwd`/darwin-cc
|
2018-09-21 16:52:03 +03:00
|
|
|
CC="$CC_WRAPPER $CC"
|
|
|
|
])
|
2018-11-04 02:10:57 +03:00
|
|
|
rm -fr conftest*
|
2018-09-21 16:52:03 +03:00
|
|
|
])
|
2022-01-15 17:10:48 +03:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[wasi*], [
|
|
|
|
# Clang linker automatically uses wasm-opt with -O if it found.
|
|
|
|
# https://github.com/llvm/llvm-project/blob/812828984c10857a4cd260eb638c52a4411f9143/clang/lib/Driver/ToolChains/WebAssembly.cpp#L95-L118
|
|
|
|
# However optimization before asyncify causes misoptimization,
|
|
|
|
# so wrap clang to insert our fake wasm-opt, which does nothing, in PATH.
|
|
|
|
CC_WRAPPER=`cd -P "${tooldir}" && pwd`/wasm-clangw
|
|
|
|
CC="$CC_WRAPPER $CC"
|
|
|
|
])
|
2018-09-21 16:52:03 +03:00
|
|
|
|
2013-04-05 18:08:27 +04:00
|
|
|
cc_version=
|
2013-03-22 11:57:09 +04:00
|
|
|
for option in --version -v -V -qversion; do
|
2013-05-17 13:10:16 +04:00
|
|
|
cc_version_message=`$CC $option 2>&1`
|
|
|
|
cc_version_status=$?
|
|
|
|
AS_CASE($cc_version_status, [0], [:], [continue])
|
|
|
|
AS_CASE($cc_version_message, [*Warning*], [continue])
|
2013-03-22 11:57:09 +04:00
|
|
|
cc_version='$(CC) '$option
|
2016-11-04 09:37:09 +03:00
|
|
|
break
|
2013-03-22 11:57:09 +04:00
|
|
|
done
|
|
|
|
AC_SUBST(CC_VERSION, $cc_version)
|
2016-11-04 09:37:09 +03:00
|
|
|
AC_SUBST(CC_VERSION_MESSAGE, $cc_version_message)
|
2013-03-22 11:57:09 +04:00
|
|
|
|
2018-03-16 04:48:02 +03:00
|
|
|
: ${DLDFLAGS="$LDFLAGS"}
|
|
|
|
|
2009-09-15 07:01:28 +04:00
|
|
|
RUBY_UNIVERSAL_ARCH
|
2020-11-21 17:21:52 +03:00
|
|
|
AS_IF([test "$target_cpu" != "$host_cpu" -a "$GCC" = yes -a "$cross_compiling" = no -a "${universal_binary:-no}" = no], [
|
2010-07-13 15:58:58 +04:00
|
|
|
RUBY_DEFAULT_ARCH("$target_cpu")
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2020-11-21 17:21:52 +03:00
|
|
|
host_os=$target_os
|
|
|
|
host_vendor=$target_vendor
|
|
|
|
host_cpu=$target_cpu
|
|
|
|
host=$target
|
|
|
|
host_alias=$target_alias
|
2002-09-23 15:01:49 +04:00
|
|
|
|
2017-07-31 07:04:10 +03:00
|
|
|
AC_CACHE_CHECK([for $AR flags], [rb_cv_arflags], [
|
2016-02-10 06:03:57 +03:00
|
|
|
AS_IF([$AR rcD conftest.a > /dev/null 2>&1 && rm conftest.a],
|
2017-07-31 07:04:10 +03:00
|
|
|
[rb_cv_arflags=rcD], [rb_cv_arflags=rcu])
|
2016-02-10 06:03:57 +03:00
|
|
|
])
|
2017-07-31 07:04:10 +03:00
|
|
|
AC_SUBST(ARFLAGS, ["$rb_cv_arflags "])
|
2006-07-26 17:28:17 +04:00
|
|
|
AC_SUBST(ASFLAGS)
|
|
|
|
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
2021-01-31 08:27:15 +03:00
|
|
|
[cygwin*|msys*|mingw*], [
|
2001-01-31 17:27:37 +03:00
|
|
|
AC_CHECK_TOOL(WINDRES, windres)
|
2002-06-11 14:26:13 +04:00
|
|
|
AC_CHECK_TOOL(DLLWRAP, dllwrap)
|
2009-10-23 09:25:56 +04:00
|
|
|
target=`echo $target | sed "s/^$target_cpu-/-/"`
|
|
|
|
target_alias=`echo $target_alias | sed "s/^$target_cpu-/-/"`
|
2001-11-30 12:17:30 +03:00
|
|
|
target_cpu=`echo $target_cpu | sed s/i.86/i386/`
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target"], [-*], [ target="$target_cpu${target}"])
|
|
|
|
AS_CASE(["$target_alias"], [-*], [ target_alias="$target_cpu${target_alias}"])
|
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[mingw*], [
|
2005-04-13 14:25:41 +04:00
|
|
|
test "$rb_cv_msvcrt" = "" && unset rb_cv_msvcrt
|
|
|
|
AC_CACHE_CHECK(for mingw32 runtime DLL, rb_cv_msvcrt, [
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include <stdio.h>]],
|
|
|
|
[[FILE* volatile f = stdin; return 0;]])],
|
2005-04-13 14:25:41 +04:00
|
|
|
[rb_cv_msvcrt=`$OBJDUMP -p conftest$ac_exeext |
|
2008-08-10 07:15:37 +04:00
|
|
|
tr A-Z a-z |
|
2021-06-21 15:44:24 +03:00
|
|
|
sed -n '/^[[ ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;};
|
|
|
|
/^[[ ]]*dll name: \(ucrtbase\|api-ms-win-crt-.*\)\.dll$/{s//ucrt/p;q;}'`],
|
2006-07-17 18:32:02 +04:00
|
|
|
[rb_cv_msvcrt=msvcrt])
|
|
|
|
test "$rb_cv_msvcrt" = "" && rb_cv_msvcrt=msvcrt])
|
2012-04-16 11:08:27 +04:00
|
|
|
RT_VER=`echo "$rb_cv_msvcrt" | tr -cd [0-9]`
|
|
|
|
test "$RT_VER" = "" && RT_VER=60
|
2021-06-21 15:44:24 +03:00
|
|
|
test "$rb_cv_msvcrt" = "ucrt" && RT_VER=140
|
2012-04-16 11:08:27 +04:00
|
|
|
AC_DEFINE_UNQUOTED(RUBY_MSVCRT_VERSION, $RT_VER)
|
2017-10-24 16:48:08 +03:00
|
|
|
sysconfdir=
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
2022-09-14 04:42:38 +03:00
|
|
|
rb_cv_binary_elf=no
|
2001-11-30 12:17:30 +03:00
|
|
|
: ${enable_shared=yes}
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
2010-01-21 09:10:16 +03:00
|
|
|
[hiuxmpp*], [AC_DEFINE(__HIUX_MPP__)]) # by TOYODA Eizi <toyoda@npd.kishou.go.jp>
|
2002-05-02 11:50:36 +04:00
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_PROG_LN_S
|
1998-01-16 15:13:05 +03:00
|
|
|
AC_PROG_MAKE_SET
|
2005-04-16 10:27:43 +04:00
|
|
|
AC_PROG_INSTALL
|
2022-07-08 22:52:40 +03:00
|
|
|
|
|
|
|
AS_CASE(["$target_os"],[openbsd*],[
|
|
|
|
ac_cv_path_mkdir="mkdir"
|
|
|
|
])
|
|
|
|
|
2022-07-07 07:20:10 +03:00
|
|
|
RUBY_PROG_MAKEDIRS
|
1998-01-16 15:13:05 +03:00
|
|
|
|
* configure.in, Makefile.in, common.mk: support DTrace on Solaris 10,
based on r26235 by Yugui. On Solaris 10, low optimization level
may also be needed, e.g. optflags="-xO1" or "-xO0" with Oracle
SolarisStudio 12.3 cc.
* configure.in (--enable-dtrace): new option to enable/disable
DTrace support. By default, trying to enable if dtrace command
is found on the system. It is disabled when cross compiling.
* configure.in (RUBY_DTRACE_POSTPROCESS): new macro. checks whether
the dtrace on the system needs postprocessing with "dtrace -G".
The postprocessing is needed on Solaris 10 and other platforms.
* configure.in (RUBY_DTRACE_BSD_BROKEN): new macro. checks whether
the dtrace supports USDT.
* configure.in (DTRACE): move after RUBY_DTRACE_POSTPROCESS.
* configure.in (LD): On Solaris, /usr/ccs/bin/ld is preferred.
* configure.in, Makefile.in, common.mk (DTRACE_OBJ): new macro for
DTrace probe object generated by postprocessing with "dtrace -G".
* Makefile.in, common.mk (probes.$(OBJEXT)): DTrace probe object
generated by the postprocessing. New file probes.stamp is for
rebuilding related objects that may be modified by "dtrace -G".
* configure.in, Makefile.in, common.mk (DTRACE_GLOMMED_OBJ): new
macro for DTrace static library hacks.
* configure.in, Makefile.in (LIBRUBY_A_OBJS): ditto.
* Makefile.in, common.mk (ruby-glommed.$(OBJEXT)): new target with
rule for DTrace static library hacks.
* common.mk (DTRACE_DEPENDENT_OBJS): objects depended on probes.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-18 12:24:24 +04:00
|
|
|
AC_CHECK_PROG([DTRACE], [${ac_tool_prefix}dtrace], [${ac_tool_prefix}dtrace])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$cross_compiling:$ac_cv_prog_DTRACE" = no: -a -n "$ac_tool_prefix"], [
|
* configure.in, Makefile.in, common.mk: support DTrace on Solaris 10,
based on r26235 by Yugui. On Solaris 10, low optimization level
may also be needed, e.g. optflags="-xO1" or "-xO0" with Oracle
SolarisStudio 12.3 cc.
* configure.in (--enable-dtrace): new option to enable/disable
DTrace support. By default, trying to enable if dtrace command
is found on the system. It is disabled when cross compiling.
* configure.in (RUBY_DTRACE_POSTPROCESS): new macro. checks whether
the dtrace on the system needs postprocessing with "dtrace -G".
The postprocessing is needed on Solaris 10 and other platforms.
* configure.in (RUBY_DTRACE_BSD_BROKEN): new macro. checks whether
the dtrace supports USDT.
* configure.in (DTRACE): move after RUBY_DTRACE_POSTPROCESS.
* configure.in (LD): On Solaris, /usr/ccs/bin/ld is preferred.
* configure.in, Makefile.in, common.mk (DTRACE_OBJ): new macro for
DTrace probe object generated by postprocessing with "dtrace -G".
* Makefile.in, common.mk (probes.$(OBJEXT)): DTrace probe object
generated by the postprocessing. New file probes.stamp is for
rebuilding related objects that may be modified by "dtrace -G".
* configure.in, Makefile.in, common.mk (DTRACE_GLOMMED_OBJ): new
macro for DTrace static library hacks.
* configure.in, Makefile.in (LIBRUBY_A_OBJS): ditto.
* Makefile.in, common.mk (ruby-glommed.$(OBJEXT)): new target with
rule for DTrace static library hacks.
* common.mk (DTRACE_DEPENDENT_OBJS): objects depended on probes.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-18 12:24:24 +04:00
|
|
|
AC_CHECK_PROG([DTRACE], [dtrace], [dtrace])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
* configure.in, Makefile.in, common.mk: support DTrace on Solaris 10,
based on r26235 by Yugui. On Solaris 10, low optimization level
may also be needed, e.g. optflags="-xO1" or "-xO0" with Oracle
SolarisStudio 12.3 cc.
* configure.in (--enable-dtrace): new option to enable/disable
DTrace support. By default, trying to enable if dtrace command
is found on the system. It is disabled when cross compiling.
* configure.in (RUBY_DTRACE_POSTPROCESS): new macro. checks whether
the dtrace on the system needs postprocessing with "dtrace -G".
The postprocessing is needed on Solaris 10 and other platforms.
* configure.in (RUBY_DTRACE_BSD_BROKEN): new macro. checks whether
the dtrace supports USDT.
* configure.in (DTRACE): move after RUBY_DTRACE_POSTPROCESS.
* configure.in (LD): On Solaris, /usr/ccs/bin/ld is preferred.
* configure.in, Makefile.in, common.mk (DTRACE_OBJ): new macro for
DTrace probe object generated by postprocessing with "dtrace -G".
* Makefile.in, common.mk (probes.$(OBJEXT)): DTrace probe object
generated by the postprocessing. New file probes.stamp is for
rebuilding related objects that may be modified by "dtrace -G".
* configure.in, Makefile.in, common.mk (DTRACE_GLOMMED_OBJ): new
macro for DTrace static library hacks.
* configure.in, Makefile.in (LIBRUBY_A_OBJS): ditto.
* Makefile.in, common.mk (ruby-glommed.$(OBJEXT)): new target with
rule for DTrace static library hacks.
* common.mk (DTRACE_DEPENDENT_OBJS): objects depended on probes.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-18 12:24:24 +04:00
|
|
|
|
2012-04-18 17:59:00 +04:00
|
|
|
AC_CHECK_PROGS(DOT, dot)
|
|
|
|
AC_CHECK_PROGS(DOXYGEN, doxygen)
|
2009-06-29 19:34:05 +04:00
|
|
|
|
2022-09-11 13:10:24 +03:00
|
|
|
AC_CHECK_TOOL(PKG_CONFIG, pkg-config)
|
|
|
|
AS_IF([test -z "$PKG_CONFIG"], [],
|
|
|
|
["$PKG_CONFIG" --print-errors --version > /dev/null 2>&1], [],
|
|
|
|
[
|
|
|
|
unset ac_cv_prog_PKG_CONFIG
|
|
|
|
PKG_CONFIG=
|
|
|
|
AC_MSG_WARN([$PKG_CONFIG does not work; ignore])
|
|
|
|
])
|
2010-10-30 09:37:43 +04:00
|
|
|
|
2020-04-21 19:45:19 +03:00
|
|
|
AC_MSG_CHECKING([whether it is Android])
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
2021-04-17 13:08:53 +03:00
|
|
|
@%:@ifndef __ANDROID__
|
|
|
|
@%:@error Not android
|
2020-04-21 19:45:19 +03:00
|
|
|
@%:@endif
|
2020-12-12 16:55:09 +03:00
|
|
|
]], [[]])],
|
2020-04-21 19:45:19 +03:00
|
|
|
[
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
target_os=${target_os}-android
|
2021-01-05 04:16:05 +03:00
|
|
|
AS_IF([test "x$cross_compiling" = xno], [
|
|
|
|
AC_MSG_CHECKING([for Android API version])
|
|
|
|
# hacky workaround: https://github.com/termux/termux-packages/issues/6176
|
|
|
|
rb_android_api=`getprop ro.build.version.sdk`
|
|
|
|
AC_MSG_RESULT($rb_android_api)
|
|
|
|
RUBY_APPEND_OPTIONS(CPPFLAGS, -D__ANDROID_API__=$rb_android_api -Wno-macro-redefined)
|
|
|
|
])
|
2021-04-17 13:08:53 +03:00
|
|
|
],
|
|
|
|
[AC_MSG_RESULT(no)])
|
2020-04-21 19:45:19 +03:00
|
|
|
|
2004-02-09 11:48:55 +03:00
|
|
|
AC_SUBST(RM, ['rm -f'])
|
2005-04-02 17:30:49 +04:00
|
|
|
AC_SUBST(CP, ['cp'])
|
2010-03-22 12:01:19 +03:00
|
|
|
RMDIRS='$(top_srcdir)/tool/rmdirs'
|
2010-07-22 01:26:56 +04:00
|
|
|
RMDIR=rmdir
|
2010-03-22 12:01:19 +03:00
|
|
|
mkdir "rmdirs_$$_test" "rmdirs_$$_test/a"
|
2010-07-22 01:26:56 +04:00
|
|
|
rmdir --ignore-fail-on-non-empty "rmdirs_$$_test" 2>/dev/null &&
|
|
|
|
RMDIR='rmdir --ignore-fail-on-non-empty'
|
|
|
|
$RMDIR -p "rmdirs_$$_test/a" 2>/dev/null &&
|
|
|
|
{ test -d "rmdirs_$$_test" || RMDIRS="$RMDIR -p"; }
|
2010-03-22 12:01:19 +03:00
|
|
|
rmdir "rmdirs_$$_test/a" "rmdirs_$$_test" 2>/dev/null
|
2010-07-22 01:26:56 +04:00
|
|
|
AC_SUBST(RMDIR)
|
2010-03-22 12:01:19 +03:00
|
|
|
AC_SUBST(RMDIRS)
|
2009-01-25 05:06:29 +03:00
|
|
|
AC_SUBST(RMALL, ['rm -fr'])
|
2004-02-09 11:48:55 +03:00
|
|
|
|
2011-02-08 13:26:42 +03:00
|
|
|
AC_MSG_CHECKING([for cd using physical directory])
|
2009-03-06 12:37:31 +03:00
|
|
|
rm -fr conf$$.dir
|
|
|
|
mkdir conf$$.dir &&
|
|
|
|
(cd conf$$.dir && mkdir src build && cd src &&
|
|
|
|
$as_ln_s ../build . > /dev/null 2>&1 && cd build &&
|
|
|
|
for chdir in 'cd -P' 'PWD= cd'; do
|
2009-03-07 12:47:05 +03:00
|
|
|
/bin/sh -c "$chdir ../src && echo '$chdir' > cdcmd" 2> /dev/null && break
|
2009-03-06 12:37:31 +03:00
|
|
|
done)
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test -f conf$$.dir/src/cdcmd], [
|
2009-03-07 12:47:05 +03:00
|
|
|
read CHDIR < conf$$.dir/src/cdcmd 2> /dev/null
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2009-03-06 12:37:31 +03:00
|
|
|
CHDIR=cd
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2009-03-06 12:37:31 +03:00
|
|
|
rm -fr conf$$.dir
|
|
|
|
AC_MSG_RESULT([$CHDIR])
|
|
|
|
AC_SUBST(CHDIR)
|
2012-08-21 20:18:10 +04:00
|
|
|
}
|
2009-02-09 22:34:43 +03:00
|
|
|
|
2018-03-24 17:28:45 +03:00
|
|
|
: "compiler section" && {
|
2013-10-22 07:11:20 +04:00
|
|
|
RUBY_WERROR_FLAG([
|
|
|
|
AC_MSG_CHECKING([whether CFLAGS is valid])
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
2013-10-22 07:11:20 +04:00
|
|
|
[AC_MSG_RESULT(yes)],
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
AC_MSG_ERROR([something wrong with CFLAGS="$CFLAGS"])
|
|
|
|
]
|
|
|
|
)
|
2018-09-20 17:30:21 +03:00
|
|
|
|
2013-10-22 07:11:20 +04:00
|
|
|
AC_MSG_CHECKING([whether LDFLAGS is valid])
|
2014-05-21 06:42:33 +04:00
|
|
|
{
|
|
|
|
mkdir tmp.$$.try_link &&
|
|
|
|
cd tmp.$$.try_link &&
|
|
|
|
cp ../confdefs.h . &&
|
|
|
|
echo '<?xml?><plist><dict><key>CFBundleIdentifier</key><string></string></dict></plist>' > Info.plist &&
|
|
|
|
:
|
2016-04-21 15:16:14 +03:00
|
|
|
} || AC_MSG_ERROR([failed to make temporary directory])
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
2013-10-22 07:11:20 +04:00
|
|
|
[AC_MSG_RESULT(yes)],
|
|
|
|
[
|
2014-05-21 06:42:33 +04:00
|
|
|
cd .. && rm -fr tmp.$$.try_link
|
2013-10-22 07:11:20 +04:00
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
AC_MSG_ERROR([something wrong with LDFLAGS="$LDFLAGS"])
|
|
|
|
]
|
|
|
|
)
|
2014-05-21 06:42:33 +04:00
|
|
|
cd .. && rm -fr tmp.$$.try_link
|
2013-10-22 07:11:20 +04:00
|
|
|
])
|
|
|
|
|
2022-09-14 04:42:38 +03:00
|
|
|
: "rpath" && {
|
|
|
|
AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf,
|
|
|
|
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[
|
|
|
|
AS_CASE(["`head -1 conftest$EXEEXT | tr -dc '\177ELF' | tr '\177' .`"],
|
|
|
|
[.ELF*], [rb_cv_binary_elf=yes], [rb_cv_binary_elf=no])],
|
|
|
|
[rb_cv_binary_elf=no])])
|
|
|
|
|
|
|
|
rpathflag=''
|
|
|
|
AS_IF([test x"${RPATHFLAG=}" = x], [
|
|
|
|
AS_CASE(["$target_os"],
|
2017-04-09 14:44:01 +03:00
|
|
|
[aix*], [rpathflag='-blibpath:'],
|
2022-09-14 04:42:38 +03:00
|
|
|
[for rpathflag in "-rpath " -R; do
|
2017-04-09 14:44:01 +03:00
|
|
|
AS_CASE("$rpathflag",
|
|
|
|
[*" "], [AS_CASE(["${linker_flag}"],
|
|
|
|
[*,], [rpathflag=`echo "$rpathflag" | tr ' ' ,`])])
|
|
|
|
rpathflag="${linker_flag}${rpathflag}"
|
|
|
|
RUBY_TRY_LDFLAGS([${rpathflag}.], [], [rpathflag=])
|
2022-09-14 04:42:38 +03:00
|
|
|
AS_IF([test "x${rpathflag}" != x], [break])
|
2017-04-09 14:44:01 +03:00
|
|
|
done])
|
2022-09-14 04:42:38 +03:00
|
|
|
], [
|
|
|
|
rpathflag=`echo "$RPATHFLAG" | sed 's/%.*//'`
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(rpath,
|
|
|
|
AS_HELP_STRING([--enable-rpath], [embed run path into extension libraries.
|
|
|
|
enabled by default on ELF platforms]),
|
|
|
|
[enable_rpath=$enableval], [enable_rpath="$rb_cv_binary_elf"])
|
|
|
|
|
|
|
|
AS_IF([test "$enable_rpath:${RPATHFLAG}" = yes:], [
|
|
|
|
RPATHFLAG="${rpathflag:+ ${rpathflag}%1\$-s}"
|
|
|
|
])
|
|
|
|
AS_CASE([${RPATHFLAG}],[*'%1$'*],[: ${LIBPATHFLAG=' -L%1$-s'}],[: ${LIBPATHFLAG=' -L%s'}])
|
|
|
|
}
|
2016-10-22 04:28:30 +03:00
|
|
|
|
2021-04-09 11:37:14 +03:00
|
|
|
RUBY_TRY_LDFLAGS(-fdeclspec, [fdeclspec=yes], [fdeclspec=no])
|
2021-02-02 02:33:08 +03:00
|
|
|
AS_IF([test "$fdeclspec" = yes], [
|
|
|
|
RUBY_APPEND_OPTIONS(CFLAGS, -fdeclspec)
|
|
|
|
RUBY_APPEND_OPTIONS(cflags, -fdeclspec)
|
|
|
|
RUBY_APPEND_OPTIONS(orig_cflags, -fdeclspec)
|
|
|
|
])
|
|
|
|
RUBY_TRY_CXXFLAGS(-fdeclspec, [fdeclspec=yes], [fdeclspec=no])
|
|
|
|
AS_IF([test "$fdeclspec" = yes], [
|
|
|
|
RUBY_APPEND_OPTIONS(CXXFLAGS, -fdeclspec)
|
2020-04-08 07:28:13 +03:00
|
|
|
])
|
2019-12-02 08:58:43 +03:00
|
|
|
|
2022-08-11 05:02:28 +03:00
|
|
|
AC_ARG_ENABLE(devel,
|
|
|
|
AS_HELP_STRING([--enable-devel], [enable development build]),
|
|
|
|
[RUBY_DEVEL=$enableval],
|
|
|
|
[AS_IF([test "x${RUBY_DEVEL-no}" != xyes], [RUBY_DEVEL=])]
|
|
|
|
)dnl
|
|
|
|
AC_SUBST(RUBY_DEVEL)
|
|
|
|
particular_werror_flags=${RUBY_DEVEL:-no}
|
2013-02-13 12:56:42 +04:00
|
|
|
AC_ARG_ENABLE(werror,
|
|
|
|
AS_HELP_STRING([--disable-werror],
|
|
|
|
[don't make warnings into errors
|
|
|
|
even if a compiler support -Werror feature
|
|
|
|
[[disabled by default unless development version]]]),
|
|
|
|
[particular_werror_flags=$enableval])
|
|
|
|
|
2011-02-15 13:44:58 +03:00
|
|
|
rb_cv_warnflags="$warnflags"
|
2018-11-19 13:15:20 +03:00
|
|
|
AS_CASE(["$GCC:${warnflags+set}:${extra_warnflags:+set}:"],
|
|
|
|
[yes::*|yes:*:set:], [# GCC && (!warnflags || extra_warnflags)
|
2022-06-18 07:46:40 +03:00
|
|
|
AS_IF([test $gcc_major -le 6], [
|
2018-11-19 16:21:48 +03:00
|
|
|
extra_warnflags="$extra_warnflags -Wno-maybe-uninitialized"
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2017-12-14 19:47:28 +03:00
|
|
|
# ICC doesn't support -Werror=
|
|
|
|
AS_IF([test $icc_version -gt 0], [
|
2017-12-14 21:33:33 +03:00
|
|
|
particular_werror_flags=no
|
2017-12-14 19:47:28 +03:00
|
|
|
])
|
2018-11-19 05:58:51 +03:00
|
|
|
for wflag in \
|
2022-06-18 07:46:40 +03:00
|
|
|
-Werror=extra-tokens \
|
2014-01-05 16:33:40 +04:00
|
|
|
-Werror=deprecated-declarations \
|
2022-01-22 13:02:16 +03:00
|
|
|
-Werror=division-by-zero -Werror=div-by-zero \
|
2018-11-19 05:58:51 +03:00
|
|
|
-Werror=duplicated-cond \
|
|
|
|
-Werror=implicit-function-declaration \
|
|
|
|
-Werror=implicit-int \
|
2017-10-18 07:35:25 +03:00
|
|
|
-Werror=misleading-indentation \
|
2018-11-19 05:58:51 +03:00
|
|
|
-Werror=pointer-arith \
|
|
|
|
-Werror=shorten-64-to-32 \
|
|
|
|
-Werror=write-strings \
|
2021-10-27 07:19:52 +03:00
|
|
|
-Werror=old-style-definition \
|
2018-11-19 05:58:51 +03:00
|
|
|
-Wimplicit-fallthrough=0 \
|
|
|
|
-Wmissing-noreturn \
|
|
|
|
-Wno-cast-function-type \
|
|
|
|
-Wno-constant-logical-operand \
|
|
|
|
-Wno-long-long \
|
|
|
|
-Wno-missing-field-initializers \
|
2018-01-16 11:35:33 +03:00
|
|
|
-Wno-overlength-strings \
|
2014-02-24 07:38:14 +04:00
|
|
|
-Wno-packed-bitfield-compat \
|
2018-11-19 05:58:51 +03:00
|
|
|
-Wno-parentheses-equality \
|
|
|
|
-Wno-self-assign \
|
|
|
|
-Wno-tautological-compare \
|
|
|
|
-Wno-unused-parameter \
|
2018-11-19 06:01:55 +03:00
|
|
|
-Wno-unused-value \
|
2016-05-08 03:55:29 +03:00
|
|
|
-Wsuggest-attribute=format \
|
2018-11-19 05:58:51 +03:00
|
|
|
-Wsuggest-attribute=noreturn \
|
|
|
|
-Wunused-variable \
|
2020-04-09 10:25:17 +03:00
|
|
|
-diag-disable=175,188,1684,2259,2312 \
|
2018-11-19 16:21:48 +03:00
|
|
|
$extra_warnflags \
|
2011-01-15 05:57:36 +03:00
|
|
|
; do
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$particular_werror_flags" != yes], [
|
2011-01-15 05:57:36 +03:00
|
|
|
wflag=`echo x$wflag | sed 's/^x-Werror=/-W/;s/^x//'`
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2010-12-31 05:46:50 +03:00
|
|
|
ok=no
|
2012-04-30 16:09:09 +04:00
|
|
|
RUBY_TRY_CFLAGS($wflag, [
|
|
|
|
RUBY_APPEND_OPTIONS(warnflags, $wflag)
|
|
|
|
ok=yes
|
|
|
|
])
|
2010-12-31 05:46:50 +03:00
|
|
|
AS_CASE([$ok:$wflag], [no:-Werror=*], [
|
|
|
|
wflag=`echo x$wflag | sed 's/^x-Werror=/-W/'`
|
|
|
|
RUBY_TRY_CFLAGS($wflag, [
|
2012-04-30 16:09:09 +04:00
|
|
|
RUBY_APPEND_OPTIONS(warnflags, $wflag)
|
2010-12-31 05:46:50 +03:00
|
|
|
particular_werror_flags=no
|
|
|
|
])
|
|
|
|
])
|
2009-03-11 23:49:07 +03:00
|
|
|
done
|
2021-05-05 03:41:07 +03:00
|
|
|
AS_IF([test "$particular_werror_flags" = "yes"], [
|
|
|
|
wflag=-Werror=undef
|
|
|
|
], [
|
|
|
|
wflag=-Wundef
|
|
|
|
])
|
|
|
|
RUBY_TRY_CFLAGS($wflag, [
|
|
|
|
RUBY_APPEND_OPTIONS(warnflags, $wflag)
|
|
|
|
], [], [
|
|
|
|
@%:@if !defined(RUBY_CONFIG_TEST_NEVER_DEFINED_SYMBOL)
|
|
|
|
@%:@elif RUBY_CONFIG_TEST_NEVER_DEFINED_SYMBOL
|
|
|
|
@%:@endif
|
|
|
|
])
|
2011-11-25 02:49:51 +04:00
|
|
|
AS_CASE([" $warnflags "],[*" -Wno-missing-field-initializers "*], [wflag="-Wall -Wextra"],
|
2010-01-21 09:10:16 +03:00
|
|
|
[wflag=-Wall])
|
2009-10-23 09:22:53 +04:00
|
|
|
RUBY_TRY_CFLAGS($wflag, [warnflags="$wflag${warnflags+ $warnflags}"])
|
2011-02-15 13:44:58 +03:00
|
|
|
# Disable warnflags while conftest. -Werror=* flags might make bad OS capability guess.
|
2011-03-04 15:16:45 +03:00
|
|
|
rb_cv_warnflags="$warnflags"
|
2011-02-15 13:44:58 +03:00
|
|
|
warnflags=
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2014-03-21 16:59:08 +04:00
|
|
|
RUBY_TRY_CFLAGS(-Qunused-arguments, [RUBY_APPEND_OPTIONS(rb_cv_wsuppress_flags, -Qunused-arguments)])
|
2020-04-10 04:23:17 +03:00
|
|
|
AC_COMPILE_IFELSE([
|
|
|
|
AC_LANG_PROGRAM([
|
|
|
|
@%:@if !(defined(__SUNPRO_C)||defined(__SUNPRO_CC))
|
|
|
|
@%:@error not sunpro
|
|
|
|
@%:@endif],[])], [
|
2020-08-22 08:12:12 +03:00
|
|
|
for e in \
|
|
|
|
E_STATEMENT_NOT_REACHED \
|
|
|
|
E_INIT_SIGN_EXTEND \
|
|
|
|
E_INIT_DOES_NOT_FIT \
|
|
|
|
E_INITIALIZATION_TYPE_MISMATCH
|
|
|
|
do
|
|
|
|
RUBY_TRY_CFLAGS([-erroff=${e}], [
|
|
|
|
RUBY_APPEND_OPTIONS(rb_cv_warnflags, [-erroff=${e}])
|
|
|
|
])
|
|
|
|
done
|
|
|
|
])
|
2014-03-21 16:59:08 +04:00
|
|
|
|
2016-11-16 09:07:55 +03:00
|
|
|
AC_ARG_WITH(compress-debug-sections,
|
|
|
|
AS_HELP_STRING([--with-compress-debug-sections=type],
|
|
|
|
[enable debug section compression]),
|
|
|
|
[compress_debug_sections=$withval], [compress_debug_sections=])
|
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$GCC" = yes], [
|
2017-10-23 08:56:25 +03:00
|
|
|
# -D_FORTIFY_SOURCE
|
|
|
|
# When defined _FORTIFY_SOURCE, glibc enables some additional sanity
|
|
|
|
# argument check. The performance drop is very little and Ubuntu enables
|
|
|
|
# _FORTIFY_SOURCE=2 by default. So, let's support it for protecting us from
|
|
|
|
# a mistake of silly C extensions.
|
2019-12-02 07:20:00 +03:00
|
|
|
|
|
|
|
# TODO: check if link succeeds with _FORTIFY_SOURCE=2.
|
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[mingw*], [
|
|
|
|
fortify_source=no
|
|
|
|
])
|
|
|
|
AC_ARG_ENABLE(fortify_source,
|
|
|
|
AS_HELP_STRING([--disable-fortify-source],
|
|
|
|
[disable -D_FORTIFY_SOURCE=2 option, which causes link error on mingw]),
|
|
|
|
[fortify_source=$enableval])
|
2019-12-03 08:51:14 +03:00
|
|
|
AS_IF([test "x$fortify_source" != xno], [
|
2022-10-29 10:14:19 +03:00
|
|
|
RUBY_TRY_CFLAGS([$optflags -D_FORTIFY_SOURCE=2],
|
|
|
|
[RUBY_APPEND_OPTION(XCFLAGS, -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2)], [],
|
2020-11-23 11:51:52 +03:00
|
|
|
[@%:@include <stdio.h>])
|
2019-12-03 08:46:49 +03:00
|
|
|
])
|
2011-11-27 16:27:00 +04:00
|
|
|
|
2018-02-04 16:43:06 +03:00
|
|
|
: ${MJIT_HEADER_FLAGS='-P -dD'}
|
|
|
|
|
2011-11-27 16:27:00 +04:00
|
|
|
# -fstack-protector
|
2011-11-27 14:09:11 +04:00
|
|
|
AS_CASE(["$target_os"],
|
2022-10-30 12:22:50 +03:00
|
|
|
[emscripten*|wasi*], [
|
2011-11-27 14:09:11 +04:00
|
|
|
stack_protector=no
|
2013-04-19 06:37:06 +04:00
|
|
|
])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test -z "${stack_protector+set}"], [
|
2018-09-02 06:49:31 +03:00
|
|
|
AS_FOR(option, opt, [-fstack-protector-strong -fstack-protector], [
|
|
|
|
RUBY_TRY_CFLAGS(option, [stack_protector=yes])
|
|
|
|
AS_IF([test "x$stack_protector" = xyes], [
|
|
|
|
RUBY_TRY_LDFLAGS(option, [], [stack_protector=])
|
|
|
|
])
|
|
|
|
AS_IF([test "x$stack_protector" = xyes], [stack_protector=option; break])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
])
|
2022-10-30 12:22:50 +03:00
|
|
|
AC_MSG_CHECKING([for -fstack-protector])
|
|
|
|
AC_MSG_RESULT(["$stack_protector"])
|
2018-09-02 06:49:31 +03:00
|
|
|
AS_CASE(["$stack_protector"], [-*], [
|
|
|
|
RUBY_APPEND_OPTION(XCFLAGS, $stack_protector)
|
|
|
|
RUBY_APPEND_OPTION(XLDFLAGS, $stack_protector)
|
|
|
|
RUBY_APPEND_OPTION(LDFLAGS, $stack_protector)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2011-11-27 16:27:00 +04:00
|
|
|
|
2022-06-15 20:31:15 +03:00
|
|
|
# aarch64 branch protection
|
|
|
|
AS_CASE(["$target_cpu"], [aarch64], [
|
2022-06-16 20:29:28 +03:00
|
|
|
AS_FOR(option, opt, [-mbranch-protection=pac-ret -msign-return-address=all], [
|
|
|
|
RUBY_TRY_CFLAGS(option, [branch_protection=yes], [branch_protection=no])
|
|
|
|
AS_IF([test "x$branch_protection" = xyes], [
|
|
|
|
RUBY_APPEND_OPTION(XCFLAGS, option)
|
|
|
|
break
|
2022-06-15 20:31:15 +03:00
|
|
|
])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2016-11-16 09:07:55 +03:00
|
|
|
AS_CASE("${compress_debug_sections:-zlib}",
|
|
|
|
[none|no], [], [
|
|
|
|
RUBY_TRY_LDFLAGS(${linker_flag}--compress-debug-sections=${compress_debug_sections:-zlib},
|
|
|
|
[compress_debug_sections=${compress_debug_sections:-zlib}],
|
2016-10-18 10:36:42 +03:00
|
|
|
[compress_debug_sections=no])
|
2016-11-16 09:07:55 +03:00
|
|
|
])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "x$compress_debug_sections" != xno], [
|
2016-11-16 09:07:55 +03:00
|
|
|
RUBY_APPEND_OPTION(DLDFLAGS, ${linker_flag}--compress-debug-sections=$compress_debug_sections)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2016-10-18 10:36:42 +03:00
|
|
|
|
2012-06-13 10:16:46 +04:00
|
|
|
AS_CASE(["$target_os"],[mingw*], [
|
|
|
|
# On Windows platforms, system provided headers are VC++
|
|
|
|
# optimized. That is, C++ habits are often contaminated into
|
|
|
|
# various headers. Most frequent situation is the use of //
|
|
|
|
# comments. We bypass ANSI C mode for them. Otherwise
|
|
|
|
# extension libs cannot include those headers.
|
2017-03-03 07:51:34 +03:00
|
|
|
|
2018-01-13 14:10:08 +03:00
|
|
|
# Since math.h in some mingw64 wrongly declares frexp and modf
|
2017-03-03 07:51:34 +03:00
|
|
|
# to be pure, the variables pointed by the second arguments are
|
|
|
|
# considered uninitialized unexpectedly.
|
|
|
|
AC_CACHE_CHECK([whether frexp and modf are broken],
|
|
|
|
rb_cv_mingw64_broken_frexp_modf,
|
|
|
|
[
|
|
|
|
save_CFLAGS="$CFLAGS"
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$particular_werror_flags" = "yes"], [
|
2017-03-03 07:51:34 +03:00
|
|
|
CFLAGS="$CFLAGS -Werror=uninitialized"
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2017-03-03 07:51:34 +03:00
|
|
|
CFLAGS="$CFLAGS -Werror -Wuninitialized"
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <math.h>
|
2017-03-03 07:51:34 +03:00
|
|
|
int foo(double x)
|
|
|
|
{
|
|
|
|
int exp;
|
|
|
|
frexp(x, &exp);
|
|
|
|
return exp;
|
2020-12-12 16:55:09 +03:00
|
|
|
}]], [[if (foo(0.0)) return 1;]])],
|
2017-03-03 07:51:34 +03:00
|
|
|
[rb_cv_mingw64_broken_frexp_modf=no],
|
|
|
|
[rb_cv_mingw64_broken_frexp_modf=yes])
|
|
|
|
CFLAGS="$save_CFLAGS"
|
|
|
|
])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_mingw64_broken_frexp_modf" = yes], [
|
2017-03-03 07:51:34 +03:00
|
|
|
AC_DEFINE(RUBY_MINGW64_BROKEN_FREXP_MODF)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2012-06-13 10:16:46 +04:00
|
|
|
],
|
2021-01-31 08:27:15 +03:00
|
|
|
[cygwin*|msys*|darwin*|netbsd*], [
|
2021-08-27 04:52:02 +03:00
|
|
|
# need lgamma_r()
|
2019-02-04 11:17:44 +03:00
|
|
|
])
|
|
|
|
|
2011-11-27 16:27:00 +04:00
|
|
|
# suppress annoying -Wstrict-overflow warnings
|
|
|
|
RUBY_TRY_CFLAGS(-fno-strict-overflow, [RUBY_APPEND_OPTION(XCFLAGS, -fno-strict-overflow)])
|
2013-04-19 06:37:06 +04:00
|
|
|
|
|
|
|
test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-ggdb3, [debugflags=-ggdb3])}
|
|
|
|
test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-ggdb, [debugflags=-ggdb])}
|
|
|
|
test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-g3, [debugflags=-g3])}
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2012-02-28 06:44:52 +04:00
|
|
|
test $ac_cv_prog_cc_g = yes && : ${debugflags=-g}
|
2011-11-25 03:04:35 +04:00
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$GCC" = ""], [
|
2012-09-16 03:52:34 +04:00
|
|
|
AS_CASE(["$target_os"],[aix*],[warnflags="$warnflags -qinfo=por" rb_cv_warnflags="$rb_cv_warnflags -qinfo=por"])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
AS_IF([test "$GCC" = yes], [
|
2022-06-18 07:46:40 +03:00
|
|
|
RUBY_TRY_CFLAGS(-fvisibility=hidden, [visibility_option=yes], [visibility_option=no])
|
2010-12-07 02:00:47 +03:00
|
|
|
AC_SUBST(WERRORFLAG, "-Werror")
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$visibility_option" = yes], [
|
2010-09-25 05:30:52 +04:00
|
|
|
RUBY_APPEND_OPTION(XCFLAGS, -fvisibility=hidden)
|
2013-04-05 14:29:38 +04:00
|
|
|
AC_DEFINE(RUBY_SYMBOL_EXPORT_BEGIN, [_Pragma("GCC visibility push(default)")])
|
|
|
|
AC_DEFINE(RUBY_SYMBOL_EXPORT_END, [_Pragma("GCC visibility pop")])
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2010-09-25 17:48:42 +04:00
|
|
|
RUBY_TRY_LDFLAGS([-Wl,-unexported_symbol,_Init_*], [visibility_option=ld], [visibility_option=no])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2017-10-23 08:56:25 +03:00
|
|
|
test "$visibility_option" = no || OBJCOPY=:
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2009-03-11 23:49:07 +03:00
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$GCC" = yes], [
|
2012-04-30 16:09:09 +04:00
|
|
|
# optflags
|
|
|
|
|
2011-10-30 19:51:33 +04:00
|
|
|
AS_CASE(["$target_os"], [mingw*], [
|
|
|
|
RUBY_TRY_CFLAGS(-fno-omit-frame-pointer, [optflags="${optflags+$optflags }-fno-omit-frame-pointer"])
|
2015-11-18 19:48:37 +03:00
|
|
|
RUBY_TRY_CFLAGS(-static-libgcc, [static_libgcc=yes], [static_libgcc=no])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$static_libgcc" = yes], [
|
2015-11-18 19:48:37 +03:00
|
|
|
RUBY_APPEND_OPTION(EXTLDFLAGS, -static-libgcc)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2011-10-30 19:51:33 +04:00
|
|
|
])
|
2012-04-30 16:09:09 +04:00
|
|
|
|
|
|
|
# disable fast-math
|
2016-05-24 10:49:25 +03:00
|
|
|
for oflag in -fno-fast-math; do
|
2021-01-27 08:50:27 +03:00
|
|
|
RUBY_TRY_CFLAGS($oflag, [RUBY_APPEND_OPTION(optflags, $oflag)])
|
2012-05-01 00:02:34 +04:00
|
|
|
done
|
2016-05-24 10:49:25 +03:00
|
|
|
for oflag in -fexcess-precision=standard -fp-model\ precise; do
|
2016-05-24 18:21:53 +03:00
|
|
|
RUBY_TRY_CFLAGS($oflag, [RUBY_APPEND_OPTION(XCFLAGS, $oflag)])
|
2016-05-24 10:49:25 +03:00
|
|
|
done
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2011-10-30 19:51:33 +04:00
|
|
|
|
2018-03-15 18:20:08 +03:00
|
|
|
AS_CASE(["$target_cpu"], [[i[3-6]86*]], [
|
|
|
|
AC_CACHE_CHECK([for __sync_val_compare_and_swap], [rb_cv_gcc_compiler_cas], [
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[unsigned long atomic_var;]],
|
|
|
|
[[__sync_val_compare_and_swap(&atomic_var, 0, 1);]])],
|
2018-03-15 18:20:08 +03:00
|
|
|
[rb_cv_gcc_compiler_cas=yes],
|
|
|
|
[
|
|
|
|
save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -march=i486"
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[unsigned long atomic_var;]],
|
|
|
|
[[__sync_val_compare_and_swap(&atomic_var, 0, 1);]])],
|
2018-03-15 18:20:08 +03:00
|
|
|
[rb_cv_gcc_compiler_cas=i486],
|
|
|
|
[rb_cv_gcc_compiler_cas=no])
|
|
|
|
CFLAGS="$save_CFLAGS"
|
|
|
|
])
|
|
|
|
])
|
|
|
|
AS_IF([test "$rb_cv_gcc_compiler_cas" = i486], [ARCH_FLAG="-march=i486"])
|
|
|
|
])
|
|
|
|
|
2022-09-14 04:42:38 +03:00
|
|
|
OPT_DIR=
|
2022-09-14 16:17:39 +03:00
|
|
|
AC_ARG_WITH([gmp-dir],
|
|
|
|
AS_HELP_STRING([--with-gmp-dir=DIR],
|
|
|
|
[specify the prefix directory where gmp is installed]),
|
2022-09-14 15:20:32 +03:00
|
|
|
[OPT_DIR="${OPT_DIR:+$OPT_DIR$PATH_SEPARATOR}$withval"], [])
|
2022-09-14 16:17:39 +03:00
|
|
|
AC_ARG_WITH([gmp],
|
|
|
|
[AS_HELP_STRING([--without-gmp],
|
|
|
|
[disable GNU GMP to accelerate Bignum operations])],
|
2022-09-14 15:20:32 +03:00
|
|
|
[], [with_gmp=yes])
|
2022-09-14 16:17:39 +03:00
|
|
|
|
2013-12-17 09:29:17 +04:00
|
|
|
AC_ARG_WITH(opt-dir,
|
|
|
|
AS_HELP_STRING([--with-opt-dir=DIR-LIST],
|
|
|
|
[add optional headers and libraries directories separated by $PATH_SEPARATOR]),
|
2022-09-14 04:42:38 +03:00
|
|
|
[OPT_DIR="${OPT_DIR:+$OPT_DIR$PATH_SEPARATOR}$withval"], [])
|
|
|
|
|
|
|
|
AS_IF([test "x$OPT_DIR" != x], [
|
|
|
|
val=`IFS="$PATH_SEPARATOR"
|
|
|
|
for dir in $OPT_DIR; do
|
|
|
|
test -z "$dir" && continue
|
|
|
|
echo x ${LIBPATHFLAG} ${RPATHFLAG} |
|
|
|
|
sed "s/^x *//;s${IFS}"'%1\\$-s'"${IFS}${dir}/lib${IFS}g;s${IFS}%s${IFS}${dir}/lib${IFS}g"
|
|
|
|
done | tr '\012' ' ' | sed 's/ *$//'`
|
|
|
|
LDFLAGS="${LDFLAGS:+$LDFLAGS }$val"
|
|
|
|
DLDFLAGS="${DLDFLAGS:+$DLDFLAGS }$val"
|
|
|
|
LDFLAGS_OPTDIR="$val"
|
|
|
|
CPPFLAGS="${CPPFLAGS:+$CPPFLAGS }"`echo "$OPT_DIR" | tr "${PATH_SEPARATOR}" '\012' |
|
|
|
|
sed '/^$/d;s|^|-I|;s|$|/include|' | tr '\012' ' ' | sed 's/ *$//'`
|
|
|
|
])
|
2013-12-17 09:29:17 +04:00
|
|
|
|
2009-04-06 21:25:28 +04:00
|
|
|
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="\"$cxxflags $ARCH_FLAG\""
|
2013-02-09 17:13:01 +04:00
|
|
|
}
|
|
|
|
|
2018-12-10 18:48:45 +03:00
|
|
|
AC_CACHE_CHECK([whether compiler has statement and declarations in expressions],
|
|
|
|
rb_cv_have_stmt_and_decl_in_expr,
|
2020-12-12 16:55:09 +03:00
|
|
|
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[ __extension__ ({ int a = 0; a; }); ]])],
|
2018-12-10 18:48:45 +03:00
|
|
|
[rb_cv_have_stmt_and_decl_in_expr=yes],
|
|
|
|
[rb_cv_have_stmt_and_decl_in_expr=no])])
|
|
|
|
AS_IF([test "$rb_cv_have_stmt_and_decl_in_expr" = yes], [
|
|
|
|
AC_DEFINE(HAVE_STMT_AND_DECL_IN_EXPR)
|
|
|
|
])
|
2018-12-10 16:58:36 +03:00
|
|
|
|
2018-03-24 17:28:45 +03:00
|
|
|
: "header and library section" && {
|
2013-02-11 07:33:11 +04:00
|
|
|
AC_ARG_WITH(winnt-ver,
|
2018-08-11 16:28:40 +03:00
|
|
|
AS_HELP_STRING([--with-winnt-ver=0xXXXX], [target Windows NT version (default to 0x0600)]),
|
|
|
|
[with_winnt_ver="$withval"], [with_winnt_ver="0x0600"])
|
2013-02-11 07:33:11 +04:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[mingw*], [
|
|
|
|
RUBY_APPEND_OPTION(CPPFLAGS, -D_WIN32_WINNT=$with_winnt_ver)
|
2013-12-25 08:00:59 +04:00
|
|
|
RUBY_APPEND_OPTION(CPPFLAGS, -D__MINGW_USE_VC2005_COMPAT)
|
2013-02-11 07:33:11 +04:00
|
|
|
])
|
|
|
|
|
2022-04-25 12:48:37 +03:00
|
|
|
RUBY_THREAD
|
2013-02-11 07:33:11 +04:00
|
|
|
|
|
|
|
dnl Checks for libraries.
|
|
|
|
AS_CASE(["$target_os"],[*bsd*|dragonfly*],[],[ac_cv_func_daemon=no])
|
|
|
|
|
2021-01-05 07:48:42 +03:00
|
|
|
AS_CASE(["$target_os"], [*android*], [
|
|
|
|
AS_CASE(["$target_cpu"], [arm*], [
|
|
|
|
ac_cv_func___builtin_setjmp=no
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2018-03-14 17:07:00 +03:00
|
|
|
AS_UNSET(ORIG_LIBS)
|
2013-02-11 07:33:11 +04:00
|
|
|
POSTLINK=:
|
|
|
|
AC_SUBST(POSTLINK)
|
2021-06-23 15:55:56 +03:00
|
|
|
cleanlibs=
|
|
|
|
AC_SUBST(cleanlibs)
|
2013-02-11 07:33:11 +04:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[nextstep*], [ ],
|
|
|
|
[openstep*], [ ],
|
|
|
|
[rhapsody*], [ ],
|
2018-03-14 17:07:00 +03:00
|
|
|
[darwin*], [
|
|
|
|
ORIG_LIBS="$LIBS"
|
|
|
|
RUBY_PREPEND_OPTION(LIBS, -lobjc)
|
2013-02-11 07:33:11 +04:00
|
|
|
RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT)
|
2019-08-19 19:58:45 +03:00
|
|
|
AC_CACHE_CHECK([whether syscall(2) is deprecated], rb_cv_syscall_deprecated,
|
|
|
|
[RUBY_WERROR_FLAG([
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <unistd.h>]],
|
|
|
|
[[if (syscall(0)) return 1;]])],
|
2019-08-19 19:58:45 +03:00
|
|
|
[rb_cv_syscall_deprecated=no],
|
|
|
|
[rb_cv_syscall_deprecated=yes])])])
|
|
|
|
AS_IF([test $rb_cv_syscall_deprecated = yes], [
|
2017-03-25 10:46:12 +03:00
|
|
|
ac_cv_func___syscall=no
|
|
|
|
ac_cv_func_syscall=no
|
|
|
|
ac_cv_header_sys_syscall_h=no
|
|
|
|
ac_cv_header_syscall_h=no
|
|
|
|
])
|
2019-08-19 18:39:06 +03:00
|
|
|
ac_cv_func_getcontext=no
|
|
|
|
ac_cv_func_setcontext=no
|
2013-02-11 07:33:11 +04:00
|
|
|
ac_cv_type_getgroups=gid_t # getgroups() on Rosetta fills garbage
|
2016-06-01 09:58:21 +03:00
|
|
|
ac_cv_lib_crypt_crypt=no
|
2013-02-11 07:33:11 +04:00
|
|
|
ac_cv_func_fdatasync=no # Mac OS X wrongly reports it has fdatasync()
|
2014-09-07 06:04:16 +04:00
|
|
|
ac_cv_func_vfork=no
|
2022-06-18 07:46:40 +03:00
|
|
|
AS_IF([test $gcc_major -eq 4 -a $gcc_minor -lt 3], [
|
2014-10-29 05:48:25 +03:00
|
|
|
ac_cv_func___builtin_setjmp=no
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2018-07-05 06:02:33 +03:00
|
|
|
with_setjmp_type=sigsetjmp # to hijack SIGCHLD handler
|
2016-06-01 09:58:21 +03:00
|
|
|
AC_CACHE_CHECK(for broken crypt with 8bit chars, rb_cv_broken_crypt,
|
2020-12-12 16:55:09 +03:00
|
|
|
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
2016-06-01 09:58:21 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
void
|
|
|
|
broken_crypt(const char *salt, const char *buf1, const char *buf2)
|
|
|
|
{
|
|
|
|
#if 0
|
|
|
|
printf("%.2x%.2x: %s -> %s\n", (unsigned char)salt[0], (unsigned char)salt[1],
|
|
|
|
buf1+2, buf2+2);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
char salt[2], buf[256], *s;
|
|
|
|
for (i = 0; i < 128*128; i++) {
|
|
|
|
salt[0] = 0x80 | (i & 0x7f);
|
|
|
|
salt[1] = 0x80 | (i >> 7);
|
|
|
|
strcpy(buf, crypt("", salt));
|
|
|
|
if (strcmp(buf, s = crypt("", salt))) {
|
|
|
|
broken_crypt(salt, buf, s);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
salt[0] = salt[1] = ' ';
|
|
|
|
strcpy(buf, crypt("", salt));
|
|
|
|
salt[0] = salt[1] = 0x80 | ' ';
|
|
|
|
if (strcmp(buf, s = crypt("", salt))) {
|
|
|
|
broken_crypt(salt, buf, s);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2020-12-12 16:55:09 +03:00
|
|
|
]])],
|
2016-06-01 09:58:21 +03:00
|
|
|
rb_cv_broken_crypt=no,
|
|
|
|
rb_cv_broken_crypt=yes,
|
|
|
|
rb_cv_broken_crypt=yes)])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_broken_crypt" = yes], [
|
2016-06-01 09:58:21 +03:00
|
|
|
AC_DEFINE(BROKEN_CRYPT, 1)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2017-06-11 08:36:56 +03:00
|
|
|
POSTLINK=""
|
2013-02-11 07:33:11 +04:00
|
|
|
AC_CHECK_PROGS(codesign, codesign)
|
2017-06-11 08:36:56 +03:00
|
|
|
AC_CHECK_PROGS(dsymutil, dsymutil)
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test -n "$codesign"], [
|
2017-06-11 08:36:56 +03:00
|
|
|
POSTLINK="{ test -z '\$(RUBY_CODESIGN)' || $codesign -s '\$(RUBY_CODESIGN)' -f \$@; }${POSTLINK:+; $POSTLINK}"
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
AS_IF([test -n "$dsymutil"], [
|
2017-06-11 08:36:56 +03:00
|
|
|
POSTLINK="$dsymutil \$@${POSTLINK:+; $POSTLINK}"
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
AS_IF([test -n "${POSTLINK}"], [
|
2013-05-05 10:54:32 +04:00
|
|
|
LINK_SO="$LINK_SO
|
|
|
|
\$(POSTLINK)"
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2013-02-11 07:33:11 +04:00
|
|
|
AC_CHECK_HEADERS(crt_externs.h, [], [], [
|
|
|
|
#include <crt_externs.h>
|
|
|
|
])
|
2021-06-23 15:55:56 +03:00
|
|
|
cleanlibs='$(TARGET_SO).dSYM'
|
2013-02-11 07:33:11 +04:00
|
|
|
],
|
2015-06-25 13:42:37 +03:00
|
|
|
[solaris*], [ LIBS="-lm $LIBS"
|
|
|
|
ac_cv_func_vfork=no
|
2018-05-16 14:06:30 +03:00
|
|
|
AC_MSG_CHECKING(whether _XOPEN_SOURCE is already given)
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>
|
2018-05-16 14:06:30 +03:00
|
|
|
#ifndef _XOPEN_SOURCE
|
|
|
|
#error _XOPEN_SOURCE is not defined
|
|
|
|
#endif
|
2020-12-12 16:55:09 +03:00
|
|
|
]], [[]])],
|
2018-05-16 14:06:30 +03:00
|
|
|
[given_xopen_source=yes], [given_xopen_source=no])
|
|
|
|
AC_MSG_RESULT($given_xopen_source)
|
|
|
|
AS_IF([test $given_xopen_source = no], [
|
|
|
|
AC_MSG_CHECKING(appropriate _XOPEN_SOURCE value to define)
|
|
|
|
define_xopen_source=""
|
|
|
|
for tmp_xpg in 7 6 5; do
|
|
|
|
AS_IF([test x"$define_xopen_source" != x], [
|
|
|
|
break
|
|
|
|
])
|
2020-12-12 16:55:09 +03:00
|
|
|
RUBY_WERROR_FLAG([AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
2018-05-16 14:06:30 +03:00
|
|
|
#define _XOPEN_SOURCE ${tmp_xpg}00
|
|
|
|
#include <unistd.h>
|
|
|
|
#ifndef _XPG${tmp_xpg}
|
|
|
|
#error _XPG${tmp_xpg} should be defined by _XOPEN_SOURCE=${tmp_xpg}00
|
|
|
|
#endif
|
2020-12-12 16:55:09 +03:00
|
|
|
]], [[]])],
|
2018-05-16 14:06:30 +03:00
|
|
|
[define_xopen_source=${tmp_xpg}00], [])
|
|
|
|
])
|
|
|
|
done
|
|
|
|
AS_IF([test x"$define_xopen_source" = x], [
|
|
|
|
define_xopen_source=no
|
|
|
|
])
|
|
|
|
AC_MSG_RESULT($define_xopen_source)
|
|
|
|
AS_IF([test x"$define_xopen_source" != xno], [
|
|
|
|
RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE=$define_xopen_source)
|
2020-12-21 17:08:35 +03:00
|
|
|
# _XOPEN_SOURCE should not be defined for C++ on Solaris.
|
|
|
|
RUBY_APPEND_OPTIONS(CXXFLAGS, -U_XOPEN_SOURCE)
|
2018-05-16 14:06:30 +03:00
|
|
|
])
|
|
|
|
])
|
2021-11-29 17:46:48 +03:00
|
|
|
AC_CHECK_TYPES([caddr_t],[],[],[@%:@include <sys/types.h>])
|
2021-11-30 05:12:21 +03:00
|
|
|
AC_CACHE_CHECK([whether madvise declaration is needed], rb_cv_madvice_prototype_using_caddr_t,
|
|
|
|
[RUBY_WERROR_FLAG([AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
Fix conflicting declaration on Solaris
SunC
```
"cont.c", line 24: identifier redeclared: madvise
current : function(pointer to char, unsigned int, int) returning int
previous: function(pointer to void, unsigned int, int) returning int : "/usr/include/sys/mman.h", line 232
```
GCC
```
cont.c:24:12: error: conflicting types for 'madvise'
24 | extern int madvise(caddr_t, size_t, int);
| ^~~~~~~
In file included from cont.c:16:
/usr/include/sys/mman.h:232:12: note: previous declaration of 'madvise' was here
232 | extern int madvise(void *, size_t, int);
| ^~~~~~~
```
2021-11-30 03:01:36 +03:00
|
|
|
@%:@include <sys/unistd.h>
|
|
|
|
@%:@include <sys/mman.h>
|
|
|
|
@%:@include <sys/types.h>
|
|
|
|
extern int madvise(caddr_t, size_t, int);
|
|
|
|
]], [[]])],
|
2021-11-30 05:12:21 +03:00
|
|
|
[rb_cv_madvice_prototype_using_caddr_t=yes], [rb_cv_madvice_prototype_using_caddr_t=no])
|
|
|
|
])
|
Fix conflicting declaration on Solaris
SunC
```
"cont.c", line 24: identifier redeclared: madvise
current : function(pointer to char, unsigned int, int) returning int
previous: function(pointer to void, unsigned int, int) returning int : "/usr/include/sys/mman.h", line 232
```
GCC
```
cont.c:24:12: error: conflicting types for 'madvise'
24 | extern int madvise(caddr_t, size_t, int);
| ^~~~~~~
In file included from cont.c:16:
/usr/include/sys/mman.h:232:12: note: previous declaration of 'madvise' was here
232 | extern int madvise(void *, size_t, int);
| ^~~~~~~
```
2021-11-30 03:01:36 +03:00
|
|
|
])
|
2021-11-30 05:12:21 +03:00
|
|
|
AS_IF([test $rb_cv_madvice_prototype_using_caddr_t = yes], [AC_DEFINE(NEED_MADVICE_PROTOTYPE_USING_CADDR_T, 1)])
|
2015-06-25 13:42:37 +03:00
|
|
|
],
|
2021-10-17 14:19:26 +03:00
|
|
|
[haiku*], [
|
|
|
|
LIBS="$LIBS" # m lib is include in root
|
|
|
|
],
|
2021-01-31 08:27:15 +03:00
|
|
|
[cygwin*|msys*], [
|
|
|
|
ac_cv_header_langinfo_h=yes
|
2016-04-14 04:25:34 +03:00
|
|
|
RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE -D_GNU_SOURCE)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(cygwin_conv_path)
|
2013-02-11 07:33:11 +04:00
|
|
|
AC_LIBOBJ([langinfo])
|
|
|
|
],
|
2021-09-24 11:06:10 +03:00
|
|
|
[mingw*], [ LIBS="-lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi -lbcrypt $LIBS"
|
2013-02-11 07:33:11 +04:00
|
|
|
ac_cv_header_pwd_h=no
|
|
|
|
ac_cv_header_utime_h=no
|
|
|
|
ac_cv_header_sys_ioctl_h=no
|
|
|
|
ac_cv_header_sys_param_h=no
|
|
|
|
ac_cv_header_sys_resource_h=no
|
|
|
|
ac_cv_header_sys_select_h=no
|
|
|
|
ac_cv_header_sys_time_h=no
|
|
|
|
ac_cv_header_sys_times_h=no
|
|
|
|
ac_cv_header_sys_socket_h=no
|
2022-01-26 12:23:51 +03:00
|
|
|
ac_cv_func_execv=yes
|
2015-03-23 08:40:48 +03:00
|
|
|
ac_cv_func_lstat=yes
|
2013-02-11 07:33:11 +04:00
|
|
|
ac_cv_func_times=yes
|
|
|
|
ac_cv_func_waitpid=yes
|
|
|
|
ac_cv_func_fsync=yes
|
|
|
|
ac_cv_func_seekdir=yes
|
|
|
|
ac_cv_func_telldir=yes
|
2015-08-26 08:21:41 +03:00
|
|
|
ac_cv_func_lchown=yes
|
2013-02-11 07:33:11 +04:00
|
|
|
ac_cv_func_link=yes
|
2015-03-23 11:36:04 +03:00
|
|
|
ac_cv_func_readlink=yes
|
2022-01-19 19:18:49 +03:00
|
|
|
ac_cv_func_shutdown=yes
|
2015-08-25 00:34:45 +03:00
|
|
|
ac_cv_func_symlink=yes
|
2016-06-01 09:58:21 +03:00
|
|
|
ac_cv_lib_crypt_crypt=no
|
2013-02-11 07:33:11 +04:00
|
|
|
ac_cv_func_getpgrp_void=no
|
|
|
|
ac_cv_func_memcmp_working=yes
|
|
|
|
ac_cv_lib_dl_dlopen=no
|
2021-03-12 09:51:29 +03:00
|
|
|
rb_cv_negative_time_t=yes
|
2013-02-11 07:33:11 +04:00
|
|
|
ac_cv_func_fcntl=yes
|
|
|
|
ac_cv_func_flock=yes
|
|
|
|
ac_cv_func_gmtime_r=yes
|
|
|
|
rb_cv_large_fd_select=yes
|
2013-03-16 11:28:32 +04:00
|
|
|
ac_cv_type_struct_timeval=yes
|
2013-08-19 20:20:40 +04:00
|
|
|
ac_cv_func_clock_gettime=yes
|
2013-09-06 17:49:55 +04:00
|
|
|
ac_cv_func_clock_getres=yes
|
2013-11-21 13:52:09 +04:00
|
|
|
ac_cv_func_malloc_usable_size=no
|
2018-11-21 06:26:58 +03:00
|
|
|
ac_cv_type_off_t=yes
|
|
|
|
ac_cv_sizeof_off_t=8
|
2016-10-31 19:31:12 +03:00
|
|
|
AS_IF([test "$target_cpu" = x64], [
|
2018-11-29 09:37:01 +03:00
|
|
|
ac_cv_func___builtin_setjmp=yes
|
2016-10-31 19:31:12 +03:00
|
|
|
ac_cv_func_round=no
|
|
|
|
])
|
2017-05-14 04:03:15 +03:00
|
|
|
ac_cv_func_tgamma=no
|
2013-06-08 09:17:04 +04:00
|
|
|
AC_CHECK_TYPE([NET_LUID], [], [],
|
2014-12-25 11:27:09 +03:00
|
|
|
[@%:@include <winsock2.h>
|
2014-08-11 05:40:20 +04:00
|
|
|
@%:@include <iphlpapi.h>])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test x"$ac_cv_type_NET_LUID" = xyes], [
|
2013-06-08 09:17:04 +04:00
|
|
|
AC_DEFINE(HAVE_TYPE_NET_LUID, 1)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(_gmtime64_s)
|
2015-06-30 11:28:28 +03:00
|
|
|
AC_CHECK_FUNCS(_wfreopen_s)
|
2013-02-11 07:33:11 +04:00
|
|
|
AC_LIBOBJ([langinfo])
|
|
|
|
],
|
|
|
|
[bsdi*], [ LIBS="-lm $LIBS"
|
|
|
|
AC_DEFINE(BROKEN_SETREUID, 1)
|
|
|
|
AC_DEFINE(BROKEN_SETREGID, 1)
|
|
|
|
ac_cv_sizeof_rlim_t=8],
|
|
|
|
[freebsd*], [ LIBS="-lm $LIBS"
|
|
|
|
ac_cv_func_getpeername=no
|
|
|
|
ac_cv_func_getsockname=no
|
|
|
|
ac_cv_func_shutdown=no
|
|
|
|
ac_cv_func_close=no
|
|
|
|
],
|
2014-04-28 13:08:15 +04:00
|
|
|
[netbsd*], [ LIBS="-lm $LIBS"
|
|
|
|
],
|
2013-02-11 07:33:11 +04:00
|
|
|
[dragonfly*], [ LIBS="-lm $LIBS"
|
|
|
|
],
|
2016-04-24 17:32:31 +03:00
|
|
|
[aix*],[ LIBS="-lm $LIBS"
|
2016-04-23 03:02:25 +03:00
|
|
|
ac_cv_func_round=no
|
2018-12-05 01:19:09 +03:00
|
|
|
ac_cv_func___builtin_setjmp=no
|
2016-04-23 03:02:25 +03:00
|
|
|
],
|
2018-10-09 23:06:36 +03:00
|
|
|
[linux*],[ LIBS="-lm $LIBS"
|
|
|
|
# __builtin_longjmp in ppc64* Linux does not restore
|
|
|
|
# the TOC register (r2), which is problematic
|
|
|
|
# when a global exit happens from JITted .so code.
|
|
|
|
AS_CASE(["$target_cpu"], [powerpc64*], [
|
|
|
|
ac_cv_func___builtin_setjmp=no
|
|
|
|
])
|
2018-11-20 02:05:11 +03:00
|
|
|
# With gcc-8's -fcf-protection, MJIT's __builtin_longjmp fails.
|
2018-11-20 03:39:07 +03:00
|
|
|
AS_CASE(["$CC $CFLAGS "], [*" -fcf-protection "*], [cf_protection=yes], [cf_protection=no])
|
2018-11-20 02:05:11 +03:00
|
|
|
AS_IF([test "$cf_protection" = yes], [
|
|
|
|
ac_cv_func___builtin_setjmp=no
|
|
|
|
])
|
2018-10-09 23:06:36 +03:00
|
|
|
],
|
2021-01-23 10:07:41 +03:00
|
|
|
[emscripten*], [LIBS="-lm -lc $LIBS"
|
2021-03-19 06:30:59 +03:00
|
|
|
RUBY_APPEND_OPTIONS(LDFLAGS, "-sALLOW_MEMORY_GROWTH=1")
|
|
|
|
RUBY_APPEND_OPTIONS(LDFLAGS, "-sASYNCIFY")
|
2021-03-19 21:04:55 +03:00
|
|
|
RUBY_APPEND_OPTIONS(LDFLAGS, "-sFORCE_FILESYSTEM=1")
|
2021-11-03 08:00:51 +03:00
|
|
|
ac_cv_func_shutdown=no
|
2021-01-23 10:07:41 +03:00
|
|
|
],
|
2022-01-15 20:34:43 +03:00
|
|
|
[wasi*],[ LIBS="-lm -lwasi-emulated-mman -lwasi-emulated-signal -lwasi-emulated-getpid -lwasi-emulated-process-clocks $LIBS"
|
|
|
|
RUBY_APPEND_OPTIONS(CFLAGS, -D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_MMAN -D_WASI_EMULATED_GETPID -D_WASI_EMULATED_PROCESS_CLOCKS)
|
|
|
|
RUBY_APPEND_OPTIONS(CPPFLAGS, -D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_MMAN -D_WASI_EMULATED_GETPID -D_WASI_EMULATED_PROCESS_CLOCKS)
|
2022-01-15 17:10:48 +03:00
|
|
|
POSTLINK="\$(WASMOPT) --asyncify \$(wasmoptflags) --pass-arg=asyncify-ignore-imports -o \$@ \$@${POSTLINK:+; $POSTLINK}"
|
2022-01-15 19:18:49 +03:00
|
|
|
# wasi-libc's sys/socket.h is not compatible with -std=gnu99,
|
|
|
|
# so re-declare shutdown in include/ruby/missing.h
|
|
|
|
ac_cv_func_shutdown=no
|
2022-01-19 08:45:52 +03:00
|
|
|
],
|
2013-02-11 07:33:11 +04:00
|
|
|
[ LIBS="-lm $LIBS"])
|
2018-03-14 17:07:00 +03:00
|
|
|
: ${ORIG_LIBS=$LIBS}
|
2013-02-11 07:33:11 +04:00
|
|
|
|
2020-12-15 10:57:28 +03:00
|
|
|
AS_IF([test -n "${rb_there_is_in_fact_no_gplusplus_but_autoconf_is_cheating_us}"], [
|
|
|
|
AC_MSG_NOTICE([Test skipped due to lack of a C++ compiler.])
|
|
|
|
],
|
|
|
|
[test -n "${CXX}"], [
|
2020-08-21 17:53:05 +03:00
|
|
|
RUBY_WERROR_FLAG([
|
|
|
|
AC_MSG_CHECKING([whether CXXFLAGS is valid])
|
|
|
|
AC_LANG_PUSH(C++)
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <cstdio>]], [[]])],
|
|
|
|
[AC_MSG_RESULT(yes)],[
|
2020-08-21 17:53:05 +03:00
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
# The message mentions CXXFLAGS, but CPPFLAGS might also affects.
|
|
|
|
AC_MSG_WARN([something wrong with CXXFLAGS="$CXXFLAGS"])
|
|
|
|
CXX=false
|
|
|
|
])
|
|
|
|
AC_LANG_POP(C++)
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2016-06-01 09:58:21 +03:00
|
|
|
AC_CHECK_LIB(crypt, crypt) # glibc (GNU/Linux, GNU/Hurd, GNU/kFreeBSD)
|
2013-05-10 15:24:06 +04:00
|
|
|
AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
|
|
|
|
AC_CHECK_LIB(socket, shutdown) # SunOS/Solaris
|
|
|
|
|
2013-02-09 17:13:01 +04:00
|
|
|
dnl Checks for header files.
|
|
|
|
AC_HEADER_DIRENT
|
|
|
|
dnl AC_HEADER_STDC has been checked in AC_USE_SYSTEM_EXTENSIONS
|
|
|
|
AC_HEADER_STDBOOL
|
|
|
|
AC_HEADER_SYS_WAIT
|
2015-11-30 23:30:50 +03:00
|
|
|
|
|
|
|
AC_CHECK_HEADERS(atomic.h)
|
2019-01-28 08:04:17 +03:00
|
|
|
AC_CHECK_HEADERS(copyfile.h)
|
2015-11-30 23:30:50 +03:00
|
|
|
AC_CHECK_HEADERS(direct.h)
|
|
|
|
AC_CHECK_HEADERS(grp.h)
|
|
|
|
AC_CHECK_HEADERS(fcntl.h)
|
|
|
|
AC_CHECK_HEADERS(float.h)
|
|
|
|
AC_CHECK_HEADERS(ieeefp.h)
|
|
|
|
AC_CHECK_HEADERS(intrinsics.h)
|
|
|
|
AC_CHECK_HEADERS(langinfo.h)
|
|
|
|
AC_CHECK_HEADERS(limits.h)
|
|
|
|
AC_CHECK_HEADERS(locale.h)
|
|
|
|
AC_CHECK_HEADERS(malloc.h)
|
|
|
|
AC_CHECK_HEADERS(malloc/malloc.h)
|
|
|
|
AC_CHECK_HEADERS(malloc_np.h)
|
|
|
|
AC_CHECK_HEADERS(net/socket.h)
|
|
|
|
AC_CHECK_HEADERS(process.h)
|
|
|
|
AC_CHECK_HEADERS(pwd.h)
|
2018-11-06 13:06:07 +03:00
|
|
|
AC_CHECK_HEADERS(sanitizer/asan_interface.h)
|
|
|
|
AC_CHECK_HEADERS(sanitizer/msan_interface.h)
|
2015-11-30 23:30:50 +03:00
|
|
|
AC_CHECK_HEADERS(setjmpex.h)
|
2018-04-09 05:40:12 +03:00
|
|
|
AC_CHECK_HEADERS(stdalign.h)
|
2022-01-15 19:18:49 +03:00
|
|
|
AC_CHECK_HEADERS(stdio.h)
|
2015-11-30 23:30:50 +03:00
|
|
|
AC_CHECK_HEADERS(sys/attr.h)
|
2018-08-24 22:19:01 +03:00
|
|
|
AC_CHECK_HEADERS(sys/eventfd.h)
|
2015-11-30 23:30:50 +03:00
|
|
|
AC_CHECK_HEADERS(sys/fcntl.h)
|
|
|
|
AC_CHECK_HEADERS(sys/file.h)
|
|
|
|
AC_CHECK_HEADERS(sys/id.h)
|
|
|
|
AC_CHECK_HEADERS(sys/ioctl.h)
|
|
|
|
AC_CHECK_HEADERS(sys/mkdev.h)
|
|
|
|
AC_CHECK_HEADERS(sys/param.h)
|
|
|
|
AC_CHECK_HEADERS(sys/prctl.h)
|
2021-01-18 06:41:58 +03:00
|
|
|
AC_CHECK_HEADERS(sys/random.h)
|
2015-11-30 23:30:50 +03:00
|
|
|
AC_CHECK_HEADERS(sys/resource.h)
|
|
|
|
AC_CHECK_HEADERS(sys/select.h)
|
|
|
|
AC_CHECK_HEADERS(sys/sendfile.h)
|
|
|
|
AC_CHECK_HEADERS(sys/socket.h)
|
|
|
|
AC_CHECK_HEADERS(sys/syscall.h)
|
2016-11-03 09:02:16 +03:00
|
|
|
AC_CHECK_HEADERS(sys/sysmacros.h)
|
2015-11-30 23:30:50 +03:00
|
|
|
AC_CHECK_HEADERS(sys/time.h)
|
|
|
|
AC_CHECK_HEADERS(sys/times.h)
|
|
|
|
AC_CHECK_HEADERS(sys/uio.h)
|
|
|
|
AC_CHECK_HEADERS(sys/utime.h)
|
|
|
|
AC_CHECK_HEADERS(syscall.h)
|
|
|
|
AC_CHECK_HEADERS(time.h)
|
|
|
|
AC_CHECK_HEADERS(ucontext.h)
|
|
|
|
AC_CHECK_HEADERS(utime.h)
|
2020-11-27 11:51:07 +03:00
|
|
|
AS_CASE("$target_cpu", [x64|x86_64|i[3-6]86*], [
|
|
|
|
AC_CHECK_HEADERS(x86intrin.h)
|
|
|
|
])
|
2021-10-01 14:25:30 +03:00
|
|
|
RUBY_UNIVERSAL_CHECK_HEADER([x86_64, i386], x86intrin.h)
|
2013-02-09 17:13:01 +04:00
|
|
|
|
2013-08-31 16:17:18 +04:00
|
|
|
AS_IF([test "x$with_gmp" != xno],
|
|
|
|
[AC_CHECK_HEADERS(gmp.h)
|
|
|
|
AS_IF([test "x$ac_cv_header_gmp_h" != xno],
|
2017-04-05 11:52:31 +03:00
|
|
|
AC_SEARCH_LIBS([__gmpz_init], [gmp],
|
|
|
|
[AC_DEFINE(HAVE_LIBGMP, 1)]))])
|
2013-08-31 16:17:18 +04:00
|
|
|
|
2014-06-04 23:34:03 +04:00
|
|
|
AC_ARG_WITH([jemalloc],
|
|
|
|
[AS_HELP_STRING([--with-jemalloc],[use jemalloc allocator])],
|
2014-12-21 02:35:33 +03:00
|
|
|
[with_jemalloc=$withval], [with_jemalloc=no])
|
2018-05-15 11:08:24 +03:00
|
|
|
AS_IF([test "x$with_jemalloc" != xno],[
|
2021-07-06 19:08:00 +03:00
|
|
|
# find jemalloc header first
|
|
|
|
malloc_header=
|
|
|
|
AC_CHECK_HEADER(jemalloc/jemalloc.h, [malloc_header=jemalloc/jemalloc.h], [
|
|
|
|
AC_CHECK_HEADER(jemalloc.h, [malloc_header=jemalloc.h])
|
|
|
|
])
|
2021-07-06 13:35:38 +03:00
|
|
|
AS_IF([test "$malloc_header" != ""], [
|
|
|
|
AC_DEFINE_UNQUOTED(RUBY_ALTERNATIVE_MALLOC_HEADER, [<$malloc_header>])
|
2014-08-11 05:40:23 +04:00
|
|
|
])
|
2021-07-06 19:08:00 +03:00
|
|
|
save_LIBS="$LIBS"
|
|
|
|
AC_CACHE_CHECK([for jemalloc library], rb_cv_jemalloc_library, [
|
|
|
|
rb_cv_jemalloc_library=no
|
|
|
|
# try [with mangle, without mangle] x [no more additional
|
|
|
|
# libraries, adding jemalloc] combination, using the jemalloc
|
|
|
|
# header found above.
|
|
|
|
for mangle in '' mangle; do
|
|
|
|
for lib in '' -ljemalloc; do
|
|
|
|
LIBS="${lib:+$lib }$LIBS"
|
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([${mangle:+@%:@define JEMALLOC_MANGLE 1}
|
|
|
|
@%:@include <stdio.h>
|
|
|
|
@%:@ifdef RUBY_ALTERNATIVE_MALLOC_HEADER
|
|
|
|
@%:@include RUBY_ALTERNATIVE_MALLOC_HEADER
|
|
|
|
@%:@else
|
|
|
|
extern const char *malloc_conf;
|
|
|
|
@%:@endif],
|
|
|
|
[/* access at runtime not to be optimized away */
|
|
|
|
if (malloc_conf) printf("malloc_conf=%s\n", malloc_conf);])],
|
|
|
|
[rb_cv_jemalloc_library="${lib:-none required}${mangle:+ with mangle}"])
|
|
|
|
LIBS="$save_LIBS"
|
|
|
|
test "${rb_cv_jemalloc_library}" = no || break 2
|
|
|
|
done
|
|
|
|
done
|
2014-06-05 09:16:46 +04:00
|
|
|
])
|
2021-07-06 19:08:00 +03:00
|
|
|
with_jemalloc=${rb_cv_jemalloc_library}
|
2018-05-15 11:08:24 +03:00
|
|
|
AS_CASE(["$with_jemalloc"],
|
2021-07-06 19:08:00 +03:00
|
|
|
[no],
|
|
|
|
[AC_MSG_ERROR([jemalloc requested but not found])],
|
|
|
|
[-l*], [
|
|
|
|
set dummy $with_jemalloc
|
|
|
|
LIBS="$2 $LIBS"
|
2021-12-07 06:32:02 +03:00
|
|
|
DLDLIBS="$2${DLDLIBS:+ $DLDLIBS}" # probably needed also in extension libraries
|
2014-06-05 09:16:46 +04:00
|
|
|
])
|
2021-07-06 19:08:00 +03:00
|
|
|
AS_CASE(["$with_jemalloc"],
|
|
|
|
[*" with mangle"], [
|
|
|
|
AC_DEFINE(JEMALLOC_MANGLE)
|
|
|
|
])
|
|
|
|
AC_DEFINE(HAVE_MALLOC_CONF)
|
|
|
|
ac_cv_func_malloc_usable_size=yes
|
|
|
|
]) # with_jemalloc
|
2014-06-04 23:34:03 +04:00
|
|
|
|
2002-03-14 09:23:46 +03:00
|
|
|
dnl check for large file stuff
|
2007-10-13 23:08:37 +04:00
|
|
|
mv confdefs.h confdefs1.h
|
|
|
|
: > confdefs.h
|
2002-03-14 09:23:46 +03:00
|
|
|
AC_SYS_LARGEFILE
|
2015-11-24 18:00:57 +03:00
|
|
|
# On 32-bit Solaris, it is safe to define _LARGEFILE_SOURCE
|
|
|
|
# which is not added by AC_SYS_LARGEFILE.
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test x"$enable_largefile" != xno], [
|
2015-11-24 18:00:57 +03:00
|
|
|
AS_CASE(["$target_os"], [solaris*], [
|
|
|
|
AC_MSG_CHECKING([wheather _LARGEFILE_SOURCE should be defined])
|
|
|
|
AS_CASE(["${ac_cv_sys_file_offset_bits}:${ac_cv_sys_large_files}"],
|
|
|
|
["64:"|"64:no"|"64:unknown"], [
|
|
|
|
# insert _LARGEFILE_SOURCE before _FILE_OFFSET_BITS line
|
|
|
|
# that is the same order as "getconf LFS_CFLAGS" output
|
|
|
|
mv confdefs.h largefile0.h
|
|
|
|
: > confdefs.h
|
|
|
|
AC_DEFINE(_LARGEFILE_SOURCE)
|
|
|
|
cat largefile0.h >> confdefs.h
|
|
|
|
rm largefile0.h
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
], [AC_MSG_RESULT([no])])
|
|
|
|
])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2007-10-13 23:08:37 +04:00
|
|
|
mv confdefs.h largefile.h
|
|
|
|
mv confdefs1.h confdefs.h
|
|
|
|
cat largefile.h >> confdefs.h
|
2002-03-14 09:23:46 +03:00
|
|
|
|
2014-06-08 19:04:29 +04:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[aix*], [
|
|
|
|
AS_CASE(["$target_cpu:$ac_cv_sys_large_files"],
|
|
|
|
[ppc64:*|powerpc64:*], [],
|
2014-07-23 18:50:00 +04:00
|
|
|
[*:no|*:unknown], [],
|
2014-06-08 19:04:29 +04:00
|
|
|
[
|
|
|
|
# AIX currently does not support a 32-bit call to posix_fadvise()
|
|
|
|
# if _LARGE_FILES is defined.
|
2014-10-06 13:45:25 +04:00
|
|
|
ac_cv_func_posix_fadvise=no
|
2014-06-08 19:04:29 +04:00
|
|
|
])
|
|
|
|
])
|
2006-08-12 10:56:09 +04:00
|
|
|
|
2021-10-01 04:41:54 +03:00
|
|
|
AC_C_BIGENDIAN([], [], [], [AC_DEFINE(AC_APPLE_UNIVERSAL_BUILD, 1)])
|
2010-11-11 17:32:15 +03:00
|
|
|
AC_C_CONST
|
|
|
|
AC_C_CHAR_UNSIGNED
|
|
|
|
AC_C_INLINE
|
|
|
|
AC_C_VOLATILE
|
2014-05-31 16:24:28 +04:00
|
|
|
AC_C_TYPEOF
|
2018-12-28 04:56:20 +03:00
|
|
|
AC_C_RESTRICT
|
2010-11-11 17:32:15 +03:00
|
|
|
|
2010-11-11 17:38:36 +03:00
|
|
|
AS_CASE(":$ac_cv_c_const:$ac_cv_c_volatile:",
|
|
|
|
[*:no:*], [AC_MSG_ERROR(ANSI C-conforming const and volatile are mandatory)])
|
|
|
|
|
2008-12-24 07:33:39 +03:00
|
|
|
AC_CHECK_TYPES([long long, off_t])
|
|
|
|
|
2009-03-08 05:40:00 +03:00
|
|
|
AC_CACHE_CHECK([char bit], [rb_cv_char_bit],
|
2009-08-24 08:14:12 +04:00
|
|
|
[test "$universal_binary" = yes && cross_compiling=yes
|
2009-08-13 13:40:12 +04:00
|
|
|
AC_COMPUTE_INT([rb_cv_char_bit], [CHAR_BIT],
|
|
|
|
[AC_INCLUDES_DEFAULT([@%:@include <limits.h>])], [rb_cv_char_bit=8])
|
2009-08-24 08:14:12 +04:00
|
|
|
test "$universal_binary" = yes && cross_compiling=$real_cross_compiling])
|
2009-03-08 05:40:00 +03:00
|
|
|
|
|
|
|
RUBY_CHECK_SIZEOF(int, [], [ILP])
|
|
|
|
RUBY_CHECK_SIZEOF(short)
|
|
|
|
RUBY_CHECK_SIZEOF(long, [int], [ILP LP])
|
|
|
|
RUBY_CHECK_SIZEOF(long long)
|
2016-02-11 08:58:16 +03:00
|
|
|
RUBY_CHECK_SIZEOF(__int64, [8], [ILP LP])
|
|
|
|
RUBY_CHECK_SIZEOF(__int128, [16], [ILP LP])
|
2009-03-08 05:40:00 +03:00
|
|
|
RUBY_CHECK_SIZEOF(off_t)
|
|
|
|
RUBY_CHECK_SIZEOF(void*, [int long "long long"], [ILP LP LLP])
|
|
|
|
RUBY_CHECK_SIZEOF(float)
|
|
|
|
RUBY_CHECK_SIZEOF(double)
|
2009-03-24 13:23:45 +03:00
|
|
|
RUBY_CHECK_SIZEOF(time_t, [long "long long"], [], [@%:@include <time.h>])
|
2013-08-23 17:07:59 +04:00
|
|
|
RUBY_CHECK_SIZEOF(clock_t, [], [], [@%:@include <time.h>])
|
2009-03-07 16:06:05 +03:00
|
|
|
|
2014-02-24 07:38:14 +04:00
|
|
|
AC_CACHE_CHECK(packed struct attribute, rb_cv_packed_struct,
|
2014-02-25 11:00:10 +04:00
|
|
|
[rb_cv_packed_struct=no
|
|
|
|
for mac in \
|
|
|
|
"__pragma(pack(push, 1)) x __pragma(pack(pop))" \
|
|
|
|
"x __attribute__((packed))" \
|
|
|
|
; do
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@define PACKED_STRUCT(x) $mac
|
|
|
|
PACKED_STRUCT(struct { int a; });]], [[]])],
|
2014-02-25 11:00:10 +04:00
|
|
|
[rb_cv_packed_struct=$mac; break])
|
|
|
|
done])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_packed_struct" != no], [
|
2014-02-25 11:00:10 +04:00
|
|
|
AC_DEFINE_UNQUOTED([PACKED_STRUCT(x)], [$rb_cv_packed_struct])
|
2017-07-30 17:48:45 +03:00
|
|
|
RUBY_TRY_CFLAGS(-Wno-address-of-packed-member, [AC_DEFINE(USE_UNALIGNED_MEMBER_ACCESS)])
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2014-02-25 11:00:10 +04:00
|
|
|
AC_DEFINE_UNQUOTED([PACKED_STRUCT(x)], x)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2014-02-24 07:38:14 +04:00
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "x$ac_cv_type_long_long" = xyes], [
|
2010-11-11 14:49:54 +03:00
|
|
|
RUBY_CHECK_PRINTF_PREFIX(long long, ll I64, LL)
|
2017-06-21 06:27:21 +03:00
|
|
|
], [test "x$ac_cv_type___int64" = xyes], [
|
2010-11-11 14:49:54 +03:00
|
|
|
RUBY_CHECK_PRINTF_PREFIX(__int64, ll I64, LL)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2010-11-11 14:49:54 +03:00
|
|
|
|
2007-02-19 16:16:12 +03:00
|
|
|
RUBY_REPLACE_TYPE(pid_t, int, PIDT)
|
|
|
|
RUBY_REPLACE_TYPE(uid_t, int, UIDT)
|
|
|
|
RUBY_REPLACE_TYPE(gid_t, int, GIDT)
|
2009-01-16 05:41:26 +03:00
|
|
|
RUBY_REPLACE_TYPE(time_t, [], TIMET, [@%:@include <time.h>])
|
2010-10-15 15:30:33 +04:00
|
|
|
RUBY_REPLACE_TYPE(dev_t, [int long "long long"], DEVT)
|
2018-01-19 12:12:06 +03:00
|
|
|
RUBY_REPLACE_TYPE(mode_t, ["unsigned short" "unsigned int" long], MODET, [@%:@include <sys/stat.h>])
|
2013-02-09 17:13:01 +04:00
|
|
|
RUBY_REPLACE_TYPE(rlim_t, [int long "long long"], RLIM, [
|
|
|
|
@%:@ifdef HAVE_SYS_TYPES_H
|
|
|
|
@%:@include <sys/types.h>
|
|
|
|
@%:@endif
|
|
|
|
@%:@ifdef HAVE_SYS_TYPES_H
|
|
|
|
@%:@include <sys/time.h>
|
|
|
|
@%:@endif
|
|
|
|
@%:@include <sys/resource.h>
|
|
|
|
])
|
2013-05-12 12:41:24 +04:00
|
|
|
RUBY_REPLACE_TYPE(off_t, [], OFFT)
|
2018-02-17 08:22:56 +03:00
|
|
|
RUBY_REPLACE_TYPE(clockid_t, [], CLOCKID, [@%:@ifdef HAVE_TIME_H
|
|
|
|
@%:@ include <time.h>
|
|
|
|
@%:@endif
|
|
|
|
@%:@ifdef HAVE_SYS_TIME_H
|
|
|
|
@%:@ include <sys/time.h>
|
|
|
|
@%:@endif])
|
2005-05-14 18:57:53 +04:00
|
|
|
|
2020-04-08 07:28:13 +03:00
|
|
|
# __VA_ARGS__ is also tested in AC_PROG_CC_C99 since autoconf 2.60a (around
|
|
|
|
# 2006). The check below is redundant and should always success. Remain not
|
|
|
|
# deleted for backward compat.
|
2008-07-09 15:18:52 +04:00
|
|
|
AC_CACHE_CHECK(for variable length macro, rb_cv_va_args_macro,
|
2020-12-12 16:55:09 +03:00
|
|
|
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
2020-04-08 07:28:13 +03:00
|
|
|
int foo(const char*);
|
|
|
|
@%:@define FOO(...) foo(@%:@__VA_ARGS__)
|
2020-12-12 16:55:09 +03:00
|
|
|
]], [[FOO(1);FOO(1,2);FOO(1,2,3);]])],
|
2008-07-09 15:18:52 +04:00
|
|
|
rb_cv_va_args_macro=yes,
|
|
|
|
rb_cv_va_args_macro=no)])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_va_args_macro" = yes], [
|
2008-07-09 15:18:52 +04:00
|
|
|
AC_DEFINE(HAVE_VA_ARGS_MACRO)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2008-07-09 15:18:52 +04:00
|
|
|
|
2020-09-23 04:57:35 +03:00
|
|
|
# We want C11's `_Alignof`. GCC (and alike) have `__alignof__`, which behave
|
|
|
|
# slightly differently than the C11's. We cannot use `__alignof__` for our
|
|
|
|
# purpose. The problem is, however, that old gcc and old clang had both
|
|
|
|
# implemented `_Alignof` as a synonym of `__alignof__`. They are not what we
|
|
|
|
# want. We have to check sanity.
|
|
|
|
#
|
|
|
|
# See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023
|
|
|
|
# See also: https://bugs.llvm.org/show_bug.cgi?id=26547
|
|
|
|
AC_CACHE_CHECK([if _Alignof() works], rb_cv_have__alignof,[
|
|
|
|
rb_cv_have__alignof=no
|
|
|
|
RUBY_WERROR_FLAG([
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
2020-09-23 04:57:35 +03:00
|
|
|
@%:@ifdef HAVE_STDALIGN_H
|
|
|
|
@%:@include <stdalign.h>
|
|
|
|
@%:@endif
|
|
|
|
@%:@ifdef STDC_HEADERS
|
|
|
|
@%:@include <stddef.h>
|
|
|
|
@%:@endif
|
|
|
|
@%:@ifndef __GNUC__
|
|
|
|
@%:@define __extension__
|
|
|
|
@%:@endif
|
2020-12-12 16:55:09 +03:00
|
|
|
]], [[
|
2020-09-23 04:57:35 +03:00
|
|
|
typedef struct conftest_tag {
|
|
|
|
char _;
|
|
|
|
double d;
|
|
|
|
} T;
|
|
|
|
static int conftest_ary@<:@
|
|
|
|
offsetof(T, d) == __extension__ _Alignof(double)
|
|
|
|
? 1 : -1
|
|
|
|
@:>@;
|
|
|
|
return conftest_ary@<:@0@:>@;
|
2020-12-12 16:55:09 +03:00
|
|
|
]])],[
|
2020-09-23 04:57:35 +03:00
|
|
|
rb_cv_have__alignof=yes
|
2020-12-12 16:55:09 +03:00
|
|
|
],[])
|
2020-09-23 04:57:35 +03:00
|
|
|
])
|
|
|
|
])
|
|
|
|
AS_IF([test "$rb_cv_have__alignof" != no], [
|
|
|
|
AC_DEFINE(HAVE__ALIGNOF)
|
2018-01-15 05:35:17 +03:00
|
|
|
])
|
|
|
|
|
2016-05-12 21:12:45 +03:00
|
|
|
RUBY_FUNC_ATTRIBUTE(__const__, CONSTFUNC)
|
|
|
|
RUBY_FUNC_ATTRIBUTE(__pure__, PUREFUNC)
|
|
|
|
RUBY_FUNC_ATTRIBUTE(__noreturn__, NORETURN)
|
|
|
|
RUBY_FUNC_ATTRIBUTE(__deprecated__, DEPRECATED)
|
|
|
|
RUBY_FUNC_ATTRIBUTE(__deprecated__("by "@%:@n), DEPRECATED_BY(n,x), rb_cv_func_deprecated_by)
|
|
|
|
RUBY_FUNC_ATTRIBUTE(__noinline__, NOINLINE)
|
2016-05-21 16:24:32 +03:00
|
|
|
RUBY_FUNC_ATTRIBUTE(__always_inline__, ALWAYS_INLINE)
|
2018-11-06 05:57:28 +03:00
|
|
|
RUBY_FUNC_ATTRIBUTE(__no_sanitize__(san), NO_SANITIZE(san, x), rb_cv_func_no_sanitize)
|
|
|
|
RUBY_FUNC_ATTRIBUTE(__no_sanitize_address__, NO_SANITIZE_ADDRESS)
|
|
|
|
RUBY_FUNC_ATTRIBUTE(__no_address_safety_analysis__, NO_ADDRESS_SAFETY_ANALYSIS)
|
2016-09-16 09:15:55 +03:00
|
|
|
RUBY_FUNC_ATTRIBUTE(__warn_unused_result__, WARN_UNUSED_RESULT)
|
|
|
|
RUBY_FUNC_ATTRIBUTE(__unused__, MAYBE_UNUSED)
|
2016-05-24 10:28:34 +03:00
|
|
|
RUBY_FUNC_ATTRIBUTE(__error__ mesg, ERRORFUNC(mesg,x), rb_cv_func___error__)
|
|
|
|
RUBY_FUNC_ATTRIBUTE(__warning__ mesg, WARNINGFUNC(mesg,x), rb_cv_func___warning__)
|
2016-05-12 21:12:45 +03:00
|
|
|
RUBY_FUNC_ATTRIBUTE(__weak__, WEAK, rb_cv_func_weak)
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_func_weak" != x], [
|
2015-12-02 00:52:02 +03:00
|
|
|
AC_DEFINE(HAVE_FUNC_WEAK)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2009-02-07 12:02:50 +03:00
|
|
|
|
2019-09-10 06:22:26 +03:00
|
|
|
AC_CACHE_CHECK([for __attribute__((__depreacted__(msg))) in C++],
|
|
|
|
rb_cv_CentOS6_CXX_workaround,
|
|
|
|
RUBY_WERROR_FLAG([
|
|
|
|
AC_LANG_PUSH([C++])
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM(
|
|
|
|
[],
|
|
|
|
[__attribute__((__deprecated__("message"))) int conftest(...);])],
|
|
|
|
[rb_cv_CentOS6_CXX_workaround=yes],
|
|
|
|
[rb_cv_CentOS6_CXX_workaround=no])
|
|
|
|
AC_LANG_POP()]))
|
2019-09-10 10:03:30 +03:00
|
|
|
AS_IF([test "$rb_cv_CentOS6_CXX_workaround" != no],[
|
2019-09-10 06:22:26 +03:00
|
|
|
AC_DEFINE([RUBY_CXX_DEPRECATED(msg)],
|
|
|
|
[__attribute__((__deprecated__(msg)))])])
|
|
|
|
|
2020-01-31 06:01:39 +03:00
|
|
|
AC_CACHE_CHECK([for std::nullptr_t], rb_cv_CXX_nullptr, [
|
|
|
|
AC_LANG_PUSH([C++])
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM(
|
|
|
|
[@%:@include <cstddef>],
|
|
|
|
[static std::nullptr_t const *const conftest = nullptr;])],
|
|
|
|
[rb_cv_CXX_nullptr=yes],
|
|
|
|
[rb_cv_CXX_nullptr=no])
|
|
|
|
AC_LANG_POP()])
|
|
|
|
AS_IF([test "$rb_cv_CXX_nullptr" != no],[AC_DEFINE(HAVE_NULLPTR)])
|
|
|
|
|
2009-02-07 12:02:50 +03:00
|
|
|
if_i386=${universal_binary+[defined __i386__]}
|
2016-05-16 07:29:01 +03:00
|
|
|
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(__fastcall__, FUNC_FASTCALL, rb_cv_func_fastcall, ${if_i386})
|
2016-05-12 21:12:45 +03:00
|
|
|
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)
|
2001-01-10 11:09:01 +03:00
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$GCC" = yes], [
|
2008-08-13 19:43:55 +04:00
|
|
|
AC_CACHE_CHECK([for function alias], [rb_cv_gcc_function_alias],
|
|
|
|
[rb_cv_gcc_function_alias=no
|
|
|
|
for a in alias weak,alias; do
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[void foo(void) {}
|
|
|
|
void bar(void) __attribute__(($a("foo")));]], [[bar()]])],
|
2008-08-13 19:43:55 +04:00
|
|
|
[rb_cv_gcc_function_alias=$a; break])
|
|
|
|
done])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_gcc_function_alias" != no], [
|
2013-05-31 11:36:19 +04:00
|
|
|
AC_DEFINE(HAVE_ATTRIBUTE_FUNCTION_ALIAS)
|
2009-01-19 11:28:28 +03:00
|
|
|
AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args)],
|
2009-01-19 11:24:10 +03:00
|
|
|
[type prot __attribute__(($rb_cv_gcc_function_alias(@%:@name)));])
|
|
|
|
AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION_VOID(prot, name, args)],
|
2009-01-19 11:28:28 +03:00
|
|
|
[RUBY_ALIAS_FUNCTION_TYPE(void, prot, name, args)])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2021-04-09 11:51:31 +03:00
|
|
|
])
|
2013-11-26 06:45:53 +04:00
|
|
|
|
2021-04-09 11:51:31 +03:00
|
|
|
{
|
2013-11-26 06:45:53 +04:00
|
|
|
AC_CACHE_CHECK([for __atomic builtins], [rb_cv_gcc_atomic_builtins], [
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[unsigned int atomic_var;]],
|
|
|
|
[[
|
2013-11-26 06:45:53 +04:00
|
|
|
__atomic_exchange_n(&atomic_var, 0, __ATOMIC_SEQ_CST);
|
|
|
|
__atomic_exchange_n(&atomic_var, 1, __ATOMIC_SEQ_CST);
|
|
|
|
__atomic_fetch_add(&atomic_var, 1, __ATOMIC_SEQ_CST);
|
|
|
|
__atomic_fetch_sub(&atomic_var, 1, __ATOMIC_SEQ_CST);
|
2014-10-11 17:33:14 +04:00
|
|
|
__atomic_or_fetch(&atomic_var, 1, __ATOMIC_SEQ_CST);
|
2020-12-12 16:55:09 +03:00
|
|
|
]])],
|
2010-10-26 04:13:37 +04:00
|
|
|
[rb_cv_gcc_atomic_builtins=yes],
|
|
|
|
[rb_cv_gcc_atomic_builtins=no])])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_gcc_atomic_builtins" = yes], [
|
2010-10-26 04:13:37 +04:00
|
|
|
AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2012-02-24 10:49:09 +04:00
|
|
|
|
2013-11-26 06:45:53 +04:00
|
|
|
AC_CACHE_CHECK([for __sync builtins], [rb_cv_gcc_sync_builtins], [
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[unsigned int atomic_var;]],
|
|
|
|
[[
|
2013-11-26 06:45:53 +04:00
|
|
|
__sync_lock_test_and_set(&atomic_var, 0);
|
|
|
|
__sync_lock_test_and_set(&atomic_var, 1);
|
|
|
|
__sync_fetch_and_add(&atomic_var, 1);
|
|
|
|
__sync_fetch_and_sub(&atomic_var, 1);
|
2014-10-11 17:33:14 +04:00
|
|
|
__sync_or_and_fetch(&atomic_var, 1);
|
|
|
|
__sync_val_compare_and_swap(&atomic_var, 0, 1);
|
2020-12-12 16:55:09 +03:00
|
|
|
]])],
|
2013-11-26 06:45:53 +04:00
|
|
|
[rb_cv_gcc_sync_builtins=yes],
|
|
|
|
[rb_cv_gcc_sync_builtins=no])])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_gcc_sync_builtins" = yes], [
|
2013-11-26 06:45:53 +04:00
|
|
|
AC_DEFINE(HAVE_GCC_SYNC_BUILTINS)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2013-11-26 06:45:53 +04:00
|
|
|
|
2012-02-24 10:49:09 +04:00
|
|
|
AC_CACHE_CHECK(for __builtin_unreachable, rb_cv_func___builtin_unreachable,
|
2012-04-14 07:55:06 +04:00
|
|
|
[RUBY_WERROR_FLAG(
|
2020-12-12 16:55:09 +03:00
|
|
|
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[volatile int zero;]],
|
|
|
|
[[if (zero) __builtin_unreachable();]])],
|
2012-02-24 10:49:09 +04:00
|
|
|
[rb_cv_func___builtin_unreachable=yes],
|
|
|
|
[rb_cv_func___builtin_unreachable=no])
|
|
|
|
])
|
2012-04-14 07:55:06 +04:00
|
|
|
])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_func___builtin_unreachable" = yes], [
|
2022-02-19 10:02:29 +03:00
|
|
|
AC_DEFINE(HAVE___BUILTIN_UNREACHABLE)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2022-02-19 15:22:13 +03:00
|
|
|
|
|
|
|
AC_CACHE_CHECK(for __assume, rb_cv_func___assume,
|
|
|
|
[RUBY_WERROR_FLAG([
|
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
|
|
|
|
[[__assume(1);]])],
|
|
|
|
[rb_cv_func___assume=yes],
|
|
|
|
[rb_cv_func___assume=no])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
AS_IF([test "$rb_cv_func___assume" = yes], [
|
|
|
|
AC_DEFINE(HAVE___ASSUME)
|
|
|
|
])
|
2021-04-09 11:51:31 +03:00
|
|
|
}
|
2008-08-13 19:43:55 +04:00
|
|
|
|
2010-08-14 10:33:06 +04:00
|
|
|
AC_CACHE_CHECK(for exported function attribute, rb_cv_func_exported, [
|
|
|
|
rb_cv_func_exported=no
|
|
|
|
RUBY_WERROR_FLAG([
|
2016-05-12 21:12:45 +03:00
|
|
|
for mac in '__attribute__ ((__visibility__("default")))' '__declspec(dllexport)'; do
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@define RUBY_FUNC_EXPORTED $mac extern
|
|
|
|
RUBY_FUNC_EXPORTED void conftest_attribute_check(void);]], [[]])],
|
2010-08-14 10:33:06 +04:00
|
|
|
[rb_cv_func_exported="$mac"; break])
|
|
|
|
done
|
|
|
|
])])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_func_exported" != no], [
|
2010-08-14 10:33:06 +04:00
|
|
|
AC_DEFINE_UNQUOTED(RUBY_FUNC_EXPORTED, [$rb_cv_func_exported extern])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2019-10-29 06:12:07 +03:00
|
|
|
RUBY_DECL_ATTRIBUTE([__nonnull__(n)], [RUBY_FUNC_NONNULL(n,x)], [rb_cv_func_nonnull],
|
|
|
|
[], [function], [
|
|
|
|
@%:@define x int conftest_attribute_check(void *p)
|
|
|
|
@%:@define n 1
|
|
|
|
])
|
2010-08-14 10:33:06 +04:00
|
|
|
|
2009-02-08 07:09:34 +03:00
|
|
|
RUBY_APPEND_OPTION(XCFLAGS, -DRUBY_EXPORT)
|
2005-10-25 21:00:03 +04:00
|
|
|
|
2018-03-09 07:24:48 +03:00
|
|
|
AC_ARG_ENABLE(mathn,
|
2020-10-23 08:38:24 +03:00
|
|
|
AS_HELP_STRING([--enable-mathn], [enable canonicalization for mathn]),
|
|
|
|
[AC_MSG_ERROR([mathn support has been dropped])])
|
2018-03-09 07:24:48 +03:00
|
|
|
|
2013-03-14 11:59:16 +04:00
|
|
|
AC_CACHE_CHECK(for function name string predefined identifier,
|
|
|
|
rb_cv_function_name_string,
|
2019-12-28 11:25:11 +03:00
|
|
|
[AS_CASE(["$target_os"],[openbsd*],[
|
|
|
|
rb_cv_function_name_string=__func__
|
|
|
|
],[
|
|
|
|
rb_cv_function_name_string=no
|
|
|
|
RUBY_WERROR_FLAG([
|
|
|
|
for func in __func__ __FUNCTION__; do
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include <stdio.h>]],
|
2021-09-10 08:19:00 +03:00
|
|
|
[[puts($func);]])],
|
2019-12-28 11:25:11 +03:00
|
|
|
[rb_cv_function_name_string=$func
|
|
|
|
break])
|
|
|
|
done
|
|
|
|
])])]
|
2013-03-14 11:59:16 +04:00
|
|
|
)
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_function_name_string" != no], [
|
2013-03-14 11:59:16 +04:00
|
|
|
AC_DEFINE_UNQUOTED(RUBY_FUNCTION_NAME_STRING, [$rb_cv_function_name_string])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2013-03-14 11:59:16 +04:00
|
|
|
|
2015-09-13 05:01:22 +03:00
|
|
|
AC_CACHE_CHECK(if enum over int is allowed, rb_cv_enum_over_int, [
|
|
|
|
rb_cv_enum_over_int=no
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "x$ac_cv_type_long_long" = xyes], [
|
2015-09-13 05:02:58 +03:00
|
|
|
type="unsigned long long" max="ULLONG_MAX"
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2015-09-13 05:01:22 +03:00
|
|
|
type="unsigned long" max="ULONG_MAX"
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2015-09-13 05:01:22 +03:00
|
|
|
RUBY_WERROR_FLAG([
|
|
|
|
AC_COMPILE_IFELSE([
|
|
|
|
AC_LANG_BOOL_COMPILE_TRY([
|
|
|
|
@%:@include <limits.h>
|
|
|
|
enum {conftest_max = $max};
|
|
|
|
], [
|
|
|
|
(conftest_max == $max) &&
|
|
|
|
(sizeof(conftest_max) == sizeof($type))
|
|
|
|
]
|
|
|
|
)],
|
|
|
|
[rb_cv_enum_over_int=yes],
|
|
|
|
[rb_cv_enum_over_int=no]
|
|
|
|
)
|
|
|
|
])
|
|
|
|
])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test $rb_cv_enum_over_int = yes], [
|
2015-09-13 05:01:22 +03:00
|
|
|
AC_DEFINE(ENUM_OVER_INT, 1)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2015-09-13 05:01:22 +03:00
|
|
|
|
2002-05-02 11:50:36 +04:00
|
|
|
dnl Check whether we need to define sys_nerr locally
|
2002-05-03 15:24:30 +04:00
|
|
|
AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default
|
2012-08-21 20:18:05 +04:00
|
|
|
@%:@include <errno.h>])
|
1999-01-20 07:59:39 +03:00
|
|
|
|
2013-05-12 12:40:24 +04:00
|
|
|
AC_CHECK_DECLS([getenv])
|
|
|
|
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_cpu"],
|
2010-09-25 04:52:20 +04:00
|
|
|
[alpha*|sh4|sh4el|sh4eb], [AS_CASE(["$target_os"::"$GCC"],
|
2010-01-21 03:38:03 +03:00
|
|
|
[*::yes], # gcc
|
|
|
|
[CFLAGS="-mieee $CFLAGS"],
|
|
|
|
[osf*], # ccc
|
|
|
|
[CFLAGS="-ieee $CFLAGS"],
|
2011-11-15 08:42:31 +04:00
|
|
|
)],
|
|
|
|
[sparc*], [AC_LIBOBJ([sparc])])
|
2003-06-23 23:54:41 +04:00
|
|
|
|
2008-08-08 12:03:19 +04:00
|
|
|
ac_cv_header_net_socket_h=${ac_cv_header_net_socket_h=no}
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$ac_cv_header_net_socket_h" = yes], [
|
2008-08-08 12:03:19 +04:00
|
|
|
ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=no}
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2008-08-08 12:03:19 +04:00
|
|
|
ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=yes}
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2008-08-08 12:03:19 +04:00
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
AC_TYPE_SIZE_T
|
2013-09-12 17:40:06 +04:00
|
|
|
RUBY_CHECK_SIGNEDNESS(size_t, [AC_MSG_ERROR(size_t is signed)], [],
|
|
|
|
[@%:@include <sys/types.h>])
|
2009-04-06 21:27:50 +04:00
|
|
|
RUBY_CHECK_SIZEOF(size_t, [int long void*], [], [@%:@include <sys/types.h>])
|
|
|
|
RUBY_CHECK_SIZEOF(ptrdiff_t, size_t, [], [@%:@include <stddef.h>])
|
2021-04-12 08:42:26 +03:00
|
|
|
RUBY_CHECK_SIZEOF(dev_t)
|
2013-06-07 06:41:45 +04:00
|
|
|
RUBY_CHECK_PRINTF_PREFIX(size_t, z)
|
2010-10-12 19:03:51 +04:00
|
|
|
RUBY_CHECK_PRINTF_PREFIX(ptrdiff_t, t)
|
2020-12-12 11:20:58 +03:00
|
|
|
AC_CHECK_MEMBERS([struct stat.st_blksize])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_blocks])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_rdev])
|
2014-10-07 05:48:18 +04:00
|
|
|
RUBY_CHECK_SIZEOF([struct stat.st_size], [off_t int long "long long"], [], [@%:@include <sys/stat.h>])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$ac_cv_member_struct_stat_st_blocks" = yes], [
|
2014-10-07 05:48:18 +04:00
|
|
|
RUBY_CHECK_SIZEOF([struct stat.st_blocks], [off_t int long "long long"], [], [@%:@include <sys/stat.h>])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2014-10-07 05:48:18 +04:00
|
|
|
RUBY_CHECK_SIZEOF([struct stat.st_ino], [long "long long"], [], [@%:@include <sys/stat.h>])
|
2021-04-12 08:42:26 +03:00
|
|
|
RUBY_CHECK_SIZEOF([struct stat.st_dev], [dev_t int long "long long"], [], [@%:@include <sys/stat.h>])
|
|
|
|
AS_IF([test "$ac_cv_member_struct_stat_st_rdev" = yes], [
|
|
|
|
RUBY_CHECK_SIZEOF([struct stat.st_rdev], [dev_t int long "long long"], [], [@%:@include <sys/stat.h>])
|
|
|
|
])
|
* configure.in: check struct timespec, clock_gettime, utimensat,
struct stat.st_atim,
struct stat.st_atimespec,
struct stat.st_atimensec,
struct stat.st_mtim,
struct stat.st_mtimespec,
struct stat.st_mtimensec,
struct stat.st_ctim,
struct stat.st_ctimespec,
struct stat.st_ctimensec.
* include/ruby/missing.h: provide struct timespec if not available.
* time.c: support nanosecond-resolution using struct timespec.
* include/ruby/intern.h: provide rb_time_nano_new.
* file.c (utime_internal): use utimensat if available.
(rb_file_s_utime): refactored.
(rb_f_test): use stat_atime, stat_mtime, stat_ctime.
(rb_stat_cmp): check tv_nsec.
(stat_atimespec): new function.
(stat_atime): ditto.
(stat_mtimespec): ditto.
(stat_mtime): ditto.
(stat_ctimespec): ditto.
(stat_ctime): ditto.
(rb_stat_atime): use stat_atime.
(rb_file_s_atime): ditto.
(rb_file_atime): ditto.
(rb_stat_mtime): use stat_mtime.
(rb_file_s_mtime): ditto.
(rb_file_mtime): ditto.
(rb_file_ctime): use stat_ctime.
(rb_file_s_ctime): ditto.
(rb_stat_ctime): ditto.
* variable.c (rb_copy_generic_ivar): clear clone's instance variables
if obj has no instance variable.
* marshal.c (w_object): dump instance variables of generated string
for TYPE_USERDEF, even if original object has instance variables.
* lib/time.rb (Time#xmlschema): use nsec instead of usec.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-19 12:09:38 +03:00
|
|
|
AC_CHECK_MEMBERS([struct stat.st_atim])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_atimespec])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_atimensec])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_mtim])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_mtimespec])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_mtimensec])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_ctim])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_ctimespec])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_ctimensec])
|
2014-05-22 15:49:22 +04:00
|
|
|
AC_CHECK_MEMBERS([struct stat.st_birthtimespec])
|
2019-02-24 14:57:18 +03:00
|
|
|
AS_IF([test "x$ac_cv_member_struct_stat_st_birthtimespec" != xyes],
|
|
|
|
[AC_CHECK_MEMBERS([struct statx.stx_btime])])
|
* configure.in: check struct timespec, clock_gettime, utimensat,
struct stat.st_atim,
struct stat.st_atimespec,
struct stat.st_atimensec,
struct stat.st_mtim,
struct stat.st_mtimespec,
struct stat.st_mtimensec,
struct stat.st_ctim,
struct stat.st_ctimespec,
struct stat.st_ctimensec.
* include/ruby/missing.h: provide struct timespec if not available.
* time.c: support nanosecond-resolution using struct timespec.
* include/ruby/intern.h: provide rb_time_nano_new.
* file.c (utime_internal): use utimensat if available.
(rb_file_s_utime): refactored.
(rb_f_test): use stat_atime, stat_mtime, stat_ctime.
(rb_stat_cmp): check tv_nsec.
(stat_atimespec): new function.
(stat_atime): ditto.
(stat_mtimespec): ditto.
(stat_mtime): ditto.
(stat_ctimespec): ditto.
(stat_ctime): ditto.
(rb_stat_atime): use stat_atime.
(rb_file_s_atime): ditto.
(rb_file_atime): ditto.
(rb_stat_mtime): use stat_mtime.
(rb_file_s_mtime): ditto.
(rb_file_mtime): ditto.
(rb_file_ctime): use stat_ctime.
(rb_file_s_ctime): ditto.
(rb_stat_ctime): ditto.
* variable.c (rb_copy_generic_ivar): clear clone's instance variables
if obj has no instance variable.
* marshal.c (w_object): dump instance variables of generated string
for TYPE_USERDEF, even if original object has instance variables.
* lib/time.rb (Time#xmlschema): use nsec instead of usec.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-19 12:09:38 +03:00
|
|
|
|
2013-03-16 09:06:47 +04:00
|
|
|
AC_CHECK_TYPES([struct timeval], [], [], [@%:@ifdef HAVE_TIME_H
|
|
|
|
@%:@include <time.h>
|
|
|
|
@%:@endif
|
|
|
|
@%:@ifdef HAVE_SYS_TIME_H
|
|
|
|
@%:@include <sys/time.h>
|
|
|
|
@%:@endif])
|
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "${ac_cv_type_struct_timeval}" = yes], [
|
2013-03-31 01:08:42 +04:00
|
|
|
RUBY_CHECK_SIZEOF([struct timeval.tv_sec], [time_t long "long long"], [],
|
|
|
|
[@%:@ifdef HAVE_TIME_H
|
|
|
|
@%:@include <time.h>
|
|
|
|
@%:@endif
|
|
|
|
@%:@ifdef HAVE_SYS_TIME_H
|
|
|
|
@%:@include <sys/time.h>
|
|
|
|
@%:@endif])
|
|
|
|
AS_CASE(${ac_cv_sizeof_struct_timeval_tv_sec},
|
|
|
|
[SIZEOF_INT], [t=int],
|
|
|
|
[SIZEOF_LONG], [t=long],
|
|
|
|
[SIZEOF_LONG_LONG], [t=LONG_LONG],
|
|
|
|
[t=])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "${t}" != ""], [
|
2013-03-31 01:08:42 +04:00
|
|
|
AC_DEFINE_UNQUOTED(TYPEOF_TIMEVAL_TV_SEC, [$t])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
])
|
2013-03-31 01:08:42 +04:00
|
|
|
|
2008-04-22 10:25:05 +04:00
|
|
|
AC_CHECK_TYPES([struct timespec], [], [], [@%:@ifdef HAVE_TIME_H
|
|
|
|
@%:@include <time.h>
|
2012-05-17 06:48:59 +04:00
|
|
|
@%:@endif
|
|
|
|
@%:@ifdef HAVE_SYS_TIME_H
|
|
|
|
@%:@include <sys/time.h>
|
2008-04-22 10:25:05 +04:00
|
|
|
@%:@endif])
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2010-01-13 00:54:47 +03:00
|
|
|
AC_CHECK_TYPES([struct timezone], [], [], [@%:@ifdef HAVE_TIME_H
|
|
|
|
@%:@ include <time.h>
|
|
|
|
@%:@endif
|
|
|
|
@%:@ifdef HAVE_SYS_TIME_H
|
|
|
|
@%:@ include <sys/time.h>
|
|
|
|
@%:@endif])
|
|
|
|
|
2010-05-26 05:35:38 +04:00
|
|
|
AC_CACHE_VAL([rb_cv_large_fd_select],
|
2017-12-27 17:07:49 +03:00
|
|
|
[AC_CHECK_TYPE(fd_mask, [rb_cv_large_fd_select=yes], [rb_cv_large_fd_select=no], [AC_INCLUDES_DEFAULT([])
|
|
|
|
@%:@ifdef HAVE_SYS_SELECT_H
|
2017-07-28 19:47:50 +03:00
|
|
|
@%:@ include <sys/select.h>
|
|
|
|
@%:@endif])])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_large_fd_select" = yes], [
|
2010-05-26 05:35:38 +04:00
|
|
|
AC_DEFINE(HAVE_RB_FD_INIT, 1)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2005-11-11 20:11:05 +03:00
|
|
|
|
* configure.in (int8_t, uint8_t, int16_t, uint16_t int32_t,
uint32_t int64_t, uint64_t, int128_t, uint128_t,
intptr_t, uintptr_t): check if defined.
* win32/Makefile.sub: follow configure.in.
* ext/digest/defs.h: remove checks for uint8_t, uint32_t and uint64_t.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-14 04:47:02 +03:00
|
|
|
RUBY_DEFINT(int8_t, 1)
|
|
|
|
RUBY_DEFINT(uint8_t, 1, unsigned)
|
|
|
|
RUBY_DEFINT(int16_t, 2)
|
|
|
|
RUBY_DEFINT(uint16_t, 2, unsigned)
|
|
|
|
RUBY_DEFINT(int32_t, 4)
|
|
|
|
RUBY_DEFINT(uint32_t, 4, unsigned)
|
|
|
|
RUBY_DEFINT(int64_t, 8)
|
|
|
|
RUBY_DEFINT(uint64_t, 8, unsigned)
|
2016-02-05 07:31:27 +03:00
|
|
|
RUBY_DEFINT(int128_t, 16)
|
|
|
|
RUBY_DEFINT(uint128_t, 16, unsigned)
|
* configure.in (int8_t, uint8_t, int16_t, uint16_t int32_t,
uint32_t int64_t, uint64_t, int128_t, uint128_t,
intptr_t, uintptr_t): check if defined.
* win32/Makefile.sub: follow configure.in.
* ext/digest/defs.h: remove checks for uint8_t, uint32_t and uint64_t.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-14 04:47:02 +03:00
|
|
|
RUBY_DEFINT(intptr_t, void*)
|
|
|
|
RUBY_DEFINT(uintptr_t, void*, unsigned)
|
2018-10-13 19:21:07 +03:00
|
|
|
AS_IF([test "x$rb_cv_type_intptr_t" != xno], [
|
|
|
|
RUBY_CHECK_PRINTF_PREFIX(intptr_t, '' ll I64 l, PTR)
|
|
|
|
])
|
2009-04-06 21:27:50 +04:00
|
|
|
RUBY_DEFINT(ssize_t, size_t, [], [@%:@include <sys/types.h>]) dnl may differ from int, so not use AC_TYPE_SSIZE_T.
|
2018-08-27 08:39:09 +03:00
|
|
|
AS_IF([test "x$rb_cv_type_int64_t" != xno], [
|
|
|
|
RUBY_CHECK_PRINTF_PREFIX(int64_t, ll I64 l, 64)
|
|
|
|
])
|
2008-03-12 19:45:28 +03:00
|
|
|
|
2004-07-08 14:27:23 +04:00
|
|
|
AC_CACHE_CHECK(for stack end address, rb_cv_stack_end_address,
|
|
|
|
[rb_cv_stack_end_address=no
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM(
|
|
|
|
[[extern void *__libc_stack_end;]],
|
|
|
|
[[if (!__libc_stack_end) return 1;]])],
|
2012-06-24 19:42:21 +04:00
|
|
|
[rb_cv_stack_end_address="__libc_stack_end"])
|
|
|
|
])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test $rb_cv_stack_end_address != no], [
|
2004-07-08 14:27:23 +04:00
|
|
|
AC_DEFINE_UNQUOTED(STACK_END_ADDRESS, $rb_cv_stack_end_address)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2004-07-08 14:27:23 +04:00
|
|
|
|
1998-01-16 15:13:05 +03:00
|
|
|
dnl Checks for library functions.
|
|
|
|
AC_TYPE_GETGROUPS
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["${target_cpu}-${target_os}:${target_archs}"],
|
2022-05-22 06:02:03 +03:00
|
|
|
[powerpc*-darwin*], [
|
2006-10-22 23:09:08 +04:00
|
|
|
AC_LIBSOURCES(alloca.c)
|
|
|
|
AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.${ac_objext}])
|
|
|
|
AC_DEFINE(C_ALLOCA)
|
|
|
|
AC_DEFINE_UNQUOTED(alloca, alloca)
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[universal-darwin*:*ppc*], [
|
2009-02-07 12:02:50 +03:00
|
|
|
AC_LIBSOURCES(alloca.c)
|
|
|
|
AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.${ac_objext}])
|
2022-10-19 13:49:45 +03:00
|
|
|
RUBY_DEFINE_IF([defined __POWERPC__], C_ALLOCA, 1) # Darwin defines __POWERPC__ for ppc and ppc64 both
|
|
|
|
RUBY_DEFINE_IF([defined __POWERPC__], alloca, alloca)
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[
|
2006-10-22 23:09:08 +04:00
|
|
|
AC_FUNC_ALLOCA
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "x$ALLOCA" = "x"], [
|
2010-10-26 13:09:45 +04:00
|
|
|
AC_CACHE_CHECK([for dynamic size alloca], rb_cv_dynamic_alloca, [
|
|
|
|
for chk in ok __chkstk; do
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
2010-10-26 13:09:45 +04:00
|
|
|
@%:@ifdef HAVE_ALLOCA_H
|
|
|
|
@%:@include <alloca.h>
|
|
|
|
@%:@endif
|
|
|
|
void $chk() {}
|
|
|
|
int dynamic_alloca_test;
|
2020-12-12 16:55:09 +03:00
|
|
|
int dynamic_alloca_result;]],
|
|
|
|
[[dynamic_alloca_result = alloca(dynamic_alloca_test) != 0;]])],
|
2010-10-26 13:09:45 +04:00
|
|
|
[rb_cv_dynamic_alloca=$chk; break])
|
|
|
|
done])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "x$rb_cv_dynamic_alloca" = "x__chkstk"], [
|
2010-10-26 13:09:45 +04:00
|
|
|
AC_DEFINE_UNQUOTED(RUBY_ALLOCA_CHKSTK, _$rb_cv_dynamic_alloca)
|
|
|
|
AS_CASE("$target_cpu",
|
|
|
|
[x64|x86_64], [
|
|
|
|
AC_SUBST([ALLOCA], [\${LIBOBJDIR}x86_64-chkstk.${ac_objext}])
|
|
|
|
],)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
])
|
1999-01-20 07:59:39 +03:00
|
|
|
AC_FUNC_MEMCMP
|
2008-07-03 11:22:06 +04:00
|
|
|
|
2010-07-28 21:38:56 +04:00
|
|
|
AS_CASE(["$target_os"],[freebsd*],[
|
2010-07-26 07:05:25 +04:00
|
|
|
AC_DEFINE(BROKEN_CLOSE)
|
|
|
|
AC_REPLACE_FUNCS(close)
|
|
|
|
])
|
2014-05-12 15:33:39 +04:00
|
|
|
|
2021-12-09 06:44:45 +03:00
|
|
|
# dup and dup2 are always available except for WASI
|
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[wasi*], [],
|
|
|
|
[
|
2022-03-28 10:56:15 +03:00
|
|
|
RUBY_REQUIRE_FUNCS(dup dup2)
|
2021-12-09 06:44:45 +03:00
|
|
|
]
|
|
|
|
)
|
2021-05-01 16:07:46 +03:00
|
|
|
|
2014-05-12 15:33:39 +04:00
|
|
|
AC_REPLACE_FUNCS(acosh)
|
|
|
|
AC_REPLACE_FUNCS(cbrt)
|
2016-06-01 09:58:21 +03:00
|
|
|
AC_REPLACE_FUNCS(crypt)
|
2014-05-12 15:33:39 +04:00
|
|
|
AC_REPLACE_FUNCS(erf)
|
2015-11-30 23:26:13 +03:00
|
|
|
AC_REPLACE_FUNCS(explicit_bzero)
|
2014-05-12 15:33:39 +04:00
|
|
|
AC_REPLACE_FUNCS(ffs)
|
|
|
|
AC_REPLACE_FUNCS(flock)
|
|
|
|
AC_REPLACE_FUNCS(hypot)
|
|
|
|
AC_REPLACE_FUNCS(lgamma_r)
|
|
|
|
AC_REPLACE_FUNCS(memmove)
|
2018-01-20 06:16:59 +03:00
|
|
|
AC_REPLACE_FUNCS(nan)
|
2014-05-18 04:37:10 +04:00
|
|
|
AC_REPLACE_FUNCS(nextafter)
|
2014-05-12 15:33:39 +04:00
|
|
|
AC_REPLACE_FUNCS(setproctitle)
|
|
|
|
AC_REPLACE_FUNCS(strchr)
|
|
|
|
AC_REPLACE_FUNCS(strerror)
|
|
|
|
AC_REPLACE_FUNCS(strlcat)
|
|
|
|
AC_REPLACE_FUNCS(strlcpy)
|
|
|
|
AC_REPLACE_FUNCS(strstr)
|
|
|
|
AC_REPLACE_FUNCS(tgamma)
|
2011-05-14 14:49:47 +04:00
|
|
|
|
2021-08-27 04:52:02 +03:00
|
|
|
AC_DEFINE(HAVE_ISFINITE) # C99; backward compatibility
|
2019-02-08 10:22:55 +03:00
|
|
|
|
2011-05-14 14:49:47 +04:00
|
|
|
# for missing/setproctitle.c
|
|
|
|
AS_CASE(["$target_os"],
|
2012-01-17 12:18:46 +04:00
|
|
|
[aix* | k*bsd*-gnu | kopensolaris*-gnu | linux* | darwin*], [AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)],
|
2011-05-14 14:49:47 +04:00
|
|
|
[])
|
2013-08-28 06:25:04 +04:00
|
|
|
AC_CHECK_HEADERS(sys/pstat.h)
|
2011-05-14 14:49:47 +04:00
|
|
|
|
|
|
|
|
2021-08-27 06:42:23 +03:00
|
|
|
AC_DEFINE(HAVE_SIGNBIT) # C99; backward compatibility
|
2013-05-10 07:01:51 +04:00
|
|
|
|
2014-09-03 02:51:03 +04:00
|
|
|
AC_FUNC_FORK
|
|
|
|
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(__syscall)
|
|
|
|
AC_CHECK_FUNCS(_longjmp) # used for AC_ARG_WITH(setjmp-type)
|
2015-03-02 09:36:12 +03:00
|
|
|
# we don't use _setjmp if _longjmp doesn't exist.
|
|
|
|
test x$ac_cv_func__longjmp = xno && ac_cv_func__setjmp=no
|
2016-05-05 04:49:35 +03:00
|
|
|
AC_CHECK_FUNCS(arc4random_buf)
|
2014-05-04 05:23:01 +04:00
|
|
|
AC_CHECK_FUNCS(atan2l atan2f)
|
2022-01-15 19:18:49 +03:00
|
|
|
AC_CHECK_FUNCS(chmod)
|
|
|
|
AC_CHECK_FUNCS(chown)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(chroot)
|
|
|
|
AC_CHECK_FUNCS(chsize)
|
|
|
|
AC_CHECK_FUNCS(clock_gettime)
|
2019-01-21 13:11:04 +03:00
|
|
|
AC_CHECK_FUNCS(copy_file_range)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(cosh)
|
2016-06-01 13:42:45 +03:00
|
|
|
AC_CHECK_FUNCS(crypt_r)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(daemon)
|
2014-09-04 19:54:04 +04:00
|
|
|
AC_CHECK_FUNCS(dirfd)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(dl_iterate_phdr)
|
|
|
|
AC_CHECK_FUNCS(dlopen)
|
2014-03-10 07:20:53 +04:00
|
|
|
AC_CHECK_FUNCS(dladdr)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(dup3)
|
|
|
|
AC_CHECK_FUNCS(eaccess)
|
|
|
|
AC_CHECK_FUNCS(endgrent)
|
2018-08-24 22:19:01 +03:00
|
|
|
AC_CHECK_FUNCS(eventfd)
|
2022-01-15 19:18:49 +03:00
|
|
|
AC_CHECK_FUNCS(execl)
|
|
|
|
AC_CHECK_FUNCS(execle)
|
2022-01-26 12:23:51 +03:00
|
|
|
AC_CHECK_FUNCS(execv)
|
2022-01-15 19:18:49 +03:00
|
|
|
AC_CHECK_FUNCS(execve)
|
2019-08-17 08:17:30 +03:00
|
|
|
AC_CHECK_FUNCS(explicit_memset)
|
2019-01-28 08:04:17 +03:00
|
|
|
AC_CHECK_FUNCS(fcopyfile)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(fchmod)
|
|
|
|
AC_CHECK_FUNCS(fchown)
|
|
|
|
AC_CHECK_FUNCS(fcntl)
|
|
|
|
AC_CHECK_FUNCS(fdatasync)
|
2017-05-23 17:34:12 +03:00
|
|
|
AC_CHECK_FUNCS(fdopendir)
|
2015-04-10 17:57:47 +03:00
|
|
|
AC_CHECK_FUNCS(fgetattrlist)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(fmod)
|
2017-05-23 17:34:12 +03:00
|
|
|
AC_CHECK_FUNCS(fstatat)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(fsync)
|
|
|
|
AC_CHECK_FUNCS(ftruncate)
|
|
|
|
AC_CHECK_FUNCS(ftruncate64) # used for Win32 platform
|
2014-12-25 09:36:18 +03:00
|
|
|
AC_CHECK_FUNCS(getattrlist)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(getcwd)
|
2022-01-15 19:18:49 +03:00
|
|
|
AC_CHECK_FUNCS(getegid)
|
2021-01-16 15:47:33 +03:00
|
|
|
AC_CHECK_FUNCS(getentropy)
|
2022-01-15 19:18:49 +03:00
|
|
|
AC_CHECK_FUNCS(geteuid)
|
|
|
|
AC_CHECK_FUNCS(getgid)
|
2014-09-05 07:43:28 +04:00
|
|
|
AC_CHECK_FUNCS(getgidx)
|
2014-10-11 17:33:14 +04:00
|
|
|
AC_CHECK_FUNCS(getgrnam)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(getgrnam_r)
|
|
|
|
AC_CHECK_FUNCS(getgroups)
|
2020-04-15 14:29:16 +03:00
|
|
|
AC_CHECK_FUNCS(getlogin)
|
|
|
|
AC_CHECK_FUNCS(getlogin_r)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(getpgid)
|
|
|
|
AC_CHECK_FUNCS(getpgrp)
|
2022-01-15 19:18:49 +03:00
|
|
|
AC_CHECK_FUNCS(getppid)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(getpriority)
|
2020-04-15 14:29:16 +03:00
|
|
|
AC_CHECK_FUNCS(getpwnam)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(getpwnam_r)
|
2020-04-15 14:29:16 +03:00
|
|
|
AC_CHECK_FUNCS(getpwuid)
|
|
|
|
AC_CHECK_FUNCS(getpwuid_r)
|
2019-02-10 11:21:33 +03:00
|
|
|
AC_CHECK_FUNCS(getrandom)
|
2014-09-04 18:56:03 +04:00
|
|
|
AC_CHECK_FUNCS(getresgid)
|
|
|
|
AC_CHECK_FUNCS(getresuid)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(getrlimit)
|
|
|
|
AC_CHECK_FUNCS(getsid)
|
|
|
|
AC_CHECK_FUNCS(gettimeofday) # for making ac_cv_func_gettimeofday
|
2022-01-15 19:18:49 +03:00
|
|
|
AC_CHECK_FUNCS(getuid)
|
2014-09-05 07:43:28 +04:00
|
|
|
AC_CHECK_FUNCS(getuidx)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(gmtime_r)
|
2018-07-05 06:02:33 +03:00
|
|
|
AC_CHECK_FUNCS(grantpt)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(initgroups)
|
|
|
|
AC_CHECK_FUNCS(ioctl)
|
|
|
|
AC_CHECK_FUNCS(isfinite)
|
|
|
|
AC_CHECK_FUNCS(issetugid)
|
2022-01-15 19:18:49 +03:00
|
|
|
AC_CHECK_FUNCS(kill)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(killpg)
|
|
|
|
AC_CHECK_FUNCS(lchmod)
|
|
|
|
AC_CHECK_FUNCS(lchown)
|
|
|
|
AC_CHECK_FUNCS(link)
|
|
|
|
AC_CHECK_FUNCS(llabs)
|
|
|
|
AC_CHECK_FUNCS(lockf)
|
|
|
|
AC_CHECK_FUNCS(log2)
|
|
|
|
AC_CHECK_FUNCS(lstat)
|
2017-11-29 17:48:02 +03:00
|
|
|
AC_CHECK_FUNCS(lutimes)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(malloc_usable_size)
|
|
|
|
AC_CHECK_FUNCS(malloc_size)
|
|
|
|
AC_CHECK_FUNCS(mblen)
|
2021-03-01 18:05:55 +03:00
|
|
|
AC_CHECK_FUNCS(memalign)
|
2015-11-30 23:26:13 +03:00
|
|
|
AC_CHECK_FUNCS(memset_s)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(writev)
|
|
|
|
AC_CHECK_FUNCS(memrchr)
|
|
|
|
AC_CHECK_FUNCS(memmem)
|
2015-09-18 14:11:14 +03:00
|
|
|
AC_CHECK_FUNCS(mkfifo)
|
|
|
|
AC_CHECK_FUNCS(mknod)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(mktime)
|
2021-02-24 00:28:56 +03:00
|
|
|
AC_CHECK_FUNCS(mmap)
|
2022-01-06 18:07:14 +03:00
|
|
|
AC_CHECK_FUNCS(mremap)
|
2017-05-23 17:34:12 +03:00
|
|
|
AC_CHECK_FUNCS(openat)
|
2022-01-15 19:18:49 +03:00
|
|
|
AC_CHECK_FUNCS(pclose)
|
|
|
|
AC_CHECK_FUNCS(pipe)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(pipe2)
|
|
|
|
AC_CHECK_FUNCS(poll)
|
2022-01-15 19:18:49 +03:00
|
|
|
AC_CHECK_FUNCS(popen)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(posix_fadvise)
|
2022-01-15 19:18:49 +03:00
|
|
|
AC_CHECK_FUNCS(posix_madvise)
|
2021-03-01 18:05:55 +03:00
|
|
|
AC_CHECK_FUNCS(posix_memalign)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(ppoll)
|
|
|
|
AC_CHECK_FUNCS(pread)
|
2017-04-03 03:10:50 +03:00
|
|
|
AC_CHECK_FUNCS(pwrite)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(qsort_r)
|
2016-05-11 11:18:56 +03:00
|
|
|
AC_CHECK_FUNCS(qsort_s)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(readlink)
|
Use realpath(3) instead of custom realpath implementation if available
This approach is simpler than the previous approach which tries to
emulate realpath(3). It also performs much better on both Linux and
OpenBSD on the included benchmarks.
By using realpath(3), we can better integrate with system security
features such as OpenBSD's unveil(2) system call.
This does not use realpath(3) on Windows even if it exists, as the
approach for checking for absolute paths does not work for drive
letters. This can be fixed without too much difficultly, though until
Windows defines realpath(3), there is no need to do so.
For File.realdirpath, where the last element of the path is not
required to exist, fallback to the previous approach, as realpath(3)
on most operating systems requires the whole path be valid (per POSIX),
and the operating systems where this isn't true either plan to conform
to POSIX or may change to conform to POSIX in the future.
glibc realpath(3) does not handle /path/to/file.rb/../other_file.rb
paths, returning ENOTDIR in that case. Fallback to the previous code
if realpath(3) returns ENOTDIR.
glibc doesn't like realpath(3) usage for paths like /dev/fd/5,
returning ENOENT even though the path may appear to exist in the
filesystem. If ENOENT is returned and the path exists, then fall
back to the default approach.
2019-04-28 06:18:55 +03:00
|
|
|
AC_CHECK_FUNCS(realpath)
|
2016-04-23 03:02:25 +03:00
|
|
|
AC_CHECK_FUNCS(round)
|
2014-10-15 13:41:25 +04:00
|
|
|
AC_CHECK_FUNCS(sched_getaffinity)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(seekdir)
|
|
|
|
AC_CHECK_FUNCS(select_large_fdset)
|
|
|
|
AC_CHECK_FUNCS(sendfile)
|
|
|
|
AC_CHECK_FUNCS(setegid)
|
|
|
|
AC_CHECK_FUNCS(setenv)
|
|
|
|
AC_CHECK_FUNCS(seteuid)
|
|
|
|
AC_CHECK_FUNCS(setgid)
|
|
|
|
AC_CHECK_FUNCS(setgroups)
|
|
|
|
AC_CHECK_FUNCS(setpgid)
|
|
|
|
AC_CHECK_FUNCS(setpgrp)
|
|
|
|
AC_CHECK_FUNCS(setregid)
|
|
|
|
AC_CHECK_FUNCS(setresgid)
|
|
|
|
AC_CHECK_FUNCS(setresuid)
|
|
|
|
AC_CHECK_FUNCS(setreuid)
|
|
|
|
AC_CHECK_FUNCS(setrgid)
|
|
|
|
AC_CHECK_FUNCS(setrlimit)
|
|
|
|
AC_CHECK_FUNCS(setruid)
|
|
|
|
AC_CHECK_FUNCS(setsid)
|
|
|
|
AC_CHECK_FUNCS(setuid)
|
|
|
|
AC_CHECK_FUNCS(shutdown)
|
|
|
|
AC_CHECK_FUNCS(sigaction)
|
|
|
|
AC_CHECK_FUNCS(sigaltstack)
|
|
|
|
AC_CHECK_FUNCS(sigprocmask)
|
|
|
|
AC_CHECK_FUNCS(sinh)
|
|
|
|
AC_CHECK_FUNCS(spawnv)
|
|
|
|
AC_CHECK_FUNCS(symlink)
|
|
|
|
AC_CHECK_FUNCS(syscall)
|
|
|
|
AC_CHECK_FUNCS(sysconf)
|
2022-01-15 19:18:49 +03:00
|
|
|
AC_CHECK_FUNCS(system)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(tanh)
|
|
|
|
AC_CHECK_FUNCS(telldir)
|
|
|
|
AC_CHECK_FUNCS(timegm)
|
|
|
|
AC_CHECK_FUNCS(times)
|
|
|
|
AC_CHECK_FUNCS(truncate)
|
|
|
|
AC_CHECK_FUNCS(truncate64) # used for Win32
|
2022-01-15 19:18:49 +03:00
|
|
|
AC_CHECK_FUNCS(tzset)
|
|
|
|
AC_CHECK_FUNCS(umask)
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(unsetenv)
|
|
|
|
AC_CHECK_FUNCS(utimensat)
|
|
|
|
AC_CHECK_FUNCS(utimes)
|
|
|
|
AC_CHECK_FUNCS(wait4)
|
|
|
|
AC_CHECK_FUNCS(waitpid)
|
2020-05-03 08:38:19 +03:00
|
|
|
AC_CHECK_FUNCS(__cospi)
|
|
|
|
AC_CHECK_FUNCS(__sinpi)
|
2008-03-31 21:58:41 +04:00
|
|
|
|
2019-02-24 14:57:18 +03:00
|
|
|
AS_IF([test "x$ac_cv_member_struct_statx_stx_btime" = xyes],
|
|
|
|
[AC_CHECK_FUNCS(statx)])
|
2019-02-20 09:54:23 +03:00
|
|
|
|
2018-09-09 13:51:48 +03:00
|
|
|
AS_CASE(["$ac_cv_func_memset_s:$ac_cv_func_qsort_s"], [*yes*],
|
2015-12-23 08:29:36 +03:00
|
|
|
[RUBY_DEFINE_IF([!defined __STDC_WANT_LIB_EXT1__], [__STDC_WANT_LIB_EXT1__], 1)])
|
2015-12-22 20:59:28 +03:00
|
|
|
|
2014-04-18 03:50:20 +04:00
|
|
|
AS_IF([test "$ac_cv_func_getcwd" = yes], [
|
|
|
|
AC_CACHE_CHECK(if getcwd allocates buffer if NULL is given, [rb_cv_getcwd_malloc],
|
2020-12-12 16:55:09 +03:00
|
|
|
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
2014-04-18 03:50:20 +04:00
|
|
|
@%:@include <stddef.h>
|
|
|
|
@%:@include <stdio.h>
|
|
|
|
@%:@ifdef HAVE_UNISTD_H
|
|
|
|
@%:@include <unistd.h>
|
|
|
|
@%:@endif
|
|
|
|
@%:@ifndef EXIT_SUCCESS
|
|
|
|
@%:@define EXIT_SUCCESS 0
|
|
|
|
@%:@endif
|
|
|
|
@%:@ifndef EXIT_FAILURE
|
|
|
|
@%:@define EXIT_FAILURE 1
|
|
|
|
@%:@endif
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
if (!getcwd(NULL, 0)) return EXIT_FAILURE;
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|
2020-12-12 16:55:09 +03:00
|
|
|
]])],
|
2014-04-18 03:50:20 +04:00
|
|
|
rb_cv_getcwd_malloc=yes,
|
|
|
|
rb_cv_getcwd_malloc=no,
|
|
|
|
AS_CASE($target_os,
|
2021-01-31 08:27:15 +03:00
|
|
|
[linux*|darwin*|*bsd|cygwin*|msys*|mingw*|mswin*],
|
2014-04-18 03:50:20 +04:00
|
|
|
[rb_cv_getcwd_malloc=yes],
|
|
|
|
[rb_cv_getcwd_malloc=no]))])
|
|
|
|
AS_IF([test "$rb_cv_getcwd_malloc" = no], [AC_DEFINE(NO_GETCWD_MALLOC, 1)])
|
|
|
|
])
|
|
|
|
|
2016-06-04 04:54:54 +03:00
|
|
|
AS_IF([test "$ac_cv_func_crypt_r" = yes],
|
2016-12-16 06:30:26 +03:00
|
|
|
[AC_CHECK_HEADERS(crypt.h)])
|
|
|
|
AS_IF([test "$ac_cv_func_crypt_r:$ac_cv_header_crypt_h" = yes:yes],
|
2016-06-04 04:54:54 +03:00
|
|
|
[AC_CHECK_MEMBERS([struct crypt_data.initialized], [], [],
|
|
|
|
[AC_INCLUDES_DEFAULT([@%:@include <crypt.h>])])])
|
|
|
|
|
2018-01-15 05:35:19 +03:00
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_alloca_with_align, [__builtin_alloca_with_align(1, 4096)])
|
2018-01-15 05:35:18 +03:00
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_assume_aligned, [__builtin_assume_aligned((void*)32, 32)])
|
2013-11-24 20:03:22 +04:00
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_bswap16, [__builtin_bswap16(0)])
|
2013-07-14 18:28:33 +04:00
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_bswap32, [__builtin_bswap32(0)])
|
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_bswap64, [__builtin_bswap64(0)])
|
2016-05-03 16:14:30 +03:00
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_popcount, [__builtin_popcount(0)])
|
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_popcountll, [__builtin_popcountll(0)])
|
2013-07-15 05:49:32 +04:00
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_clz, [__builtin_clz(0)])
|
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_clzl, [__builtin_clzl(0)])
|
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_clzll, [__builtin_clzll(0)])
|
2016-04-30 18:39:02 +03:00
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_ctz, [__builtin_ctz(0)])
|
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_ctzll, [__builtin_ctzll(0)])
|
2017-02-02 20:07:28 +03:00
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_add_overflow, [int x;__builtin_add_overflow(0,0,&x)])
|
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_sub_overflow, [int x;__builtin_sub_overflow(0,0,&x)])
|
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_mul_overflow, [int x;__builtin_mul_overflow(0,0,&x)])
|
2017-03-06 09:04:52 +03:00
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_mul_overflow_p, [__builtin_mul_overflow_p(0,0,(int)0)])
|
2016-05-12 21:12:46 +03:00
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_constant_p, [__builtin_constant_p(0)])
|
2015-02-16 08:14:48 +03:00
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_choose_expr, [
|
|
|
|
[int x[__extension__(__builtin_choose_expr(1, 1, -1))]];
|
|
|
|
[int y[__extension__(__builtin_choose_expr(0, -1, 1))]];
|
|
|
|
])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test x$rb_cv_builtin___builtin_choose_expr = xyes], [
|
2015-02-16 08:14:48 +03:00
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_choose_expr_constant_p, [
|
|
|
|
[int x[__extension__(__builtin_choose_expr(__builtin_constant_p(1), 1, -1))]];
|
|
|
|
[int y[__extension__(__builtin_choose_expr(__builtin_constant_p(foo), -1, 1))]];
|
|
|
|
])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2013-11-27 20:07:10 +04:00
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_types_compatible_p, [__builtin_types_compatible_p(int, int)])
|
2018-11-07 11:04:33 +03:00
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_trap, [__builtin_trap()])
|
configure.ac: check if __builtin_expect is available or not
include/ruby/internal/has/builtin.h uses HAVE_BUILTIN___BUILTIN_EXPECT
for icc but previously it was not defined.
This is a follow up of 8b32de2ec9b72d4c9ede19b70ec9497718fb25a6 and this
will fix the following failures:
http://rubyci.s3.amazonaws.com/icc-x64/ruby-master/log/20210505T030003Z.fail.html.gz
```
1) Failure:
TestMkmf::TestConvertible#test_typeof_builtin [/home/chkbuild/chkbuild/tmp/build/20210505T030003Z/ruby/test/mkmf/test_convertible.rb:9]:
convertible_int: checking for convertible type of short... -------------------- short
--------------------
convertible_int: checking for convertible type of int... -------------------- int
--------------------
convertible_int: checking for convertible type of long... -------------------- long
--------------------
convertible_int: checking for convertible type of signed short... -------------------- failed
"icc -std=gnu99 -o conftest -I. -I/home/chkbuild/chkbuild/tmp/build/20210505T030003Z/ruby/.ext/include/x86_64-linux -I/home/chkbuild/chkbuild/tmp/build/20210505T030003Z/ruby/include -I./test -O3 -ggdb -Wall -Wextra -Wdeprecated-declarations -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-unused-parameter -Wunused-variable -diag-disable=175,188,1684,2259,2312 -Wextra-tokens -Wundef conftest.c -L. -L/home/chkbuild/chkbuild/tmp/build/20210505T030003Z/ruby -Wl,-rpath,/home/chkbuild/chkbuild/tmp/build/20210505T030003Z/ruby -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-rpath,/home/chkbuild/chkbuild/tmp/build/20210505T030003Z/lib -L/home/chkbuild/chkbuild/tmp/build/20210505T030003Z/lib -lruby-static -lz -lpthread -lrt -lrt -ldl -lcrypt -lm -lm -lc"
In file included from /home/chkbuild/chkbuild/tmp/build/20210505T030003Z/ruby/include/ruby/defines.h(72),
from /home/chkbuild/chkbuild/tmp/build/20210505T030003Z/ruby/include/ruby/ruby.h(23),
from /home/chkbuild/chkbuild/tmp/build/20210505T030003Z/ruby/include/ruby.h(39),
from conftest.c(1):
/home/chkbuild/chkbuild/tmp/build/20210505T030003Z/ruby/include/ruby/backward/2/assume.h(34): warning #193: zero used for undefined preprocessing identifier "HAVE_BUILTIN___BUILTIN_EXPECT"
#if RBIMPL_HAS_BUILTIN(__builtin_expect)
...
```
2021-05-05 06:58:12 +03:00
|
|
|
RUBY_CHECK_BUILTIN_FUNC(__builtin_expect, [__builtin_expect(0, 0)])
|
2013-07-14 18:28:33 +04:00
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$ac_cv_func_qsort_r" != no], [
|
2014-02-09 00:21:57 +04:00
|
|
|
AC_CACHE_CHECK(whether qsort_r is GNU version, rb_cv_gnu_qsort_r,
|
2020-12-12 16:55:09 +03:00
|
|
|
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
2014-02-09 03:56:11 +04:00
|
|
|
@%:@include <stdlib.h>
|
2018-09-13 14:00:55 +03:00
|
|
|
void (qsort_r)(void *base, size_t nmemb, size_t size,
|
2014-02-09 00:21:57 +04:00
|
|
|
int (*compar)(const void *, const void *, void *),
|
|
|
|
void *arg);
|
2020-12-12 16:55:09 +03:00
|
|
|
]], [[ ]])],
|
2014-02-08 16:50:28 +04:00
|
|
|
[rb_cv_gnu_qsort_r=yes],
|
|
|
|
[rb_cv_gnu_qsort_r=no])
|
|
|
|
])
|
2014-02-09 03:56:11 +04:00
|
|
|
AC_CACHE_CHECK(whether qsort_r is BSD version, rb_cv_bsd_qsort_r,
|
2020-12-12 16:55:09 +03:00
|
|
|
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
2014-02-09 03:56:11 +04:00
|
|
|
@%:@include <stdlib.h>
|
2018-09-13 14:00:55 +03:00
|
|
|
void (qsort_r)(void *base, size_t nmemb, size_t size,
|
2014-02-09 03:56:11 +04:00
|
|
|
void *arg, int (*compar)(void *, const void *, const void *));
|
2020-12-12 16:55:09 +03:00
|
|
|
]], [[ ]])],
|
2014-02-09 03:56:11 +04:00
|
|
|
[rb_cv_bsd_qsort_r=yes],
|
|
|
|
[rb_cv_bsd_qsort_r=no])
|
|
|
|
])
|
|
|
|
AS_CASE("$rb_cv_gnu_qsort_r:$rb_cv_bsd_qsort_r",
|
|
|
|
[yes:no], [
|
2014-02-08 16:50:28 +04:00
|
|
|
AC_DEFINE(HAVE_GNU_QSORT_R, 1)
|
2015-09-15 06:44:34 +03:00
|
|
|
],
|
|
|
|
[no:yes], [
|
|
|
|
AC_DEFINE(HAVE_BSD_QSORT_R, 1)
|
2014-02-09 03:56:11 +04:00
|
|
|
])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2014-02-08 16:50:28 +04:00
|
|
|
|
2014-05-12 18:57:17 +04:00
|
|
|
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], [
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
2014-05-12 18:57:17 +04:00
|
|
|
@%:@include <math.h>
|
|
|
|
@%:@ifdef HAVE_UNISTD_H
|
|
|
|
@%:@include <unistd.h>
|
|
|
|
@%:@endif
|
|
|
|
@%:@ifndef EXIT_SUCCESS
|
|
|
|
@%:@define EXIT_SUCCESS 0
|
|
|
|
@%:@endif
|
|
|
|
@%:@ifndef EXIT_FAILURE
|
|
|
|
@%:@define EXIT_FAILURE 1
|
|
|
|
@%:@endif
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
if (fabs(atan2(INFINITY, INFINITY) - M_PI_4) <= 0.01) return EXIT_SUCCESS;
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
2020-12-12 16:55:09 +03:00
|
|
|
]])],
|
2014-05-12 18:57:17 +04:00
|
|
|
[rb_cv_atan2_inf_c99=yes],
|
|
|
|
[rb_cv_atan2_inf_c99=no],
|
|
|
|
[AS_CASE($target_os, [mingw*|mswin*], [rb_cv_atan2_inf_c99=no], [rb_cv_atan2_inf_c99=yes])]
|
|
|
|
)
|
2014-05-18 12:31:34 +04:00
|
|
|
], [rb_cv_atan2_inf_c99=no])
|
2014-05-12 18:57:17 +04:00
|
|
|
])
|
2014-05-18 12:31:34 +04:00
|
|
|
AS_IF([test "x$rb_cv_atan2_inf_c99" = xyes], [AC_DEFINE(ATAN2_INF_C99)])
|
2014-05-12 18:57:17 +04:00
|
|
|
|
2013-07-19 07:06:12 +04:00
|
|
|
# Some platform need -lrt for clock_gettime, but the other don't.
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test x"$ac_cv_func_clock_gettime" != xyes], [
|
2013-05-12 12:40:35 +04:00
|
|
|
# glibc 2.17 moves clock_* functions from librt to the main C library.
|
2022-04-05 16:36:48 +03:00
|
|
|
# https://sourceware.org/legacy-ml/libc-announce/2012/msg00001.html
|
2013-08-18 09:26:47 +04:00
|
|
|
AC_CHECK_LIB(rt, clock_gettime)
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test x"$ac_cv_lib_rt_clock_gettime" = xyes], [
|
2013-08-19 08:03:22 +04:00
|
|
|
AC_DEFINE(HAVE_CLOCK_GETTIME, 1)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
])
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(clock_getres) # clock_getres should be tested after clock_gettime test including librt test.
|
2018-08-14 00:34:24 +03:00
|
|
|
AC_CHECK_LIB([rt], [timer_create])
|
|
|
|
AC_CHECK_LIB([rt], [timer_settime])
|
|
|
|
AS_IF([test x"$ac_cv_lib_rt_timer_create" = xyes], [
|
|
|
|
AC_DEFINE(HAVE_TIMER_CREATE, 1)
|
|
|
|
])
|
|
|
|
AS_IF([test x"$ac_cv_lib_rt_timer_settime" = xyes], [
|
|
|
|
AC_DEFINE(HAVE_TIMER_SETTIME, 1)
|
|
|
|
])
|
2013-05-12 12:40:35 +04:00
|
|
|
|
2010-01-26 15:41:43 +03:00
|
|
|
AC_CACHE_CHECK(for unsetenv returns a value, rb_cv_unsetenv_return_value,
|
2020-12-12 16:55:09 +03:00
|
|
|
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
2010-01-26 15:41:43 +03:00
|
|
|
#include <stdlib.h>
|
2020-12-12 16:55:09 +03:00
|
|
|
]], [[int v = unsetenv("foo");]])],
|
2010-01-26 15:41:43 +03:00
|
|
|
rb_cv_unsetenv_return_value=yes,
|
|
|
|
rb_cv_unsetenv_return_value=no)])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_unsetenv_return_value" = no], [
|
2010-01-26 15:41:43 +03:00
|
|
|
AC_DEFINE(VOID_UNSETENV)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2010-01-26 15:41:43 +03:00
|
|
|
|
2013-05-12 12:40:47 +04:00
|
|
|
# End of setjmp check.
|
2008-03-31 21:58:41 +04:00
|
|
|
|
2003-07-23 20:07:35 +04:00
|
|
|
AC_ARG_ENABLE(setreuid,
|
2009-03-31 10:17:38 +04:00
|
|
|
AS_HELP_STRING([--enable-setreuid], [use setreuid()/setregid() according to need even if obsolete]),
|
2003-07-23 20:07:35 +04:00
|
|
|
[use_setreuid=$enableval])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$use_setreuid" = yes], [
|
2003-07-23 20:07:35 +04:00
|
|
|
AC_DEFINE(USE_SETREUID)
|
|
|
|
AC_DEFINE(USE_SETREGID)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_STRUCT_TIMEZONE
|
2001-12-17 09:45:37 +03:00
|
|
|
AC_CACHE_CHECK(for struct tm.tm_gmtoff, rb_cv_member_struct_tm_tm_gmtoff,
|
2020-12-12 16:55:09 +03:00
|
|
|
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
2016-04-27 19:15:21 +03:00
|
|
|
@%:@define _BSD_SOURCE
|
|
|
|
@%:@define _DEFAULT_SOURCE
|
|
|
|
@%:@include <time.h>
|
2020-12-12 16:55:09 +03:00
|
|
|
]],
|
|
|
|
[[struct tm t; t.tm_gmtoff = 3600;]])],
|
2001-12-17 09:45:37 +03:00
|
|
|
[rb_cv_member_struct_tm_tm_gmtoff=yes],
|
|
|
|
[rb_cv_member_struct_tm_tm_gmtoff=no])])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_member_struct_tm_tm_gmtoff" = yes], [
|
2001-12-17 09:45:37 +03:00
|
|
|
AC_DEFINE(HAVE_STRUCT_TM_TM_GMTOFF)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2000-06-12 11:48:31 +04:00
|
|
|
AC_CACHE_CHECK(for external int daylight, rb_cv_have_daylight,
|
2020-12-12 16:55:09 +03:00
|
|
|
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>
|
|
|
|
int i;]],
|
|
|
|
[[i = daylight;]])],
|
2000-06-12 11:48:31 +04:00
|
|
|
rb_cv_have_daylight=yes,
|
|
|
|
rb_cv_have_daylight=no)])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_have_daylight" = yes], [
|
2000-06-12 11:48:31 +04:00
|
|
|
AC_DEFINE(HAVE_DAYLIGHT)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2007-12-14 04:01:42 +03:00
|
|
|
|
2001-02-20 10:42:03 +03:00
|
|
|
AC_CACHE_CHECK(for negative time_t for gmtime(3), rb_cv_negative_time_t,
|
2020-12-12 16:55:09 +03:00
|
|
|
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
2011-01-20 06:27:54 +03:00
|
|
|
#include <stdlib.h>
|
2001-02-20 10:42:03 +03:00
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
void
|
|
|
|
check(tm, y, m, d, h, s)
|
|
|
|
struct tm *tm;
|
|
|
|
int y, m, d, h, s;
|
|
|
|
{
|
2001-02-26 08:29:06 +03:00
|
|
|
if (!tm ||
|
|
|
|
tm->tm_year != y ||
|
2001-02-20 10:42:03 +03:00
|
|
|
tm->tm_mon != m-1 ||
|
|
|
|
tm->tm_mday != d ||
|
|
|
|
tm->tm_hour != h ||
|
|
|
|
tm->tm_sec != s) {
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
time_t t = -1;
|
|
|
|
struct tm *tm;
|
|
|
|
|
|
|
|
check(gmtime(&t), 69, 12, 31, 23, 59);
|
2001-12-17 09:45:37 +03:00
|
|
|
t = ~(time_t)0 << 31;
|
2001-02-20 10:42:03 +03:00
|
|
|
check(gmtime(&t), 1, 12, 13, 20, 52);
|
|
|
|
return 0;
|
|
|
|
}
|
2020-12-12 16:55:09 +03:00
|
|
|
]])],
|
2001-02-20 10:42:03 +03:00
|
|
|
rb_cv_negative_time_t=yes,
|
|
|
|
rb_cv_negative_time_t=no,
|
|
|
|
rb_cv_negative_time_t=yes)])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_negative_time_t" = yes], [
|
2001-02-20 10:42:03 +03:00
|
|
|
AC_DEFINE(NEGATIVE_TIME_T)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2010-04-06 17:03:43 +04:00
|
|
|
# [ruby-dev:40910] overflow of time on FreeBSD
|
2022-04-05 16:36:48 +03:00
|
|
|
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=145341
|
2010-04-06 17:03:43 +04:00
|
|
|
AC_CACHE_CHECK(for localtime(3) overflow correctly, rb_cv_localtime_overflow,
|
2020-12-12 16:55:09 +03:00
|
|
|
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
2011-01-20 17:34:39 +03:00
|
|
|
#include <stdlib.h>
|
2010-04-06 17:03:43 +04:00
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
void
|
|
|
|
check(time_t t1)
|
|
|
|
{
|
|
|
|
struct tm *tm;
|
|
|
|
time_t t2;
|
|
|
|
tm = localtime(&t1);
|
|
|
|
if (!tm)
|
|
|
|
return; /* overflow detected. ok. */
|
|
|
|
t2 = mktime(tm);
|
|
|
|
if (t1 == t2)
|
|
|
|
return; /* round-trip. ok. */
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
time_t t;
|
|
|
|
if (~(time_t)0 <= 0) {
|
|
|
|
t = (((time_t)1) << (sizeof(time_t) * 8 - 2));
|
|
|
|
t |= t - 1;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
t = ~(time_t)0;
|
|
|
|
}
|
|
|
|
check(t);
|
|
|
|
return 0;
|
|
|
|
}
|
2020-12-12 16:55:09 +03:00
|
|
|
]])],
|
2010-04-06 17:03:43 +04:00
|
|
|
rb_cv_localtime_overflow=yes,
|
|
|
|
rb_cv_localtime_overflow=no,
|
2013-11-19 02:24:52 +04:00
|
|
|
rb_cv_localtime_overflow=no)])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_localtime_overflow" = no], [
|
2010-04-06 17:03:43 +04:00
|
|
|
AC_DEFINE(LOCALTIME_OVERFLOW_PROBLEM)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2010-04-06 17:03:43 +04:00
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$ac_cv_func_sigprocmask" = yes && test "$ac_cv_func_sigaction" = yes], [
|
1998-01-16 15:13:05 +03:00
|
|
|
AC_DEFINE(POSIX_SIGNAL)
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(sigsetmask)
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_CACHE_CHECK(for BSD signal semantics, rb_cv_bsd_signal,
|
2020-12-12 16:55:09 +03:00
|
|
|
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
1998-01-16 15:13:05 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <signal.h>
|
|
|
|
|
|
|
|
void
|
|
|
|
sig_handler(dummy)
|
|
|
|
int dummy;
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
signal(SIGINT, sig_handler);
|
|
|
|
kill(getpid(), SIGINT);
|
|
|
|
kill(getpid(), SIGINT);
|
|
|
|
return 0;
|
|
|
|
}
|
2020-12-12 16:55:09 +03:00
|
|
|
]])],
|
1998-01-16 15:13:05 +03:00
|
|
|
rb_cv_bsd_signal=yes,
|
1999-08-13 09:45:20 +04:00
|
|
|
rb_cv_bsd_signal=no,
|
2008-02-14 20:40:56 +03:00
|
|
|
rb_cv_bsd_signal=$ac_cv_func_sigsetmask)])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_bsd_signal" = yes], [
|
1998-01-16 15:13:05 +03:00
|
|
|
AC_DEFINE(BSD_SIGNAL)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
])
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2016-07-04 07:57:27 +03:00
|
|
|
AC_CHECK_TYPES([sig_t],[],[],[@%:@include <signal.h>])
|
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$ac_cv_func_getpgid" = no], [
|
2013-04-26 12:45:02 +04:00
|
|
|
# AC_FUNC_GETPGRP fails when cross-compiling with old autoconf.
|
|
|
|
# autoconf is changed between 2.52d and 2.52f?
|
2022-04-09 10:53:13 +03:00
|
|
|
# https://lists.gnu.org/archive/html/bug-gnu-utils/2001-09/msg00181.html
|
2013-04-26 12:45:02 +04:00
|
|
|
# "autoconf cleanup for AC_FUNC_GETPGRP and GETPGRP_VOID"
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_FUNC_GETPGRP
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
AS_IF([test "$ac_cv_func_setpgid:$ac_cv_func_setpgrp" = no:yes], [
|
2013-04-26 07:51:01 +04:00
|
|
|
# AC_FUNC_SETPGRP fails when cross-compiling. (until autoconf 2.69?)
|
|
|
|
# https://lists.gnu.org/archive/html/bug-autoconf/2013-02/msg00002.html
|
2013-04-26 12:45:02 +04:00
|
|
|
# "AC_FUNC_SETPGRP fails to work properly when cross-compiling"
|
2009-02-02 12:34:36 +03:00
|
|
|
AC_FUNC_SETPGRP
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test x"$ac_cv_func_dirfd" = xno], [
|
2015-11-06 20:07:08 +03:00
|
|
|
AS_CASE(["$target_os"],[solaris*],
|
|
|
|
[AC_CHECK_MEMBERS([DIR.d_fd, DIR.dd_fd],,,[
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <dirent.h>
|
|
|
|
])])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2015-11-06 20:07:08 +03:00
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_CACHE_CHECK(whether right shift preserve sign bit, rb_cv_rshift_sign,
|
2010-10-09 11:54:42 +04:00
|
|
|
[AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([], [(-1==(-1>>1))])],
|
1999-01-20 07:59:39 +03:00
|
|
|
rb_cv_rshift_sign=yes,
|
2008-08-09 16:10:54 +04:00
|
|
|
rb_cv_rshift_sign=no)])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_rshift_sign" = yes], [
|
2010-03-16 08:03:30 +03:00
|
|
|
AC_DEFINE(RSHIFT(x,y), ((x)>>(int)(y)))
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2010-03-16 08:03:30 +03:00
|
|
|
AC_DEFINE(RSHIFT(x,y), (((x)<0) ? ~((~(x))>>(int)(y)) : (x)>>(int)(y)))
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
1999-01-20 07:59:39 +03:00
|
|
|
|
2020-09-12 07:36:53 +03:00
|
|
|
AS_IF([test "$ac_cv_func_copy_file_range" = no], [
|
|
|
|
AC_CACHE_CHECK([for copy_file_range],
|
|
|
|
rb_cv_use_copy_file_range,
|
2020-12-12 16:55:09 +03:00
|
|
|
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
2020-09-12 07:36:53 +03:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/syscall.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#ifndef O_TMPFILE
|
|
|
|
#define O_TMPFILE __O_TMPFILE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
#ifdef __NR_copy_file_range
|
|
|
|
int ret, fd_in, fd_out;
|
|
|
|
fd_in = open("/tmp", O_TMPFILE|O_RDWR, S_IRUSR);
|
|
|
|
fd_out = open("/tmp", O_TMPFILE|O_WRONLY, S_IWUSR);
|
|
|
|
ret = syscall(__NR_copy_file_range, fd_in, NULL, fd_out, NULL, 0, 0);
|
2020-09-12 10:27:14 +03:00
|
|
|
close(fd_in);
|
|
|
|
close(fd_out);
|
2020-09-12 07:36:53 +03:00
|
|
|
if (ret == -1) { return 1; }
|
|
|
|
return 0;
|
|
|
|
#else
|
|
|
|
return 1;
|
|
|
|
#endif
|
|
|
|
}
|
2020-12-12 16:55:09 +03:00
|
|
|
]])],
|
2020-09-12 07:36:53 +03:00
|
|
|
[rb_cv_use_copy_file_range=yes],
|
2020-09-12 10:27:14 +03:00
|
|
|
[rb_cv_use_copy_file_range=no],
|
2020-09-12 07:36:53 +03:00
|
|
|
[rb_cv_use_copy_file_range=no])])
|
2020-09-12 10:27:14 +03:00
|
|
|
])
|
|
|
|
AS_CASE(["$ac_cv_func_copy_file_range:$rb_cv_use_copy_file_range"], [*yes*], [
|
|
|
|
AC_DEFINE(USE_COPY_FILE_RANGE)
|
2020-09-12 07:36:53 +03:00
|
|
|
])
|
|
|
|
|
2018-06-14 16:10:25 +03:00
|
|
|
AS_CASE(["$ac_cv_func_gettimeofday:$ac_cv_func_clock_gettime"],
|
|
|
|
[*yes*], [],
|
|
|
|
[
|
|
|
|
AC_MSG_ERROR(clock_gettime() or gettimeofday() must exist)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2013-05-12 12:41:36 +04:00
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$ac_cv_func_sysconf" = yes], [
|
2006-07-06 18:30:20 +04:00
|
|
|
RUBY_CHECK_SYSCONF(CLK_TCK)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2006-07-06 18:30:20 +04:00
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "${universal_binary-no}" = yes ], [
|
2009-11-01 10:24:18 +03:00
|
|
|
archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
|
|
|
|
save_CFLAGS="$CFLAGS" new_cflags=`echo "$CFLAGS" | sed "s|$archflagpat"'||'`
|
|
|
|
save_LDFLAGS="$LDFLAGS" new_ldflags=`echo "$LDFLAGS" | sed "s|$archflagpat"'||'`
|
|
|
|
stack_dir=
|
|
|
|
for archs in ${universal_archnames}; do
|
|
|
|
archs=`echo $archs | sed 's/=.*//'`
|
|
|
|
CFLAGS="$new_cflags -arch $archs"
|
|
|
|
LDFLAGS="$new_ldflags -arch $archs"
|
|
|
|
RUBY_STACK_GROW_DIRECTION($archs, dir)
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test x$stack_dir = x], [
|
2009-11-01 10:24:18 +03:00
|
|
|
stack_dir=$dir
|
2017-06-21 06:27:21 +03:00
|
|
|
], [test x$stack_dir != x$dir], [
|
2009-11-01 10:24:18 +03:00
|
|
|
stack_dir=no
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2009-11-01 10:24:18 +03:00
|
|
|
done
|
|
|
|
CFLAGS="$save_CFLAGS" LDFLAGS="$save_LDFLAGS"
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test x$stack_dir = xno], [
|
2009-11-01 10:24:18 +03:00
|
|
|
for archs in ${universal_archnames}; do
|
|
|
|
archs=`echo $archs | sed 's/=.*//'`
|
2011-10-27 09:55:29 +04:00
|
|
|
eval dir=\$[rb_cv_stack_grow_dir_]AS_TR_SH([$archs])
|
2009-11-01 10:24:18 +03:00
|
|
|
RUBY_DEFINE_IF([defined __${archs}__], STACK_GROW_DIRECTION, $dir)
|
|
|
|
done
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2009-11-01 10:24:18 +03:00
|
|
|
AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $stack_dir)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
], [
|
2009-11-01 10:24:18 +03:00
|
|
|
RUBY_STACK_GROW_DIRECTION($target_cpu, dir)
|
|
|
|
AC_DEFINE_UNQUOTED(STACK_GROW_DIRECTION, $dir)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2003-06-28 07:29:00 +04:00
|
|
|
|
2019-06-29 04:07:07 +03:00
|
|
|
AC_ARG_WITH(coroutine,
|
|
|
|
AS_HELP_STRING([--with-coroutine=IMPLEMENTATION], [specify the coroutine implementation to use]),
|
2021-03-09 16:07:31 +03:00
|
|
|
[coroutine_type=$withval], [coroutine_type=])
|
|
|
|
AS_CASE([$coroutine_type], [yes|''], [
|
|
|
|
coroutine_type=
|
2018-11-21 06:26:59 +03:00
|
|
|
AS_CASE(["$target_cpu-$target_os"],
|
2021-01-22 17:41:52 +03:00
|
|
|
[universal-darwin*], [
|
2021-03-09 16:07:31 +03:00
|
|
|
coroutine_type=universal
|
2021-01-22 17:41:52 +03:00
|
|
|
],
|
2019-06-24 06:12:21 +03:00
|
|
|
[x*64-darwin*], [
|
2021-03-09 16:07:31 +03:00
|
|
|
coroutine_type=amd64
|
2019-06-24 06:12:21 +03:00
|
|
|
],
|
Fix build error on Apple silicon macOS
This patch will fix following build error on macOS 11.0 + Xcode 12 beta.
```
$ ./configure
$ make V=1
BASERUBY = /Users/watson/.rbenv/shims/ruby --disable=gems
CC = clang -fdeclspec
LD = ld
LDSHARED = clang -fdeclspec -dynamiclib
CFLAGS = -O3 -ggdb3 -Wall -Wextra -Werror=deprecated-declarations -Werror=division-by-zero -Werror=implicit-function-declaration -Werror=implicit-int -Werror=misleading-indentation -Werror=pointer-arith -Werror=shorten-64-to-32 -Werror=write-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Werror=extra-tokens -std=gnu99 -pipe
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -DRUBY_DEVEL=1 -fvisibility=hidden -DRUBY_EXPORT -fPIE -DCANONICALIZATION_FOR_MATHN -I. -I.ext/include/arm64-darwin20 -I./include -I. -I./enc/unicode/12.1.0
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -fstack-protector-strong -Wl,-pie -framework Security -framework Foundation
SOLIBS = -lpthread -ldl -lobjc
LANG = ja_JP.UTF-8
LC_ALL =
LC_CTYPE =
MFLAGS =
Apple clang version 12.0.0 (clang-1200.0.22.19)
Target: arm64-apple-darwin20.0.0
Thread model: posix
InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
clang -fdeclspec -O3 -ggdb3 -Wall -Wextra -Werror=deprecated-declarations -Werror=division-by-zero -Werror=implicit-function-declaration -Werror=implicit-int -Werror=misleading-indentation -Werror=pointer-arith -Werror=shorten-64-to-32 -Werror=write-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Werror=extra-tokens -std=gnu99 -pipe -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -DRUBY_DEVEL=1 -fvisibility=hidden -DRUBY_EXPORT -fPIE -DCANONICALIZATION_FOR_MATHN -I. -I.ext/include/arm64-darwin20 -I./include -I. -I./enc/unicode/12.1.0 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -o cont.o -c cont.c
In file included from cont.c:19:
./coroutine/ucontext/Context.h:32:5: error: 'getcontext' is deprecated: first deprecated in macOS 10.6 [-Werror,-Wdeprecated-declarations]
getcontext(&context->state);
^
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ucontext.h:37:6: note: 'getcontext' has been
explicitly marked deprecated here
int getcontext(ucontext_t *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
^
In file included from cont.c:19:
./coroutine/ucontext/Context.h:51:5: error: 'makecontext' is deprecated: first deprecated in macOS 10.6 [-Werror,-Wdeprecated-declarations]
makecontext(&context->state, (void(*)(void))coroutine_trampoline, 2, (void*)start, (void*)context);
^
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ucontext.h:38:6: note: 'makecontext' has been
explicitly marked deprecated here
void makecontext(ucontext_t *, void (*)(), int, ...) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHI...
^
In file included from cont.c:19:
./coroutine/ucontext/Context.h:59:5: error: 'swapcontext' is deprecated: first deprecated in macOS 10.6 [-Werror,-Wdeprecated-declarations]
swapcontext(¤t->state, &target->state);
^
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ucontext.h:40:6: note: 'swapcontext' has been
explicitly marked deprecated here
int swapcontext(ucontext_t * __restrict, const ucontext_t * __restrict) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_...
^
3 errors generated.
make: *** [cont.o] Error 1
```
2020-07-05 08:43:29 +03:00
|
|
|
[arm64-darwin*], [
|
2021-03-09 16:07:31 +03:00
|
|
|
coroutine_type=arm64
|
Fix build error on Apple silicon macOS
This patch will fix following build error on macOS 11.0 + Xcode 12 beta.
```
$ ./configure
$ make V=1
BASERUBY = /Users/watson/.rbenv/shims/ruby --disable=gems
CC = clang -fdeclspec
LD = ld
LDSHARED = clang -fdeclspec -dynamiclib
CFLAGS = -O3 -ggdb3 -Wall -Wextra -Werror=deprecated-declarations -Werror=division-by-zero -Werror=implicit-function-declaration -Werror=implicit-int -Werror=misleading-indentation -Werror=pointer-arith -Werror=shorten-64-to-32 -Werror=write-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Werror=extra-tokens -std=gnu99 -pipe
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -DRUBY_DEVEL=1 -fvisibility=hidden -DRUBY_EXPORT -fPIE -DCANONICALIZATION_FOR_MATHN -I. -I.ext/include/arm64-darwin20 -I./include -I. -I./enc/unicode/12.1.0
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -fstack-protector-strong -Wl,-pie -framework Security -framework Foundation
SOLIBS = -lpthread -ldl -lobjc
LANG = ja_JP.UTF-8
LC_ALL =
LC_CTYPE =
MFLAGS =
Apple clang version 12.0.0 (clang-1200.0.22.19)
Target: arm64-apple-darwin20.0.0
Thread model: posix
InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
clang -fdeclspec -O3 -ggdb3 -Wall -Wextra -Werror=deprecated-declarations -Werror=division-by-zero -Werror=implicit-function-declaration -Werror=implicit-int -Werror=misleading-indentation -Werror=pointer-arith -Werror=shorten-64-to-32 -Werror=write-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Werror=extra-tokens -std=gnu99 -pipe -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -DRUBY_DEVEL=1 -fvisibility=hidden -DRUBY_EXPORT -fPIE -DCANONICALIZATION_FOR_MATHN -I. -I.ext/include/arm64-darwin20 -I./include -I. -I./enc/unicode/12.1.0 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -o cont.o -c cont.c
In file included from cont.c:19:
./coroutine/ucontext/Context.h:32:5: error: 'getcontext' is deprecated: first deprecated in macOS 10.6 [-Werror,-Wdeprecated-declarations]
getcontext(&context->state);
^
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ucontext.h:37:6: note: 'getcontext' has been
explicitly marked deprecated here
int getcontext(ucontext_t *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
^
In file included from cont.c:19:
./coroutine/ucontext/Context.h:51:5: error: 'makecontext' is deprecated: first deprecated in macOS 10.6 [-Werror,-Wdeprecated-declarations]
makecontext(&context->state, (void(*)(void))coroutine_trampoline, 2, (void*)start, (void*)context);
^
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ucontext.h:38:6: note: 'makecontext' has been
explicitly marked deprecated here
void makecontext(ucontext_t *, void (*)(), int, ...) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0) __WATCHOS_PROHI...
^
In file included from cont.c:19:
./coroutine/ucontext/Context.h:59:5: error: 'swapcontext' is deprecated: first deprecated in macOS 10.6 [-Werror,-Wdeprecated-declarations]
swapcontext(¤t->state, &target->state);
^
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ucontext.h:40:6: note: 'swapcontext' has been
explicitly marked deprecated here
int swapcontext(ucontext_t * __restrict, const ucontext_t * __restrict) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_...
^
3 errors generated.
make: *** [cont.o] Error 1
```
2020-07-05 08:43:29 +03:00
|
|
|
],
|
2022-10-19 13:49:45 +03:00
|
|
|
# Correct target name is powerpc*-, but Ruby seems to prefer ppc*-.
|
|
|
|
# Notice that Darwin PPC ABI differs from AIX and ELF.
|
|
|
|
# Adding PPC targets for AIX, *BSD and *Linux will require separate implementations.
|
|
|
|
[powerpc-darwin*|ppc-darwin*], [
|
2022-05-22 06:02:03 +03:00
|
|
|
coroutine_type=ppc
|
|
|
|
],
|
2022-10-19 13:49:45 +03:00
|
|
|
[powerpc64-darwin*|ppc64-darwin*], [
|
2022-05-22 06:02:03 +03:00
|
|
|
coroutine_type=ppc64
|
|
|
|
],
|
2019-07-23 12:22:25 +03:00
|
|
|
[x*64-linux*], [
|
2019-06-24 06:12:21 +03:00
|
|
|
AS_CASE(["$ac_cv_sizeof_voidp"],
|
2021-03-09 16:07:31 +03:00
|
|
|
[8], [ coroutine_type=amd64 ],
|
|
|
|
[4], [ coroutine_type=x86 ],
|
2020-07-08 17:52:41 +03:00
|
|
|
dnl unknown pointer size, bail out as no Context.h soon.
|
2019-06-24 06:12:21 +03:00
|
|
|
)
|
|
|
|
],
|
2019-07-23 12:22:25 +03:00
|
|
|
[*86-linux*], [
|
2021-03-09 16:07:31 +03:00
|
|
|
coroutine_type=x86
|
2019-06-24 06:12:21 +03:00
|
|
|
],
|
2021-06-21 15:45:00 +03:00
|
|
|
[x64-mingw*], [
|
2021-03-09 16:07:31 +03:00
|
|
|
coroutine_type=win64
|
2019-06-24 06:12:21 +03:00
|
|
|
],
|
2021-06-21 15:45:00 +03:00
|
|
|
[*86-mingw*], [
|
2021-03-09 16:07:31 +03:00
|
|
|
coroutine_type=win32
|
2019-07-06 15:32:39 +03:00
|
|
|
],
|
2020-04-01 04:13:49 +03:00
|
|
|
[arm*-linux*], [
|
2021-03-09 16:07:31 +03:00
|
|
|
coroutine_type=arm32
|
2019-06-26 13:02:19 +03:00
|
|
|
],
|
2019-07-23 12:22:25 +03:00
|
|
|
[aarch64-linux*], [
|
2021-03-09 16:07:31 +03:00
|
|
|
coroutine_type=arm64
|
2019-06-24 06:13:10 +03:00
|
|
|
],
|
2019-07-23 12:22:25 +03:00
|
|
|
[powerpc64le-linux*], [
|
2021-03-09 16:07:31 +03:00
|
|
|
coroutine_type=ppc64le
|
2019-06-24 06:12:21 +03:00
|
|
|
],
|
2021-03-30 08:46:24 +03:00
|
|
|
[riscv64-linux*], [
|
2021-03-30 14:58:34 +03:00
|
|
|
coroutine_type=riscv64
|
2021-03-30 08:46:24 +03:00
|
|
|
],
|
2021-08-15 15:31:54 +03:00
|
|
|
[x86_64-freebsd*], [
|
|
|
|
coroutine_type=amd64
|
|
|
|
],
|
|
|
|
[i386-freebsd*], [
|
|
|
|
coroutine_type=x86
|
|
|
|
],
|
|
|
|
[aarch64-freebsd*], [
|
|
|
|
coroutine_type=arm64
|
|
|
|
],
|
2021-08-23 15:01:23 +03:00
|
|
|
[x86_64-netbsd*], [
|
|
|
|
coroutine_type=amd64
|
|
|
|
],
|
|
|
|
[i386-netbsd*], [
|
|
|
|
coroutine_type=x86
|
|
|
|
],
|
|
|
|
[aarch64-netbsd*], [
|
|
|
|
coroutine_type=arm64
|
|
|
|
],
|
2019-06-27 01:21:59 +03:00
|
|
|
[x86_64-openbsd*], [
|
2021-03-09 16:07:31 +03:00
|
|
|
coroutine_type=amd64
|
2019-06-27 01:21:59 +03:00
|
|
|
],
|
2019-07-01 21:44:12 +03:00
|
|
|
[i386-openbsd*], [
|
2021-03-09 16:07:31 +03:00
|
|
|
coroutine_type=x86
|
2019-07-01 21:44:12 +03:00
|
|
|
],
|
2019-06-26 17:53:54 +03:00
|
|
|
[*-openbsd*], [
|
2021-06-26 01:17:26 +03:00
|
|
|
coroutine_type=pthread
|
2019-06-26 17:53:54 +03:00
|
|
|
],
|
2021-09-12 07:55:25 +03:00
|
|
|
[x86_64-dragonfly*], [
|
|
|
|
coroutine_type=amd64
|
|
|
|
],
|
2020-10-30 00:49:17 +03:00
|
|
|
[*-haiku*], [
|
2021-06-26 01:17:26 +03:00
|
|
|
coroutine_type=pthread
|
2020-10-30 00:49:17 +03:00
|
|
|
],
|
2021-01-23 12:54:50 +03:00
|
|
|
[*-emscripten*], [
|
2021-03-09 16:07:31 +03:00
|
|
|
coroutine_type=emscripten
|
2021-01-23 12:54:50 +03:00
|
|
|
],
|
2022-01-15 16:22:30 +03:00
|
|
|
[*-wasi*], [
|
|
|
|
coroutine_type=asyncify
|
|
|
|
],
|
2020-07-08 17:52:41 +03:00
|
|
|
[
|
2021-02-09 08:48:03 +03:00
|
|
|
AC_CHECK_FUNCS([getcontext swapcontext makecontext],
|
2021-03-09 16:07:31 +03:00
|
|
|
[coroutine_type=ucontext],
|
2021-06-26 01:17:26 +03:00
|
|
|
[coroutine_type=pthread; break]
|
2021-02-09 08:48:03 +03:00
|
|
|
)
|
2019-06-24 06:12:21 +03:00
|
|
|
]
|
2018-11-21 06:26:59 +03:00
|
|
|
)
|
2021-07-06 13:20:39 +03:00
|
|
|
AC_MSG_CHECKING(native coroutine implementation for ${target_cpu}-${target_os})
|
2021-03-09 16:07:31 +03:00
|
|
|
AC_MSG_RESULT(${coroutine_type})
|
2018-11-21 06:26:59 +03:00
|
|
|
])
|
2021-03-09 16:07:31 +03:00
|
|
|
COROUTINE_H=coroutine/$coroutine_type/Context.h
|
2020-07-08 17:52:41 +03:00
|
|
|
AS_IF([test ! -f "$srcdir/$COROUTINE_H"],
|
2021-03-09 16:07:31 +03:00
|
|
|
[AC_MSG_ERROR('$coroutine_type' is not supported as coroutine)])
|
2021-08-16 07:45:30 +03:00
|
|
|
COROUTINE_SRC=coroutine/$coroutine_type/Context.c
|
|
|
|
AS_IF([test ! -f "$srcdir/$COROUTINE_SRC"],
|
|
|
|
[COROUTINE_SRC=coroutine/$coroutine_type/Context.'$(ASMEXT)'])
|
2019-06-29 04:07:07 +03:00
|
|
|
AC_DEFINE_UNQUOTED(COROUTINE_H, ["$COROUTINE_H"])
|
|
|
|
AC_SUBST(X_COROUTINE_H, [$COROUTINE_H])
|
|
|
|
AC_SUBST(X_COROUTINE_SRC, [$COROUTINE_SRC])
|
2018-11-20 12:59:14 +03:00
|
|
|
|
2022-04-25 12:48:37 +03:00
|
|
|
AS_IF([test "$THREAD_MODEL" = pthread], [
|
2014-06-11 12:38:09 +04:00
|
|
|
AC_CACHE_CHECK([whether pthread_t is scalar type], [rb_cv_scalar_pthread_t], [
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
2014-06-11 12:38:09 +04:00
|
|
|
@%:@include <pthread.h>
|
2020-12-12 16:55:09 +03:00
|
|
|
]], [[
|
2014-06-11 12:38:09 +04:00
|
|
|
pthread_t thread_id;
|
|
|
|
thread_id = 0;
|
|
|
|
if (!thread_id) return 0;
|
2020-12-12 16:55:09 +03:00
|
|
|
]])],[rb_cv_scalar_pthread_t=yes],[rb_cv_scalar_pthread_t=no])
|
2014-06-11 12:38:09 +04:00
|
|
|
])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test x"$rb_cv_scalar_pthread_t" = xyes], [
|
2014-06-11 12:38:09 +04:00
|
|
|
: # RUBY_CHECK_SIZEOF(pthread_t, [void* int long], [], [@%:@include <pthread.h>])
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2014-06-11 12:38:09 +04:00
|
|
|
AC_DEFINE(NON_SCALAR_THREAD_ID)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2011-05-06 18:18:06 +04:00
|
|
|
AC_CHECK_FUNCS(sched_yield pthread_attr_setinheritsched \
|
2018-02-15 04:59:16 +03:00
|
|
|
pthread_attr_get_np pthread_attr_getstack pthread_attr_getguardsize \
|
2010-02-03 16:22:32 +03:00
|
|
|
pthread_get_stackaddr_np pthread_get_stacksize_np \
|
2011-05-06 20:47:38 +04:00
|
|
|
thr_stksegment pthread_stackseg_np pthread_getthrds_np \
|
2018-01-09 11:26:43 +03:00
|
|
|
pthread_condattr_setclock \
|
2021-03-19 06:32:33 +03:00
|
|
|
pthread_setname_np pthread_set_name_np)
|
|
|
|
AS_CASE(["$target_os"],[emscripten*],[ac_cv_func_pthread_sigmask=no],[AC_CHECK_FUNCS(pthread_sigmask)])
|
2015-10-20 02:24:12 +03:00
|
|
|
AS_CASE(["$target_os"],[aix*],[ac_cv_func_pthread_getattr_np=no],[AC_CHECK_FUNCS(pthread_getattr_np)])
|
2015-12-03 05:57:14 +03:00
|
|
|
set_current_thread_name=
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$ac_cv_func_pthread_setname_np" = yes], [
|
2014-02-28 04:51:37 +04:00
|
|
|
AC_CACHE_CHECK([arguments of pthread_setname_np], [rb_cv_func_pthread_setname_np_arguments],
|
|
|
|
[rb_cv_func_pthread_setname_np_arguments=
|
2014-04-25 08:06:45 +04:00
|
|
|
# Linux,AIX, (pthread_self(), name)
|
2020-09-01 00:19:23 +03:00
|
|
|
# NetBSD (pthread_self(), \"%s\", name)
|
2014-04-25 08:06:45 +04:00
|
|
|
# Darwin (name)
|
2014-02-28 04:51:37 +04:00
|
|
|
for mac in \
|
|
|
|
"(pthread_self(), name)" \
|
2020-09-01 00:19:23 +03:00
|
|
|
"(pthread_self(), \"%s\", name)" \
|
2014-02-28 04:51:37 +04:00
|
|
|
"(name)" \
|
|
|
|
; do
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
2014-02-27 11:10:11 +04:00
|
|
|
@%:@include <pthread.h>
|
|
|
|
@%:@ifdef HAVE_PTHREAD_NP_H
|
|
|
|
@%:@include <pthread_np.h>
|
|
|
|
@%:@endif
|
2014-02-28 04:51:37 +04:00
|
|
|
@%:@define SET_THREAD_NAME(name) pthread_setname_np${mac}
|
2020-12-12 16:55:09 +03:00
|
|
|
]],
|
|
|
|
[[if (SET_THREAD_NAME("conftest")) return 1;]])],
|
2014-02-28 04:51:37 +04:00
|
|
|
[rb_cv_func_pthread_setname_np_arguments="${mac}"
|
|
|
|
break])
|
|
|
|
done
|
2014-02-27 11:10:11 +04:00
|
|
|
]
|
|
|
|
)
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test -n "${rb_cv_func_pthread_setname_np_arguments}"], [
|
2015-12-03 05:57:14 +03:00
|
|
|
set_current_thread_name="pthread_setname_np${rb_cv_func_pthread_setname_np_arguments}"
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
], [test "$ac_cv_func_pthread_set_name_np" = yes], [
|
2015-12-03 05:57:14 +03:00
|
|
|
set_current_thread_name="pthread_set_name_np(pthread_self(), name)"
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2015-12-03 05:57:14 +03:00
|
|
|
AS_IF([test -n "$set_current_thread_name"], [
|
|
|
|
AC_DEFINE_UNQUOTED(SET_CURRENT_THREAD_NAME(name), $set_current_thread_name)
|
|
|
|
AS_CASE([$set_current_thread_name],
|
|
|
|
[*'pthread_self()'*], [
|
|
|
|
set_another_thread_name=`echo "$set_current_thread_name" | sed 's/pthread_self()/thid/'`
|
|
|
|
AC_DEFINE_UNQUOTED(SET_ANOTHER_THREAD_NAME(thid,name), $set_another_thread_name)
|
|
|
|
])
|
|
|
|
])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2015-11-23 06:54:42 +03:00
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test x"$ac_cv_header_ucontext_h" = xno], [
|
2015-11-23 06:54:42 +03:00
|
|
|
AC_CACHE_CHECK([if signal.h defines ucontext_t], [rb_cv_ucontext_in_signal_h],
|
2020-12-12 16:55:09 +03:00
|
|
|
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <signal.h>]],
|
|
|
|
[[size_t size = sizeof(ucontext_t);]])],
|
2015-11-23 06:54:42 +03:00
|
|
|
[rb_cv_ucontext_in_signal_h=yes], [rb_cv_ucontext_in_signal_h=no])])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test x"$rb_cv_ucontext_in_signal_h" = xyes], [
|
2015-11-23 06:54:42 +03:00
|
|
|
AC_DEFINE_UNQUOTED(UCONTEXT_IN_SIGNAL_H, 1)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
])
|
|
|
|
AS_IF([test x"$ac_cv_header_ucontext_h" = xyes -o x"$rb_cv_ucontext_in_signal_h" = xyes], [
|
2014-12-13 11:59:54 +03:00
|
|
|
AC_CACHE_CHECK([if mcontext_t is a pointer], [rb_cv_mcontext_t_ptr],
|
2020-12-12 16:55:09 +03:00
|
|
|
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
2015-11-23 06:54:42 +03:00
|
|
|
@%:@include <signal.h>
|
|
|
|
@%:@ifdef HAVE_UCONTEXT_H
|
|
|
|
@%:@include <ucontext.h>
|
|
|
|
@%:@endif
|
|
|
|
mcontext_t test(mcontext_t mc) {return mc+1;}
|
2020-12-12 16:55:09 +03:00
|
|
|
]],
|
|
|
|
[[test(0);]])],
|
2014-12-13 11:59:54 +03:00
|
|
|
[rb_cv_mcontext_t_ptr=yes], [rb_cv_mcontext_t_ptr=no])])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test x"$rb_cv_mcontext_t_ptr" = xyes], [
|
2014-12-13 11:59:54 +03:00
|
|
|
AC_DEFINE_UNQUOTED(DEFINE_MCONTEXT_PTR(mc, uc), mcontext_t mc = (uc)->uc_mcontext)
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2014-12-13 11:59:54 +03:00
|
|
|
AC_DEFINE_UNQUOTED(DEFINE_MCONTEXT_PTR(mc, uc), mcontext_t *mc = &(uc)->uc_mcontext)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2022-04-25 12:48:37 +03:00
|
|
|
AS_IF([test x"$THREAD_MODEL" = xpthread], [
|
2003-12-26 12:34:03 +03:00
|
|
|
AC_CHECK_FUNCS(getcontext setcontext)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
])
|
2003-11-20 06:50:32 +03:00
|
|
|
|
2022-04-25 12:48:37 +03:00
|
|
|
AS_IF([test "$ac_cv_func_fork_works" = "yes" -a x"$THREAD_MODEL" = xpthread], [
|
2014-09-07 05:57:44 +04:00
|
|
|
AC_CACHE_CHECK([if fork works with pthread], rb_cv_fork_with_pthread,
|
2020-12-12 16:55:09 +03:00
|
|
|
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
2008-06-24 12:20:42 +04:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <pthread.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/wait.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#ifndef EXIT_SUCCESS
|
|
|
|
#define EXIT_SUCCESS 0
|
|
|
|
#endif
|
|
|
|
#ifndef EXIT_FAILURE
|
|
|
|
#define EXIT_FAILURE 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void *
|
|
|
|
thread_func(void *dmy)
|
|
|
|
{
|
|
|
|
return dmy;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
use_threads(void)
|
|
|
|
{
|
|
|
|
pthread_t tid;
|
|
|
|
if (pthread_create(&tid, 0, thread_func, 0) != 0) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (pthread_join(tid, 0) != 0) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
pid_t pid;
|
|
|
|
if (use_threads()) return EXIT_FAILURE;
|
2014-09-07 05:57:44 +04:00
|
|
|
pid = fork();
|
2008-06-24 12:20:42 +04:00
|
|
|
|
|
|
|
if (pid) {
|
|
|
|
int loc;
|
|
|
|
sleep(1);
|
|
|
|
if (waitpid(pid, &loc, WNOHANG) == 0) {
|
|
|
|
kill(pid, SIGKILL);
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
2009-04-01 15:40:38 +04:00
|
|
|
if (!WIFEXITED(loc) || WEXITSTATUS(loc) != EXIT_SUCCESS)
|
|
|
|
return EXIT_FAILURE;
|
2008-06-24 12:20:42 +04:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (use_threads()) return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
2020-12-12 16:55:09 +03:00
|
|
|
}]])],
|
2014-09-07 05:57:44 +04:00
|
|
|
rb_cv_fork_with_pthread=yes,
|
|
|
|
rb_cv_fork_with_pthread=no,
|
|
|
|
rb_cv_fork_with_pthread=yes)])
|
2008-06-24 12:20:42 +04:00
|
|
|
test x$rb_cv_fork_with_pthread = xyes || AC_DEFINE(CANNOT_FORK_WITH_PTHREAD)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2021-05-05 17:54:36 +03:00
|
|
|
|
2021-05-14 03:33:20 +03:00
|
|
|
AC_CHECK_HEADERS([sys/user.h])
|
|
|
|
AS_IF([test "x$ac_cv_func_mmap" = xyes], [
|
2021-05-06 05:15:24 +03:00
|
|
|
AC_CACHE_CHECK([whether PAGE_SIZE is compile-time const], rb_cv_const_page_size,
|
2021-05-14 03:33:20 +03:00
|
|
|
[malloc_headers=`sed -n '/MALLOC_HEADERS_BEGIN/,/MALLOC_HEADERS_END/p' ${srcdir}/gc.c`
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$malloc_headers
|
2021-05-05 17:54:36 +03:00
|
|
|
typedef char conftest_page[PAGE_SIZE];
|
|
|
|
]], [[]])],
|
2021-05-06 05:15:24 +03:00
|
|
|
[rb_cv_const_page_size=yes],
|
|
|
|
[rb_cv_const_page_size=no])])
|
|
|
|
])
|
|
|
|
AS_IF([test "x$rb_cv_const_page_size" = xyes],
|
|
|
|
[AC_DEFINE(HAVE_CONST_PAGE_SIZE, 1)],
|
|
|
|
[AC_DEFINE(HAVE_CONST_PAGE_SIZE, 0)]
|
|
|
|
)
|
2021-06-16 05:51:21 +03:00
|
|
|
|
|
|
|
AS_IF([test "x$ac_cv_func_ioctl" = xyes], [
|
|
|
|
AC_CACHE_CHECK([ioctl request type], rb_cv_ioctl_request_type,
|
|
|
|
[rb_cv_ioctl_request_type=no
|
|
|
|
dnl corresponding NUM2IOCTLREQ needs to be defined
|
|
|
|
for type in "unsigned long:ULONG_MAX" int:INT_MAX; do
|
|
|
|
max=`echo $type | sed 's/.*://'`
|
|
|
|
type=`echo $type | sed 's/:.*//'`
|
|
|
|
RUBY_WERROR_FLAG([
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
|
|
|
@%:@include <limits.h>
|
|
|
|
@%:@include <sys/types.h>
|
|
|
|
@%:@if defined(HAVE_SYS_IOCTL_H) && !defined(_WIN32)
|
|
|
|
@%:@include <sys/ioctl.h>
|
|
|
|
@%:@endif
|
|
|
|
]], [[
|
|
|
|
$type req = $max;
|
|
|
|
if (ioctl(0, req)) {/* do nothing*/};
|
|
|
|
]])],
|
|
|
|
[rb_cv_ioctl_request_type="$type"])
|
|
|
|
])
|
|
|
|
test "x$rb_cv_ioctl_request_type" = xno || break
|
|
|
|
done])
|
|
|
|
AS_CASE(["$rb_cv_ioctl_request_type"], [no|int], [],
|
|
|
|
["unsigned long"], [
|
|
|
|
AC_DEFINE_UNQUOTED(IOCTL_REQ_TYPE, [$rb_cv_ioctl_request_type])
|
|
|
|
AC_DEFINE_UNQUOTED(NUM2IOCTLREQ(num), [NUM2ULONG(num)])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2012-08-21 20:18:10 +04:00
|
|
|
}
|
2009-02-09 22:34:43 +03:00
|
|
|
|
2018-03-24 17:28:45 +03:00
|
|
|
: "runtime section" && {
|
2001-04-01 20:53:41 +04:00
|
|
|
dnl wheather use dln_a_out or not
|
2009-02-02 12:34:36 +03:00
|
|
|
AC_ARG_WITH(dln-a-out,
|
2021-03-24 14:13:55 +03:00
|
|
|
AS_HELP_STRING([--with-dln-a-out], [dln_a_out is deprecated]),
|
2009-03-31 10:17:38 +04:00
|
|
|
[
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE([$withval],
|
|
|
|
[yes], [
|
2021-03-24 14:13:55 +03:00
|
|
|
AC_MSG_ERROR(dln_a_out no longer supported)
|
|
|
|
])
|
|
|
|
])
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_binary_elf" = yes], [
|
2000-02-01 06:12:21 +03:00
|
|
|
AC_DEFINE(USE_ELF)
|
2012-05-17 06:48:59 +04:00
|
|
|
AC_CHECK_HEADERS([elf.h elf_abi.h])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test $ac_cv_header_elf_h = yes -o $ac_cv_header_elf_abi_h = yes], [
|
2012-05-17 06:48:59 +04:00
|
|
|
AC_LIBOBJ([addr2line])
|
2020-12-11 04:54:06 +03:00
|
|
|
AC_CHECK_LIB([z], [uncompress])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
])
|
2000-02-01 06:12:21 +03:00
|
|
|
|
2018-10-20 09:35:25 +03:00
|
|
|
AC_CHECK_HEADERS([mach-o/loader.h])
|
|
|
|
AS_IF([test "$ac_cv_header_mach_o_loader_h" = yes], [
|
|
|
|
AC_LIBOBJ([addr2line])
|
|
|
|
])
|
|
|
|
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
2017-10-23 08:56:25 +03:00
|
|
|
[linux* | gnu* | k*bsd*-gnu | bsdi* | kopensolaris*-gnu], [
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_binary_elf" = no], [
|
2021-03-24 14:13:55 +03:00
|
|
|
AC_MSG_ERROR(Not ELF)
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2003-11-30 12:33:03 +03:00
|
|
|
LDFLAGS="$LDFLAGS -rdynamic"
|
2017-06-21 06:27:21 +03:00
|
|
|
])])
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
LIBEXT=a
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2020-03-24 07:46:00 +03:00
|
|
|
AC_ARG_WITH(mjit-tabs,
|
2020-03-24 08:31:38 +03:00
|
|
|
AS_HELP_STRING([--without-mjit-tabs], [expand tabs in mjit header]),
|
|
|
|
[AS_IF([test $withval = no], [MJIT_TABS=false])])
|
|
|
|
AC_SUBST(MJIT_TABS)dnl
|
1998-01-16 15:13:05 +03:00
|
|
|
AC_SUBST(DLDFLAGS)dnl
|
2003-11-30 14:27:34 +03:00
|
|
|
AC_SUBST(ARCH_FLAG)dnl
|
2018-02-04 16:43:06 +03:00
|
|
|
AC_SUBST(MJIT_HEADER_FLAGS)dnl
|
2018-02-08 18:19:32 +03:00
|
|
|
AC_SUBST(MJIT_HEADER_INSTALL_DIR)dnl
|
2018-11-06 15:08:54 +03:00
|
|
|
AC_SUBST(MJIT_CC)dnl
|
2021-01-27 08:58:34 +03:00
|
|
|
AS_CASE(["$GCC:$target_os"],
|
|
|
|
[yes:aix*], [mjit_std_cflag="-std=gnu99"],
|
|
|
|
[mjit_std_cflag=])
|
2018-12-05 01:19:09 +03:00
|
|
|
AC_SUBST(MJIT_CFLAGS, [${MJIT_CFLAGS-"-w ${mjit_std_cflag} ${orig_cflags}"}])dnl
|
2018-03-02 01:49:26 +03:00
|
|
|
AC_SUBST(MJIT_OPTFLAGS, [${MJIT_OPTFLAGS-'$(optflags)'}])dnl
|
|
|
|
AC_SUBST(MJIT_DEBUGFLAGS, [${MJIT_DEBUGFLAGS-'$(debugflags)'}])dnl
|
2018-03-03 08:09:32 +03:00
|
|
|
AC_SUBST(MJIT_LDSHARED)dnl
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
AC_SUBST(STATIC)dnl
|
|
|
|
AC_SUBST(CCDLFLAGS)dnl
|
|
|
|
AC_SUBST(LDSHARED)dnl
|
2005-04-21 01:45:43 +04:00
|
|
|
AC_SUBST(LDSHAREDXX)dnl
|
1998-01-16 15:13:05 +03:00
|
|
|
AC_SUBST(DLEXT)dnl
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
AC_SUBST(LIBEXT)dnl
|
2014-10-08 05:38:32 +04:00
|
|
|
AC_SUBST(ASMEXT, S)dnl
|
1998-01-16 15:13:05 +03:00
|
|
|
|
|
|
|
STATIC=
|
|
|
|
|
2021-03-24 14:13:55 +03:00
|
|
|
: "dlopen" && {
|
1998-01-16 15:13:05 +03:00
|
|
|
rb_cv_dlopen=unknown
|
|
|
|
AC_MSG_CHECKING(whether OS depend dynamic link works)
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$GCC" = yes], [
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
2011-09-26 04:19:03 +04:00
|
|
|
[darwin*], [
|
2009-02-08 07:09:34 +03:00
|
|
|
# The -fno-common is needed if we wish to embed the Ruby interpreter
|
|
|
|
# into a plugin module of some project (as opposed to embedding it
|
|
|
|
# within the project's application). The -I/usr/local/include is
|
|
|
|
# needed because CPP as discovered by configure (cc -E -traditional)
|
|
|
|
# fails to consult /usr/local/include by default. This causes
|
|
|
|
# mkmf.rb's have_header() to fail if the desired resource happens to be
|
|
|
|
# installed in the /usr/local tree.
|
2010-01-21 03:38:03 +03:00
|
|
|
RUBY_APPEND_OPTION(CCDLFLAGS, -fno-common)],
|
2021-01-31 08:27:15 +03:00
|
|
|
[bsdi*|cygwin*|msys*|mingw*|aix*|interix*], [ ],
|
2010-01-21 03:38:03 +03:00
|
|
|
[
|
|
|
|
RUBY_APPEND_OPTION(CCDLFLAGS, -fPIC)])
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
2010-01-21 09:10:16 +03:00
|
|
|
[solaris*|irix*], [CCDLFLAGS="$CCDLFLAGS -KPIC"],
|
|
|
|
[sunos*], [CCDLFLAGS="$CCDLFLAGS -PIC"],
|
|
|
|
[esix*|uxpds*], [CCDLFLAGS="$CCDLFLAGS -KPIC"],
|
|
|
|
[: ${CCDLFLAGS=""}])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2021-03-24 14:13:55 +03:00
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2022-11-10 19:30:54 +03:00
|
|
|
EXTSTATIC=
|
|
|
|
AC_SUBST(EXTSTATIC)dnl
|
|
|
|
AC_ARG_WITH(static-linked-ext,
|
|
|
|
AS_HELP_STRING([--with-static-linked-ext], [link external modules statically]),
|
|
|
|
[AS_CASE([$withval],[yes],[STATIC=;EXTSTATIC=static],[no],[],[EXTSTATIC="$withval"])])
|
|
|
|
AS_CASE([",$EXTSTATIC,"], [,static,|*,enc,*], [
|
|
|
|
ENCOBJS='enc/encinit.$(OBJEXT) enc/libenc.$(LIBEXT) enc/libtrans.$(LIBEXT)'
|
|
|
|
EXTOBJS='ext/extinit.$(OBJEXT)'
|
|
|
|
AC_DEFINE_UNQUOTED(EXTSTATIC, 1)
|
|
|
|
AC_SUBST(ENCSTATIC, static)
|
|
|
|
], [
|
|
|
|
ENCOBJS='dmyenc.$(OBJEXT)'
|
|
|
|
EXTOBJS='dmyext.$(OBJEXT)'
|
|
|
|
])
|
|
|
|
AC_SUBST(ENCOBJS)
|
|
|
|
AC_SUBST(EXTOBJS)
|
|
|
|
|
2021-03-24 14:13:55 +03:00
|
|
|
: "rpath" && {
|
2022-09-17 06:09:34 +03:00
|
|
|
AS_CASE(["$target_os"],
|
2017-06-21 06:27:21 +03:00
|
|
|
[solaris*], [ AS_IF([test "$GCC" = yes], [
|
2009-02-09 22:34:43 +03:00
|
|
|
: ${LDSHARED='$(CC) -shared'}
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_prog_gnu_ld" = yes], [
|
2009-02-09 22:34:43 +03:00
|
|
|
LDFLAGS="$LDFLAGS -Wl,-E"
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
], [
|
2011-08-04 15:36:50 +04:00
|
|
|
: ${LDSHARED='$(CC) -G'}
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
AS_IF([test "$ac_cv_sizeof_voidp" = 8], [
|
2011-08-21 09:34:51 +04:00
|
|
|
: ${LIBPATHENV=LD_LIBRARY_PATH_64}
|
2015-03-02 19:06:08 +03:00
|
|
|
: ${PRELOADENV=LD_PRELOAD_64}
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2015-03-02 19:06:08 +03:00
|
|
|
: ${LIBPATHENV=LD_LIBRARY_PATH_32}
|
|
|
|
: ${PRELOADENV=LD_PRELOAD_32}
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2010-01-21 03:38:03 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2012-05-16 10:15:56 +04:00
|
|
|
[sunos*], [ : ${LDSHARED='$(LD) -assert nodefinitions'}
|
2010-01-21 03:38:03 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2012-05-16 10:15:56 +04:00
|
|
|
[irix*], [ : ${LDSHARED='$(LD) -shared'}
|
2010-01-21 03:38:03 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2012-05-16 10:15:56 +04:00
|
|
|
[sysv4*], [ : ${LDSHARED='$(LD) -G'}
|
2010-01-21 03:38:03 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2010-03-24 23:44:45 +03:00
|
|
|
[nto-qnx*], [ : ${LDSHARED='$(CC) -shared'}
|
|
|
|
rb_cv_dlopen=yes],
|
2012-05-16 10:15:56 +04:00
|
|
|
[esix*|uxpds*], [ : ${LDSHARED='$(LD) -G'}
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2012-05-16 10:47:49 +04:00
|
|
|
[osf*], [ : ${LDSHARED='$(LD) -shared -expect_unresolved "*"'}
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
|
|
|
[bsdi3*], [ AS_CASE(["$CC"],
|
2010-03-24 23:44:45 +03:00
|
|
|
[*shlicc*], [ : ${LDSHARED='$(CC) -r'}
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes])],
|
2015-10-24 16:51:25 +03:00
|
|
|
[linux* | gnu* | k*bsd*-gnu | netbsd* | bsdi* | kopensolaris*-gnu | haiku*], [
|
2010-03-24 23:44:45 +03:00
|
|
|
: ${LDSHARED='$(CC) -shared'}
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_binary_elf" = yes], [
|
2004-12-19 11:25:36 +03:00
|
|
|
LDFLAGS="$LDFLAGS -Wl,-export-dynamic"
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2010-03-24 23:44:45 +03:00
|
|
|
[interix*], [ : ${LDSHARED='$(CC) -shared'}
|
2004-01-21 17:53:31 +03:00
|
|
|
XLDFLAGS="$XLDFLAGS -Wl,-E"
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2010-01-21 03:38:03 +03:00
|
|
|
[freebsd*|dragonfly*], [
|
2010-03-24 23:44:45 +03:00
|
|
|
: ${LDSHARED='$(CC) -shared'}
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_binary_elf" = yes], [
|
2003-11-30 12:33:03 +03:00
|
|
|
LDFLAGS="$LDFLAGS -rdynamic"
|
2014-01-30 09:47:15 +04:00
|
|
|
DLDFLAGS="$DLDFLAGS "'-Wl,-soname,$@'
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2012-05-16 10:15:56 +04:00
|
|
|
test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable'
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2013-02-07 17:02:31 +04:00
|
|
|
[openbsd*|mirbsd*], [ : ${LDSHARED='$(CC) -shared ${CCDLFLAGS}'}
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_binary_elf" = yes], [
|
2003-11-30 12:33:03 +03:00
|
|
|
LDFLAGS="$LDFLAGS -Wl,-E"
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2010-01-21 03:38:03 +03:00
|
|
|
[darwin*], [ : ${LDSHARED='$(CC) -dynamic -bundle'}
|
2018-11-06 06:32:57 +03:00
|
|
|
: ${DLDSHARED='$(CC) -dynamiclib'}
|
2003-11-30 12:33:03 +03:00
|
|
|
: ${LDFLAGS=""}
|
2018-08-16 12:46:20 +03:00
|
|
|
: ${LIBPATHENV=DYLD_FALLBACK_LIBRARY_PATH}
|
2015-02-26 11:01:54 +03:00
|
|
|
: ${PRELOADENV=DYLD_INSERT_LIBRARIES}
|
2022-07-30 12:32:38 +03:00
|
|
|
AS_IF([test x"$enable_shared" = xyes], [
|
|
|
|
# Resolve symbols from libruby.dylib when --enable-shared
|
|
|
|
EXTDLDFLAGS='$(LIBRUBYARG_SHARED)'
|
|
|
|
], [test "x$EXTSTATIC" = x], [
|
|
|
|
# When building exts as bundles, a mach-o bundle needs to know its loader
|
|
|
|
# program to bind symbols from the ruby executable
|
|
|
|
EXTDLDFLAGS="-bundle_loader '\$(BUILTRUBY)'"
|
2022-07-28 11:19:28 +03:00
|
|
|
])
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2010-05-15 21:25:17 +04:00
|
|
|
[aix*], [ : ${LDSHARED='$(CC)'}
|
2018-12-05 01:19:09 +03:00
|
|
|
AS_IF([test "$GCC" = yes], [
|
|
|
|
LDSHARED="$LDSHARED ${linker_flag}-G -shared"
|
|
|
|
], [
|
|
|
|
LDSHARED="$LDSHARED ${linker_flag}-G"
|
|
|
|
])
|
2012-07-18 09:53:23 +04:00
|
|
|
EXTDLDFLAGS='-e$(TARGET_ENTRY)'
|
2009-09-11 09:19:28 +04:00
|
|
|
XLDFLAGS="${linker_flag}"'-bE:$(ARCHFILE)'" ${linker_flag}-brtl"
|
2008-09-08 01:50:32 +04:00
|
|
|
XLDFLAGS="$XLDFLAGS ${linker_flag}-blibpath:${prefix}/lib:${LIBPATH:-/usr/lib:/lib}"
|
2006-12-31 18:02:22 +03:00
|
|
|
: ${ARCHFILE="ruby.imp"}
|
2018-11-22 01:44:24 +03:00
|
|
|
TRY_LINK='$(CC) -oconftest $(INCFLAGS) -I$(hdrdir) $(CPPFLAGS)'
|
|
|
|
TRY_LINK="$TRY_LINK"' $(CFLAGS) $(src) $(LIBPATH) $(LDFLAGS) $(LOCAL_LIBS) $(LIBS)'
|
2012-07-23 09:43:37 +04:00
|
|
|
: ${LIBPATHENV=LIBPATH}
|
2018-12-05 01:19:09 +03:00
|
|
|
: ${PRELOADENV=LDR_PRELOAD}
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2010-01-21 03:38:03 +03:00
|
|
|
[nto-qnx*], [ DLDFLAGS="$DLDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
|
2012-05-16 10:15:56 +04:00
|
|
|
: ${LDSHARED='$(LD) -Bshareable -x'}
|
2003-11-30 12:33:03 +03:00
|
|
|
LDFLAGS="$LDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
|
2010-01-21 03:38:03 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2021-01-31 08:27:15 +03:00
|
|
|
[cygwin*|msys*|mingw*], [
|
2017-05-15 14:16:26 +03:00
|
|
|
: ${LDSHARED='$(CC) -shared'}
|
2008-09-08 01:50:32 +04:00
|
|
|
XLDFLAGS="$XLDFLAGS -Wl,--stack,0x00200000,--enable-auto-import"
|
2009-01-20 09:32:36 +03:00
|
|
|
DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import"
|
2017-09-13 18:28:16 +03:00
|
|
|
: ${LIBPATHENV=PATH}
|
2015-11-13 17:11:30 +03:00
|
|
|
: ${PRELOADENV=""}
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2012-05-16 10:15:56 +04:00
|
|
|
[hiuxmpp], [ : ${LDSHARED='$(LD) -r'}],
|
2010-03-24 23:44:45 +03:00
|
|
|
[atheos*], [ : ${LDSHARED='$(CC) -shared'}
|
2010-02-03 16:20:43 +03:00
|
|
|
rb_cv_dlopen=yes],
|
2014-08-11 05:40:20 +04:00
|
|
|
[ : ${LDSHARED='$(LD)'}])
|
2022-09-17 06:09:34 +03:00
|
|
|
AC_MSG_RESULT($rb_cv_dlopen)
|
|
|
|
}
|
2014-01-05 16:35:44 +04:00
|
|
|
|
2022-09-17 06:09:34 +03:00
|
|
|
AS_IF([test "$rb_cv_dlopen" = yes], [
|
2014-03-15 06:03:25 +04:00
|
|
|
AS_CASE(["$target_os"],
|
2022-09-17 06:09:34 +03:00
|
|
|
[darwin*], [
|
|
|
|
AC_SUBST(ADDITIONAL_DLDFLAGS, "")
|
2014-03-15 06:03:25 +04:00
|
|
|
for flag in \
|
2014-03-16 08:21:48 +04:00
|
|
|
"-multiply_defined suppress" \
|
2022-09-17 06:09:34 +03:00
|
|
|
"-undefined dynamic_lookup" \
|
2014-03-15 06:03:25 +04:00
|
|
|
; do
|
2022-09-17 06:09:34 +03:00
|
|
|
test "x${linker_flag}" = x || flag="${linker_flag}`echo ${flag} | tr ' ' ,`"
|
2022-10-14 19:03:47 +03:00
|
|
|
RUBY_TRY_LDFLAGS([$flag], [], [flag=])
|
2022-09-17 06:09:34 +03:00
|
|
|
AS_IF([test x"$flag" = x], [continue])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether $flag is accepted for bundle])
|
|
|
|
: > conftest.c
|
|
|
|
AS_IF([${LDSHARED/'$(CC)'/$CC} -o conftest.bundle $flag conftest.c >/dev/null 2>conftest.err &&
|
|
|
|
test ! -s conftest.err], [
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
RUBY_APPEND_OPTIONS(DLDFLAGS, [$flag])
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
RUBY_APPEND_OPTIONS(ADDITIONAL_DLDFLAGS, [$flag])
|
|
|
|
])
|
|
|
|
rm -fr conftest.*
|
2014-03-15 06:03:25 +04:00
|
|
|
done
|
2022-09-17 06:09:34 +03:00
|
|
|
])
|
|
|
|
])
|
2021-03-24 14:13:55 +03:00
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "${LDSHAREDXX}" = ""], [
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["${LDSHARED}"],
|
|
|
|
[*'$(CC)'*], [
|
2005-04-21 01:45:43 +04:00
|
|
|
LDSHAREDXX=`echo "${LDSHARED}" | sed 's/\$(CC)/$(CXX)/'`
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[*'${CC}'*], [
|
2005-04-21 01:45:43 +04:00
|
|
|
LDSHAREDXX=`echo "${LDSHARED}" | sed 's/\${CC}/${CXX}/'`
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[*$CC*], [
|
2005-04-21 01:45:43 +04:00
|
|
|
LDSHAREDXX=`echo "${LDSHARED}" | sed "s|$CC|$CXX|"`
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[ld" "*], [
|
|
|
|
])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2005-04-21 01:45:43 +04:00
|
|
|
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
AC_SUBST(LINK_SO)
|
|
|
|
AC_SUBST(LIBPATHFLAG)
|
2003-10-31 06:58:21 +03:00
|
|
|
AC_SUBST(RPATHFLAG)
|
2004-02-09 11:48:55 +03:00
|
|
|
AC_SUBST(LIBPATHENV, "${LIBPATHENV-LD_LIBRARY_PATH}")
|
2015-02-26 11:01:54 +03:00
|
|
|
AC_SUBST(PRELOADENV, "${PRELOADENV-LD_PRELOAD}")
|
2004-06-26 10:10:52 +04:00
|
|
|
AC_SUBST(TRY_LINK)
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2014-03-11 05:02:34 +04:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[freebsd*], [
|
|
|
|
AC_CHECK_LIB([procstat], [procstat_open_sysctl])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "x$ac_cv_lib_procstat_procstat_open_sysctl" = xyes], [
|
2015-03-11 07:28:51 +03:00
|
|
|
AC_CHECK_FUNCS(procstat_getvmmap)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2014-03-11 05:18:45 +04:00
|
|
|
])
|
2012-08-23 05:50:12 +04:00
|
|
|
AS_CASE(["$target_cpu-$target_os"],
|
2013-03-18 08:31:59 +04:00
|
|
|
[*-darwin*], [
|
2019-08-19 11:36:28 +03:00
|
|
|
AC_CHECK_HEADERS([libproc.h])
|
2013-03-18 08:31:59 +04:00
|
|
|
AC_CHECK_HEADERS([execinfo.h])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "x$ac_cv_header_execinfo_h" = xyes], [
|
2013-03-18 08:31:59 +04:00
|
|
|
AC_CHECK_LIB([execinfo], [backtrace])
|
2015-10-14 10:56:53 +03:00
|
|
|
AC_CHECK_HEADERS([libunwind.h])
|
2022-05-23 02:30:26 +03:00
|
|
|
|
|
|
|
AC_CHECK_HEADERS([mach/task.h mach/mach_init.h mach/mach_port.h])
|
|
|
|
AS_IF([ test \
|
|
|
|
"x${ac_cv_header_mach_task_h}" = xyes -a \
|
|
|
|
"x${ac_cv_header_mach_mach_init_h}" = xyes -a \
|
|
|
|
"x${ac_cv_header_mach_mach_port_h}" = xyes \
|
|
|
|
], [
|
|
|
|
AC_DEFINE([HAVE_MACH_TASK_EXCEPTION_PORTS], [1])
|
|
|
|
])
|
2017-06-21 06:27:21 +03:00
|
|
|
])],
|
2012-08-23 05:50:12 +04:00
|
|
|
[*-freebsd*|x86_64-netbsd*], [
|
|
|
|
AC_CHECK_HEADERS([execinfo.h])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "x$ac_cv_header_execinfo_h" = xyes], [
|
2012-08-23 05:50:12 +04:00
|
|
|
AC_CHECK_LIB([execinfo], [backtrace])
|
2013-02-19 01:21:02 +04:00
|
|
|
AC_CHECK_LIB([unwind], [unw_backtrace])
|
2017-06-21 06:27:21 +03:00
|
|
|
])])
|
2014-02-12 20:04:05 +04:00
|
|
|
AC_CHECK_FUNCS(backtrace)
|
2012-08-23 05:50:12 +04:00
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "x$ac_cv_func_backtrace" = xyes], [
|
2013-02-19 01:20:59 +04:00
|
|
|
AC_CACHE_CHECK(for broken backtrace, rb_cv_broken_backtrace,
|
2020-12-12 16:55:09 +03:00
|
|
|
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
2013-02-19 01:20:59 +04:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#include <execinfo.h>
|
|
|
|
|
2020-07-22 15:26:21 +03:00
|
|
|
]`grep '^@%:@ *define *RUBY_SIGALTSTACK_SIZE' ${srcdir}/signal.c`[
|
2013-02-19 01:20:59 +04:00
|
|
|
#define TRACE_SIZE 256
|
|
|
|
|
|
|
|
void sigsegv(int signum, siginfo_t *info, void *ctx){
|
|
|
|
void *trace[TRACE_SIZE];
|
|
|
|
int n = backtrace(trace, TRACE_SIZE);
|
|
|
|
if (n > 0) {
|
2013-02-22 04:05:51 +04:00
|
|
|
/*fprintf(stdout, "backtrace:%d\n",n);*/
|
2013-02-19 01:20:59 +04:00
|
|
|
} else {
|
2014-07-13 05:56:27 +04:00
|
|
|
_exit(EXIT_FAILURE);
|
2013-02-19 01:20:59 +04:00
|
|
|
}
|
2014-07-13 05:56:27 +04:00
|
|
|
_exit(EXIT_SUCCESS);
|
2013-02-19 01:20:59 +04:00
|
|
|
}
|
|
|
|
int
|
2014-07-13 05:56:27 +04:00
|
|
|
main(void)
|
2013-02-19 01:20:59 +04:00
|
|
|
{
|
2014-07-13 05:56:27 +04:00
|
|
|
volatile int *a = NULL;
|
2013-02-19 01:20:59 +04:00
|
|
|
stack_t ss;
|
2018-12-05 19:15:09 +03:00
|
|
|
struct sigaction sa;
|
|
|
|
|
2020-07-22 15:26:21 +03:00
|
|
|
ss.ss_sp = malloc(RUBY_SIGALTSTACK_SIZE);
|
2013-02-19 01:20:59 +04:00
|
|
|
if (ss.ss_sp == NULL) {
|
|
|
|
fprintf(stderr, "cannot allocate memory for sigaltstack\n");
|
2014-07-13 05:56:27 +04:00
|
|
|
return EXIT_FAILURE;
|
2013-02-19 01:20:59 +04:00
|
|
|
}
|
2020-07-22 15:26:21 +03:00
|
|
|
ss.ss_size = RUBY_SIGALTSTACK_SIZE;
|
2013-02-19 01:20:59 +04:00
|
|
|
ss.ss_flags = 0;
|
|
|
|
if (sigaltstack(&ss, NULL) == -1) {
|
|
|
|
fprintf(stderr, "sigaltstack failed\n");
|
2014-07-13 05:56:27 +04:00
|
|
|
return EXIT_FAILURE;
|
2013-02-19 01:20:59 +04:00
|
|
|
}
|
|
|
|
memset(&sa, 0, sizeof(struct sigaction));
|
|
|
|
sigemptyset(&sa.sa_mask);
|
|
|
|
sa.sa_sigaction = sigsegv;
|
|
|
|
sa.sa_flags |= SA_SIGINFO;
|
|
|
|
sa.sa_flags |= SA_ONSTACK;
|
|
|
|
sigaction(SIGSEGV, &sa, NULL);
|
|
|
|
a[0] = 1;
|
2014-07-13 05:56:27 +04:00
|
|
|
return EXIT_SUCCESS;
|
2013-02-19 01:20:59 +04:00
|
|
|
}
|
2020-12-12 16:55:09 +03:00
|
|
|
]])],
|
2013-02-19 01:20:59 +04:00
|
|
|
rb_cv_broken_backtrace=no,
|
|
|
|
rb_cv_broken_backtrace=yes,
|
|
|
|
rb_cv_broken_backtrace=no)])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_broken_backtrace" = yes], [
|
2013-02-19 01:20:59 +04:00
|
|
|
AC_DEFINE(BROKEN_BACKTRACE, 1)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
])
|
2013-02-19 01:20:59 +04:00
|
|
|
|
2012-08-23 05:50:12 +04:00
|
|
|
AC_ARG_WITH(valgrind,
|
|
|
|
AS_HELP_STRING([--without-valgrind],[disable valgrind memcheck support]),
|
|
|
|
[], with_valgrind=yes)
|
|
|
|
AS_IF([test x$with_valgrind != xno],
|
|
|
|
[AC_CHECK_HEADERS(valgrind/memcheck.h)])
|
|
|
|
|
2021-03-24 14:13:55 +03:00
|
|
|
: "dlext & soext" && {
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
2011-09-26 04:19:03 +04:00
|
|
|
[darwin*], [
|
2017-10-14 18:35:05 +03:00
|
|
|
SOEXT=dylib
|
2010-01-21 03:38:03 +03:00
|
|
|
DLEXT=bundle],
|
2021-01-31 08:27:15 +03:00
|
|
|
[cygwin*|msys*|mingw*|*djgpp*], [
|
2009-02-19 08:48:14 +03:00
|
|
|
LOAD_RELATIVE=1
|
2017-10-16 08:00:21 +03:00
|
|
|
SOEXT=dll
|
2010-01-21 03:38:03 +03:00
|
|
|
DLEXT=so],
|
|
|
|
[
|
|
|
|
DLEXT=so])
|
2017-10-16 08:00:21 +03:00
|
|
|
: ${SOEXT="${DLEXT}"}
|
2017-10-14 18:35:05 +03:00
|
|
|
AC_SUBST(SOEXT)
|
2021-03-24 14:13:55 +03:00
|
|
|
}
|
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_dlopen:$load_relative" = yes:yes], [
|
|
|
|
AS_IF([test "$ac_cv_func_dladdr" = yes], [
|
2009-03-09 18:06:22 +03:00
|
|
|
LOAD_RELATIVE=1
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
])
|
|
|
|
AS_IF([test x"$LOAD_RELATIVE" = x1], [
|
2012-07-30 08:11:21 +04:00
|
|
|
load_relative=yes
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2012-07-30 08:11:21 +04:00
|
|
|
unset load_relative
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2009-03-09 18:06:22 +03:00
|
|
|
|
2007-05-03 17:19:11 +04:00
|
|
|
len=2 # .rb
|
|
|
|
n=`expr "$DLEXT" : '.*'`; test "$n" -gt "$len" && len=$n
|
|
|
|
AC_DEFINE_UNQUOTED(DLEXT_MAXLEN, `expr $len + 1`)
|
|
|
|
test ".$DLEXT" = "." || AC_DEFINE_UNQUOTED(DLEXT, ".$DLEXT")
|
2007-12-15 12:56:59 +03:00
|
|
|
AC_SUBST(DLEXT)
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2021-03-24 14:13:55 +03:00
|
|
|
: "strip" && {
|
2020-08-22 02:50:44 +03:00
|
|
|
AC_MSG_CHECKING([for $STRIP flags])
|
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM], [AS_IF(
|
|
|
|
["${STRIP}" -A -n conftest$ac_exeext 2>/dev/null], [
|
|
|
|
AC_MSG_RESULT([-A -n])
|
|
|
|
STRIP="${STRIP} -A -n"
|
|
|
|
],
|
|
|
|
["${STRIP}" -S -x conftest$ac_exeext 2>/dev/null], [
|
|
|
|
AC_MSG_RESULT([-S -x])
|
|
|
|
STRIP="${STRIP} -S -x"
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([none needed])
|
|
|
|
])
|
|
|
|
])
|
2021-03-24 14:13:55 +03:00
|
|
|
}
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2010-02-18 16:33:25 +03:00
|
|
|
AC_ARG_WITH(ext,
|
2020-12-12 16:55:09 +03:00
|
|
|
AS_HELP_STRING([--with-ext=EXTS],
|
2010-02-18 16:33:25 +03:00
|
|
|
[pass to --with-ext option of extmk.rb]))
|
|
|
|
AC_ARG_WITH(out-ext,
|
2020-12-12 16:55:09 +03:00
|
|
|
AS_HELP_STRING([--with-out-ext=EXTS],
|
2015-01-11 07:44:09 +03:00
|
|
|
[pass to --without-ext option of extmk.rb]))
|
2014-11-27 23:10:26 +03:00
|
|
|
AC_ARG_WITH(setup,
|
|
|
|
AS_HELP_STRING([--with-setup=SETUP], [use extension libraries setup]),
|
|
|
|
[setup=$withval])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test -n "$setup"], [
|
|
|
|
AS_IF([! test -f "ext/$setup" -o -f "$srcdir/ext/$setup"], [
|
2014-11-27 23:10:26 +03:00
|
|
|
AC_MSG_ERROR(Setup file $setup not found under ext or $srcdir/ext)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
], [test -f "$srcdir/ext/Setup.$target_os"], [
|
2013-02-25 08:12:45 +04:00
|
|
|
setup="Setup.$target_os"
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2013-02-25 08:12:45 +04:00
|
|
|
setup=
|
|
|
|
for file in "$srcdir"/ext/Setup.*; do
|
|
|
|
AS_CASE(["$file"], [*~|*.bak|*.orig|*.rej|*.tmp], [continue])
|
|
|
|
setup=`basename "$file"`
|
|
|
|
AS_CASE(["$target_os"], [`expr "$setup" : 'Setup.\(.*\)'`*], [break])
|
|
|
|
platform=`sed '/^option *platform */!d;s///;s/|/*|/g;q' "$file"`
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "x$platform" != x], [
|
2013-02-25 08:12:45 +04:00
|
|
|
eval "AS_CASE([\"\$target_os\"], [$platform*], [break])"
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2013-02-25 08:12:45 +04:00
|
|
|
setup=
|
|
|
|
done
|
|
|
|
: ${setup:=Setup}
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
1998-01-16 15:13:05 +03:00
|
|
|
AC_SUBST(setup)
|
|
|
|
|
2013-12-14 11:26:52 +04:00
|
|
|
rubylibprefix='${libdir}/${RUBY_BASE_NAME}'
|
|
|
|
AC_ARG_WITH(rubylibprefix,
|
|
|
|
AS_HELP_STRING([--with-rubylibprefix=DIR], [prefix for ruby libraries [[LIBDIR/RUBY_BASE_NAME]]]),
|
2017-06-21 06:27:21 +03:00
|
|
|
[AS_IF([test "x$withval" = xno], [
|
2013-12-14 11:26:52 +04:00
|
|
|
AC_MSG_ERROR([No ruby, No libprefix])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2013-12-14 11:26:52 +04:00
|
|
|
rubylibprefix="$withval"])
|
|
|
|
AC_SUBST(rubylibprefix)
|
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test x"${exec_prefix}" != xNONE], [
|
2013-05-16 11:15:48 +04:00
|
|
|
RUBY_EXEC_PREFIX="$exec_prefix"
|
2017-06-21 06:27:21 +03:00
|
|
|
], [test x"$prefix" != xNONE], [
|
2013-05-16 11:15:48 +04:00
|
|
|
RUBY_EXEC_PREFIX="$prefix"
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2013-05-16 11:15:48 +04:00
|
|
|
RUBY_EXEC_PREFIX=$ac_default_prefix
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2013-05-16 11:15:48 +04:00
|
|
|
pat=`echo "${RUBY_EXEC_PREFIX}" | tr -c '\012' .`'\(.*\)'
|
2021-12-21 10:31:43 +03:00
|
|
|
for var in bindir includedir libdir rubylibprefix; do
|
2013-02-16 07:45:53 +04:00
|
|
|
eval val='"$'$var'"'
|
2013-05-16 11:15:48 +04:00
|
|
|
AS_CASE(["$val"], ["${RUBY_EXEC_PREFIX}"*], [val='${exec_prefix}'"`expr \"$val\" : \"$pat\"`"])
|
2013-02-16 07:45:53 +04:00
|
|
|
eval $var='"$val"'
|
|
|
|
done
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2012-05-17 06:48:59 +04:00
|
|
|
BTESTRUBY='$(MINIRUBY)'
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test x"$cross_compiling" = xyes], [
|
2012-08-09 18:46:48 +04:00
|
|
|
test x"$MINIRUBY" = x && MINIRUBY="${RUBY-$BASERUBY} -I`$CHDIR .; pwd` "-r'$(arch)-fake'
|
2010-09-24 20:34:56 +04:00
|
|
|
XRUBY_LIBDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["libdir"]']`
|
|
|
|
XRUBY_RUBYLIBDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["rubylibdir"]']`
|
|
|
|
XRUBY_RUBYHDRDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["rubyhdrdir"]']`
|
|
|
|
AC_SUBST(XRUBY_LIBDIR)
|
|
|
|
AC_SUBST(XRUBY_RUBYLIBDIR)
|
|
|
|
AC_SUBST(XRUBY_RUBYHDRDIR)
|
2022-07-30 11:25:12 +03:00
|
|
|
PREP='$(arch)-fake.rb'
|
2013-09-30 11:07:06 +04:00
|
|
|
RUNRUBY_COMMAND='$(MINIRUBY) -I`cd $(srcdir)/lib; pwd`'
|
|
|
|
RUNRUBY='$(RUNRUBY_COMMAND)'
|
2009-10-23 02:32:39 +04:00
|
|
|
XRUBY='$(MINIRUBY)'
|
2009-07-20 06:13:00 +04:00
|
|
|
TEST_RUNNABLE=no
|
2013-01-04 13:04:58 +04:00
|
|
|
CROSS_COMPILING=yes
|
2019-12-10 11:39:04 +03:00
|
|
|
AC_DEFINE(CROSS_COMPILING, 1)
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2011-01-14 05:37:34 +03:00
|
|
|
MINIRUBY='./miniruby$(EXEEXT) -I$(srcdir)/lib -I.'
|
2010-08-03 02:52:25 +04:00
|
|
|
MINIRUBY="$MINIRUBY"' -I$(EXTOUT)/common'
|
2022-07-30 11:25:12 +03:00
|
|
|
PREP='miniruby$(EXEEXT)'
|
2020-04-04 21:57:05 +03:00
|
|
|
RUNRUBY_COMMAND='$(MINIRUBY) $(tooldir)/runruby.rb --extout=$(EXTOUT) $(RUNRUBYOPT)'
|
2013-09-30 11:07:06 +04:00
|
|
|
RUNRUBY='$(RUNRUBY_COMMAND) --'
|
2009-10-23 02:32:39 +04:00
|
|
|
XRUBY='$(RUNRUBY)'
|
2009-07-20 06:13:00 +04:00
|
|
|
TEST_RUNNABLE=yes
|
2013-01-04 13:04:58 +04:00
|
|
|
CROSS_COMPILING=no
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2009-07-20 06:13:00 +04:00
|
|
|
AC_SUBST(TEST_RUNNABLE)
|
2013-01-04 13:04:58 +04:00
|
|
|
AC_SUBST(CROSS_COMPILING)
|
2000-01-05 07:41:21 +03:00
|
|
|
AC_SUBST(MINIRUBY)
|
2012-05-17 06:48:59 +04:00
|
|
|
AC_SUBST(BTESTRUBY)
|
2000-01-05 07:41:21 +03:00
|
|
|
AC_SUBST(PREP)
|
2013-09-30 11:07:06 +04:00
|
|
|
AC_SUBST(RUNRUBY_COMMAND)
|
2004-02-09 11:48:55 +03:00
|
|
|
AC_SUBST(RUNRUBY)
|
2009-10-23 02:32:39 +04:00
|
|
|
AC_SUBST(XRUBY)
|
2007-06-10 07:06:15 +04:00
|
|
|
AC_SUBST(EXTOUT, [${EXTOUT=.ext}])
|
2000-01-05 07:41:21 +03:00
|
|
|
|
2018-03-02 03:37:28 +03:00
|
|
|
FIRSTMAKEFILE=""
|
2002-11-14 16:51:19 +03:00
|
|
|
LIBRUBY_A='lib$(RUBY_SO_NAME)-static.a'
|
1999-08-13 09:45:20 +04:00
|
|
|
LIBRUBY='$(LIBRUBY_A)'
|
2002-11-14 16:51:19 +03:00
|
|
|
LIBRUBYARG_STATIC='-l$(RUBY_SO_NAME)-static'
|
|
|
|
LIBRUBYARG='$(LIBRUBYARG_STATIC)'
|
2018-03-02 04:37:53 +03:00
|
|
|
SOLIBS='$(MAINLIBS)'
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
2021-01-31 08:27:15 +03:00
|
|
|
[cygwin*|msys*|mingw*|haiku*|darwin*], [
|
2003-11-30 12:33:03 +03:00
|
|
|
: ${DLDLIBS=""}
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[
|
2021-12-07 06:32:02 +03:00
|
|
|
DLDLIBS="${DLDLIBS:+$DLDLIBS }-lc"
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
2000-05-09 08:53:16 +04:00
|
|
|
|
2013-02-21 07:42:25 +04:00
|
|
|
AC_ARG_ENABLE(multiarch,
|
|
|
|
AS_HELP_STRING([--enable-multiarch], [enable multiarch compatible directories]),
|
|
|
|
[multiarch=], [unset multiarch])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test ${multiarch+set}], [
|
2013-02-21 07:45:07 +04:00
|
|
|
AC_DEFINE(ENABLE_MULTIARCH)
|
2018-02-08 18:19:32 +03:00
|
|
|
MJIT_HEADER_INSTALL_DIR=include/'${arch}/${RUBY_VERSION_NAME}'
|
|
|
|
], [
|
|
|
|
MJIT_HEADER_INSTALL_DIR=include/'${RUBY_VERSION_NAME}/${arch}'
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2013-02-21 07:42:25 +04:00
|
|
|
|
|
|
|
archlibdir='${libdir}/${arch}'
|
|
|
|
sitearchlibdir='${libdir}/${sitearch}'
|
|
|
|
archincludedir='${includedir}/${arch}'
|
|
|
|
sitearchincludedir='${includedir}/${sitearch}'
|
|
|
|
|
2009-05-08 05:14:14 +04:00
|
|
|
AC_ARG_WITH(soname,
|
|
|
|
AS_HELP_STRING([--with-soname=SONAME], [base name of shared library]),
|
2017-03-10 08:34:27 +03:00
|
|
|
[RUBY_SO_NAME=$withval],
|
|
|
|
[
|
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[darwin*], [
|
2018-04-29 14:15:41 +03:00
|
|
|
RUBY_SO_NAME='$(RUBY_BASE_NAME).$(RUBY_API_VERSION)'
|
2017-03-10 08:34:27 +03:00
|
|
|
],
|
|
|
|
[cygwin*], [
|
2017-10-15 05:31:29 +03:00
|
|
|
RUBY_SO_NAME='$(RUBY_BASE_NAME)$(MAJOR)$(MINOR)0'
|
2017-03-10 08:34:27 +03:00
|
|
|
],
|
|
|
|
[mingw*], [
|
2017-10-15 05:31:29 +03:00
|
|
|
RUBY_SO_NAME="${rb_cv_msvcrt}"'-$(RUBY_BASE_NAME)$(MAJOR)$(MINOR)0'
|
2017-03-10 08:34:27 +03:00
|
|
|
AS_IF([test x"${target_cpu}" != xi386], [
|
|
|
|
RUBY_SO_NAME="${target_cpu}-${RUBY_SO_NAME}"
|
|
|
|
])
|
|
|
|
],
|
|
|
|
[RUBY_SO_NAME='$(RUBY_BASE_NAME)'])
|
|
|
|
])
|
2009-05-08 05:14:14 +04:00
|
|
|
|
2018-11-06 06:32:57 +03:00
|
|
|
LIBRUBY_LDSHARED=${DLDSHARED=${LDSHARED}}
|
1999-08-13 09:45:20 +04:00
|
|
|
LIBRUBY_DLDFLAGS=$DLDFLAGS
|
2017-10-14 18:35:05 +03:00
|
|
|
LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT).$(RUBY_PROGRAM_VERSION)'
|
|
|
|
LIBRUBY_SONAME='lib$(RUBY_SO_NAME).$(SOEXT).$(RUBY_API_VERSION)'
|
|
|
|
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).$(SOEXT)'
|
2000-07-02 19:57:18 +04:00
|
|
|
ENABLE_SHARED=no
|
|
|
|
|
2001-11-30 12:17:30 +03:00
|
|
|
AC_ARG_ENABLE(shared,
|
2009-03-31 10:17:38 +04:00
|
|
|
AS_HELP_STRING([--enable-shared], [build a shared library for Ruby]),
|
1999-08-13 09:45:20 +04:00
|
|
|
[enable_shared=$enableval])
|
2013-02-21 07:42:25 +04:00
|
|
|
libprefix=${multiarch+'$(archlibdir)'}${multiarch-'$(libdir)'}
|
2012-07-30 08:11:21 +04:00
|
|
|
LIBRUBY_RELATIVE=${load_relative-no}
|
2010-05-21 08:55:48 +04:00
|
|
|
AS_CASE("$enable_shared", [yes], [
|
1999-08-13 09:45:20 +04:00
|
|
|
LIBRUBY='$(LIBRUBY_SO)'
|
2010-05-21 08:55:48 +04:00
|
|
|
LIBRUBYARG_SHARED='-l$(RUBY_SO_NAME)'
|
2002-11-14 16:51:19 +03:00
|
|
|
LIBRUBYARG='$(LIBRUBYARG_SHARED)'
|
2012-07-30 08:11:21 +04:00
|
|
|
LIBRUBY_RELATIVE=no
|
2009-02-08 07:09:34 +03:00
|
|
|
test -z "$CCDLFLAGS" || CFLAGS="$CFLAGS $CCDLFLAGS"
|
2000-07-02 19:57:18 +04:00
|
|
|
ENABLE_SHARED=yes
|
2011-11-25 05:41:59 +04:00
|
|
|
|
2012-08-29 10:03:09 +04:00
|
|
|
# libdir can be overridden in config.site file (on OpenSUSE at least).
|
|
|
|
libdir_basename=lib
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$bindir" = '${exec_prefix}/bin'], [
|
2012-08-29 10:03:09 +04:00
|
|
|
AS_CASE(["$libdir"], ['${exec_prefix}/'*], [libdir_basename=`basename "$libdir"`])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2012-09-01 09:03:34 +04:00
|
|
|
AC_DEFINE_UNQUOTED(LIBDIR_BASENAME, ["${libdir_basename}"])
|
2013-02-21 07:42:25 +04:00
|
|
|
libdir_basename="${libdir_basename}"${multiarch+'/${arch}'}
|
2012-08-29 10:03:09 +04:00
|
|
|
|
2021-07-07 11:50:11 +03:00
|
|
|
# Debian bullseye reportedly has its ld(1) patched, which breaks
|
|
|
|
# --enable-shared --with-jemalloc combination. We might have to deal with
|
|
|
|
# the ld(1) change sooner or later, but in the meantime let us force it
|
|
|
|
# the old way.
|
|
|
|
#
|
|
|
|
# See https://github.com/ruby/ruby/pull/4627
|
2021-07-07 04:16:48 +03:00
|
|
|
RUBY_TRY_LDFLAGS([${linker_flag}--no-as-needed], [no_as_needed=yes], [no_as_needed=no])
|
|
|
|
AS_IF([test "$no_as_needed" = yes], [
|
|
|
|
RUBY_APPEND_OPTIONS(LDFLAGS, [${linker_flag}--no-as-needed])
|
|
|
|
])
|
|
|
|
|
2011-11-26 23:59:13 +04:00
|
|
|
AS_CASE(["$target_os"],
|
2011-11-27 02:49:28 +04:00
|
|
|
[freebsd*|dragonfly*], [],
|
2011-11-26 23:59:13 +04:00
|
|
|
[
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$GCC" = yes], [
|
2011-12-02 10:18:21 +04:00
|
|
|
RUBY_TRY_LDFLAGS([${linker_flag}--no-undefined], [no_undefined=yes], [no_undefined=no])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "no_undefined" = yes], [
|
2011-12-02 10:18:21 +04:00
|
|
|
RUBY_APPEND_OPTION(EXTLDFLAGS, [${linker_flag}--no-undefined])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
])
|
2011-11-26 23:59:13 +04:00
|
|
|
])
|
2011-11-25 05:41:59 +04:00
|
|
|
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[sunos4*], [
|
2017-10-14 18:35:05 +03:00
|
|
|
LIBRUBY_ALIASES='$(LIBRUBY_SONAME) lib$(RUBY_SO_NAME).$(SOEXT)'
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
2015-11-23 06:54:42 +03:00
|
|
|
[linux* | gnu* | k*bsd*-gnu | atheos* | kopensolaris*-gnu | haiku*], [
|
2017-10-14 18:35:05 +03:00
|
|
|
RUBY_APPEND_OPTIONS(LIBRUBY_DLDFLAGS, ['-Wl,-soname,$(LIBRUBY_SONAME)' "$LDFLAGS_OPTDIR"])
|
|
|
|
LIBRUBY_ALIASES='$(LIBRUBY_SONAME) lib$(RUBY_SO_NAME).$(SOEXT)'
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$load_relative" = yes], [
|
2013-02-21 07:42:25 +04:00
|
|
|
libprefix="'\$\${ORIGIN}/../${libdir_basename}'"
|
|
|
|
LIBRUBY_RPATHFLAGS="-Wl,-rpath,${libprefix}"
|
2010-11-06 01:28:45 +03:00
|
|
|
LIBRUBY_RELATIVE=yes
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[freebsd*|dragonfly*], [
|
2017-10-16 07:15:19 +03:00
|
|
|
LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT).$(MAJOR)$(MINOR)'
|
|
|
|
LIBRUBY_SONAME='$(LIBRUBY_SO)'
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_binary_elf" != "yes" ], [
|
1999-08-13 09:45:20 +04:00
|
|
|
LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)"
|
|
|
|
LIBRUBY_ALIASES=''
|
2021-07-06 15:26:14 +03:00
|
|
|
], [test "$load_relative" = yes], [
|
|
|
|
libprefix="'\$\$ORIGIN/../${libdir_basename}'"
|
|
|
|
LIBRUBY_RPATHFLAGS="-Wl,-rpath,${libprefix}"
|
|
|
|
LIBRUBY_RELATIVE=yes
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[netbsd*], [
|
2017-10-15 05:31:29 +03:00
|
|
|
LIBRUBY_SONAME='lib$(RUBY_SO_NAME).$(SOEXT).$(MAJOR)$(MINOR)'
|
2017-10-16 07:15:19 +03:00
|
|
|
LIBRUBY_SO="${LIBRUBY_SONAME}"'.$(TEENY)'
|
2017-10-14 18:35:05 +03:00
|
|
|
RUBY_APPEND_OPTIONS(LIBRUBY_DLDFLAGS, ['-Wl,-soname,$(LIBRUBY_SONAME)' "$LDFLAGS_OPTDIR"])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$rb_cv_binary_elf" = yes], [ # ELF platforms
|
2017-10-14 18:35:05 +03:00
|
|
|
LIBRUBY_ALIASES='$(LIBRUBY_SONAME) lib$(RUBY_SO_NAME).$(SOEXT)'
|
2017-06-21 06:27:21 +03:00
|
|
|
], [ # a.out platforms
|
2001-12-02 21:33:10 +03:00
|
|
|
LIBRUBY_ALIASES=""
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
2013-02-11 11:08:41 +04:00
|
|
|
[openbsd*|mirbsd*], [
|
2017-10-14 18:35:05 +03:00
|
|
|
LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT).$(MAJOR).'`expr ${MINOR} \* 10 + ${TEENY}`
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[solaris*], [
|
2017-10-14 18:35:05 +03:00
|
|
|
LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT).$(MAJOR)'
|
|
|
|
LIBRUBY_SONAME='lib$(RUBY_SO_NAME).$(SOEXT).$(RUBY_PROGRAM_VERSION)'
|
|
|
|
LIBRUBY_ALIASES='$(LIBRUBY_SONAME) lib$(RUBY_SO_NAME).$(SOEXT)'
|
2018-08-13 10:55:43 +03:00
|
|
|
RUBY_APPEND_OPTIONS(LIBRUBY_DLDFLAGS, ["${linker_flag}-h${linker_flag:+,}"'$(@F)'])
|
2021-11-30 06:36:49 +03:00
|
|
|
AS_IF([test "$load_relative" = yes], [
|
|
|
|
libprefix="'\$\$ORIGIN/../${libdir_basename}'"
|
|
|
|
LIBRUBY_RPATHFLAGS="-R${libprefix}"
|
|
|
|
LIBRUBY_RELATIVE=yes
|
|
|
|
], [
|
|
|
|
LIBRUBY_RPATHFLAGS='-R${libdir}'
|
|
|
|
])
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[aix*], [
|
2016-10-22 04:28:30 +03:00
|
|
|
RUBY_APPEND_OPTIONS(LIBRUBY_DLDFLAGS, ["${linker_flag}-bnoentry" "$XLDFLAGS" "$LDFLAGS_OPTDIR"])
|
2006-10-30 17:41:43 +03:00
|
|
|
LIBRUBYARG_SHARED='-L${libdir} -l${RUBY_SO_NAME}'
|
2018-03-02 04:37:53 +03:00
|
|
|
LIBS="$LIBS -lm -lc"
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[darwin*], [
|
2018-04-29 14:15:41 +03:00
|
|
|
LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT)'
|
|
|
|
LIBRUBY_SONAME='$(LIBRUBY_SO)'
|
|
|
|
LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).$(SOEXT)'
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$load_relative" = yes], [
|
2013-02-21 07:42:25 +04:00
|
|
|
libprefix="@executable_path/../${libdir_basename}"
|
2010-11-06 01:28:45 +03:00
|
|
|
LIBRUBY_RELATIVE=yes
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2017-10-14 18:35:05 +03:00
|
|
|
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS -install_name ${libprefix}"'/$(LIBRUBY_SONAME)'
|
2017-09-25 09:31:38 +03:00
|
|
|
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-compatibility_version $(RUBY_API_VERSION)'
|
2016-11-27 13:08:00 +03:00
|
|
|
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-current_version $(RUBY_PROGRAM_VERSION)'
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$visibility_option" = ld], [
|
2010-09-25 05:30:52 +04:00
|
|
|
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_Init_*'
|
2015-02-23 10:05:23 +03:00
|
|
|
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_ruby_static_id_*'
|
2010-09-25 05:30:52 +04:00
|
|
|
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,*_threadptr_*'
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2009-10-10 13:19:05 +04:00
|
|
|
LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "' $(XLDFLAGS)'
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[interix*], [
|
2007-04-17 21:17:15 +04:00
|
|
|
LIBRUBYARG_SHARED='-L. -L${libdir} -l$(RUBY_SO_NAME)'
|
2012-07-03 06:16:08 +04:00
|
|
|
],
|
2021-01-31 08:27:15 +03:00
|
|
|
[cygwin*|msys*|mingw*|mswin*], [
|
2012-07-03 06:16:08 +04:00
|
|
|
LIBRUBY_RELATIVE=yes
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
2010-05-21 08:55:48 +04:00
|
|
|
], [
|
|
|
|
LIBRUBYARG_SHARED=
|
2011-11-25 03:50:00 +04:00
|
|
|
|
|
|
|
# enable PIE if possible
|
2014-03-26 04:13:36 +04:00
|
|
|
AC_ARG_ENABLE(pie,
|
|
|
|
AS_HELP_STRING([--disable-pie], [disable PIE feature]),
|
|
|
|
[pie=$enableval], [pie=])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$GCC" = yes -a -z "$EXTSTATIC" -a "x$pie" != xno], [
|
2011-12-02 10:41:27 +04:00
|
|
|
RUBY_TRY_CFLAGS(-fPIE, [pie=yes], [pie=no])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$pie" = yes], [
|
2012-12-26 07:00:13 +04:00
|
|
|
# Use -fPIE when testing -pie. RUBY_TRY_LDFLAGS sets
|
|
|
|
# $save_CFLAGS internally, so set other name here.
|
|
|
|
save_CFLAGS_before_pie="$CFLAGS"
|
|
|
|
CFLAGS="$CFLAGS -fPIE"
|
|
|
|
|
|
|
|
# gcc need -pie but clang need -Wl,-pie.
|
2011-12-02 10:41:27 +04:00
|
|
|
for pie in -pie -Wl,-pie; do
|
|
|
|
RUBY_TRY_LDFLAGS([$pie], [], [pie=])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "x$pie" != x], [
|
2012-12-26 07:00:13 +04:00
|
|
|
RUBY_APPEND_OPTION(XCFLAGS, -fPIE)
|
2011-12-02 10:41:27 +04:00
|
|
|
RUBY_APPEND_OPTION(XLDFLAGS, $pie)
|
|
|
|
break
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2011-12-02 10:41:27 +04:00
|
|
|
done
|
2012-12-26 07:00:13 +04:00
|
|
|
CFLAGS="$save_CFLAGS_before_pie"
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
])
|
2010-05-21 08:55:48 +04:00
|
|
|
])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$enable_rpath" = yes], [
|
2010-11-06 01:28:45 +03:00
|
|
|
test -z "$LIBRUBY_RPATHFLAGS" || LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS "
|
2014-01-05 16:35:44 +04:00
|
|
|
rpathflag="${RPATHFLAG}"
|
|
|
|
AS_CASE(["${cross_compiling}${load_relative}"], [*yes*], [], [rpathflag="$RPATHFLAG$LIBPATHFLAG"])
|
|
|
|
rpathflag=`IFS="$PATH_SEPARATOR"
|
|
|
|
echo x "$rpathflag" |
|
|
|
|
sed "s/^x *//;s${IFS}"'%1\\$-s'"${IFS}${libprefix}${IFS}g;s${IFS}%s${IFS}${libprefix}${IFS}g"
|
|
|
|
`
|
|
|
|
LIBRUBY_RPATHFLAGS="$LIBRUBY_RPATHFLAGS${rpathflag}"
|
2008-11-16 20:19:05 +03:00
|
|
|
LIBRUBYARG_SHARED="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_SHARED"
|
|
|
|
LIBRUBYARG_STATIC="$LIBRUBY_RPATHFLAGS $LIBRUBYARG_STATIC"
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2010-11-06 01:28:45 +03:00
|
|
|
AC_SUBST(LIBRUBY_RELATIVE)
|
2004-12-19 11:25:36 +03:00
|
|
|
|
2007-04-17 21:17:15 +04:00
|
|
|
LDFLAGS="-L. $LDFLAGS"
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
AC_SUBST(ARCHFILE)
|
1999-01-20 07:59:39 +03:00
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$EXEEXT" = .exe], [
|
2009-11-30 10:54:26 +03:00
|
|
|
EXECUTABLE_EXTS='".exe",".com",".cmd",".bat"'
|
|
|
|
AC_DEFINE_UNQUOTED(EXECUTABLE_EXTS, $EXECUTABLE_EXTS)
|
2010-01-29 08:21:55 +03:00
|
|
|
EXECUTABLE_EXTS=`echo $EXECUTABLE_EXTS | tr -d '"' | tr , ' '`
|
2009-11-30 10:54:26 +03:00
|
|
|
AC_SUBST(EXECUTABLE_EXTS)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2009-11-30 10:54:26 +03:00
|
|
|
|
2015-10-04 18:43:58 +03:00
|
|
|
AS_CASE("$cross_compiling:${LIBPATHENV}", [yes:* | no:], [], [
|
|
|
|
AC_MSG_CHECKING(whether wrapper for $LIBPATHENV is needed)
|
|
|
|
AS_IF([env ${LIBPATHENV}=/lib /bin/sh -c ': ${'${LIBPATHENV}'?}' 2>/dev/null],
|
|
|
|
[AC_MSG_RESULT(no)],
|
2022-09-02 19:08:47 +03:00
|
|
|
[AC_SUBST(XRUBY_LIBPATHENV_WRAPPER, 'exe/$(PROGRAM)')
|
2015-10-04 18:43:58 +03:00
|
|
|
AC_MSG_RESULT(yes)]
|
|
|
|
)
|
|
|
|
])
|
|
|
|
|
* configure.in, Makefile.in, common.mk: support DTrace on Solaris 10,
based on r26235 by Yugui. On Solaris 10, low optimization level
may also be needed, e.g. optflags="-xO1" or "-xO0" with Oracle
SolarisStudio 12.3 cc.
* configure.in (--enable-dtrace): new option to enable/disable
DTrace support. By default, trying to enable if dtrace command
is found on the system. It is disabled when cross compiling.
* configure.in (RUBY_DTRACE_POSTPROCESS): new macro. checks whether
the dtrace on the system needs postprocessing with "dtrace -G".
The postprocessing is needed on Solaris 10 and other platforms.
* configure.in (RUBY_DTRACE_BSD_BROKEN): new macro. checks whether
the dtrace supports USDT.
* configure.in (DTRACE): move after RUBY_DTRACE_POSTPROCESS.
* configure.in (LD): On Solaris, /usr/ccs/bin/ld is preferred.
* configure.in, Makefile.in, common.mk (DTRACE_OBJ): new macro for
DTrace probe object generated by postprocessing with "dtrace -G".
* Makefile.in, common.mk (probes.$(OBJEXT)): DTrace probe object
generated by the postprocessing. New file probes.stamp is for
rebuilding related objects that may be modified by "dtrace -G".
* configure.in, Makefile.in, common.mk (DTRACE_GLOMMED_OBJ): new
macro for DTrace static library hacks.
* configure.in, Makefile.in (LIBRUBY_A_OBJS): ditto.
* Makefile.in, common.mk (ruby-glommed.$(OBJEXT)): new target with
rule for DTrace static library hacks.
* common.mk (DTRACE_DEPENDENT_OBJS): objects depended on probes.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-18 12:24:24 +04:00
|
|
|
AC_ARG_ENABLE(dtrace,
|
|
|
|
AS_HELP_STRING([--enable-dtrace],
|
2012-11-20 12:35:57 +04:00
|
|
|
[enable DTrace for tracing inside ruby. enabled by default on systems having dtrace]),
|
2012-11-20 06:21:17 +04:00
|
|
|
[enable_dtrace=$enableval], [enable_dtrace=auto])
|
* configure.in, Makefile.in, common.mk: support DTrace on Solaris 10,
based on r26235 by Yugui. On Solaris 10, low optimization level
may also be needed, e.g. optflags="-xO1" or "-xO0" with Oracle
SolarisStudio 12.3 cc.
* configure.in (--enable-dtrace): new option to enable/disable
DTrace support. By default, trying to enable if dtrace command
is found on the system. It is disabled when cross compiling.
* configure.in (RUBY_DTRACE_POSTPROCESS): new macro. checks whether
the dtrace on the system needs postprocessing with "dtrace -G".
The postprocessing is needed on Solaris 10 and other platforms.
* configure.in (RUBY_DTRACE_BSD_BROKEN): new macro. checks whether
the dtrace supports USDT.
* configure.in (DTRACE): move after RUBY_DTRACE_POSTPROCESS.
* configure.in (LD): On Solaris, /usr/ccs/bin/ld is preferred.
* configure.in, Makefile.in, common.mk (DTRACE_OBJ): new macro for
DTrace probe object generated by postprocessing with "dtrace -G".
* Makefile.in, common.mk (probes.$(OBJEXT)): DTrace probe object
generated by the postprocessing. New file probes.stamp is for
rebuilding related objects that may be modified by "dtrace -G".
* configure.in, Makefile.in, common.mk (DTRACE_GLOMMED_OBJ): new
macro for DTrace static library hacks.
* configure.in, Makefile.in (LIBRUBY_A_OBJS): ditto.
* Makefile.in, common.mk (ruby-glommed.$(OBJEXT)): new target with
rule for DTrace static library hacks.
* common.mk (DTRACE_DEPENDENT_OBJS): objects depended on probes.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-18 12:24:24 +04:00
|
|
|
|
|
|
|
LIBRUBY_A_OBJS='$(OBJS)'
|
2015-02-04 05:12:45 +03:00
|
|
|
DTRACE_REBUILD=
|
2016-12-17 10:48:57 +03:00
|
|
|
AS_CASE(["${enable_dtrace}"],
|
|
|
|
[yes|auto], [
|
|
|
|
RUBY_DTRACE_AVAILABLE()
|
|
|
|
], [
|
|
|
|
rb_cv_dtrace_available=no
|
|
|
|
])
|
2020-12-25 06:06:46 +03:00
|
|
|
AS_CASE(["$target_os"],[freebsd*],[
|
|
|
|
rb_cv_dtrace_available=no
|
|
|
|
])
|
2016-12-17 10:48:57 +03:00
|
|
|
AS_IF([test "${enable_dtrace}" = yes], [dnl
|
|
|
|
AS_IF([test -z "$DTRACE"], [dnl
|
|
|
|
AC_MSG_ERROR([dtrace(1) is missing])
|
|
|
|
], [test "$cross_compiling" = yes], [dnl
|
|
|
|
AC_MSG_ERROR([--enable-dtrace, however, cross compiling])
|
|
|
|
], [test "${rb_cv_dtrace_available}" = "no"], [dnl
|
|
|
|
AC_MSG_ERROR([--enable-dtrace, however, USDT is not available])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
AS_CASE([$rb_cv_dtrace_available],
|
|
|
|
[yes*], [dnl
|
|
|
|
RUBY_DTRACE_POSTPROCESS()
|
|
|
|
AS_IF([test "$rb_cv_prog_dtrace_g" != no], [dnl
|
|
|
|
DTRACE_OBJ='probes.$(OBJEXT)'
|
|
|
|
])
|
|
|
|
AS_IF([test "$rb_cv_prog_dtrace_g" = rebuild], [dnl
|
|
|
|
DTRACE_REBUILD=yes
|
|
|
|
LIBRUBY_A_OBJS='$(DTRACE_GLOMMED_OBJ)'
|
|
|
|
])
|
|
|
|
AS_CASE("${target_os}", [freebsd*], [dnl
|
|
|
|
# FreeBSD's dtrace requires libelf
|
|
|
|
LIBS="-lelf $LIBS"
|
|
|
|
])
|
* configure.in, Makefile.in, common.mk: support DTrace on Solaris 10,
based on r26235 by Yugui. On Solaris 10, low optimization level
may also be needed, e.g. optflags="-xO1" or "-xO0" with Oracle
SolarisStudio 12.3 cc.
* configure.in (--enable-dtrace): new option to enable/disable
DTrace support. By default, trying to enable if dtrace command
is found on the system. It is disabled when cross compiling.
* configure.in (RUBY_DTRACE_POSTPROCESS): new macro. checks whether
the dtrace on the system needs postprocessing with "dtrace -G".
The postprocessing is needed on Solaris 10 and other platforms.
* configure.in (RUBY_DTRACE_BSD_BROKEN): new macro. checks whether
the dtrace supports USDT.
* configure.in (DTRACE): move after RUBY_DTRACE_POSTPROCESS.
* configure.in (LD): On Solaris, /usr/ccs/bin/ld is preferred.
* configure.in, Makefile.in, common.mk (DTRACE_OBJ): new macro for
DTrace probe object generated by postprocessing with "dtrace -G".
* Makefile.in, common.mk (probes.$(OBJEXT)): DTrace probe object
generated by the postprocessing. New file probes.stamp is for
rebuilding related objects that may be modified by "dtrace -G".
* configure.in, Makefile.in, common.mk (DTRACE_GLOMMED_OBJ): new
macro for DTrace static library hacks.
* configure.in, Makefile.in (LIBRUBY_A_OBJS): ditto.
* Makefile.in, common.mk (ruby-glommed.$(OBJEXT)): new target with
rule for DTrace static library hacks.
* common.mk (DTRACE_DEPENDENT_OBJS): objects depended on probes.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-18 12:24:24 +04:00
|
|
|
DTRACE_EXT=d
|
2016-12-17 10:48:57 +03:00
|
|
|
], [dnl
|
|
|
|
enable_dtrace=no
|
* configure.in, Makefile.in, common.mk: support DTrace on Solaris 10,
based on r26235 by Yugui. On Solaris 10, low optimization level
may also be needed, e.g. optflags="-xO1" or "-xO0" with Oracle
SolarisStudio 12.3 cc.
* configure.in (--enable-dtrace): new option to enable/disable
DTrace support. By default, trying to enable if dtrace command
is found on the system. It is disabled when cross compiling.
* configure.in (RUBY_DTRACE_POSTPROCESS): new macro. checks whether
the dtrace on the system needs postprocessing with "dtrace -G".
The postprocessing is needed on Solaris 10 and other platforms.
* configure.in (RUBY_DTRACE_BSD_BROKEN): new macro. checks whether
the dtrace supports USDT.
* configure.in (DTRACE): move after RUBY_DTRACE_POSTPROCESS.
* configure.in (LD): On Solaris, /usr/ccs/bin/ld is preferred.
* configure.in, Makefile.in, common.mk (DTRACE_OBJ): new macro for
DTrace probe object generated by postprocessing with "dtrace -G".
* Makefile.in, common.mk (probes.$(OBJEXT)): DTrace probe object
generated by the postprocessing. New file probes.stamp is for
rebuilding related objects that may be modified by "dtrace -G".
* configure.in, Makefile.in, common.mk (DTRACE_GLOMMED_OBJ): new
macro for DTrace static library hacks.
* configure.in, Makefile.in (LIBRUBY_A_OBJS): ditto.
* Makefile.in, common.mk (ruby-glommed.$(OBJEXT)): new target with
rule for DTrace static library hacks.
* common.mk (DTRACE_DEPENDENT_OBJS): objects depended on probes.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-18 12:24:24 +04:00
|
|
|
DTRACE_EXT=dmyh
|
2016-12-17 10:48:57 +03:00
|
|
|
])
|
* configure.in, Makefile.in, common.mk: support DTrace on Solaris 10,
based on r26235 by Yugui. On Solaris 10, low optimization level
may also be needed, e.g. optflags="-xO1" or "-xO0" with Oracle
SolarisStudio 12.3 cc.
* configure.in (--enable-dtrace): new option to enable/disable
DTrace support. By default, trying to enable if dtrace command
is found on the system. It is disabled when cross compiling.
* configure.in (RUBY_DTRACE_POSTPROCESS): new macro. checks whether
the dtrace on the system needs postprocessing with "dtrace -G".
The postprocessing is needed on Solaris 10 and other platforms.
* configure.in (RUBY_DTRACE_BSD_BROKEN): new macro. checks whether
the dtrace supports USDT.
* configure.in (DTRACE): move after RUBY_DTRACE_POSTPROCESS.
* configure.in (LD): On Solaris, /usr/ccs/bin/ld is preferred.
* configure.in, Makefile.in, common.mk (DTRACE_OBJ): new macro for
DTrace probe object generated by postprocessing with "dtrace -G".
* Makefile.in, common.mk (probes.$(OBJEXT)): DTrace probe object
generated by the postprocessing. New file probes.stamp is for
rebuilding related objects that may be modified by "dtrace -G".
* configure.in, Makefile.in, common.mk (DTRACE_GLOMMED_OBJ): new
macro for DTrace static library hacks.
* configure.in, Makefile.in (LIBRUBY_A_OBJS): ditto.
* Makefile.in, common.mk (ruby-glommed.$(OBJEXT)): new target with
rule for DTrace static library hacks.
* common.mk (DTRACE_DEPENDENT_OBJS): objects depended on probes.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-18 12:24:24 +04:00
|
|
|
AC_SUBST(DTRACE_EXT)
|
|
|
|
AC_SUBST(DTRACE_OBJ)
|
2015-02-04 05:12:45 +03:00
|
|
|
AC_SUBST(DTRACE_REBUILD)
|
2016-12-17 10:48:58 +03:00
|
|
|
AC_SUBST(DTRACE_OPT)
|
* configure.in, Makefile.in, common.mk: support DTrace on Solaris 10,
based on r26235 by Yugui. On Solaris 10, low optimization level
may also be needed, e.g. optflags="-xO1" or "-xO0" with Oracle
SolarisStudio 12.3 cc.
* configure.in (--enable-dtrace): new option to enable/disable
DTrace support. By default, trying to enable if dtrace command
is found on the system. It is disabled when cross compiling.
* configure.in (RUBY_DTRACE_POSTPROCESS): new macro. checks whether
the dtrace on the system needs postprocessing with "dtrace -G".
The postprocessing is needed on Solaris 10 and other platforms.
* configure.in (RUBY_DTRACE_BSD_BROKEN): new macro. checks whether
the dtrace supports USDT.
* configure.in (DTRACE): move after RUBY_DTRACE_POSTPROCESS.
* configure.in (LD): On Solaris, /usr/ccs/bin/ld is preferred.
* configure.in, Makefile.in, common.mk (DTRACE_OBJ): new macro for
DTrace probe object generated by postprocessing with "dtrace -G".
* Makefile.in, common.mk (probes.$(OBJEXT)): DTrace probe object
generated by the postprocessing. New file probes.stamp is for
rebuilding related objects that may be modified by "dtrace -G".
* configure.in, Makefile.in, common.mk (DTRACE_GLOMMED_OBJ): new
macro for DTrace static library hacks.
* configure.in, Makefile.in (LIBRUBY_A_OBJS): ditto.
* Makefile.in, common.mk (ruby-glommed.$(OBJEXT)): new target with
rule for DTrace static library hacks.
* common.mk (DTRACE_DEPENDENT_OBJS): objects depended on probes.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-18 12:24:24 +04:00
|
|
|
AC_SUBST(LIBRUBY_A_OBJS)
|
|
|
|
|
2017-05-20 16:00:41 +03:00
|
|
|
AC_ARG_ENABLE(gcov,
|
|
|
|
AS_HELP_STRING([--enable-gcov], [enable coverage measurement by gcov]),
|
|
|
|
[gcov=yes])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test x"$gcov" = xyes], [
|
2017-05-20 16:00:41 +03:00
|
|
|
CFLAGS="$CFLAGS -coverage"
|
|
|
|
LDFLAGS="$LDFLAGS -coverage"
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2017-05-20 16:00:41 +03:00
|
|
|
|
2014-05-09 09:27:07 +04:00
|
|
|
RUBY_SETJMP_TYPE
|
2012-08-21 20:18:10 +04:00
|
|
|
}
|
2009-02-09 22:34:43 +03:00
|
|
|
|
2018-03-24 17:28:45 +03:00
|
|
|
: "build section" && {
|
2004-01-08 17:58:57 +03:00
|
|
|
dnl build rdoc index if requested
|
|
|
|
RDOCTARGET=""
|
2010-09-19 17:10:27 +04:00
|
|
|
CAPITARGET=""
|
2004-01-08 17:58:57 +03:00
|
|
|
AC_ARG_ENABLE(install-doc,
|
2015-12-02 09:12:49 +03:00
|
|
|
AS_HELP_STRING([--disable-install-doc], [do not install either rdoc indexes or C API documents during install]),
|
2004-01-10 20:39:07 +03:00
|
|
|
[install_doc=$enableval], [install_doc=yes])
|
2019-05-25 11:20:31 +03:00
|
|
|
AC_ARG_WITH(rdoc,
|
|
|
|
AS_HELP_STRING([--with-rdoc=ri,html], [comma/space separated list of RDoc formats to install]),
|
|
|
|
[install_rdoc=`echo ,$withval, | sed 'y/,/ /;s/ ri / rdoc /;s/^ *//;s/ *$//'`], [
|
2010-09-19 17:10:27 +04:00
|
|
|
AC_ARG_ENABLE(install-rdoc,
|
|
|
|
AS_HELP_STRING([--disable-install-rdoc], [do not install rdoc indexes during install]),
|
|
|
|
[install_rdoc=$enableval], [install_rdoc=yes])
|
2019-05-25 11:20:31 +03:00
|
|
|
])
|
2010-09-19 17:10:27 +04:00
|
|
|
AC_ARG_ENABLE(install-capi,
|
|
|
|
AS_HELP_STRING([--disable-install-capi], [do not install C API documents during install]),
|
2014-05-17 11:48:25 +04:00
|
|
|
[install_capi=$enableval], [install_capi=no])
|
2010-09-19 17:10:27 +04:00
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$install_doc" != no], [
|
2019-05-25 11:20:31 +03:00
|
|
|
AS_CASE(["$install_rdoc"],
|
|
|
|
[yes], [
|
2010-09-19 17:10:27 +04:00
|
|
|
RDOCTARGET="rdoc"
|
2019-05-25 11:20:31 +03:00
|
|
|
],
|
|
|
|
[all], [
|
|
|
|
RDOCTARGET="rdoc html"
|
|
|
|
],
|
|
|
|
[no|''], [
|
2010-09-19 17:10:27 +04:00
|
|
|
RDOCTARGET="nodoc"
|
2019-05-25 11:20:31 +03:00
|
|
|
],
|
|
|
|
[
|
|
|
|
RDOCTARGET="$install_rdoc"
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
AS_IF([test "$install_capi" != no -a -n "$DOXYGEN"], [
|
2010-09-19 17:10:27 +04:00
|
|
|
CAPITARGET="capi"
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2010-09-19 17:10:27 +04:00
|
|
|
CAPITARGET="nodoc"
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
], [
|
2009-09-14 06:23:47 +04:00
|
|
|
RDOCTARGET="nodoc"
|
2010-04-08 09:35:37 +04:00
|
|
|
CAPITARGET="nodoc"
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2010-09-19 17:10:27 +04:00
|
|
|
|
2004-01-08 17:58:57 +03:00
|
|
|
AC_SUBST(RDOCTARGET)
|
2010-09-19 17:10:27 +04:00
|
|
|
AC_SUBST(CAPITARGET)
|
2004-01-08 17:58:57 +03:00
|
|
|
|
2010-01-21 09:10:16 +03:00
|
|
|
AS_CASE(["$RDOCTARGET:$CAPITARGET"],[nodoc:nodoc],[INSTALLDOC=nodoc],[INSTALLDOC=all])
|
2009-09-16 11:20:19 +04:00
|
|
|
AC_SUBST(INSTALLDOC)
|
|
|
|
|
2018-11-19 17:00:49 +03:00
|
|
|
AC_ARG_ENABLE(jit-support,
|
2022-06-13 19:28:28 +03:00
|
|
|
AS_HELP_STRING([--disable-jit-support], [disable JIT features]),
|
|
|
|
[MJIT_SUPPORT=$enableval],
|
|
|
|
[AS_CASE(["$target_os"],
|
2022-09-05 11:17:12 +03:00
|
|
|
[wasi | mingw* | solaris*], [MJIT_SUPPORT=no],
|
2022-06-13 19:28:28 +03:00
|
|
|
[MJIT_SUPPORT=yes]
|
|
|
|
)])
|
2021-12-14 13:12:02 +03:00
|
|
|
|
|
|
|
AS_IF([test x"$MJIT_SUPPORT" = "xyes"],
|
|
|
|
[AC_DEFINE(USE_MJIT, 1)],
|
|
|
|
[AC_DEFINE(USE_MJIT, 0)])
|
2018-10-20 09:53:00 +03:00
|
|
|
|
2018-10-20 11:00:42 +03:00
|
|
|
AC_SUBST(MJIT_SUPPORT)
|
2018-10-19 15:31:02 +03:00
|
|
|
|
2022-11-05 16:19:21 +03:00
|
|
|
AC_CHECK_PROG(RUSTC, [rustc], [rustc], [no]) dnl no ac_tool_prefix
|
2022-11-05 00:02:04 +03:00
|
|
|
|
2022-11-08 19:57:11 +03:00
|
|
|
dnl check if rustc is recent enough to build YJIT (rustc >= 1.58.0)
|
|
|
|
YJIT_RUSTC_OK=no
|
|
|
|
AS_IF([test "$RUSTC" != "no"],
|
2022-11-08 23:29:30 +03:00
|
|
|
AC_MSG_CHECKING([whether ${RUSTC} is new enough for YJIT])
|
|
|
|
AS_IF([echo "fn main() { let x = 1; format!(\"{x}\"); }" | $RUSTC - --emit asm=/dev/null 2>/dev/null],
|
2022-11-08 19:57:11 +03:00
|
|
|
[YJIT_RUSTC_OK=yes]
|
|
|
|
)
|
2022-11-08 23:29:30 +03:00
|
|
|
AC_MSG_RESULT($YJIT_RUSTC_OK)
|
2022-11-06 13:32:50 +03:00
|
|
|
)
|
2022-11-08 19:57:11 +03:00
|
|
|
|
|
|
|
dnl check if we can build YJIT on this target platform
|
|
|
|
dnl we can't easily cross-compile with rustc so we don't support that
|
|
|
|
YJIT_TARGET_OK=no
|
|
|
|
AS_IF([test "$cross_compiling" = no],
|
|
|
|
AS_CASE(["$target_cpu-$target_os"],
|
|
|
|
[*android*], [
|
|
|
|
YJIT_TARGET_OK=no
|
|
|
|
],
|
|
|
|
[arm64-darwin*|aarch64-darwin*|x86_64-darwin*], [
|
|
|
|
YJIT_TARGET_OK=yes
|
|
|
|
],
|
|
|
|
[arm64-*linux*|aarch64-*linux*|x86_64-*linux*], [
|
|
|
|
YJIT_TARGET_OK=yes
|
|
|
|
],
|
|
|
|
[arm64-*bsd*|aarch64-*bsd*|x86_64-*bsd*], [
|
|
|
|
YJIT_TARGET_OK=yes
|
|
|
|
]
|
|
|
|
)
|
2022-11-05 00:02:04 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
dnl build YJIT in release mode if rustc >= 1.58.0 is present and we are on a supported platform
|
Rust YJIT
In December 2021, we opened an [issue] to solicit feedback regarding the
porting of the YJIT codebase from C99 to Rust. There were some
reservations, but this project was given the go ahead by Ruby core
developers and Matz. Since then, we have successfully completed the port
of YJIT to Rust.
The new Rust version of YJIT has reached parity with the C version, in
that it passes all the CRuby tests, is able to run all of the YJIT
benchmarks, and performs similarly to the C version (because it works
the same way and largely generates the same machine code). We've even
incorporated some design improvements, such as a more fine-grained
constant invalidation mechanism which we expect will make a big
difference in Ruby on Rails applications.
Because we want to be careful, YJIT is guarded behind a configure
option:
```shell
./configure --enable-yjit # Build YJIT in release mode
./configure --enable-yjit=dev # Build YJIT in dev/debug mode
```
By default, YJIT does not get compiled and cargo/rustc is not required.
If YJIT is built in dev mode, then `cargo` is used to fetch development
dependencies, but when building in release, `cargo` is not required,
only `rustc`. At the moment YJIT requires Rust 1.60.0 or newer.
The YJIT command-line options remain mostly unchanged, and more details
about the build process are documented in `doc/yjit/yjit.md`.
The CI tests have been updated and do not take any more resources than
before.
The development history of the Rust port is available at the following
commit for interested parties:
https://github.com/Shopify/ruby/commit/1fd9573d8b4b65219f1c2407f30a0a60e537f8be
Our hope is that Rust YJIT will be compiled and included as a part of
system packages and compiled binaries of the Ruby 3.2 release. We do not
anticipate any major problems as Rust is well supported on every
platform which YJIT supports, but to make sure that this process works
smoothly, we would like to reach out to those who take care of building
systems packages before the 3.2 release is shipped and resolve any
issues that may come up.
[issue]: https://bugs.ruby-lang.org/issues/18481
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Co-authored-by: Noah Gibbs <the.codefolio.guy@gmail.com>
Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2022-04-19 21:40:21 +03:00
|
|
|
AC_ARG_ENABLE(yjit,
|
2022-11-05 00:02:04 +03:00
|
|
|
AS_HELP_STRING([--enable-yjit],
|
|
|
|
[enable experimental in-process JIT compiler that requires Rust build tools [default=no]]),
|
|
|
|
[YJIT_SUPPORT=$enableval],
|
2022-11-08 19:57:11 +03:00
|
|
|
[AS_CASE(["$enable_jit_support:$YJIT_TARGET_OK:$YJIT_RUSTC_OK"],
|
|
|
|
[yes:yes:yes|:yes:yes], [
|
|
|
|
YJIT_SUPPORT=yes
|
2022-11-06 09:59:32 +03:00
|
|
|
],
|
2022-11-08 19:57:11 +03:00
|
|
|
[YJIT_SUPPORT=no]
|
2022-11-06 09:59:32 +03:00
|
|
|
)]
|
2022-11-05 00:02:04 +03:00
|
|
|
)
|
Rust YJIT
In December 2021, we opened an [issue] to solicit feedback regarding the
porting of the YJIT codebase from C99 to Rust. There were some
reservations, but this project was given the go ahead by Ruby core
developers and Matz. Since then, we have successfully completed the port
of YJIT to Rust.
The new Rust version of YJIT has reached parity with the C version, in
that it passes all the CRuby tests, is able to run all of the YJIT
benchmarks, and performs similarly to the C version (because it works
the same way and largely generates the same machine code). We've even
incorporated some design improvements, such as a more fine-grained
constant invalidation mechanism which we expect will make a big
difference in Ruby on Rails applications.
Because we want to be careful, YJIT is guarded behind a configure
option:
```shell
./configure --enable-yjit # Build YJIT in release mode
./configure --enable-yjit=dev # Build YJIT in dev/debug mode
```
By default, YJIT does not get compiled and cargo/rustc is not required.
If YJIT is built in dev mode, then `cargo` is used to fetch development
dependencies, but when building in release, `cargo` is not required,
only `rustc`. At the moment YJIT requires Rust 1.60.0 or newer.
The YJIT command-line options remain mostly unchanged, and more details
about the build process are documented in `doc/yjit/yjit.md`.
The CI tests have been updated and do not take any more resources than
before.
The development history of the Rust port is available at the following
commit for interested parties:
https://github.com/Shopify/ruby/commit/1fd9573d8b4b65219f1c2407f30a0a60e537f8be
Our hope is that Rust YJIT will be compiled and included as a part of
system packages and compiled binaries of the Ruby 3.2 release. We do not
anticipate any major problems as Rust is well supported on every
platform which YJIT supports, but to make sure that this process works
smoothly, we would like to reach out to those who take care of building
systems packages before the 3.2 release is shipped and resolve any
issues that may come up.
[issue]: https://bugs.ruby-lang.org/issues/18481
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Co-authored-by: Noah Gibbs <the.codefolio.guy@gmail.com>
Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2022-04-19 21:40:21 +03:00
|
|
|
|
|
|
|
CARGO=
|
|
|
|
CARGO_BUILD_ARGS=
|
|
|
|
YJIT_LIBS=
|
|
|
|
AS_CASE(["${YJIT_SUPPORT}"],
|
2022-07-30 01:07:06 +03:00
|
|
|
[yes|dev|stats|dev_nodebug], [
|
Rust YJIT
In December 2021, we opened an [issue] to solicit feedback regarding the
porting of the YJIT codebase from C99 to Rust. There were some
reservations, but this project was given the go ahead by Ruby core
developers and Matz. Since then, we have successfully completed the port
of YJIT to Rust.
The new Rust version of YJIT has reached parity with the C version, in
that it passes all the CRuby tests, is able to run all of the YJIT
benchmarks, and performs similarly to the C version (because it works
the same way and largely generates the same machine code). We've even
incorporated some design improvements, such as a more fine-grained
constant invalidation mechanism which we expect will make a big
difference in Ruby on Rails applications.
Because we want to be careful, YJIT is guarded behind a configure
option:
```shell
./configure --enable-yjit # Build YJIT in release mode
./configure --enable-yjit=dev # Build YJIT in dev/debug mode
```
By default, YJIT does not get compiled and cargo/rustc is not required.
If YJIT is built in dev mode, then `cargo` is used to fetch development
dependencies, but when building in release, `cargo` is not required,
only `rustc`. At the moment YJIT requires Rust 1.60.0 or newer.
The YJIT command-line options remain mostly unchanged, and more details
about the build process are documented in `doc/yjit/yjit.md`.
The CI tests have been updated and do not take any more resources than
before.
The development history of the Rust port is available at the following
commit for interested parties:
https://github.com/Shopify/ruby/commit/1fd9573d8b4b65219f1c2407f30a0a60e537f8be
Our hope is that Rust YJIT will be compiled and included as a part of
system packages and compiled binaries of the Ruby 3.2 release. We do not
anticipate any major problems as Rust is well supported on every
platform which YJIT supports, but to make sure that this process works
smoothly, we would like to reach out to those who take care of building
systems packages before the 3.2 release is shipped and resolve any
issues that may come up.
[issue]: https://bugs.ruby-lang.org/issues/18481
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Co-authored-by: Noah Gibbs <the.codefolio.guy@gmail.com>
Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2022-04-19 21:40:21 +03:00
|
|
|
AS_IF([test x"$enable_jit_support" = "xno"],
|
|
|
|
AC_MSG_ERROR([--disable-jit-support but --enable-yjit. YJIT requires JIT support])
|
|
|
|
)
|
|
|
|
AS_IF([test x"$RUSTC" = "xno"],
|
|
|
|
AC_MSG_ERROR([rustc is required. Installation instructions available at https://www.rust-lang.org/tools/install])
|
|
|
|
)
|
2022-07-07 08:14:25 +03:00
|
|
|
|
|
|
|
AS_CASE(["${YJIT_SUPPORT}"],
|
|
|
|
[yes], [
|
|
|
|
rb_rust_target_subdir=release
|
|
|
|
],
|
|
|
|
[dev], [
|
|
|
|
rb_rust_target_subdir=debug
|
2022-10-19 21:03:07 +03:00
|
|
|
CARGO_BUILD_ARGS='--features stats,disasm'
|
2022-07-07 08:14:25 +03:00
|
|
|
AC_DEFINE(RUBY_DEBUG, 1)
|
|
|
|
],
|
2022-07-30 01:07:06 +03:00
|
|
|
[dev_nodebug], [
|
|
|
|
rb_rust_target_subdir=dev_nodebug
|
2022-10-19 21:03:07 +03:00
|
|
|
CARGO_BUILD_ARGS='--profile dev_nodebug --features stats,disasm'
|
2022-07-30 01:07:06 +03:00
|
|
|
],
|
2022-07-07 08:14:25 +03:00
|
|
|
[stats], [
|
|
|
|
rb_rust_target_subdir=stats
|
2022-09-28 02:27:19 +03:00
|
|
|
CARGO_BUILD_ARGS='--profile stats --features stats'
|
2022-11-11 00:16:25 +03:00
|
|
|
AC_DEFINE(YJIT_STATS, 1)
|
2022-07-07 08:14:25 +03:00
|
|
|
])
|
|
|
|
|
|
|
|
AS_IF([test -n "${CARGO_BUILD_ARGS}"], [
|
2022-09-28 02:27:19 +03:00
|
|
|
AC_CHECK_TOOL(CARGO, [cargo], [no])
|
|
|
|
AS_IF([test x"$CARGO" = "xno"],
|
|
|
|
AC_MSG_ERROR([cargo is required. Installation instructions available at https://www.rust-lang.org/tools/install])
|
|
|
|
]))
|
2022-07-07 08:14:25 +03:00
|
|
|
|
Rust YJIT
In December 2021, we opened an [issue] to solicit feedback regarding the
porting of the YJIT codebase from C99 to Rust. There were some
reservations, but this project was given the go ahead by Ruby core
developers and Matz. Since then, we have successfully completed the port
of YJIT to Rust.
The new Rust version of YJIT has reached parity with the C version, in
that it passes all the CRuby tests, is able to run all of the YJIT
benchmarks, and performs similarly to the C version (because it works
the same way and largely generates the same machine code). We've even
incorporated some design improvements, such as a more fine-grained
constant invalidation mechanism which we expect will make a big
difference in Ruby on Rails applications.
Because we want to be careful, YJIT is guarded behind a configure
option:
```shell
./configure --enable-yjit # Build YJIT in release mode
./configure --enable-yjit=dev # Build YJIT in dev/debug mode
```
By default, YJIT does not get compiled and cargo/rustc is not required.
If YJIT is built in dev mode, then `cargo` is used to fetch development
dependencies, but when building in release, `cargo` is not required,
only `rustc`. At the moment YJIT requires Rust 1.60.0 or newer.
The YJIT command-line options remain mostly unchanged, and more details
about the build process are documented in `doc/yjit/yjit.md`.
The CI tests have been updated and do not take any more resources than
before.
The development history of the Rust port is available at the following
commit for interested parties:
https://github.com/Shopify/ruby/commit/1fd9573d8b4b65219f1c2407f30a0a60e537f8be
Our hope is that Rust YJIT will be compiled and included as a part of
system packages and compiled binaries of the Ruby 3.2 release. We do not
anticipate any major problems as Rust is well supported on every
platform which YJIT supports, but to make sure that this process works
smoothly, we would like to reach out to those who take care of building
systems packages before the 3.2 release is shipped and resolve any
issues that may come up.
[issue]: https://bugs.ruby-lang.org/issues/18481
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Co-authored-by: Noah Gibbs <the.codefolio.guy@gmail.com>
Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2022-04-19 21:40:21 +03:00
|
|
|
YJIT_LIBS="yjit/target/${rb_rust_target_subdir}/libyjit.a"
|
2022-09-22 19:35:51 +03:00
|
|
|
AS_CASE(["$target_os"],[openbsd*],[
|
|
|
|
# Link libc++abi (which requires libpthread) for _Unwind_* functions needed by yjit
|
|
|
|
LDFLAGS="$LDFLAGS -lpthread -lc++abi"
|
|
|
|
])
|
Rust YJIT
In December 2021, we opened an [issue] to solicit feedback regarding the
porting of the YJIT codebase from C99 to Rust. There were some
reservations, but this project was given the go ahead by Ruby core
developers and Matz. Since then, we have successfully completed the port
of YJIT to Rust.
The new Rust version of YJIT has reached parity with the C version, in
that it passes all the CRuby tests, is able to run all of the YJIT
benchmarks, and performs similarly to the C version (because it works
the same way and largely generates the same machine code). We've even
incorporated some design improvements, such as a more fine-grained
constant invalidation mechanism which we expect will make a big
difference in Ruby on Rails applications.
Because we want to be careful, YJIT is guarded behind a configure
option:
```shell
./configure --enable-yjit # Build YJIT in release mode
./configure --enable-yjit=dev # Build YJIT in dev/debug mode
```
By default, YJIT does not get compiled and cargo/rustc is not required.
If YJIT is built in dev mode, then `cargo` is used to fetch development
dependencies, but when building in release, `cargo` is not required,
only `rustc`. At the moment YJIT requires Rust 1.60.0 or newer.
The YJIT command-line options remain mostly unchanged, and more details
about the build process are documented in `doc/yjit/yjit.md`.
The CI tests have been updated and do not take any more resources than
before.
The development history of the Rust port is available at the following
commit for interested parties:
https://github.com/Shopify/ruby/commit/1fd9573d8b4b65219f1c2407f30a0a60e537f8be
Our hope is that Rust YJIT will be compiled and included as a part of
system packages and compiled binaries of the Ruby 3.2 release. We do not
anticipate any major problems as Rust is well supported on every
platform which YJIT supports, but to make sure that this process works
smoothly, we would like to reach out to those who take care of building
systems packages before the 3.2 release is shipped and resolve any
issues that may come up.
[issue]: https://bugs.ruby-lang.org/issues/18481
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Co-authored-by: Noah Gibbs <the.codefolio.guy@gmail.com>
Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2022-04-19 21:40:21 +03:00
|
|
|
YJIT_OBJ='yjit.$(OBJEXT)'
|
2022-11-16 21:08:52 +03:00
|
|
|
AS_IF([test x"$YJIT_SUPPORT" != "xyes" ], [
|
|
|
|
AC_DEFINE_UNQUOTED(YJIT_SUPPORT, [$YJIT_SUPPORT])
|
|
|
|
])
|
Rust YJIT
In December 2021, we opened an [issue] to solicit feedback regarding the
porting of the YJIT codebase from C99 to Rust. There were some
reservations, but this project was given the go ahead by Ruby core
developers and Matz. Since then, we have successfully completed the port
of YJIT to Rust.
The new Rust version of YJIT has reached parity with the C version, in
that it passes all the CRuby tests, is able to run all of the YJIT
benchmarks, and performs similarly to the C version (because it works
the same way and largely generates the same machine code). We've even
incorporated some design improvements, such as a more fine-grained
constant invalidation mechanism which we expect will make a big
difference in Ruby on Rails applications.
Because we want to be careful, YJIT is guarded behind a configure
option:
```shell
./configure --enable-yjit # Build YJIT in release mode
./configure --enable-yjit=dev # Build YJIT in dev/debug mode
```
By default, YJIT does not get compiled and cargo/rustc is not required.
If YJIT is built in dev mode, then `cargo` is used to fetch development
dependencies, but when building in release, `cargo` is not required,
only `rustc`. At the moment YJIT requires Rust 1.60.0 or newer.
The YJIT command-line options remain mostly unchanged, and more details
about the build process are documented in `doc/yjit/yjit.md`.
The CI tests have been updated and do not take any more resources than
before.
The development history of the Rust port is available at the following
commit for interested parties:
https://github.com/Shopify/ruby/commit/1fd9573d8b4b65219f1c2407f30a0a60e537f8be
Our hope is that Rust YJIT will be compiled and included as a part of
system packages and compiled binaries of the Ruby 3.2 release. We do not
anticipate any major problems as Rust is well supported on every
platform which YJIT supports, but to make sure that this process works
smoothly, we would like to reach out to those who take care of building
systems packages before the 3.2 release is shipped and resolve any
issues that may come up.
[issue]: https://bugs.ruby-lang.org/issues/18481
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Co-authored-by: Noah Gibbs <the.codefolio.guy@gmail.com>
Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2022-04-19 21:40:21 +03:00
|
|
|
AC_DEFINE(USE_YJIT, 1)
|
|
|
|
], [AC_DEFINE(USE_YJIT, 0)])
|
|
|
|
|
|
|
|
dnl These variables end up in ::RbConfig::CONFIG
|
|
|
|
AC_SUBST(YJIT_SUPPORT)dnl what flavor of YJIT the Ruby build includes
|
|
|
|
AC_SUBST(RUSTC)dnl Rust compiler command
|
|
|
|
AC_SUBST(CARGO)dnl Cargo command for Rust builds
|
|
|
|
AC_SUBST(CARGO_BUILD_ARGS)dnl for selecting Rust build profiles
|
|
|
|
AC_SUBST(YJIT_LIBS)dnl for optionally building the Rust parts of YJIT
|
|
|
|
AC_SUBST(YJIT_OBJ)dnl for optionally building the C parts of YJIT
|
|
|
|
|
2016-10-17 10:17:07 +03:00
|
|
|
AC_ARG_ENABLE(install-static-library,
|
|
|
|
AS_HELP_STRING([--disable-install-static-library], [do not install static ruby library]),
|
2021-08-13 18:16:24 +03:00
|
|
|
[INSTALL_STATIC_LIBRARY=$enableval
|
|
|
|
AS_IF([test x"$enable_shared" = xno -a x"$INSTALL_STATIC_LIBRARY" = xno],
|
|
|
|
[AC_MSG_ERROR([must install either static or shared library])],
|
|
|
|
[])],
|
2016-10-17 10:17:07 +03:00
|
|
|
AS_IF([test x"$enable_shared" = xyes],
|
|
|
|
[INSTALL_STATIC_LIBRARY=no],
|
|
|
|
[INSTALL_STATIC_LIBRARY=yes]))
|
|
|
|
AC_SUBST(INSTALL_STATIC_LIBRARY)
|
|
|
|
|
2010-11-11 14:45:32 +03:00
|
|
|
AC_CACHE_CHECK([for prefix of external symbols], rb_cv_symbol_prefix, [
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[extern void conftest_external(void) {}]], [[]])],[
|
2010-11-11 14:45:32 +03:00
|
|
|
rb_cv_symbol_prefix=`$NM conftest.$ac_objext |
|
2011-05-12 13:31:34 +04:00
|
|
|
sed -n ['/.*T[ ]\([^ ]*\)conftest_external.*/!d;s//\1/p;q']`
|
2010-11-06 01:33:18 +03:00
|
|
|
],
|
2010-11-11 14:45:32 +03:00
|
|
|
[rb_cv_symbol_prefix=''])
|
|
|
|
test -n "$rb_cv_symbol_prefix" || rb_cv_symbol_prefix=NONE
|
2010-11-06 01:33:18 +03:00
|
|
|
])
|
2010-11-11 14:45:32 +03:00
|
|
|
SYMBOL_PREFIX="$rb_cv_symbol_prefix"
|
|
|
|
test "x$SYMBOL_PREFIX" = xNONE && SYMBOL_PREFIX=''
|
2012-11-23 19:00:12 +04:00
|
|
|
DLNOBJ=dln.o
|
|
|
|
AC_ARG_ENABLE(dln,
|
2020-12-12 16:55:09 +03:00
|
|
|
AS_HELP_STRING([--disable-dln], [disable dynamic link feature]),
|
2012-11-23 19:00:12 +04:00
|
|
|
[test "$enableval" = yes || DLNOBJ=dmydln.o])
|
|
|
|
AC_SUBST(DLNOBJ)
|
2009-11-06 06:07:52 +03:00
|
|
|
MINIDLNOBJ=dmydln.o
|
2012-05-17 06:48:59 +04:00
|
|
|
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[linux*], [
|
|
|
|
],
|
|
|
|
[netbsd*], [
|
2009-02-08 07:09:34 +03:00
|
|
|
RUBY_APPEND_OPTION(CFLAGS, -pipe)
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[darwin*], [
|
2009-02-08 07:09:34 +03:00
|
|
|
RUBY_APPEND_OPTION(CFLAGS, -pipe)
|
2022-06-26 18:20:21 +03:00
|
|
|
AC_MSG_CHECKING([whether Security framework is needed])
|
2018-08-31 12:56:24 +03:00
|
|
|
AC_COMPILE_IFELSE([
|
2022-06-26 18:20:21 +03:00
|
|
|
AC_LANG_BOOL_COMPILE_TRY([
|
|
|
|
@%:@include <AvailabilityMacros.h>
|
|
|
|
enum {
|
|
|
|
least = MAC_OS_X_VERSION_10_7, /* just fail if undefined */
|
|
|
|
required = MAC_OS_X_VERSION_MIN_REQUIRED,
|
|
|
|
upper /* bigger than MIN_REQUIRED, or */
|
|
|
|
@%:@ifdef MAC_OS_X_VERSION_10_10
|
|
|
|
= MAC_OS_X_VERSION_10_10
|
|
|
|
@%:@endif
|
|
|
|
};],
|
|
|
|
[required >= least && required < upper])],
|
2018-08-31 12:56:24 +03:00
|
|
|
[dnl
|
2022-06-26 18:20:21 +03:00
|
|
|
AC_MSG_RESULT(yes)
|
2018-08-31 12:56:24 +03:00
|
|
|
RUBY_APPEND_OPTION(XLDFLAGS, [-framework Security])
|
|
|
|
RUBY_APPEND_OPTION(LIBRUBYARG_STATIC, [-framework Security])
|
2022-06-26 18:20:21 +03:00
|
|
|
],dnl
|
|
|
|
[dnl
|
|
|
|
AC_MSG_RESULT(no)
|
2018-08-31 12:56:24 +03:00
|
|
|
]dnl
|
|
|
|
)
|
2021-03-19 09:27:42 +03:00
|
|
|
RUBY_APPEND_OPTION(XLDFLAGS, [-framework CoreFoundation])
|
|
|
|
RUBY_APPEND_OPTION(LIBRUBYARG_STATIC, [-framework CoreFoundation])
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[osf*], [
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$GCC" != "yes" ], [
|
2000-03-15 08:01:17 +03:00
|
|
|
# compile something small: taint.c is fine for this.
|
|
|
|
# the main point is the '-v' flag of 'cc'.
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["`cc -v -I. -c main.c -o /tmp/main.o 2>&1`"],
|
|
|
|
[*/gemc_cc*], [ # we have the new DEC GEM CC
|
2000-03-15 12:09:28 +03:00
|
|
|
CFLAGS="$CFLAGS -oldc"
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[ # we have the old MIPS CC
|
|
|
|
])
|
2000-03-15 08:01:17 +03:00
|
|
|
# cleanup
|
|
|
|
rm -f /tmp/main.o
|
|
|
|
CFLAGS="$CFLAGS -std"
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
2021-01-31 08:27:15 +03:00
|
|
|
[cygwin*|msys*|mingw*], [
|
2018-08-13 10:55:43 +03:00
|
|
|
LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)'
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
|
|
|
[cygwin*], [
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test x"$enable_shared" = xyes], [
|
2009-05-08 05:14:14 +04:00
|
|
|
LIBRUBY_SO='cyg$(RUBY_SO_NAME)'.dll
|
2009-01-20 09:32:36 +03:00
|
|
|
LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2010-01-21 03:38:03 +03:00
|
|
|
],
|
|
|
|
[mingw*], [
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test x"$enable_shared" = xyes], [
|
2003-08-07 09:43:59 +04:00
|
|
|
LIBRUBY_SO='$(RUBY_SO_NAME)'.dll
|
2005-11-05 07:43:46 +03:00
|
|
|
LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2010-11-11 14:45:32 +03:00
|
|
|
EXPORT_PREFIX=' '
|
2021-08-29 07:04:42 +03:00
|
|
|
EXTDLDFLAGS='$(DEFFILE)'
|
2012-02-28 19:51:25 +04:00
|
|
|
AC_LIBOBJ([win32/win32])
|
|
|
|
AC_LIBOBJ([win32/file])
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
COMMON_LIBS=m
|
2005-03-25 05:02:54 +03:00
|
|
|
# COMMON_MACROS="WIN32_LEAN_AND_MEAN="
|
2005-02-10 07:55:34 +03:00
|
|
|
COMMON_HEADERS="winsock2.h windows.h"
|
2012-02-29 08:07:06 +04:00
|
|
|
PLATFORM_DIR=win32
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
2003-08-07 09:43:59 +04:00
|
|
|
LIBRUBY_ALIASES=''
|
|
|
|
FIRSTMAKEFILE=GNUmakefile:cygwin/GNUmakefile.in
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test x"$enable_shared" = xyes], [
|
2005-11-05 07:43:46 +03:00
|
|
|
LIBRUBY='lib$(RUBY_SO_NAME).dll.a'
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2000-07-26 05:12:31 +04:00
|
|
|
LIBRUBY_SO=dummy
|
2002-06-11 14:26:13 +04:00
|
|
|
LIBRUBY='lib$(RUBY_SO_NAME).a'
|
2002-12-12 13:21:41 +03:00
|
|
|
LIBRUBYARG='-l$(RUBY_SO_NAME)'
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2022-01-15 17:10:48 +03:00
|
|
|
],
|
|
|
|
[wasi*], [
|
|
|
|
FIRSTMAKEFILE=GNUmakefile:wasm/GNUmakefile.in
|
2022-01-15 19:18:49 +03:00
|
|
|
AC_LIBOBJ([wasm/missing])
|
2022-01-15 17:10:48 +03:00
|
|
|
AC_LIBOBJ([wasm/runtime])
|
|
|
|
AC_LIBOBJ([wasm/fiber])
|
|
|
|
AC_LIBOBJ([wasm/machine])
|
|
|
|
AC_LIBOBJ([wasm/setjmp])
|
|
|
|
AC_LIBOBJ([wasm/machine_core])
|
|
|
|
AC_LIBOBJ([wasm/setjmp_core])
|
|
|
|
PLATFORM_DIR=wasm
|
2017-10-23 08:56:25 +03:00
|
|
|
])
|
2013-09-04 06:11:38 +04:00
|
|
|
|
2008-04-03 07:56:07 +04:00
|
|
|
MINIOBJS="$MINIDLNOBJ"
|
1999-01-20 07:59:39 +03:00
|
|
|
|
2010-06-26 08:07:20 +04:00
|
|
|
AC_ARG_ENABLE(debug-env,
|
|
|
|
AS_HELP_STRING([--enable-debug-env], [enable RUBY_DEBUG environment variable]),
|
2017-05-15 10:04:48 +03:00
|
|
|
[AC_SUBST(ENABLE_DEBUG_ENV, yes)])
|
2010-06-26 08:07:20 +04:00
|
|
|
|
2010-01-21 09:10:16 +03:00
|
|
|
AS_CASE(["$FIRSTMAKEFILE"], [*GNUmakefile:*], [gnumake=yes], [
|
2012-09-14 21:29:40 +04:00
|
|
|
AC_MSG_CHECKING([if ${MAKE-make} is GNU make])
|
2008-08-14 07:01:42 +04:00
|
|
|
mkdir conftest.dir
|
|
|
|
echo "all:; @echo yes" > conftest.dir/GNUmakefile
|
|
|
|
echo "all:; @echo no" > conftest.dir/Makefile
|
|
|
|
gnumake=`(cd conftest.dir; ${MAKE-make})`
|
|
|
|
rm -fr conftest.dir
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$gnumake"],
|
|
|
|
[*yes*], [
|
2013-03-06 10:30:08 +04:00
|
|
|
FIRSTMAKEFILE=GNUmakefile:template/GNUmakefile.in
|
2010-01-21 03:38:03 +03:00
|
|
|
gnumake=yes],
|
|
|
|
[
|
|
|
|
gnumake=no])
|
2008-08-14 07:01:42 +04:00
|
|
|
AC_MSG_RESULT($gnumake)
|
2010-01-21 09:10:16 +03:00
|
|
|
])
|
2011-07-31 15:31:55 +04:00
|
|
|
AS_IF([test "$gnumake" = yes], [ NULLCMD=: ], [
|
2011-07-31 18:17:45 +04:00
|
|
|
AC_MSG_CHECKING([for safe null command for ${MAKE-make}])
|
2011-07-31 15:31:55 +04:00
|
|
|
mkdir conftest.dir
|
2012-12-15 05:39:49 +04:00
|
|
|
NULLCMD=
|
|
|
|
for cmd in : true; do
|
2011-07-31 15:31:55 +04:00
|
|
|
echo 'A=1' > conftest.dir/Makefile
|
2012-12-15 05:39:49 +04:00
|
|
|
echo 'B=$(A:1=@'$cmd')' >> conftest.dir/Makefile
|
2011-07-31 15:31:55 +04:00
|
|
|
echo 'all:; $B 1 2 3 4 5 6 7 8 9' >> conftest.dir/Makefile
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([(cd conftest.dir; ${MAKE-make} >/dev/null 2>/dev/null)], [
|
2012-12-15 05:39:49 +04:00
|
|
|
NULLCMD=$cmd
|
|
|
|
break
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2012-12-15 05:39:49 +04:00
|
|
|
done
|
2011-07-31 15:31:55 +04:00
|
|
|
rm -fr conftest.dir
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test -z "$NULLCMD"], [
|
2012-12-15 05:39:49 +04:00
|
|
|
AC_MSG_ERROR(no candidate for safe null command)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2011-07-31 15:31:55 +04:00
|
|
|
AC_MSG_RESULT($NULLCMD)
|
|
|
|
])
|
|
|
|
AC_SUBST(NULLCMD)
|
2003-01-01 12:26:45 +03:00
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "${universal_binary-no}" = yes ], [
|
2010-03-11 05:16:39 +03:00
|
|
|
AC_CACHE_CHECK([for architecture macros], rb_cv_architecture_macros, [
|
2009-02-08 07:09:34 +03:00
|
|
|
mv confdefs.h confdefs1.h
|
|
|
|
: > confdefs.h
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@if defined __`echo ${universal_archnames} |
|
2009-02-08 07:09:34 +03:00
|
|
|
sed 's/=[^ ]*//g;s/ /__ || defined __/g'`__
|
|
|
|
@%:@else
|
|
|
|
@%:@error
|
|
|
|
>>>>>><<<<<<
|
2020-12-12 16:55:09 +03:00
|
|
|
@%:@endif]], [[]])],[
|
2010-03-11 05:16:39 +03:00
|
|
|
rb_cv_architecture_macros=yes
|
2009-02-08 07:09:34 +03:00
|
|
|
mv -f confdefs1.h confdefs.h
|
|
|
|
], [
|
2010-03-11 05:16:39 +03:00
|
|
|
rb_cv_architecture_macros=no
|
2009-02-08 07:09:34 +03:00
|
|
|
archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
|
2009-04-06 21:25:28 +04:00
|
|
|
new_cflags=`echo "$CFLAGS" | sed "s|$archflagpat"'||'`
|
2009-02-08 07:09:34 +03:00
|
|
|
for archs in ${universal_archnames}; do
|
2012-08-21 20:18:05 +04:00
|
|
|
cpu=${archs@%:@*=}
|
2009-02-08 07:09:34 +03:00
|
|
|
archs=${archs%=*}
|
2009-04-06 21:25:28 +04:00
|
|
|
CFLAGS="$new_cflags -arch $archs"
|
2009-02-08 07:09:34 +03:00
|
|
|
archs="__${archs}__"
|
|
|
|
AC_MSG_CHECKING([for macro ${archs} on ${cpu}])
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@ifndef ${archs}
|
2009-02-08 07:09:34 +03:00
|
|
|
@%:@error
|
2020-12-12 16:55:09 +03:00
|
|
|
@%:@endif]], [[]])],
|
|
|
|
[AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
|
2009-02-08 07:09:34 +03:00
|
|
|
done
|
|
|
|
mv -f confdefs1.h confdefs.h
|
|
|
|
AC_MSG_ERROR([failed])
|
2010-03-11 05:16:39 +03:00
|
|
|
])])
|
2014-02-27 06:07:40 +04:00
|
|
|
AC_CACHE_CHECK(whether __ARCHITECTURE__ is available, rb_cv_architecture_available,
|
2020-12-12 16:55:09 +03:00
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <stdio.h>
|
|
|
|
const char arch[[]] = __ARCHITECTURE__;]], [[puts(arch);]])],
|
2014-02-27 06:07:40 +04:00
|
|
|
[rb_cv_architecture_available=yes], [rb_cv_architecture_available=no]))
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2009-02-08 07:09:34 +03:00
|
|
|
|
2018-03-03 08:09:32 +03:00
|
|
|
: ${MJIT_LDSHARED=`echo "$LDSHARED" | sed ['s|\$(LD)|'"${LD}"'|g;s|\$(CC)|$(MJIT_CC)|g']`}
|
|
|
|
|
2018-03-02 04:37:53 +03:00
|
|
|
MAINLIBS="$LIBS"
|
|
|
|
LIBS=$ORIG_LIBS
|
|
|
|
AS_IF([test -n "${LIBS}"], [
|
|
|
|
libspat=`echo "${LIBS}" | sed 's/[[][|.*$^]]/\\&/g;s/^ */ /;s/^ *$/ /'`
|
|
|
|
MAINFLAGS=`echo " $MAINLIBS " | sed "s|$libspat"'||;s/^ *//;s/ *$//'`
|
|
|
|
])
|
|
|
|
LIBRUBYARG_STATIC="${LIBRUBYARG_STATIC} \$(MAINLIBS)"
|
2007-10-13 23:08:37 +04:00
|
|
|
CPPFLAGS="$CPPFLAGS "'$(DEFS)'
|
2007-12-22 09:14:50 +03:00
|
|
|
test -z "$CPPFLAGS" || CPPFLAGS="$CPPFLAGS "; CPPFLAGS="$CPPFLAGS"'${cppflags}'
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test -n "${cflags+set}"], [
|
2009-05-06 00:34:05 +04:00
|
|
|
cflagspat=`eval echo '"'"${cflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/^ *$/ /'`
|
|
|
|
CFLAGS=`echo " $CFLAGS " | sed "s|$cflagspat"'|${cflags}|;s/^ *//;s/ *$//'`
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
AS_IF([test -n "${cxxflags+set}"], [
|
2009-05-06 00:34:05 +04:00
|
|
|
cxxflagspat=`eval echo '"'"${cxxflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/^ *$/ /'`
|
|
|
|
CXXFLAGS=`echo " $CXXFLAGS " | sed "s|$cxxflagspat"'|${cxxflags}|;s/^ *//;s/ *$//'`
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
AS_IF([test "${ARCH_FLAG}"], [
|
2009-02-07 12:02:50 +03:00
|
|
|
archflagpat=`eval echo '"'"${ARCH_FLAG}"'"' | sed 's/[[][|.*]]/\\&/g'`
|
2011-12-03 02:17:34 +04:00
|
|
|
CFLAGS=`echo "$CFLAGS" | sed "s| *$archflagpat"'||'`
|
|
|
|
CXXFLAGS=`echo "$CXXFLAGS" | sed "s| *$archflagpat"'||'`
|
|
|
|
LDFLAGS=`echo "$LDFLAGS" | sed "s| *$archflagpat"'||'`
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2019-01-22 04:56:26 +03:00
|
|
|
rb_cv_warnflags=`echo "$rb_cv_warnflags" | sed 's/^ *//;s/ *$//'`
|
2011-02-15 13:44:58 +03:00
|
|
|
warnflags="$rb_cv_warnflags"
|
2013-12-17 08:32:51 +04:00
|
|
|
AC_SUBST(cppflags)dnl
|
2016-05-24 18:21:53 +03:00
|
|
|
AC_SUBST(cflags, ["${orig_cflags:+$orig_cflags }"'${optflags} ${debugflags} ${warnflags}'])dnl
|
2019-09-06 12:43:10 +03:00
|
|
|
AC_SUBST(cxxflags)dnl
|
2007-12-22 09:14:50 +03:00
|
|
|
AC_SUBST(optflags)dnl
|
|
|
|
AC_SUBST(debugflags)dnl
|
2008-05-31 10:58:11 +04:00
|
|
|
AC_SUBST(warnflags)dnl
|
2012-09-16 03:58:04 +04:00
|
|
|
AC_SUBST(strict_warnflags)dnl
|
* gc.c (Init_stack): stack region is far smaller than usual if
pthread is used.
* marshal.c (w_extended): singleton methods should not be checked
when dumping via marshal_dump() or _dump(). [ruby-talk:85909]
* file.c (getcwdofdrv): avoid using getcwd() directly, use
my_getcwd() instead.
* merged NeXT, OpenStep, Rhapsody ports patch from Eric Sunshine
<sunshine@sunshineco.com>. [ruby-core:01596]
* marshal.c (w_object): LINK check earlier than anything else,
i.e. do not dump TYPE_IVAR for already dumped objects.
(ruby-bugs PR#1220)
* eval.c (rb_eval): call "inherited" only when a new class is
generated; not on reopening.
* eval.c (eval): prepend error position in evaluating string to
* configure.in: revived NextStep, OpenStep, and Rhapsody ports which
had become unbuildable; enhanced --enable-fat-binary option so that
it accepts a list of desired architectures (rather than assuming a
fixed list), or defaults to a platform-appropriate list if user does
not provide an explicit list; made the default list of architectures
for MAB (fat binary) more comprehensive; now uses -fno-common even
when building the interpreter (in addition to using it for
extensions), thus allowing the interpreter to be embedded into a
plugin module of an external project (in addition to allowing
embedding directly into an application); added checks for
<netinet/in_systm.h> (needed by `socket' extension) and getcwd(); now
ensures that -I/usr/local/include is employed when extensions'
extconf.rb scripts invoke have_header() since extension checks on
NextStep and OpenStep will fail without it if the desired resource
resides in the /usr/local tree; fixed formatting of --help message.
* Makefile.in: $(LIBRUBY_A) rule now deletes the archive before
invoking $(AR) since `ar' on Apple/NeXT can not "update" MAB archives
(see configure's --enable-fat-binary option); added rule for new
missing/getcwd.c.
* defines.h: fixed endian handling during MAB build (see configure's
--enable-fat-binary option) to ensure that all portions of the
project see the correct WORDS_BIGENDIAN value (some extension modules
were getting the wrong endian setting); added missing constants
GETPGRP_VOID, WNOHANG, WUNTRACED, X_OK, and type pid_t for NextStep
and OpenStep; removed unnecessary and problematic HAVE_SYS_WAIT_H
define in NeXT section.
* dir.c: do not allow NAMLEN() macro to trust dirent::d_namlen on
NextStep since, on some installations, this value always resolves
uselessly to zero.
* dln.c: added error reporting to NextStep extension loader since the
previous behavior of failing silently was not useful; now ensures
that NSLINKMODULE_OPTION_BINDNOW compatibility constant is defined
for OpenStep and Rhapsody; no longer includes <mach-o/dyld.h> twice
on Rhapsody since this header lacks multiple-include protection,
which resulted in "redefinition" compilation errors.
* main.c: also create hard reference to objc_msgSend() on NeXT
platforms (in addition to Apple platforms).
* lib/mkmf.rb: now exports XCFLAGS from configure script to extension
makefiles so that extensions can be built MAB (see configure's
--enable-fat-binary option); also utilize XCFLAGS in cc_command()
(but not cpp_command() because MAB flags are incompatible with
direct invocation of `cpp').
* ext/curses/extconf.rb: now additionally checks for presence of these
curses functions which are not present on NextStep or Openstep:
bkgd(), bkgdset(), color(), curs(), getbkgd(), init(), scrl(), set(),
setscrreg(), wattroff(), wattron(), wattrset(), wbkgd(), wbkgdset(),
wscrl(), wsetscrreg()
* ext/curses/curses.c: added appropriate #ifdef's for additional set of
curses functions now checked by extconf.rb; fixed curses_bkgd() and
window_bkgd() to correctly return boolean result rather than numeric
result; fixed window_getbkgd() to correctly signal an error by
returning nil rather than -1.
* ext/etc/etc.c: setup_passwd() and setup_group() now check for null
pointers before invoking rb_tainted_str_new2() upon fields extracted
from `struct passwd' and `struct group' since null pointers in some
fields are common on NextStep/OpenStep (especially so for the
`pw_comment' field) and rb_tainted_str_new2() throws an exception
when it receives a null pointer.
* ext/pty/pty.c: include "util.h" for strdup()/ruby_strdup() for
platforms such as NextStep and OpenStep which lack strdup().
* ext/socket/getaddrinfo.c: cast first argument of getservbyname(),
gethostbyaddr(), and gethostbyname() from (const char*) to non-const
(char*) for older platforms such as NextStep and OpenStep.
* ext/socket/socket.c: include "util.h" for strdup()/ruby_strdup() for
platforms such as NextStep and OpenStep which lack strdup(); include
<netinet/in_systm.h> if present for NextStep and OpenStep; cast first
argument of gethostbyaddr() and getservbyname() from (const char*) to
non-const (char*) for older platforms.
* ext/syslog/syslog.c: include "util.h" for strdup()/ruby_strdup() for
platforms such as NextStep and OpenStep which lack strdup().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-22 07:00:03 +03:00
|
|
|
AC_SUBST(XCFLAGS)dnl
|
|
|
|
AC_SUBST(XLDFLAGS)dnl
|
2011-11-25 05:41:59 +04:00
|
|
|
AC_SUBST(EXTLDFLAGS)dnl
|
2012-07-18 09:53:23 +04:00
|
|
|
AC_SUBST(EXTDLDFLAGS)dnl
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_SUBST(LIBRUBY_LDSHARED)
|
|
|
|
AC_SUBST(LIBRUBY_DLDFLAGS)
|
|
|
|
AC_SUBST(RUBY_INSTALL_NAME)
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
AC_SUBST(rubyw_install_name)
|
|
|
|
AC_SUBST(RUBYW_INSTALL_NAME)
|
2000-08-07 09:05:04 +04:00
|
|
|
AC_SUBST(RUBY_SO_NAME)
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_SUBST(LIBRUBY_A)
|
|
|
|
AC_SUBST(LIBRUBY_SO)
|
2017-10-14 18:35:05 +03:00
|
|
|
AC_SUBST(LIBRUBY_SONAME)
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_SUBST(LIBRUBY_ALIASES)
|
1999-01-20 07:59:39 +03:00
|
|
|
AC_SUBST(LIBRUBY)
|
|
|
|
AC_SUBST(LIBRUBYARG)
|
2002-11-14 16:51:19 +03:00
|
|
|
AC_SUBST(LIBRUBYARG_STATIC)
|
|
|
|
AC_SUBST(LIBRUBYARG_SHARED)
|
1999-01-20 07:59:39 +03:00
|
|
|
AC_SUBST(SOLIBS)
|
2000-05-09 08:53:16 +04:00
|
|
|
AC_SUBST(DLDLIBS)
|
2018-11-06 06:32:57 +03:00
|
|
|
AC_SUBST(DLDSHARED)
|
2000-07-02 19:57:18 +04:00
|
|
|
AC_SUBST(ENABLE_SHARED)
|
2001-04-01 20:53:41 +04:00
|
|
|
AC_SUBST(MAINLIBS)
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
AC_SUBST(COMMON_LIBS)
|
|
|
|
AC_SUBST(COMMON_MACROS)
|
|
|
|
AC_SUBST(COMMON_HEADERS)
|
|
|
|
AC_SUBST(EXPORT_PREFIX)
|
2010-11-11 14:45:32 +03:00
|
|
|
AC_SUBST(SYMBOL_PREFIX)
|
2005-09-07 03:23:04 +04:00
|
|
|
AC_SUBST(MINIOBJS)
|
2007-02-28 04:33:57 +03:00
|
|
|
AC_SUBST(THREAD_MODEL)
|
2022-06-05 20:33:49 +03:00
|
|
|
AC_SUBST(COROUTINE_TYPE, ${coroutine_type})
|
2012-02-29 08:07:06 +04:00
|
|
|
AC_SUBST(PLATFORM_DIR)
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
|
2013-10-17 06:56:22 +04:00
|
|
|
firstmf=`echo $FIRSTMAKEFILE | sed 's/:.*//'`
|
|
|
|
firsttmpl=`echo $FIRSTMAKEFILE | sed 's/.*://'`
|
|
|
|
MAKEFILES="Makefile $firstmf"
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 18:17:44 +04:00
|
|
|
MAKEFILES="`echo $MAKEFILES`"
|
|
|
|
AC_SUBST(MAKEFILES)
|
1999-01-20 07:59:39 +03:00
|
|
|
|
|
|
|
ri_prefix=
|
|
|
|
test "$program_prefix" != NONE &&
|
|
|
|
ri_prefix=$program_prefix
|
|
|
|
|
|
|
|
ri_suffix=
|
|
|
|
test "$program_suffix" != NONE &&
|
|
|
|
ri_suffix=$program_suffix
|
|
|
|
|
2009-05-08 05:14:14 +04:00
|
|
|
RUBY_INSTALL_NAME="${ri_prefix}"'$(RUBY_BASE_NAME)'"${ri_suffix}"
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$target_os"],
|
2021-01-31 08:27:15 +03:00
|
|
|
[cygwin*|msys*|mingw*], [
|
2009-05-08 05:14:14 +04:00
|
|
|
RUBYW_INSTALL_NAME="${ri_prefix}"'$(RUBYW_BASE_NAME)'"${ri_suffix}"
|
|
|
|
rubyw_install_name='$(RUBYW_INSTALL_NAME)'
|
2010-01-21 03:38:03 +03:00
|
|
|
])
|
2009-05-08 05:14:14 +04:00
|
|
|
|
2013-02-06 12:32:38 +04:00
|
|
|
rubylibdir='${rubylibprefix}/${ruby_version}'
|
2013-02-06 12:33:03 +04:00
|
|
|
rubyarchdir=${multiarch+'${rubyarchprefix}/${ruby_version}'}${multiarch-'${rubylibdir}/${arch}'}
|
2000-09-27 10:48:23 +04:00
|
|
|
|
2013-02-06 12:33:03 +04:00
|
|
|
rubyarchprefix=${multiarch+'${archlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${arch}'}
|
2013-02-06 12:32:53 +04:00
|
|
|
AC_ARG_WITH(rubyarchprefix,
|
|
|
|
AS_HELP_STRING([--with-rubyarchprefix=DIR],
|
|
|
|
[prefix for architecture dependent ruby libraries [[RUBYLIBPREFIX/ARCH]]]),
|
|
|
|
[rubyarchprefix="$withval"])
|
|
|
|
AC_SUBST(rubyarchprefix)
|
|
|
|
|
2013-02-11 08:17:22 +04:00
|
|
|
rubysitearchprefix=${multiarch+'${sitearchlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${sitearch}'}
|
|
|
|
AC_ARG_WITH(rubysitearchprefix,
|
|
|
|
AS_HELP_STRING([--with-rubysitearchprefix=DIR],
|
|
|
|
[prefix for architecture dependent site libraries [[RUBYLIBPREFIX/SITEARCH]]]),
|
|
|
|
[rubysitearchprefix="$withval"])
|
|
|
|
AC_SUBST(rubysitearchprefix)
|
|
|
|
|
2009-05-23 20:07:46 +04:00
|
|
|
RI_BASE_NAME=`echo ${RUBY_BASE_NAME} | sed 's/ruby/ri/'`
|
2009-06-17 20:09:30 +04:00
|
|
|
ridir='${datarootdir}/${RI_BASE_NAME}'
|
2009-05-23 20:07:46 +04:00
|
|
|
AC_ARG_WITH(ridir,
|
|
|
|
AS_HELP_STRING([--with-ridir=DIR], [ri documentation [[DATAROOTDIR/ri]]]),
|
|
|
|
[ridir=$withval])
|
|
|
|
AC_SUBST(ridir)
|
2009-06-17 20:09:30 +04:00
|
|
|
AC_SUBST(RI_BASE_NAME)
|
2009-05-23 20:07:46 +04:00
|
|
|
|
2008-07-15 16:33:28 +04:00
|
|
|
AC_ARG_WITH(ruby-version,
|
2009-03-31 10:17:38 +04:00
|
|
|
AS_HELP_STRING([--with-ruby-version=STR], [ruby version string for version specific directories [[full]] (full|minor|STR)]),
|
2008-07-15 16:33:28 +04:00
|
|
|
[ruby_version=$withval],
|
|
|
|
[ruby_version=full])
|
2009-02-05 05:21:37 +03:00
|
|
|
unset RUBY_LIB_VERSION
|
2009-03-06 13:25:41 +03:00
|
|
|
unset RUBY_LIB_VERSION_STYLE
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$ruby_version"],
|
2010-01-21 09:10:16 +03:00
|
|
|
[full], [RUBY_LIB_VERSION_STYLE='3 /* full */'],
|
|
|
|
[minor], [RUBY_LIB_VERSION_STYLE='2 /* minor */'])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test ${RUBY_LIB_VERSION_STYLE+set}], [
|
2009-02-05 05:21:37 +03:00
|
|
|
{
|
2009-03-06 13:25:41 +03:00
|
|
|
echo "#define RUBY_LIB_VERSION_STYLE $RUBY_LIB_VERSION_STYLE"
|
2022-07-12 10:44:57 +03:00
|
|
|
echo '@%:@include "confdefs.h"'
|
2009-03-06 13:25:41 +03:00
|
|
|
echo '#define STRINGIZE(x) x'
|
2009-06-23 11:16:17 +04:00
|
|
|
test -f revision.h -o -f "${srcdir}/revision.h" || echo '#define RUBY_REVISION 0'
|
2009-03-06 13:25:41 +03:00
|
|
|
echo '#include "version.h"'
|
|
|
|
echo 'ruby_version=RUBY_LIB_VERSION'
|
2009-02-05 05:21:37 +03:00
|
|
|
} > conftest.c
|
2012-03-27 17:44:25 +04:00
|
|
|
ruby_version="`$CPP -I. -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`"
|
2009-02-05 05:21:37 +03:00
|
|
|
eval $ruby_version
|
2017-06-21 06:27:21 +03:00
|
|
|
], [test -z "${ruby_version}"], [
|
2013-02-09 12:46:02 +04:00
|
|
|
AC_MSG_ERROR([No ruby version, No place for bundled libraries])
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2014-12-06 00:14:25 +03:00
|
|
|
RUBY_LIB_VERSION="${ruby_version}"
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2013-05-16 08:13:40 +04:00
|
|
|
AC_SUBST(RUBY_LIB_VERSION_STYLE)
|
|
|
|
AC_SUBST(RUBY_LIB_VERSION)
|
2008-07-15 16:33:28 +04:00
|
|
|
|
2000-04-12 09:06:23 +04:00
|
|
|
AC_ARG_WITH(sitedir,
|
2011-08-12 08:42:13 +04:00
|
|
|
AS_HELP_STRING([--with-sitedir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]], "no" to disable site directory]),
|
2000-09-22 22:15:52 +04:00
|
|
|
[sitedir=$withval],
|
2009-05-08 05:14:14 +04:00
|
|
|
[sitedir='${rubylibprefix}/site_ruby'])
|
2013-02-06 12:32:38 +04:00
|
|
|
sitelibdir='${sitedir}/${ruby_version}'
|
2013-02-06 12:32:53 +04:00
|
|
|
|
|
|
|
AC_ARG_WITH(sitearchdir,
|
2013-02-09 12:38:46 +04:00
|
|
|
AS_HELP_STRING([--with-sitearchdir=DIR],
|
2013-02-06 12:32:53 +04:00
|
|
|
[architecture dependent site libraries in DIR [[SITEDIR/SITEARCH]], "no" to disable site directory]),
|
|
|
|
[sitearchdir=$withval],
|
2013-02-11 08:17:22 +04:00
|
|
|
[sitearchdir=${multiarch+'${rubysitearchprefix}/site_ruby/${ruby_version}'}${multiarch-'${sitelibdir}/${sitearch}'}])
|
2000-02-17 10:11:22 +03:00
|
|
|
|
2007-11-03 14:35:59 +03:00
|
|
|
AC_ARG_WITH(vendordir,
|
2011-08-12 06:42:51 +04:00
|
|
|
AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]], "no" to disable vendor directory]),
|
2007-11-03 14:35:59 +03:00
|
|
|
[vendordir=$withval],
|
2009-05-08 05:14:14 +04:00
|
|
|
[vendordir='${rubylibprefix}/vendor_ruby'])
|
2013-02-06 12:32:38 +04:00
|
|
|
vendorlibdir='${vendordir}/${ruby_version}'
|
2013-02-06 12:32:53 +04:00
|
|
|
|
|
|
|
AC_ARG_WITH(vendorarchdir,
|
2013-02-09 12:38:46 +04:00
|
|
|
AS_HELP_STRING([--with-vendorarchdir=DIR],
|
2013-02-06 12:32:53 +04:00
|
|
|
[architecture dependent vendor libraries in DIR [[VENDORDIR/SITEARCH]], "no" to disable vendor directory]),
|
|
|
|
[vendorarchdir=$withval],
|
2013-02-11 08:17:22 +04:00
|
|
|
[vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby/${ruby_version}'}${multiarch-'${vendorlibdir}/${sitearch}'}])
|
2008-03-14 10:59:25 +03:00
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "${LOAD_RELATIVE+set}"], [
|
2009-02-19 08:48:14 +03:00
|
|
|
AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
|
2013-05-15 11:58:28 +04:00
|
|
|
RUBY_EXEC_PREFIX=''
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2007-11-03 14:35:59 +03:00
|
|
|
|
2013-05-16 08:13:40 +04:00
|
|
|
AC_SUBST(RUBY_EXEC_PREFIX)
|
2007-11-03 14:35:59 +03:00
|
|
|
|
2013-02-20 13:01:17 +04:00
|
|
|
AC_SUBST(libdirname, ${multiarch+arch}libdir)
|
2013-02-06 12:33:03 +04:00
|
|
|
AC_SUBST(archlibdir)dnl
|
|
|
|
AC_SUBST(sitearchlibdir)dnl
|
|
|
|
AC_SUBST(archincludedir)dnl
|
|
|
|
AC_SUBST(sitearchincludedir)dnl
|
1998-01-16 15:13:05 +03:00
|
|
|
AC_SUBST(arch)dnl
|
2002-08-23 12:18:19 +04:00
|
|
|
AC_SUBST(sitearch)dnl
|
2008-07-15 16:33:28 +04:00
|
|
|
AC_SUBST(ruby_version)dnl
|
2013-02-06 12:32:53 +04:00
|
|
|
AC_SUBST(rubylibdir)dnl
|
|
|
|
AC_SUBST(rubyarchdir)dnl
|
2000-04-12 09:06:23 +04:00
|
|
|
AC_SUBST(sitedir)dnl
|
2013-02-06 12:32:53 +04:00
|
|
|
AC_SUBST(sitelibdir)dnl
|
|
|
|
AC_SUBST(sitearchdir)dnl
|
2007-11-03 14:35:59 +03:00
|
|
|
AC_SUBST(vendordir)dnl
|
2013-02-06 12:32:53 +04:00
|
|
|
AC_SUBST(vendorlibdir)dnl
|
|
|
|
AC_SUBST(vendorarchdir)dnl
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2015-03-19 05:04:31 +03:00
|
|
|
AC_SUBST(CONFIGURE, "`echo $0 | sed 's|.*/||'`")dnl
|
2013-02-09 18:50:03 +04:00
|
|
|
AC_SUBST(configure_args, "`echo "${ac_configure_args}" | sed 's/\\$/$$/g'`")dnl
|
1999-08-13 09:45:20 +04:00
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "${universal_binary-no}" = yes ], [
|
2009-02-07 12:02:50 +03:00
|
|
|
arch="universal-${target_os}"
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "${rb_cv_architecture_available}" = yes], [
|
2013-05-15 12:56:28 +04:00
|
|
|
AC_DEFINE_UNQUOTED(RUBY_PLATFORM_CPU, __ARCHITECTURE__)
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2009-02-08 07:09:34 +03:00
|
|
|
for archs in ${universal_archnames}; do
|
|
|
|
cpu=`echo $archs | sed 's/.*=//'`
|
|
|
|
archs=`echo $archs | sed 's/=.*//'`
|
2018-10-03 07:49:34 +03:00
|
|
|
RUBY_DEFINE_IF([defined __${archs}__ &&! defined RUBY_PLATFORM_CPU], RUBY_PLATFORM_CPU, ["${cpu}"])
|
2009-02-08 07:09:34 +03:00
|
|
|
done
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2011-12-03 02:14:30 +04:00
|
|
|
ints='long int short'
|
2009-03-19 12:49:51 +03:00
|
|
|
test "$ac_cv_type_long_long" = yes && ints="'long long' $ints"
|
|
|
|
AC_SUBST(UNIVERSAL_ARCHNAMES, "${universal_archnames}")
|
|
|
|
AC_SUBST(UNIVERSAL_INTS, "${ints}")
|
2013-05-15 12:56:28 +04:00
|
|
|
AC_DEFINE_UNQUOTED(RUBY_PLATFORM_OS, "${target_os}")
|
2019-11-05 16:31:52 +03:00
|
|
|
AC_DEFINE_UNQUOTED(RUBY_ARCH, "universal-" RUBY_PLATFORM_OS)
|
|
|
|
AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "universal." RUBY_PLATFORM_CPU "-" RUBY_PLATFORM_OS)
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2021-06-25 11:07:18 +03:00
|
|
|
AS_IF([test "${target_os}-${rb_cv_msvcrt}" = "mingw32-ucrt" ], [
|
|
|
|
arch="${target_cpu}-mingw-ucrt"
|
|
|
|
], [
|
|
|
|
arch="${target_cpu}-${target_os}"
|
|
|
|
])
|
2014-10-11 07:57:46 +04:00
|
|
|
AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "$arch")
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2000-02-17 10:11:22 +03:00
|
|
|
|
2009-02-05 05:21:37 +03:00
|
|
|
unset sitearch
|
2010-01-21 09:10:16 +03:00
|
|
|
AS_CASE(["$target_os"],[mingw*],[sitearch="$target_cpu-$rb_cv_msvcrt"])
|
2010-10-25 19:29:32 +04:00
|
|
|
: ${sitearch='${arch}'}
|
2002-08-23 12:18:19 +04:00
|
|
|
|
1999-08-13 09:45:20 +04:00
|
|
|
AC_ARG_WITH(search-path,
|
2009-03-31 10:17:38 +04:00
|
|
|
AS_HELP_STRING([--with-search-path=DIR], [specify the additional search path]),
|
1999-08-13 09:45:20 +04:00
|
|
|
[search_path=$withval])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$search_path" != ""], [
|
2013-05-16 08:13:40 +04:00
|
|
|
AC_SUBST(RUBY_SEARCH_PATH, $search_path)
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2007-06-10 07:06:15 +04:00
|
|
|
AC_ARG_WITH(rubyhdrdir,
|
2009-08-14 09:31:39 +04:00
|
|
|
AS_HELP_STRING([--with-rubyhdrdir=DIR], [core headers in DIR [[INCLUDEDIR/RUBY_BASE_NAME-RUBY_VERSION]]]),
|
2007-06-10 07:06:15 +04:00
|
|
|
[rubyhdrdir=$withval],
|
2013-02-06 12:32:48 +04:00
|
|
|
[rubyhdrdir='${includedir}/${RUBY_VERSION_NAME}'])
|
2007-06-10 07:06:15 +04:00
|
|
|
|
2013-02-06 12:32:58 +04:00
|
|
|
AC_ARG_WITH(rubyarchhdrdir,
|
2013-02-09 12:38:46 +04:00
|
|
|
AS_HELP_STRING([--with-rubyarchhdrdir=DIR],
|
2013-02-06 12:32:58 +04:00
|
|
|
[architecture dependent core headers in DIR [[$(rubyhdrdir)/$(arch)]]]),
|
|
|
|
[rubyarchhdrdir=$withval],
|
2013-02-06 12:33:03 +04:00
|
|
|
[rubyarchhdrdir=${multiarch+'${archincludedir}/${RUBY_VERSION_NAME}'}${multiarch-'${rubyhdrdir}/${arch}'}])
|
2013-02-06 12:32:58 +04:00
|
|
|
|
2007-06-10 07:06:15 +04:00
|
|
|
AC_ARG_WITH(sitehdrdir,
|
2009-11-01 10:23:05 +03:00
|
|
|
AS_HELP_STRING([--with-sitehdrdir=DIR], [core site headers in DIR [[RUBYHDRDIR/site_ruby]]]),
|
2007-06-10 07:06:15 +04:00
|
|
|
[sitehdrdir=$withval],
|
|
|
|
[sitehdrdir='${rubyhdrdir}/site_ruby'])
|
|
|
|
|
2013-02-06 12:32:58 +04:00
|
|
|
AC_ARG_WITH(sitearchhdrdir,
|
2013-02-09 12:38:46 +04:00
|
|
|
AS_HELP_STRING([--with-sitearchhdrdir=DIR],
|
2013-02-06 12:32:58 +04:00
|
|
|
[architecture dependent core site headers in DIR [[RUBYHDRDIR/site_ruby]]]),
|
|
|
|
[sitearchhdrdir=$withval],
|
2013-02-06 12:33:03 +04:00
|
|
|
[sitearchhdrdir=${multiarch+'${sitearchincludedir}/${RUBY_VERSION_NAME}/site_ruby'}${multiarch-'${sitehdrdir}/${sitearch}'}])
|
2013-02-06 12:32:58 +04:00
|
|
|
|
2007-11-03 16:30:59 +03:00
|
|
|
AC_ARG_WITH(vendorhdrdir,
|
2009-11-01 10:23:05 +03:00
|
|
|
AS_HELP_STRING([--with-vendorhdrdir=DIR], [core vendor headers in DIR [[RUBYHDRDIR/vendor_ruby]]]),
|
2007-11-03 16:30:59 +03:00
|
|
|
[vendorhdrdir=$withval],
|
|
|
|
[vendorhdrdir='${rubyhdrdir}/vendor_ruby'])
|
|
|
|
|
2013-02-06 12:32:58 +04:00
|
|
|
AC_ARG_WITH(vendorarchhdrdir,
|
2013-02-09 12:38:46 +04:00
|
|
|
AS_HELP_STRING([--with-vendorarchhdrdir=DIR],
|
2013-02-06 12:32:58 +04:00
|
|
|
[architecture dependent core vendor headers in DIR [[RUBYHDRDIR/vendor_ruby]]]),
|
|
|
|
[vendorarchhdrdir=$withval],
|
2013-02-06 12:33:03 +04:00
|
|
|
[vendorarchhdrdir=${multiarch+'${sitearchincludedir}/${RUBY_VERSION_NAME}/vendor_ruby'}${multiarch-'${vendorhdrdir}/${sitearch}'}])
|
2013-02-06 12:32:58 +04:00
|
|
|
|
2007-06-10 07:06:15 +04:00
|
|
|
AC_SUBST(rubyhdrdir)dnl
|
|
|
|
AC_SUBST(sitehdrdir)dnl
|
2007-11-03 16:30:59 +03:00
|
|
|
AC_SUBST(vendorhdrdir)dnl
|
2013-02-06 12:32:58 +04:00
|
|
|
AC_SUBST(rubyarchhdrdir)dnl
|
|
|
|
AC_SUBST(sitearchhdrdir)dnl
|
|
|
|
AC_SUBST(vendorarchhdrdir)dnl
|
2007-06-10 07:06:15 +04:00
|
|
|
|
2003-01-20 15:51:50 +03:00
|
|
|
AC_ARG_WITH(mantype,
|
2009-10-23 09:06:12 +04:00
|
|
|
AS_HELP_STRING([--with-mantype=TYPE], [specify man page type; TYPE is one of man and doc]),
|
2003-01-20 15:51:50 +03:00
|
|
|
[
|
2010-01-21 03:38:03 +03:00
|
|
|
AS_CASE(["$withval"],
|
2015-07-10 15:49:55 +03:00
|
|
|
[man|man.gz|man.bz2|doc|doc.gz|doc.bz2], [MANTYPE=$withval],
|
2010-01-21 09:10:16 +03:00
|
|
|
[AC_MSG_ERROR(invalid man type: $withval)])
|
2003-01-20 15:51:50 +03:00
|
|
|
])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test -z "$MANTYPE"], [
|
2017-10-06 14:17:38 +03:00
|
|
|
dnl Looks for nroff with -mdoc support.
|
|
|
|
AC_CACHE_VAL([ac_cv_path_NROFF], [
|
|
|
|
AC_PATH_PROGS_FEATURE_CHECK([NROFF],
|
|
|
|
[nroff awf mandoc],
|
|
|
|
[$ac_path_NROFF -mdoc ${srcdir}/man/ruby.1 \
|
|
|
|
>/dev/null 2>&1 &&
|
|
|
|
ac_cv_path_NROFF=$ac_path_NROFF \
|
|
|
|
ac_path_NROFF_found=:],
|
|
|
|
[], ["/usr/bin:/usr/ucb"]
|
|
|
|
)
|
|
|
|
])
|
|
|
|
AS_IF([test -n "$ac_cv_path_NROFF"], [
|
2003-01-20 15:51:50 +03:00
|
|
|
MANTYPE=doc
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2003-01-20 15:51:50 +03:00
|
|
|
MANTYPE=man
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
])
|
2003-01-20 15:51:50 +03:00
|
|
|
AC_SUBST(MANTYPE)
|
|
|
|
|
2022-04-21 23:59:59 +03:00
|
|
|
MKMF_VERBOSE=0
|
|
|
|
AC_ARG_ENABLE(mkmf-verbose,
|
|
|
|
AS_HELP_STRING([--enable-mkmf-verbose], [enable verbose in mkmf]),
|
|
|
|
[MKMF_VERBOSE=1],
|
|
|
|
[MKMF_VERBOSE=0])
|
|
|
|
AC_SUBST(MKMF_VERBOSE)
|
|
|
|
|
2011-02-11 06:03:26 +03:00
|
|
|
AC_ARG_ENABLE(rubygems,
|
|
|
|
AS_HELP_STRING([--disable-rubygems], [disable rubygems by default]),
|
|
|
|
[enable_rubygems="$enableval"], [enable_rubygems=yes])
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test x"$enable_rubygems" = xno], [
|
2018-06-22 07:13:02 +03:00
|
|
|
USE_RUBYGEMS=no
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2018-06-22 07:13:02 +03:00
|
|
|
USE_RUBYGEMS=yes
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2011-02-11 06:03:26 +03:00
|
|
|
AC_SUBST(USE_RUBYGEMS)
|
|
|
|
|
2007-06-10 07:06:15 +04:00
|
|
|
arch_hdrdir="${EXTOUT}/include/${arch}/ruby"
|
2009-08-13 11:20:16 +04:00
|
|
|
AS_MKDIR_P("${arch_hdrdir}")
|
2007-06-10 07:06:15 +04:00
|
|
|
config_h="${arch_hdrdir}/config.h"
|
2010-07-26 13:18:21 +04:00
|
|
|
guard=INCLUDE_RUBY_CONFIG_H
|
|
|
|
{
|
|
|
|
echo "#ifndef $guard"
|
|
|
|
echo "#define $guard 1"
|
2013-05-16 08:13:40 +04:00
|
|
|
grep -v "^#define PACKAGE_" confdefs.h
|
2010-07-26 13:18:21 +04:00
|
|
|
echo "#endif /* $guard */"
|
|
|
|
} | tr -d '\015' |
|
2015-11-25 06:36:13 +03:00
|
|
|
(
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "x$CONFIGURE_TTY" = xyes], [color=--color], [color=])
|
2021-05-06 18:10:16 +03:00
|
|
|
exec ${SHELL} ${tooldir}/ifchange $color "${config_h}" -
|
2018-04-03 11:29:51 +03:00
|
|
|
) >&AS_MESSAGE_FD || AC_MSG_ERROR([failed to create ${config_h}])
|
2007-10-13 23:08:37 +04:00
|
|
|
tr -d '\015' < largefile.h > confdefs.h
|
2007-12-30 05:00:59 +03:00
|
|
|
rm largefile.h
|
1998-01-16 15:13:05 +03:00
|
|
|
|
2007-12-15 16:27:41 +03:00
|
|
|
BUILTIN_ENCS=["`sed -n -e '/^BUILTIN_ENCS[ ]*=/{' \
|
|
|
|
-e s/// -e :l -e '/\\\\$/N' -e 's/\\\\\\n/ /' -e 't l' -e p \
|
2007-12-16 08:52:01 +03:00
|
|
|
-e '}' "${srcdir}/enc/Makefile.in"`"]
|
2007-12-15 12:56:59 +03:00
|
|
|
BUILTIN_ENCOBJS=
|
2015-01-18 06:56:52 +03:00
|
|
|
for e in $BUILTIN_ENCS; do BUILTIN_ENCOBJS="$BUILTIN_ENCOBJS "`echo $e | sed 's/\.c$/.$(OBJEXT)/'`; done
|
2007-12-15 12:56:59 +03:00
|
|
|
AC_SUBST(BUILTIN_ENCOBJS)
|
|
|
|
|
2008-08-24 19:58:43 +04:00
|
|
|
BUILTIN_TRANSES=["`sed -n -e '/^BUILTIN_TRANSES[ ]*=/{' \
|
|
|
|
-e s/// -e :l -e '/\\\\$/N' -e 's/\\\\\\n/ /' -e 't l' -e p \
|
|
|
|
-e '}' "${srcdir}/enc/Makefile.in"`"]
|
|
|
|
BUILTIN_TRANSSRCS=
|
|
|
|
BUILTIN_TRANSOBJS=
|
|
|
|
for e in $BUILTIN_TRANSES; do
|
2015-01-18 06:56:52 +03:00
|
|
|
BUILTIN_TRANSSRCS="$BUILTIN_TRANSSRCS "`echo $e | sed 's/\.trans$/.c/'`
|
|
|
|
BUILTIN_TRANSOBJS="$BUILTIN_TRANSOBJS "`echo $e | sed 's/\.trans$/.$(OBJEXT)/'`
|
2008-08-24 19:58:43 +04:00
|
|
|
done
|
|
|
|
AC_SUBST(BUILTIN_TRANSSRCS)
|
|
|
|
AC_SUBST(BUILTIN_TRANSOBJS)
|
|
|
|
|
2009-05-08 05:14:14 +04:00
|
|
|
PACKAGE=$RUBY_BASE_NAME
|
2008-12-22 16:19:08 +03:00
|
|
|
AC_SUBST(PACKAGE)
|
2015-10-20 10:15:04 +03:00
|
|
|
AS_MESSAGE([$PACKAGE library version = $ruby_version])
|
2008-12-22 16:19:08 +03:00
|
|
|
|
2018-11-04 02:43:17 +03:00
|
|
|
AS_IF([test x"$CC_WRAPPER" != x], [
|
|
|
|
CC='$(CC_WRAPPER) '"${CC@%:@$CC_WRAPPER }"
|
|
|
|
CPP='$(CC_WRAPPER) '"${CPP@%:@$CC_WRAPPER }"
|
2022-01-15 19:13:06 +03:00
|
|
|
XCC_WRAPPER="$CC_WRAPPER"
|
2018-09-21 10:19:13 +03:00
|
|
|
])
|
2018-11-07 19:51:19 +03:00
|
|
|
AC_SUBST(CC_WRAPPER, '')
|
2018-11-04 02:43:17 +03:00
|
|
|
AC_SUBST(XCC_WRAPPER)
|
2018-09-21 10:19:13 +03:00
|
|
|
|
2010-03-24 23:44:45 +03:00
|
|
|
AS_CASE([" $CPP "], [*" $CC "*], [CPP=`echo " $CPP " | sed "s| $CC |"' $(CC) |;s/^ *//;s/ *$//'`])
|
|
|
|
|
2022-09-26 04:20:24 +03:00
|
|
|
AS_IF([test ! -f "$srcdir/revision.h"], [
|
|
|
|
AS_IF([test "x$HAVE_BASERUBY" = xyes], [
|
|
|
|
${BASERUBY} -C "$srcdir" tool/file2lastrev.rb -q --revision.h > "$srcdir/revision.h"
|
|
|
|
], [
|
|
|
|
touch "$srcdir/revision.h"
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test x"$firstmf" != x], [
|
2013-10-17 09:40:57 +04:00
|
|
|
AC_CONFIG_FILES($firstmf:$firsttmpl, [], [firstmf="$firstmf" firsttmpl="$firsttmpl"])
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2019-06-07 03:09:29 +03:00
|
|
|
AC_CONFIG_FILES(Makefile:template/Makefile.in, [
|
2012-03-23 04:56:46 +04:00
|
|
|
tmpmk=confmk$$.tmp
|
|
|
|
{
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test ${VCS+set}], [
|
2012-03-22 09:59:48 +04:00
|
|
|
:
|
2017-06-21 06:27:21 +03:00
|
|
|
], [git_dir=`$GIT --work-tree="$srcdir" --git-dir="$srcdir/.git" rev-parse --git-dir 2>/dev/null`], [
|
2019-05-10 09:22:54 +03:00
|
|
|
VCS='$(GIT)'
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2009-01-16 11:33:02 +03:00
|
|
|
VCS='echo cannot'
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
2012-03-22 09:59:48 +04:00
|
|
|
AS_CASE("$VCS",
|
2020-06-04 04:26:40 +03:00
|
|
|
['$(GIT)'|git], [VCSUP='$(VCS) pull --rebase $(GITPULLOPTIONS)'],
|
2012-03-22 09:59:48 +04:00
|
|
|
[VCSUP='$(VCS)'])
|
2022-09-25 16:40:05 +03:00
|
|
|
for f in "$srcdir/version.h" "$srcdir/revision.h"; do
|
|
|
|
test -f "$f" || continue
|
|
|
|
sed -n \
|
|
|
|
-e '[/^@%:@define \(RUBY_RELEASE_[A-Z]*\) \([0-9][0-9]*\)/]{' \
|
|
|
|
-e 's//\1 = \2/' \
|
|
|
|
-e '[s/ \([0-9]\)$/ 0\1/]' \
|
|
|
|
-e p \
|
|
|
|
-e '}' "$f"
|
|
|
|
done
|
2009-01-16 11:33:02 +03:00
|
|
|
sed '/^MISSING/s/\$U\././g;/^VCS *=/s#@VCS@#'"$VCS"'#;/^VCSUP *=/s#@VCSUP@#'"$VCSUP"'#' Makefile
|
2004-03-25 08:01:15 +03:00
|
|
|
echo; test x"$EXEEXT" = x || echo 'miniruby: miniruby$(EXEEXT)'
|
2017-06-21 06:27:21 +03:00
|
|
|
AS_IF([test "$gnumake" != yes], [
|
2008-08-14 07:01:42 +04:00
|
|
|
echo ['$(MKFILES): $(srcdir)/common.mk']
|
|
|
|
sed ['s/{\$([^(){}]*)[^{}]*}//g'] ${srcdir}/common.mk
|
2022-09-20 15:36:06 +03:00
|
|
|
AS_IF([test "$YJIT_SUPPORT" = yes], [
|
|
|
|
cat ${srcdir}/yjit/not_gmake.mk
|
|
|
|
echo ['$(MKFILES): ${srcdir}/yjit/not_gmake.mk']
|
|
|
|
])
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2008-12-24 07:45:34 +03:00
|
|
|
echo 'distclean-local::; @$(RM) GNUmakefile uncommon.mk'
|
2017-06-21 06:27:21 +03:00
|
|
|
])
|
|
|
|
} > $tmpmk && AS_IF([! grep '^ruby:' $tmpmk > /dev/null], [
|
|
|
|
AS_IF([test "${gnumake}" = yes], [
|
2012-03-23 04:56:46 +04:00
|
|
|
tmpgmk=confgmk$$.tmp
|
|
|
|
{
|
|
|
|
echo "include $tmpmk"
|
|
|
|
echo "-include uncommon.mk"
|
|
|
|
} > $tmpgmk
|
2017-06-21 06:27:21 +03:00
|
|
|
], [
|
2012-03-23 04:56:46 +04:00
|
|
|
tmpgmk=$tmpmk
|
2017-06-21 06:27:21 +03:00
|
|
|
]) &&
|
2012-03-23 04:56:46 +04:00
|
|
|
test -z "`${MAKE-make} -f $tmpgmk info-program | grep '^PROGRAM=ruby$'`" &&
|
|
|
|
echo 'ruby: $(PROGRAM);' >> $tmpmk
|
|
|
|
test "$tmpmk" = "$tmpgmk" || rm -f "$tmpgmk"
|
2017-06-21 06:27:21 +03:00
|
|
|
]) && mv -f $tmpmk Makefile],
|
2022-09-20 15:36:06 +03:00
|
|
|
[EXEEXT='$EXEEXT' MAKE='${MAKE-make}' gnumake='$gnumake' GIT='$GIT' YJIT_SUPPORT='$YJIT_SUPPORT'])
|
2010-10-25 19:29:32 +04:00
|
|
|
|
2012-03-03 01:57:16 +04:00
|
|
|
AC_ARG_WITH([ruby-pc],
|
2020-12-12 16:55:09 +03:00
|
|
|
AS_HELP_STRING([--with-ruby-pc=FILENAME], [pc file basename]),
|
2012-03-03 01:57:16 +04:00
|
|
|
[ruby_pc="$withval"],
|
|
|
|
[ruby_pc="${RUBY_BASE_NAME}-${MAJOR}.${MINOR}.pc"])
|
2010-10-25 19:29:32 +04:00
|
|
|
AC_SUBST(ruby_pc)
|
2011-03-08 03:33:05 +03:00
|
|
|
AC_SUBST(exec, [exec])
|
|
|
|
|
2014-07-18 05:47:01 +04:00
|
|
|
AC_ARG_WITH(destdir,
|
|
|
|
AS_HELP_STRING([--with-destdir=DESTDIR], [specify default directory to install]),
|
|
|
|
[DESTDIR="$withval"])
|
|
|
|
AC_SUBST(DESTDIR)
|
|
|
|
|
2002-04-19 11:39:40 +04:00
|
|
|
AC_OUTPUT
|
2012-08-21 20:18:10 +04:00
|
|
|
}
|
|
|
|
}
|
2016-02-28 17:14:42 +03:00
|
|
|
|
2018-04-03 11:29:51 +03:00
|
|
|
AS_IF([test "$silent" = yes], [], [
|
2016-02-28 17:14:44 +03:00
|
|
|
AS_IF([${FOLD+:} false], [], [
|
|
|
|
AS_IF([test "`echo abcdefg hijklmno | fold -s -w10 | sed 1d`" = hijklmno], [FOLD="fold"], [FOLD=])
|
|
|
|
])
|
2019-06-06 06:03:19 +03:00
|
|
|
fold_width=`expr $COLUMNS - 30 2>/dev/null` || fold_width=50
|
2016-02-28 17:14:44 +03:00
|
|
|
AS_REQUIRE_SHELL_FN([config_summary],
|
|
|
|
[AS_FUNCTION_DESCRIBE([config_summary], [NAME, VAL], [configuration summary])],
|
|
|
|
[AS_IF([test -z "$2"], [], [
|
2017-05-03 05:02:50 +03:00
|
|
|
AS_ECHO_N([" * $1: "]) | dd bs=1 count=26 2>/dev/null
|
2016-02-28 17:14:44 +03:00
|
|
|
AS_IF([test "$FOLD"], [
|
2019-06-06 06:03:19 +03:00
|
|
|
echo "$2" | fold -s -w$fold_width |
|
2016-02-28 17:14:44 +03:00
|
|
|
sed '1!s/^/ /;$!s/$/\\/'
|
|
|
|
], [echo "$2"])
|
|
|
|
])]
|
|
|
|
)
|
|
|
|
|
2019-05-25 10:56:26 +03:00
|
|
|
AS_IF([test $install_doc = yes],
|
|
|
|
[DOCTARGETS=`echo " $RDOCTARGET $CAPITARGET " | sed 's/ nodoc //g;s/^ *//;s/ *$//'`],
|
|
|
|
[DOCTARGETS=no])
|
2016-02-28 17:14:42 +03:00
|
|
|
echo "---"
|
2018-12-28 05:12:34 +03:00
|
|
|
echo "Configuration summary for $RUBY_BASE_NAME version $MAJOR.$MINOR.$TEENY"
|
2016-02-28 17:14:42 +03:00
|
|
|
echo ""
|
2016-02-28 17:14:44 +03:00
|
|
|
config_summary "Installation prefix" "$prefix"
|
|
|
|
config_summary "exec prefix" "$exec_prefix"
|
|
|
|
config_summary "arch" "$arch"
|
|
|
|
config_summary "site arch" "$sitearch"
|
|
|
|
config_summary "RUBY_BASE_NAME" "$RUBY_BASE_NAME"
|
|
|
|
config_summary "enable shared" "$enable_shared"
|
|
|
|
config_summary "ruby lib prefix" "$rubylibprefix"
|
|
|
|
config_summary "site libraries path" "$rubysitearchprefix"
|
|
|
|
config_summary "vendor path" "$vendordir"
|
|
|
|
config_summary "target OS" "$target_os"
|
|
|
|
config_summary "compiler" "$CC"
|
2022-04-25 12:48:37 +03:00
|
|
|
config_summary "with thread" "$THREAD_MODEL"
|
2021-03-10 16:13:06 +03:00
|
|
|
config_summary "with coroutine" "$coroutine_type"
|
2016-02-28 17:14:44 +03:00
|
|
|
config_summary "enable shared libs" "$ENABLE_SHARED"
|
|
|
|
config_summary "dynamic library ext" "$DLEXT"
|
|
|
|
config_summary "CFLAGS" "$cflags"
|
|
|
|
config_summary "CPPFLAGS" "$cppflags"
|
|
|
|
config_summary "LDFLAGS" "$LDFLAGS"
|
2018-03-16 04:48:02 +03:00
|
|
|
config_summary "DLDFLAGS" "$DLDFLAGS"
|
2016-02-28 17:14:44 +03:00
|
|
|
config_summary "optflags" "$optflags"
|
|
|
|
config_summary "debugflags" "$debugflags"
|
|
|
|
config_summary "warnflags" "$warnflags"
|
|
|
|
config_summary "strip command" "$STRIP"
|
2019-05-25 10:56:26 +03:00
|
|
|
config_summary "install doc" "$DOCTARGETS"
|
2022-06-13 19:28:28 +03:00
|
|
|
config_summary "MJIT support" "$MJIT_SUPPORT"
|
Rust YJIT
In December 2021, we opened an [issue] to solicit feedback regarding the
porting of the YJIT codebase from C99 to Rust. There were some
reservations, but this project was given the go ahead by Ruby core
developers and Matz. Since then, we have successfully completed the port
of YJIT to Rust.
The new Rust version of YJIT has reached parity with the C version, in
that it passes all the CRuby tests, is able to run all of the YJIT
benchmarks, and performs similarly to the C version (because it works
the same way and largely generates the same machine code). We've even
incorporated some design improvements, such as a more fine-grained
constant invalidation mechanism which we expect will make a big
difference in Ruby on Rails applications.
Because we want to be careful, YJIT is guarded behind a configure
option:
```shell
./configure --enable-yjit # Build YJIT in release mode
./configure --enable-yjit=dev # Build YJIT in dev/debug mode
```
By default, YJIT does not get compiled and cargo/rustc is not required.
If YJIT is built in dev mode, then `cargo` is used to fetch development
dependencies, but when building in release, `cargo` is not required,
only `rustc`. At the moment YJIT requires Rust 1.60.0 or newer.
The YJIT command-line options remain mostly unchanged, and more details
about the build process are documented in `doc/yjit/yjit.md`.
The CI tests have been updated and do not take any more resources than
before.
The development history of the Rust port is available at the following
commit for interested parties:
https://github.com/Shopify/ruby/commit/1fd9573d8b4b65219f1c2407f30a0a60e537f8be
Our hope is that Rust YJIT will be compiled and included as a part of
system packages and compiled binaries of the Ruby 3.2 release. We do not
anticipate any major problems as Rust is well supported on every
platform which YJIT supports, but to make sure that this process works
smoothly, we would like to reach out to those who take care of building
systems packages before the 3.2 release is shipped and resolve any
issues that may come up.
[issue]: https://bugs.ruby-lang.org/issues/18481
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Co-authored-by: Noah Gibbs <the.codefolio.guy@gmail.com>
Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2022-04-19 21:40:21 +03:00
|
|
|
config_summary "YJIT support" "$YJIT_SUPPORT"
|
2016-02-28 17:14:44 +03:00
|
|
|
config_summary "man page type" "$MANTYPE"
|
|
|
|
config_summary "search path" "$search_path"
|
|
|
|
config_summary "static-linked-ext" ${EXTSTATIC:+"yes"}
|
2019-10-20 10:16:54 +03:00
|
|
|
config_summary "BASERUBY -v" "$BASERUBY_VERSION"
|
2016-02-28 17:14:42 +03:00
|
|
|
echo ""
|
|
|
|
echo "---"
|
2018-04-03 11:29:51 +03:00
|
|
|
])
|