Permalink
Browse files

make sure -O3 is used when compiling with CFLAGS, fix #1418

  • Loading branch information...
1 parent 1999359 commit a77e2f6e18333bfa01feadd3f16ecced259fdbf0 @mpapis mpapis committed Jan 7, 2013
Showing with 32 additions and 0 deletions.
  1. +1 −0 scripts/functions/manage/base
  2. +31 −0 scripts/functions/support
@@ -224,6 +224,7 @@ __rvm_install_source()
then rvm_configure_flags=( ${=db_configure_flags} "${rvm_configure_flags[@]}" )
else rvm_configure_flags=( ${db_configure_flags} "${rvm_configure_flags[@]}" )
fi
+ __rvm_array_prepend_or_ignore rvm_configure_env CFLAGS= " " "-O3"
__rvm_log_command "configure" "$rvm_ruby_string - #configuring" \
"${rvm_configure_env[@]}" ./configure "${rvm_configure_flags[@]}" ||
{
View
@@ -102,6 +102,37 @@ __rvm_array_add_or_update()
eval "${_array_name}=( \"\${_array_value_new[@]}\" )"
}
+__rvm_array_prepend_or_ignore()
+{
+ typeset _array_name _variable _separator _value _local_value
+ typeset -a _array_value_old _array_value_new
+
+ _array_name="$1"
+ _variable="$2"
+ _separator="$3"
+ _value="$4"
+ _array_value_new=()
+ eval "_array_value_old=( \"\${${_array_name}[@]}\" )"
+
+ case " ${_array_value_old[*]} " in
+ (*[[:space:]]${_variable}*)
+ for _local_value in "${_array_value_old[@]}"
+ do
+ case "${_local_value}" in
+ (${_variable}*)
+ rvm_debug "__rvm_array_prepend_or_ignore ${_array_name} ${_variable}\"${_value}${_separator}${_local_value#${_variable}}\""
+ _array_value_new+=( "${_variable}${_value}${_separator}${_local_value#${_variable}}" )
+ ;;
+ (*)
+ _array_value_new+=( "${_local_value}" )
+ ;;
+ esac
+ done
+ eval "${_array_name}=( \"\${_array_value_new[@]}\" )"
+ ;;
+ esac
+}
+
# Drop in replacement for sed -i compatible with OpenBSD
# Assumes that filename is the first argument, all others are passed onto sed
__rvm_sed_i()

0 comments on commit a77e2f6

Please sign in to comment.