Skip to content

Commit

Permalink
add extra checks for older clang on osx, closes #1660
Browse files Browse the repository at this point in the history
  • Loading branch information
mpapis committed Mar 25, 2013
1 parent 07068f8 commit 4b7e665
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion scripts/functions/build_config
Expand Up @@ -5,7 +5,7 @@ __rvm_setup_compile_environment()
typeset __type
typeset -a __types
__types=(
setup requirements osx_gcc architectures gcc47 bison smartos sunos openbsd
setup requirements osx_gcc osx_clang architectures gcc47 bison smartos sunos openbsd
auto_conf_make flags_docs flags_tcltk flags_shared_static flags_threads
)
for __type in "${__types[@]}"
Expand Down Expand Up @@ -110,6 +110,47 @@ __rvm_setup_compile_environment_osx_gcc()
fi
}

__rvm_setup_compile_environment_osx_clang_installed() [[ -x /usr/bin/clang ]]

__rvm_setup_compile_environment_osx_clang_latest()
{
typeset __clang_version
__clang_version="$( /usr/bin/clang --version | grep -oE "clang-\d+\.\d+\.\d+" )" || return $?
__clang_version="${__clang_version#clang-}"
__rvm_version_compare "${__clang_version:-0}" -ge "425.0.24" || return $?
true # for osx
}

__rvm_setup_compile_environment_osx_clang()
{
[[ "Darwin" == "$(uname)" ]] || return 0

if
[[ "$( __rvm_found_compiler )" =~ "clang" ]]
then
if
__rvm_version_compare "${_system_version}" -ge 10.7
then
__rvm_setup_compile_environment_osx_clang_installed ||
rvm_requiremnts_fail_or_run_action \
"Can not find 'Command Line Tools for Xcode',
You should install the latest version from: http://connect.apple.com" \
true || return $?

__rvm_setup_compile_environment_osx_clang_latest ||
rvm_requiremnts_fail_or_run_action \
"Found older 'Command Line Tools for Xcode',
You should install the latest version from: http://connect.apple.com" \
true || return $?
else
rvm_requiremnts_fail_or_run_action \
"You are using 'clang' which is known to be buggy on older OSX (like: ${_system_version}).
Make sure 'gcc-4.2' is available and try again." \
true || return $?
fi
fi
}

__rvm_setup_compile_environment_bison()
{
(( ${rvm_autolibs_flag_number} > 1 )) || return 0
Expand Down

0 comments on commit 4b7e665

Please sign in to comment.