-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path2.3.8
More file actions
58 lines (54 loc) · 2.59 KB
/
Copy path2.3.8
File metadata and controls
58 lines (54 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Old config.guess isn't arm64-aware. Pull a new one in from automake.
build_package_freshen_automake_config() {
if type -p brew >/dev/null; then
{
mv tool/config.guess tool/config.guess.dist
mv tool/config.sub tool/config.sub.dist
} >&4 2>&1
fi
}
install_bundler() {
"$PREFIX_PATH"/bin/gem install bundler:1.17.3
}
# -O3 because leaving this empty does not mean "use configure's default". ruby-build
# exports it as CFLAGS, which supersedes configure's own optflags, so an empty value builds
# at -O0 — measured 2.6-3.5x slower than the same source at -O3. (rbconfig still reports
# optflags: -O3 in that case, which is misleading; the timings are what to trust.)
#
# -fno-strict-overflow guards the fixnum overflow checks in these old sources, which assume
# signed overflow wraps — undefined behaviour that GCC exploits from -O2 up. On 1.8.7 its
# absence silently makes 2**64 evaluate to 0. Kept uniform across every definition here;
# it costs nothing measurable.
RUBY_CFLAGS="-O3 -fno-strict-overflow"
case "$(cc -v 2>&1)" in
*gcc*)
RUBY_CFLAGS+=" -Wno-discarded-qualifiers"
RUBY_CFLAGS+=" -Wno-implicit-int"
RUBY_CFLAGS+=" -Wno-incompatible-pointer-types"
RUBY_CFLAGS+=" -Wno-int-conversion"
RUBY_CFLAGS+=" -Wno-return-type"
# GCC 15 porting: Use -std=gnu99 with relaxed type checking
RUBY_CFLAGS+=" -std=gnu99 -Wno-error=implicit-function-declaration"
;;
*clang*)
RUBY_CFLAGS+=" -Wno-compound-token-split-by-macro"
RUBY_CFLAGS+=" -Wno-implicit-function-declaration"
RUBY_CFLAGS+=" -Wno-implicit-int"
RUBY_CFLAGS+=" -Wno-incompatible-function-pointer-types"
RUBY_CFLAGS+=" -Wno-int-conversion"
RUBY_CFLAGS+=" -Wno-return-type"
;;
esac
export RUBY_CFLAGS
# M1-compatible OpenSSL 1.0 from https://github.com/basecamp/homebrew-dev
if type -p brew >/dev/null; then
brew install basecamp/dev/openssl@1.0
openssl_prefix_path="$(brew --prefix basecamp/dev/openssl@1.0)"
package_option ruby configure --with-openssl-dir="$openssl_prefix_path"
export PKG_CONFIG_PATH="$openssl_prefix_path/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
else
install_package "openssl-1.0.2u" "https://www.openssl.org/source/openssl-1.0.2u.tar.gz#ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16" openssl --if needs_openssl:0.9.6-1.0.x
fi
package_option ruby configure --with-out-ext=tk --disable-install-doc
install_package "ruby-2.3.8" "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.8.tar.bz2#4d1a3a88e8cf9aea624eb73843fbfc60a9a281582660f86d5e4e00870397407c" freshen_automake_config ldflags_dirs standard verify_openssl
install_bundler