aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
Commit message (Collapse)AuthorAgeFilesLines
* Revert AC_PROG_CC_C99 for -std=gnu99 option to gcc 4.8Nobuyoshi Nakada2021-01-181-1/+4
|
* Update for autoconf 2.70Nobuyoshi Nakada2021-01-181-116/+116
|
* Removed unused AC_CHECKINGNobuyoshi Nakada2021-01-181-7/+0
|
* OpenBSD has getentropy, but no sys/random.hKazuhiro NISHIYAMA2021-01-181-0/+1
| | | | | | | | | | | | | https://man.openbsd.org/getentropy Try to fix https://rubyci.s3.amazonaws.com/openbsd-current/ruby-master/log/20210118T023008Z.fail.html.gz ``` compiling random.c random.c:53:11: fatal error: 'sys/random.h' file not found # include <sys/random.h> ^~~~~~~~~~~~~~ 1 error generated. ```
* random generator update for Mac proposalDavid CARLIER2021-01-171-0/+1
| | | | | using getentropy for seeding, reading 256 bytes at a time to avoid the EIO errno since this is the maximum.
* configure.ac: disable using __builtin_setjmp on ARM AndroidYusuke Endoh2021-01-051-0/+6
| | | | A patch from Tee KOBAYASHI <xtkoba+ruby@gmail.com>. [Bug #17511]
* configure.ac: Stop auto-detection of __ANDROID_API__ when cross-compilingYusuke Endoh2021-01-051-5/+7
| | | | A patch from Tee KOBAYASHI <xtkoba+ruby@gmail.com>. [Bug #17491]
* Disable DTrace in FreeBSD (#3999)TAKANO Mitsuhiro2020-12-251-0/+3
| | | The latest ruby cannot compile with FreeBSD Dtrace enabled.
* configure.ac: Make it possible to build on Android TermuxYusuke Endoh2020-12-251-11/+4
| | | | | | | | | | | | The recent Termux's clang predefines `__ANDROID_API__` as a fixed number 24. However, when it is lower to the current device version, some functions that "configure" detemines available are not declared correctly in the header files. This change forces to overwrite the predefined `__ANDROID_API__` macro with the current device version. ref: https://github.com/termux/termux-packages/issues/6176
* On Solaris, _XOPEN_SOURCE should be undefined for C++ sources.Naohisa Goto2020-12-211-0/+2
|
* configure.ac: avoid squashing CXX=g++卜部昌平2020-12-161-3/+5
| | | | | We are discussing this issue at [Bug #17337] but in the meantime, leave this questionable autoconf glitch as-is to save sassc and eventmachine.
* Haiku: disable stack-protectorZoltán Mizsei2020-12-151-1/+1
|
* Add Haiku to the context support listZoltán Mizsei2020-12-151-0/+3
|
* Removed obsolete autoconf checksNobuyoshi Nakada2020-12-121-3/+3
| | | | | | | Use regular `AC_CHECK_MEMBERS` instead of: * `AC_STRUCT_ST_BLKSIZE` * `AC_STRUCT_ST_BLOCKS` * `AC_STRUCT_ST_RDEV`
* Signal handler type should be voidNobuyoshi Nakada2020-12-121-1/+0
|
* Omit checks for C89 standard or laterNobuyoshi Nakada2020-12-121-72/+0
| | | | | | | | | | Now we require C99, these features available of course. * prototypes * stdarg prototypes * token pasting * stringization * string literal concatenation
* Link zlib always if availableYusuke Endoh2020-12-111-3/+1
| | | | | | | | | | | | | | | Major Linux distribution packages including Debian, Ubuntu, and Fedora use `--compress-debug-sections=no` to build ruby, and then extract and compress debug symbols as separate files. However, the configure option makes ruby not link zlib, thus the generated binary cannot uncompress the compressed separate debug symbol files, and fails to show C level backtrace when a critical error like segfault occurs. This change makes ruby always link zlib if it is available so that it can show C level backtrace correctly. Related: Debian packages require https://github.com/ruby/ruby/pull/3627 to load debug symbol files.
* Revert getaddrinfo_a()Masaki Matsushita2020-12-071-2/+0
| | | | | | | | getaddrinfo_a() gets stuck after fork(). To avoid this, we need 1 second sleep to wait for internal worker threads of getaddrinfo_a() to be finished, but that is unacceptable. [Bug #17220] [Feature #17134] [Feature #17187]
* Add a hook before fork() for getaddrinfo_a()Masaki Matsushita2020-12-041-0/+2
| | | | | | | | | We need stop worker threads in getaddrinfo_a() before fork(). This change adds a hook before fork() that cancel all outstanding requests and wait for all ongoing requests. Then, it waits for all worker threads to be finished. Fixes [Bug #17220]
* configure.ac: Check x86intrin.h only when the target CPU is x86Yusuke Endoh2020-11-271-1/+3
| | | | | | | | | | | | | | | | The check output a warning on M1 Mac mini http://rubyci.s3.amazonaws.com/osx1100arm/ruby-master/log/20201127T074507Z.log.html.gz ``` checking x86intrin.h usability... no checking x86intrin.h presence... yes configure: WARNING: x86intrin.h: present but cannot be compiled configure: WARNING: x86intrin.h: check for missing prerequisite headers? configure: WARNING: x86intrin.h: see the Autoconf documentation configure: WARNING: x86intrin.h: section "Present But Cannot Be Compiled" configure: WARNING: x86intrin.h: proceeding with the compiler's result checking for x86intrin.h... no ```
* Check if _FORTIFY_SOURCE really worksNobuyoshi Nakada2020-11-231-1/+2
| | | | | i686-pc-cygwin gcc 6.4.0 seems broken around ssp.h, when compiling with both of optimization and _FORTIFY_SOURCE.
* [Bug #17021] Make host_* values consistent with target_*Nobuyoshi Nakada2020-11-211-1/+6
|
* configure.ac: fix for upcoming autoconf-2.70Sergei Trofimovich2020-11-171-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The failure initially noticed on `autoconf-2.69d` (soon to become 2.70): ``` $ ./configure ./configure: line 8720: syntax error near unexpected token `fi' ./configure: line 8720: `fi' ``` Before the change generated `./configure ` snippet looked like: ``` if ! $CC -E -xc - <<SRC >/dev/null then : #if defined __APPLE_CC__ && defined __clang_major__ && __clang_major__ < 3 #error premature clang #endif SRC as_fn_error $? "clang version 3.0 or later is required" "$LINENO" 5 fi ``` Note the newline that breaks here-document syntax. After the change the snippet does not use here-document. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Removed canonicalization for mathnNobuyoshi Nakada2020-11-101-4/+2
|
* No longer need libtoolNobuyoshi Nakada2020-10-061-7/+0
| | | | | As debug_counter.c has had a global symbol since cdc614cd0a21, ranlib should no longer complain that it has no symbols.
* Do not use clang on cygwinNobuyoshi Nakada2020-09-281-1/+1
| | | | | | Its `__has_declspec_attribute()` is not reliable. For instance, while `__has_declspec_attribute(noalias)` is true but 'noalias' attribute is warned as unknown.
* RBIMPL_ALIGNOF: do not use __alignof__卜部昌平2020-09-251-20/+38
| | | | | | | | | | | | | It is reported that on a system of i386 System V ABI, GCC returns 8 for __alignof__(double). OTOH the ABI defines alignments of double to be 4, and ISO/IEC 9899:2011 reads that _Alignof(double) shall return 4 on such machine. What we want in ruby is 4 instead of 8 there. We cannot use __alignof__. Additionally, both old GCC / old clang return 8 for _Alignof(double) on such platforms. They are their bugs, and already fixed in recent versions. But we have to support older compilers for a while. Shall check sanity of _Alignof.
* rb_cv_have_alignas: not used any longer卜部昌平2020-09-251-28/+0
| | | | | | Availability of `alignas` is checked in include/ruby/internal/stdalign.h now. That does not need this configure check. Also as commented in the header, we see `_Alignas` being inadequate for our purpose.
* Fix compile-time check for copy_file_range(2)Masaki Matsushita2020-09-121-3/+6
| | | | | | * close fds properly * define USE_COPY_FILE_RANGE if HAVE_COPY_FILE_RANGE is defined * avoid errors on cross-compiling environments
* Check copy_file_range(2) is actually supported.Masaki Matsushita2020-09-121-0/+36
| | | | see also: https://gitlab.com/gitlab-org/gitlab/-/issues/218999#note_363225872
* configure: detect that there is no g++卜部昌平2020-09-031-0/+8
| | | | | | | | | AC_PROG_CXX checks for several C++ compilers INCLUDING g++. When none of them were found it sets the CXX variable to be g++. This doesn't make any sense. Absense of g++ has already been made sure. Because we don't want insanity (that's the whole reason we test the environment using autoconf), we need to swipe such insane variable out.
* Fix pthread_setname_np arguments on NetBSDJeremy Evans2020-09-011-2/+2
| | | | | | | | | | The previous attempt to fix this in b87df1bf243074edb2e6cc8a24bc00df81cebf3c reversed the argument order instead of just fixing the quote escaping. From Takahiro Kambe. Fixes [Bug #15178]
* congigure.ac: favour gcc on Linux卜部昌平2020-09-011-1/+3
| | | | Requested by Naruse.
* DEPRECATED_TYPE: is deprecated卜部昌平2020-08-271-1/+0
| | | | Nobody uses this macro any longer.
* configure.ac: suppress more Sun C warnings.卜部昌平2020-08-221-2/+11
| | | | They are rather annoying than being useful to us.
* configure.ac: more checks on STRIP卜部昌平2020-08-221-6/+13
| | | | | STRIP now depends on compilers, not on OS. Previous check against $target_os does no longer work.
* configure.ac: rule out old Sun C++卜部昌平2020-08-221-0/+14
| | | | | CI failures observed for old Sun C++. We don't want to hustle, as newer versions are okay. Just check the sanity and rule out insane compilers.
* protect CFLAGS from being smashed by AC_PROG_CC卜部昌平2020-08-221-0/+6
| | | | | | | | AC_PROG_CC_C99 calls AC_PROC_CC, which calls _AC_PROG_CC_G, which sets default CFLAGS, whose contents are not customisable. We don't welcome this behaviour. The exact same thing happens for CXXFLAGS in AC_PROG_CXX.
* configure.ac: try GCC-provided ld卜部昌平2020-08-211-1/+1
| | | | | | | | | | | In case of cross-compilation, GCC might provide its own linker. Its behaviour seems slightly different from that of gcc(1). This is not a big deal for normal situations, but the difference can cause libtool to go mad. We ship bundled libffi for windows users, and libffi uses libtool. If we use cross-compiler version of gcc instead of its ld conterpart, we fail to compile fiddle. That should not be what we want.
* AC_PROG_CXXCPP: remove卜部昌平2020-08-211-1/+0
| | | | Caused CI failures on environments without sane C++ compilers.
* configure.ac: move program_transform_name卜部昌平2020-08-211-14/+13
| | | | | | | | | Historically `$program_transform_name` has been put in front of `AC_CANONICAL_TARGET`. Previous commit changes it, which affects the name of generated ruby binary when cross-compiling. I _guess_ the historical behaviour is a bug (name of ruby binary shall honour --target configure option I think), but anyways here I preserve that questionable way.
* configure.ac: use compiler-provided toolchains卜部昌平2020-08-211-71/+91
| | | | | | | | | These days as link-time optimisations spread accross compilers, they tend to ship their own version of ld, ar, etc. Why not detect such things if any. Users can select compilers by ./configure --with-gcc= whatever, or select individual tool by e.g. ./configure NM=whatever. The added AC_ARG_VAR macros enrich ./configure --help output.
* Share the size for sigaltstack between configure.ac and signal.cNobuyoshi Nakada2020-07-221-2/+3
|
* configure.ac: Bump the size of sigaltstackJake Zimmerman2020-07-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RubyVM uses C macro defines to feature detect whether `backtrace(2)` support is available, and if so it includes C level backtraces when the RubyVM itself crashes. But on my machine, C level backtraces from `vm_dump.c` didn't work when using a version of Ruby buillt on the machine, but worked fine when using a version of Ruby built on another machine and copied to my machine. The default autoconf test for backtraces uses a sigaltstack size that is too small, so the SIGSEGV signal handler itself causes a SIGSEGV). I noticed that signal.c uses a larger sigaltstack size: https://github.com/ruby/ruby/blob/v2_6_5/signal.c#L568 The specific variables it looks at: - `HAVE_BACKTRACE` this is a macro defined by autoconf because there is a line in the configure script like `AC_CHECK_FUNCS(backtrace)` (see the autoconf docs for more). - `BROKEN_BACKTRACE` this comes from a custom program that Ruby's configure script runs to attempt to figure out whether actually using backtrace(2) in a real program works. You can see the autoconf program here. <https://github.com/ruby/ruby/blob/v2_6_5/configure.ac#L2817-L2863> It uses sigaltstack and SA_ONSTACK to create a seperate stack for handling signals. The problem was: SIGSTKSZ (which comes from a system header!) was not suggesting a large enough stack size. When checking on an Ubuntu 16.04 box, we found that SIGSTKSZ was 8192 and MINSIGSTKSZ was 2048.
* Bail out when unsupported coroutine targetNobuyoshi Nakada2020-07-091-4/+7
|
* Fix build error on Apple silicon macOSWatson2020-07-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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(&current->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 ```
* No GITPULLOPTIONS by defaultNobuyoshi Nakada2020-06-041-1/+1
| | | | | To honor the environment variable, keep GITPULLOPTIONS unset by default, and appended the option to VCSUP.
* Check that BASERUBY is at least Ruby 2.2 in configureJeremy Evans2020-05-281-1/+1
| | | | | | | | | | | | | | BASERUBY needs to be at least Ruby 2.2 since 46acd0075d80c2f886498f089fde1e9d795d50c4. I think it's better to explicitly fail early as soon as BASERUBY is used in this case, versus trying to debug later failures. This modifies things to check both implicitly use of ruby in the PATH as BASERUBY, and explicitly specified older versions of ruby when using --with-baseruby. Fixes [Bug #16668]
* Allow Dir.home to work for non-login procs when $HOME not setAlan D. Salewski2020-05-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow the 'Dir.home' method to reliably locate the user's home directory when all three of the following are true at the same time: 1. Ruby is running on a Unix-like OS 2. The $HOME environment variable is not set 3. The process is not a descendant of login(1) (or a work-alike) The prior behavior was that the lookup could only work for login-descended processes. This is accomplished by looking up the user's record in the password database by uid (getpwuid_r(3)) as a fallback to the lookup by name (getpwname_r(3)) which is still attempted first (based on the name, if any, returned by getlogin_r(3)). If getlogin_r(3), getpwnam_r(3), and/or getpwuid_r(3) is not available at compile time, will fallback on using their respective non-*_r() variants: getlogin(3), getpwnam(3), and/or getpwuid(3). The rationale for attempting to do the lookup by name prior to doing it by uid is to accommodate the possibility of multiple login names (each with its own record in the password database, so each with a potentially different home directory) being mapped to the same uid (as is explicitly allowed for by POSIX; see getlogin(3posix)). Preserves the existing behavior for login-descended processes, and adds the new capability of having Dir.home being able to find the user's home directory for non-login-descended processes. Fixes [Bug #16787] Related discussion: https://bugs.ruby-lang.org/issues/16787 https://github.com/ruby/ruby/pull/3034
* Search pkg-config with ac_tool_prefix [Bug #16909]Nobuyoshi Nakada2020-05-231-2/+5
| | | | | Should prefer a prefixed version over the bare pkg-config for cross compiling.