#!/bin/bash

required_tools=( g++ nasm ld ) # This is all the tools we need to build Caldera

recommended_tools=( genisoimage tar gzip mbchk ) # Other stuff (like generating an ISO image)

for tool in ${required_tools[@]}; do
	printf "Checking for required tool $tool.."
	which $tool > /dev/null
	if [ $? -eq 1 ]; then
		printf "\nERROR: Could not find $tool.\n"
		false # Houston, we have a problem..
		exit
	else
		echo "Got it!" # Blue sky and apple pie
	fi
done

printf "\n\n"

for tool in ${recommended_tools[@]}; do
	printf "Checking for recommended tool $tool.."
	which $tool > /dev/null
	if [ $? -eq 1 ]; then
		printf "\nWARNING: Could not find $tool.\n" # Danger, Will Robinson!
	else
		echo "Got it!" # All is well in the world!
	fi
done

printf "\n"