mirror of
https://github.com/rbenv/ruby-build.git
synced 2025-11-27 14:20:56 +01:00
Merge pull request #1046 from yuichiro-naito/gcc_on_freebsd
gcc is installed on FreeBSD
This commit is contained in:
commit
f6c7d8dfe3
2 changed files with 14 additions and 11 deletions
|
|
@ -1239,14 +1239,17 @@ if [ -n "$noexec" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Work around warnings building Ruby 2.0 on Clang 2.x:
|
# Apply following work around, if gcc is not installed.
|
||||||
# pass -Wno-error=shorten-64-to-32 if the compiler accepts it.
|
if [ -z "$(locate_gcc)" ]; then
|
||||||
#
|
# Work around warnings building Ruby 2.0 on Clang 2.x:
|
||||||
# When we set CFLAGS, Ruby won't apply its default flags, though. Since clang
|
# pass -Wno-error=shorten-64-to-32 if the compiler accepts it.
|
||||||
# builds 1.9.x and 2.x only, where -O3 is default, we can safely set that flag.
|
#
|
||||||
# Ensure it's the first flag since later flags take precedence.
|
# When we set CFLAGS, Ruby won't apply its default flags, though. Since clang
|
||||||
if "${CC:-cc}" -x c /dev/null -E -Wno-error=shorten-64-to-32 &>/dev/null; then
|
# builds 1.9.x and 2.x only, where -O3 is default, we can safely set that flag.
|
||||||
RUBY_CFLAGS="-O3 -Wno-error=shorten-64-to-32 $RUBY_CFLAGS"
|
# Ensure it's the first flag since later flags take precedence.
|
||||||
|
if "${CC:-cc}" -x c /dev/null -E -Wno-error=shorten-64-to-32 &>/dev/null; then
|
||||||
|
RUBY_CFLAGS="-O3 -Wno-error=shorten-64-to-32 $RUBY_CFLAGS"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$MAKE" ]; then
|
if [ -z "$MAKE" ]; then
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ export -n RUBY_CONFIGURE_OPTS
|
||||||
@test "require_gcc on OS X 10.9" {
|
@test "require_gcc on OS X 10.9" {
|
||||||
stub uname '-s : echo Darwin'
|
stub uname '-s : echo Darwin'
|
||||||
stub sw_vers '-productVersion : echo 10.9.5'
|
stub sw_vers '-productVersion : echo 10.9.5'
|
||||||
stub gcc '--version : echo 4.2.1'
|
stub gcc '--version : echo 4.2.1' '--version : echo 4.2.1'
|
||||||
|
|
||||||
run_inline_definition <<DEF
|
run_inline_definition <<DEF
|
||||||
require_gcc
|
require_gcc
|
||||||
|
|
@ -27,7 +27,7 @@ OUT
|
||||||
@test "require_gcc on OS X 10.10" {
|
@test "require_gcc on OS X 10.10" {
|
||||||
stub uname '-s : echo Darwin'
|
stub uname '-s : echo Darwin'
|
||||||
stub sw_vers '-productVersion : echo 10.10'
|
stub sw_vers '-productVersion : echo 10.10'
|
||||||
stub gcc '--version : echo 4.2.1'
|
stub gcc '--version : echo 4.2.1' '--version : echo 4.2.1'
|
||||||
|
|
||||||
run_inline_definition <<DEF
|
run_inline_definition <<DEF
|
||||||
require_gcc
|
require_gcc
|
||||||
|
|
@ -42,7 +42,7 @@ OUT
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "require_gcc silences warnings" {
|
@test "require_gcc silences warnings" {
|
||||||
stub gcc '--version : echo warning >&2; echo 4.2.1'
|
stub gcc '--version : echo warning >&2; echo 4.2.1' '--version : echo warning >&2; echo 4.2.1'
|
||||||
|
|
||||||
run_inline_definition <<DEF
|
run_inline_definition <<DEF
|
||||||
require_gcc
|
require_gcc
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue