Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ The build process may be configured through the following environment variables:
| `RUBY_BUILD_ROOT` | The path prefix to search for build definitions files. *Deprecated:* use `RUBY_BUILD_DEFINITIONS`|
| `RUBY_BUILD_VENDOR_OPENSSL` | Build and vendor openssl even if the system openssl is compatible |
| `CC` | Path to the C compiler. |
| `RUBY_CFLAGS` | Additional `CFLAGS` options (_e.g.,_ to override `-O3`). |
| `RUBY_CFLAGS` | Overrides Ruby's default `CFLAGS`, including `-O3` (beware: without a `-O` flag Ruby is built unoptimized). To add flags, use `RUBY_CONFIGURE_OPTS=cflags=...` instead |
| `CONFIGURE_OPTS` | Additional `./configure` options. |
| `MAKE` | Custom `make` command (_e.g.,_ `gmake`). |
| `MAKE_OPTS` / `MAKEOPTS` | Additional `make` options. |
Expand Down
12 changes: 10 additions & 2 deletions bin/ruby-build
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,11 @@ build_package_standard() {
#
# TODO: Consider changing this to check for GCC v15 specifically
# rather than inspecting the OS itself.
export CFLAGS="-std=gnu17 $CFLAGS"

# Use the cflags configure variable, which Ruby's configure appends to
# its default optflags/debugflags/warnflags, unlike CFLAGS which would
# override them and notably lose the -O3, producing a -O0 Ruby.
export cflags="-std=gnu17 $cflags"
fi
# ./configure --prefix=/path/to/ruby
# shellcheck disable=SC2086,SC2153
Expand Down Expand Up @@ -1169,7 +1173,11 @@ homebrew_openssl_versions() {
# Example: 3.1.23 -> 30123
# See also osx_version, require_java
normalize_semver() {
awk -F. '{print $1 * 10000 + $2 * 100 + $3}' <<<"$1"
if [ "$1" = "dev" ]; then
echo 99999999
else
awk -F. '{print $1 * 10000 + $2 * 100 + $3}' <<<"$1"
fi
}

# Checks if system OpenSSL does NOT satisfy the version requirement
Expand Down