toaruos/util/check-reqs
2012-02-05 17:40:19 -06:00

50 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Build Dependencies Checker
# ToAruOS Kernel / Userspace
function INFO {
echo -e "\033[34;1minfo\033[0m $1" >&2
}
function WARN {
echo -e "\033[33;1mwarning\033[0m $1" >&2
}
function ERROR {
echo -e "\033[31;1merror\033[0m $1" >&2
}
function BAIL {
exit 1
}
INFO "Checking for required tools (one-time check)..."
if [ -z `which clang` ] ; then
WARN "Missing clang"
if [ -z `which gcc` ] ; then
WARN "Missing gcc"
if [ -z `which cc` ] ; then
ERROR "No compiler found"
BAIL
fi
fi
fi
if [ -z `which genext2fs` ] ; then
ERROR "Missing genext2fs"
INFO "You can probably get it from a package of the same name."
BAIL
fi
if [ -z `which qemu` ] ; then
if [ -z `which qemu-system-i386` ] ; then
ERROR "Missing qemu"
INFO "You can probably install it from a package of the same name."
fi
ERROR "qemu is installed, but not as 'qemu'"
INFO "You have a version of qemu which does not provide the 'qemu' binary."
INFO "You should run 'ln -s ~/bin/qemu \`which qemu-system-i386\` or similar to correct this."
fi