From 326953ed18f1f6ec11887293181ba9aa64376537 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Tue, 15 Oct 2013 14:00:33 +0200 Subject: [mltk] prints missing dev tools. Depending on distro print the possible package list. --- mltk | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'mltk') diff --git a/mltk b/mltk index d6380a03..6a7ad23e 100755 --- a/mltk +++ b/mltk @@ -102,14 +102,25 @@ print_usage() { check_devtools() { # Checking for needed development tools, compilers etc. # Required: m4 make gcc g++ binutils - DEVTOOLS="gcc c++ g++ make m4 strip git depmod patch mksquashfs pkg-config qmake" # 'strip' as marker for binutils - for i in $DEVTOOLS; do - which "$i" 2>/dev/null 1>&2 || { echo "Essential development tool $i not found - exiting."; exit 1; } + local DEV_TOOLS="gcc c++ g++ make m4 strip git depmod patch mksquashfs pkg-config qmake" # 'strip' as marker for binutils + + # DEV_CHECK marks missing dev-tools + local DEV_TOOLS_MISSING="" + for i in $DEV_TOOLS; do + which "$i" 2>/dev/null 1>&2 || DEV_TOOLS_MISSING+="$i " done - - # TODO make the script install the dev-stuff automaticly. - # Ubuntu: 'build-essential', 'm4', 'squashfs-tools' - # OpenSUSE: ??? + + if [ -n "$DEV_TOOLS_MISSING" ]; then + pinfo "You appear to be missing following development tools." + pinfo "Missing tools are: $DEV_TOOLS_MISSING" + pinfo "For $SYS_DISTRIBUTION you probably need to run:" + case $SYS_DISTRIBUTION in + pinfo "apt-get install build-essential m4 squashfs-tools" ;; + opensuse) pinfo "zypper install -t pattern devel_basis" ;; + *) perror "Cannot determine SYS_DISTRIBUTION: $SYS_DISTRIBUTION unknown!" ;; + esac + + fi } initial_checks() { -- cgit v1.2.3-55-g7522