summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2010-10-25 18:49:54 +0200
committerAlexander Barton <alex@barton.de>2010-10-25 18:49:54 +0200
commit05d1df97c300485d24dc31b4cf7f280fe1d693f4 (patch)
treeec060f57b5e52837ab7e6699d3fd21f9d45e1c49
parent01c39ba0015f715b2082f5ed54dc769d09c09bd0 (diff)
downloadngircd-05d1df97c300485d24dc31b4cf7f280fe1d693f4.tar.gz
ngircd-05d1df97c300485d24dc31b4cf7f280fe1d693f4.zip
Updated contrib/platformtest.sh (new version scheme)
 - handle version numbers generated by "git describe"
 - detect gcc compiler version correctly when "-std=xxx" is used
-rwxr-xr-xcontrib/platformtest.sh22
1 files changed, 11 insertions, 11 deletions
diff --git a/contrib/platformtest.sh b/contrib/platformtest.sh
index 0a518b8a..d4765957 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 <alex@barton.de>
+# Copyright (c)2001-2010 Alexander Barton <alex@barton.de>
 #
 # 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,9 +51,9 @@ 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 [ -e ./autogen.sh ]; then
+	echo "$NAME: Running ./autogen.sh ..."
 	[ -n "$VERBOSE" ] && ./autogen.sh || ./autogen.sh >/dev/null
 fi
 
@@ -93,7 +93,7 @@ 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 }" \
@@ -103,12 +103,12 @@ if [ -r "Makefile" ]; then
 fi
 
 # Get ngIRCd version information
-if [ -d ".git" ]; then
-	VERSION=`git log --abbrev-commit --pretty=oneline HEAD~1.. \
-	 | 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