1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
#!/bin/sh
#Colors for colored print messages.
RED='\033[0;31m'
RESET='\033[0m'
# Abort program with message.
abort()
{
echo -e "${RED}ERROR: $@${RESET}"
exit 1
}
# Check the folowing commands is available to this shell.
check_existence()
{
local tool_available
local tools='libtoolize aclocal autoheader automake autoconf'
for tool in $tools; do
$tool --version > /dev/null
tool_available=$?
if [ $tool_available -ne 0 ]; then
abort "$tool not found, but is required by bootstrap"
fi
done
}
# Check existence of commands. On failure, user must install the missing
# packages.
check_existence
# Run the bootstrap process
libtoolize -c
aclocal
autoheader
automake --add-missing -c
autoconf
|