mirror of
https://github.com/rbenv/ruby-build.git
synced 2025-09-03 07:41:23 +02:00
The definitions that use `require_gcc` are not compatible with Apple's clang-powered `gcc` and need gcc-4.2 from Homebrew. However, builds using gcc-4.2 fail on Yosemite with a warning: couldn't understand kern.osversion `14.0.0' Although the warning is non-fatal, the build goes to shit from there. It seems that setting the magical value `MACOSX_DEPLOYMENT_TARGET=10.9` makes the build work and doesn't seem to have negative consequences.
38 lines
783 B
Bash
38 lines
783 B
Bash
#!/usr/bin/env bats
|
|
|
|
load test_helper
|
|
export MAKE=make
|
|
|
|
@test "require_gcc on OS X 10.9" {
|
|
stub uname '-s : echo Darwin'
|
|
stub sw_vers '-productVersion : echo 10.9'
|
|
stub gcc '--version : echo 4.2.1'
|
|
|
|
run_inline_definition <<DEF
|
|
require_gcc
|
|
echo CC=\$CC
|
|
echo MACOSX_DEPLOYMENT_TARGET=\${MACOSX_DEPLOYMENT_TARGET-no}
|
|
DEF
|
|
assert_success
|
|
assert_output <<OUT
|
|
CC=${TMP}/bin/gcc
|
|
MACOSX_DEPLOYMENT_TARGET=no
|
|
OUT
|
|
}
|
|
|
|
@test "require_gcc on OS X 10.10" {
|
|
stub uname '-s : echo Darwin'
|
|
stub sw_vers '-productVersion : echo 10.10'
|
|
stub gcc '--version : echo 4.2.1'
|
|
|
|
run_inline_definition <<DEF
|
|
require_gcc
|
|
echo CC=\$CC
|
|
echo MACOSX_DEPLOYMENT_TARGET=\${MACOSX_DEPLOYMENT_TARGET-no}
|
|
DEF
|
|
assert_success
|
|
assert_output <<OUT
|
|
CC=${TMP}/bin/gcc
|
|
MACOSX_DEPLOYMENT_TARGET=10.9
|
|
OUT
|
|
}
|