]> granicus.if.org Git - ngircd/commitdiff
contrib/platformtest.sh: fix gcc version detection
authorAlexander Barton <alex@barton.de>
Fri, 29 Apr 2011 20:45:55 +0000 (22:45 +0200)
committerAlexander Barton <alex@barton.de>
Fri, 29 Apr 2011 23:03:17 +0000 (01:03 +0200)
Now the version of GNU C is detected correctly on SuSE Linux, too ...

contrib/platformtest.sh

index 85d3a1d7ebb32e95fa8cf49c8d1139a787f1fb7b..6449a67cdbb5dd6da1342cda88f5a88a828ce910 100755 (executable)
@@ -96,8 +96,8 @@ if [ -r "Makefile" ]; then
        CC=$(grep "^CC = " Makefile | cut -d' ' -f3)
        $CC --version 2>&1 | grep -i "GCC" >/dev/null
        if [ $? -eq 0 ]; then
-               COMPILER=$($CC --version | head -1 | awk "{ print \$3 }" \
-                | cut -d'-' -f1)
+               COMPILER=$($CC --version | head -1 \
+                 | cut -d')' -f2 | cut -d' ' -f2)
                COMPILER="gcc $COMPILER"
        else
                case "$CC" in