X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=contrib%2Fplatformtest.sh;h=85d3a1d7ebb32e95fa8cf49c8d1139a787f1fb7b;hp=aee7f2996f509b72a98ddaf0b6d3ab6f68e7dfa1;hb=25dd193e9b49b38db39cf549f94df4ba11812fe9;hpb=21bb2bd65808dbeacc5959a9ac3bc4fd9b3087c7 diff --git a/contrib/platformtest.sh b/contrib/platformtest.sh index aee7f299..85d3a1d7 100755 --- a/contrib/platformtest.sh +++ b/contrib/platformtest.sh @@ -1,7 +1,7 @@ #!/bin/sh # # ngIRCd -- The Next Generation IRC Daemon -# Copyright (c)2001-2009 Alexander Barton +# Copyright (c)2001-2010 Alexander Barton # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -51,16 +51,16 @@ if [ $? -ne 0 ]; then cd .. fi -echo "$NAME: Checking for ./configure script ..." -if [ ! -e ./configure ]; then - echo "$NAME: Not found. Running ./autogen.sh ..." +echo "$NAME: Checking for \"./autogen.sh\" script ..." +if [ -r ./autogen.sh ]; then + echo "$NAME: Running \"./autogen.sh\" ..." [ -n "$VERBOSE" ] && ./autogen.sh || ./autogen.sh >/dev/null fi -if [ -e ./configure ]; then +if [ -r ./configure ]; then echo "$NAME: Running \"./configure\" script ..." [ -n "$VERBOSE" ] && ./configure || ./configure >/dev/null - if [ $? -eq 0 -a -e ./Makefile ]; then + if [ $? -eq 0 -a -r ./Makefile ]; then CONFIGURE=1 echo "$NAME: Running \"make\" ..." [ -n "$VERBOSE" ] && make || make >/dev/null @@ -93,22 +93,29 @@ fi # Get compiler information if [ -r "Makefile" ]; then - eval $(grep "^CC = " Makefile | sed -e 's/ //g') + CC=$(grep "^CC = " Makefile | cut -d' ' -f3) $CC --version 2>&1 | grep -i "GCC" >/dev/null if [ $? -eq 0 ]; then - COMPILER=$($CC --version | head -n 1 | awk "{ print \$3 }" \ + COMPILER=$($CC --version | head -1 | awk "{ print \$3 }" \ | cut -d'-' -f1) COMPILER="gcc $COMPILER" + else + case "$CC" in + gcc*) + v="`$CC --version 2>/dev/null | head -1`" + [ -n "$v" ] && COMPILER="gcc $v" + ;; + esac fi fi # Get ngIRCd version information -if [ -d ".git" ]; then - VERSION=`git log --abbrev-commit --pretty=oneline HEAD~1.. \ - | cut -d' ' -f1 | tr -d '.'` -elif [ -r "Makefile" ]; then - eval $(grep "^VERSION = " Makefile | sed -e 's/ //g') -fi +eval $(grep "^VERSION = " Makefile | sed -e 's/ //g') +case "$VERSION" in + *-*-*) + VERSION=`echo "$VERSION" | cut -d'-' -f3 | cut -b2-` + ;; +esac [ -n "$VERSION" ] || VERSION="unknown" # Get IO interface information @@ -137,7 +144,13 @@ echo " ./configure works --+ | | echo " | | | |" echo "Platform Compiler ngIRCd Date Tester C M T R See" echo "--------------------------- ------------ ---------- -------- ------ - - - - ---" -printf "%-27s %-12s %-10s %s %-6s %s %s %s %s%s" \ - "$PLATFORM" "$COMPILER" "$VERSION" "$DATE" "$USER" \ - "$C" "$M" "$T" "$R" "$COMMENT" +type printf >/dev/null 2>&1 +if [ $? -eq 0 ]; then + printf "%-27s %-12s %-10s %s %-6s %s %s %s %s%s" \ + "$PLATFORM" "$COMPILER" "$VERSION" "$DATE" "$USER" \ + "$C" "$M" "$T" "$R" "$COMMENT" +else + echo "$PLATFORM $COMPILER $VERSION $DATE $USER" \ + "$C" "$M" "$T" "$R" "$COMMENT" +fi echo; echo