build/support/cplusplus.rb
def run_compiler(*command)
  PhusionPassenger.require_passenger_lib 'utils/ansi_colors' if !defined?(PhusionPassenger::Utils::AnsiColors)
  show_command = command.join(' ')
  puts show_command
  if !system(*command)
    colors = PhusionPassenger::Utils::AnsiColors.new
    if $? && $?.exitstatus == 4
      # This probably means the compiler ran out of memory.
      msg = "<b>" +
            "-----------------------------------------------\n" +
            "Your compiler failed with the exit status 4. This " +
            "probably means that it ran out of memory. To solve " +
            "this problem, try increasing your swap space: " +
            "https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04" +
            "</b>"
      fail(colors.ansi_colorize(msg))
    elsif $? && $?.termsig == 9
      msg = "<b>" +
            "-----------------------------------------------\n" +
            "Your compiler was killed by the operating system. This " +
            "probably means that it ran out of memory. To solve " +
            "this problem, try increasing your swap space: " +
            "https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04" +
            "</b>"
      fail(colors.ansi_colorize(msg))
    else
      fail "Command failed with status (#{$? ? $?.exitstatus : 1}): [#{show_command}]"
    end
  end
end
# Rake functions for compiling/linking C++ stuff.
Rake functions for compiling/linking C++ stuff.
Rake functions for compiling / linking C ++ stuff .
def run_compiler(*command)
  PhusionPassenger.require_passenger_lib 'utils/ansi_colors' if !defined?(PhusionPassenger::Utils::AnsiColors)
  show_command = command.join(' ')
  puts show_command
  if !system(*command)
    colors = PhusionPassenger::Utils::AnsiColors.new
    if $? && $?.exitstatus == 4
      msg = "<b>" +
            "-----------------------------------------------\n" +
            "Your compiler failed with the exit status 4. This " +
            "probably means that it ran out of memory. To solve " +
            "this problem, try increasing your swap space: " +
            "https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04" +
            "</b>"
      fail(colors.ansi_colorize(msg))
    elsif $? && $?.termsig == 9
      msg = "<b>" +
            "-----------------------------------------------\n" +
            "Your compiler was killed by the operating system. This " +
            "probably means that it ran out of memory. To solve " +
            "this problem, try increasing your swap space: " +
            "https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04" +
            "</b>"
      fail(colors.ansi_colorize(msg))
    else
      fail "Command failed with status (#{$? ? $?.exitstatus : 1}): [#{show_command}]"
    end
  end
end
def run_compiler ( * command ) PhusionPassenger . require_passenger_lib 'utils/ansi_colors' if ! defined? ( PhusionPassenger :: Utils :: AnsiColors ) show_command = command . join ( ' ' ) puts show_command if ! system ( * command ) colors = PhusionPassenger :: Utils :: AnsiColors . new if $? && $? . exitstatus == 4 msg = "<b>" + "-----------------------------------------------\n" + "Your compiler failed with the exit status 4. This " + "probably means that it ran out of memory. To solve " + "this problem, try increasing your swap space: " + "https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04" + "</b>" fail ( colors . ansi_colorize ( msg ) ) elsif $? && $? . termsig == 9 msg = "<b>" + "-----------------------------------------------\n" + "Your compiler was killed by the operating system. This " + "probably means that it ran out of memory. To solve " + "this problem, try increasing your swap space: " + "https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04" + "</b>" fail ( colors . ansi_colorize ( msg ) ) else fail "Command failed with status (#{$? ? $?.exitstatus : 1}): [#{show_command}]" end end end
Rake functions for compiling/linking C++ stuff.
Rake functions for compiling / linking C ++ stuff .
# This probably means the compiler ran out of memory.
command