Skip to content

Commit

Permalink
Merge branch 'archflags'
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneeseguin committed Jan 3, 2011
2 parents a74c685 + 9a2ecc8 commit c1cc589
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
4 changes: 4 additions & 0 deletions scripts/cli
Expand Up @@ -303,6 +303,10 @@ __rvm_parse_args()
rvm_patch_original_pwd="$PWD"
;;

--arch)
rvm_architectures="${rvm_architectures} $1" ; shift
;;

--head) rvm_head_flag=1 ;;

--static) rvm_static_flag=1 ;;
Expand Down
10 changes: 6 additions & 4 deletions scripts/manage
Expand Up @@ -234,7 +234,7 @@ __rvm_install_source()
fi
fi

local configure_command="./configure --prefix=$rvm_ruby_home ${db_configure_flags:-""} ${rvm_configure_flags:-""} ${configure_parameters:-""}"
local configure_command="${rvm_configure_env:-""} ./configure --prefix=$rvm_ruby_home ${db_configure_flags:-""} ${rvm_configure_flags:-""} ${configure_parameters:-""}"

__rvm_run "configure" "$configure_command" "$rvm_ruby_string - #configuring "
result=$?
Expand Down Expand Up @@ -629,7 +629,7 @@ RubyWrapper

rvm_configure_flags="${rvm_configure_flags:-"--skip-system"}"

rvm_ruby_configure="$rvm_path/wrappers/$ruby/ruby ./configure --prefix=$rvm_ruby_home $db_configure_flags $rvm_configure_flags"
rvm_ruby_configure="$rvm_path/wrappers/$ruby/ruby ${rvm_configure_env:-""} ./configure --prefix=$rvm_ruby_home $db_configure_flags $rvm_configure_flags"
message="$rvm_ruby_string - #configuring"

if [[ "$rvm_llvm_flag" = "0" ]] ; then
Expand Down Expand Up @@ -743,7 +743,7 @@ RubyWrapper
;;
*)
__rvm_run "nailgun" \
"builtin cd \"${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string/tool/nailgun\" && ./configure --prefix=$rvm_ruby_home && make $rvm_make_flags" \
"builtin cd \"${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string/tool/nailgun\" && ${rvm_configure_env:-""} ./configure --prefix=$rvm_ruby_home && make $rvm_make_flags" \
"Building Nailgun"
;;
esac
Expand Down Expand Up @@ -1119,7 +1119,7 @@ RubyWrapper
fi

elif [[ -s ./configure ]] ; then
local configure_command="./configure --prefix=$rvm_ruby_home $rvm_configure_flags"
local configure_command="${rvm_configure_env:-""} ./configure --prefix=$rvm_ruby_home $rvm_configure_flags"

__rvm_run "configure" "$configure_command" \
"Configuring $rvm_ruby_string using $rvm_configure_flags, this may take a while depending on your cpu(s)..."
Expand Down Expand Up @@ -2092,6 +2092,8 @@ __rvm_manage_rubies()
rvm_ruby_gem_home="${rvm_ruby_gem_home:-""//${rvm_gemset_separator:-"@"}*}"
rvm_ruby_string="${rvm_ruby_string:-""//${rvm_gemset_separator:-"@"}*}"

__rvm_setup_compile_environment

# Given list of ruby strings.
if [[ -n "${rubies_string:-""}" ]] ;then

Expand Down
4 changes: 3 additions & 1 deletion scripts/package
Expand Up @@ -5,6 +5,8 @@ if [[ "$rvm_trace_flag" -eq 2 ]] ; then set -x ; export rvm_trace_flag ; fi
rvm_base_except="selector"
source "$rvm_path/scripts/base"

__rvm_setup_compile_environment

install_package()
{
__rvm_db "${package}_url" "package_url"
Expand Down Expand Up @@ -70,7 +72,7 @@ install_package()
fi

__rvm_run "$package/configure" \
"${configure:-"./configure --prefix=\"${prefix_path:-"$usr_path"}\""} $configure_flags" \
"${configure:-"${rvm_configure_env:-""} ./configure --prefix=\"${prefix_path:-"$usr_path"}\""} ${rvm_configure_flags:-""} $configure_flags" \
"Configuring $package in $src_path/$package-$version."

unset configure_flags
Expand Down
14 changes: 14 additions & 0 deletions scripts/utility
Expand Up @@ -940,6 +940,20 @@ __rvm_inspect()
return 0
}

__rvm_setup_compile_environment()
{
if [[ "Darwin" = "$(uname)" ]]; then
local architectures="${rvm_architectures:-"-arch i386 -arch x86_64"}"
rvm_configure_env="${rvm_configure_env} MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion | awk -F'.' '{print $1"."$2}')"
rvm_configure_env="${rvm_configure_env} CFLAGS='$architectures -g -Os -pipe -no-cpp-precomp'"
rvm_configure_env="${rvm_configure_env} CCFLAGS='$architectures -g -Os -pipe'"
rvm_configure_env="${rvm_configure_env} CXXFLAGS='$architectures -g -Os -pipe'"
rvm_configure_env="${rvm_configure_env} LDFLAGS='$architectures -bind_at_load'"
rvm_configure_env="${rvm_configure_env} LDSHARED='$architectures cc -dynamiclib -undefined suppress -flat_namespace'"
fi
export rvm_configure_env
}

# Attempt to override the Darwin build settings for rubies
# This should only be used in extreme edge cases that
# will not work via the default way.
Expand Down

0 comments on commit c1cc589

Please sign in to comment.