#! /bin/bash

function solve_gpp() {
source script/show_solutions
source script/discover_package_manager
discover_package_manager $1
pcman=$discover_package_manager_ret

if [ x"$pcman" = x"" ]; then
        exit 1
fi

if [ x"$1" = x"osx" ]; then
        commands[0]="$pcman install gcc49"
        commands[1]="echo \"Continue without installing\""
        possible_solutions "${commands[@]}"
        compiler_opt=" CXX=g++-4.9 CC=gcc-4.9  "
        compiler_gcc="gcc-4.9"
        compiler_gpp="g++-4.9"
elif [ x"$1" = x"linux"  ]; then

	if [ x"$pcman" == x"pacman" ]; then
          commands[0]="su -c \"$pcman -Sy gcc sudo make\""
          commands[1]="sudo $pcman -Sy gcc make"
          possible_solutions "${commands[@]}"
          compiler_gcc="gcc"
          compiler_gpp="g++"
        elif [ x"$pcman" == x"yum" -o x"$pcman" == x"zypper" ]; then
          commands[0]="su -c \"$pcman install gcc-c++\""
          commands[1]="sudo $pcman install gcc-c++"
          possible_solutions "${commands[@]}"
          compiler_gcc="gcc"
          compiler_gpp="g++"
        else
          commands[0]="su -c \"$pcman install g++\""
          commands[1]="sudo $pcman install g++"
          possible_solutions "${commands[@]}"
          compiler_gcc="gcc"
          compiler_gpp="g++"
        fi
fi
}