Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix missing compiler for binary rubies, fix #1372

  • Loading branch information...
commit 43c6a4a4336ef9d030dc058ca6fd4be292336d0c 1 parent f300985
@mpapis mpapis authored
Showing with 25 additions and 0 deletions.
  1. +4 −0 scripts/external
  2. +21 −0 scripts/functions/build
View
4 scripts/external
@@ -1,6 +1,8 @@
#!/usr/bin/env bash
source "$rvm_scripts_path/base"
+source "$rvm_scripts_path/functions/build"
+
external_automount()
{
@@ -119,6 +121,7 @@ external_mount()
__rvm_gemsets_initial
)
+ __rvm_fix_gcc_path "$rvm_rubies_path"
__rvm_ruby_config_save "$ruby_path" "$rvm_rubies_path/$rvm_ruby_string/config"
__rvm_fix_group_permissions "$rvm_rubies_path/$rvm_ruby_string"
__rvm_record_install "$rvm_ruby_string"
@@ -366,6 +369,7 @@ external_import_setup()
rvm_create_flag=1 __rvm_use
__rvm_bin_script # environment + wrappers
+ __rvm_fix_gcc_path "$rvm_rubies_path"
__rvm_gemsets_initial
__rvm_ruby_config_save "$rvm_rubies_path/$rvm_ruby_string/bin/ruby" "$rvm_rubies_path/$rvm_ruby_string/config"
__rvm_record_install "$rvm_ruby_string"
View
21 scripts/functions/build
@@ -31,6 +31,27 @@ __rvm_found_compiler()
__rvm_selected_compiler || \which gcc 2>/dev/null
}
+__rvm_fix_gcc_path()
+{
+ typeset __config_file __cc_value __cc_new
+ __rvm_which $(
+ "$rvm_ruby_home/bin/ruby" -rrbconfig -e 'puts RbConfig::CONFIG["CC"]||"true"' 2>/dev/null
+ ) >/dev/null 2>/dev/null ||
+ {
+ __cc_value="$( "$rvm_ruby_home/bin/ruby" -rrbconfig -e 'puts RbConfig::CONFIG["CC"]' 2>/dev/null )"
+ if
+ __config_file="$( find $rvm_ruby_home/ -name rbconfig.rb )" &&
+ GREP_OPTIONS="" \grep "CONFIG\[\"CC\"\]" "${__config_file}" >/dev/null
+ then
+ __cc_new="$( __rvm_found_compiler )"
+ rvm_debug "Fixing ruby compiler from '${__cc_value}' to '${__cc_new}'."
+ sed -i'' "s#CONFIG\[\"CC\"\].*$#CONFIG\[\"CC\"\] = ENV[\"CC\"] || \"${__cc_new}\"#" "${__config_file}"
+ else
+ rvm_warn "Installed ruby contains path to non existing compiler '${__config_file}', compiling native gems might be impossible."
+ fi
+ }
+}
+
__rvm_run_compiler()
{
typeset compiler
Please sign in to comment.
Something went wrong with that request. Please try again.