[Goodies-commits] r6333 - sion/trunk

Enrico Troeger enrico at xfce.org
Fri Dec 19 19:42:08 CET 2008


Author: enrico
Date: 2008-12-19 18:42:08 +0000 (Fri, 19 Dec 2008)
New Revision: 6333

Modified:
   sion/trunk/ChangeLog
   sion/trunk/configure
   sion/trunk/wscript
Log:
Remove coloured output.
Remove unnecessary checks and code and avoid using 'which'.


Modified: sion/trunk/ChangeLog
===================================================================
--- sion/trunk/ChangeLog	2008-12-19 18:17:42 UTC (rev 6332)
+++ sion/trunk/ChangeLog	2008-12-19 18:42:08 UTC (rev 6333)
@@ -2,6 +2,9 @@
 
  * src/Makefile.am, README, configure.ac, Makefile.am, autogen.sh:
    Add support for building Sion with autotools.
+ * configure:
+   Remove coloured output.
+   Remove unnecessary checks and code and avoid using 'which'.
 
 
 2008-12-18  Enrico Tröger  <enrico(at)xfce(dot)org>

Modified: sion/trunk/configure
===================================================================
--- sion/trunk/configure	2008-12-19 18:17:42 UTC (rev 6332)
+++ sion/trunk/configure	2008-12-19 18:42:08 UTC (rev 6333)
@@ -2,94 +2,30 @@
 
 # waf configure wrapper
 
-# Fancy colors used to beautify the output a bit.
-#
-if [ "$NOCOLOR" ] ; then
-    NORMAL=""
-    BOLD=""
-    RED=""
-    YELLOW=""
-    GREEN=""
-else
-    NORMAL="\033[0m"
-    BOLD="\033[1m"
-    RED="\033[91m"
-    YELLOW="\033[01;33m"
-    GREEN="\033[32m"
-fi
-
-EXIT_SUCCESS=0
 EXIT_FAILURE=1
-EXIT_ERROR=2
-EXIT_BUG=10
 
-CUR_DIR=$PWD
 
-#possible relative path
-WORKINGDIR=`dirname $0`
-cd $WORKINGDIR
-#abs path
-WORKINGDIR=`pwd`
-cd $CUR_DIR
-
-
 # Checks for Python interpreter. Honours $PYTHON if set. Stores path to
 # interpreter in $PYTHON.
-#
 checkPython()
 {
 	if [ -z "$PYTHON" ] ; then
-		PYTHON=`which python 2>/dev/null`
+		PYTHON="python"
 	fi
-	printf "Checking for Python\t\t\t:  "
-	if [ ! -x "$PYTHON" ] ; then
-		printf $RED"not found!"$NORMAL"\n"
+	printf "Checking for Python\t\t\t : "
+	("$PYTHON" --version) < /dev/null > /dev/null 2>&1 || {
+		printf "not found!\n"
 		echo "Please make sure that the Python interpreter is available in your PATH"
 		echo "or invoke configure using the PYTHON flag, e.g."
-		echo "$ PYTHON=/usr/local/bin/python configure"
+		echo "$ PYTHON=/usr/local/bin/python ./waf configure "$@
+		echo "Alternatively, you can run ./autogen.sh to use the autotools chain"
+		echo "to build and install the sources."
 		exit $EXIT_FAILURE
-	fi
-	printf $GREEN"$PYTHON"$NORMAL"\n"
+	}
+	printf "ok\n"
 }
 
-# Checks for WAF. Honours $WAF if set. Stores path to 'waf' in $WAF.
-# Requires that $PYTHON is set.
-#
-checkWAF()
-{
-	printf "Checking for WAF\t\t\t:  "
-	#installed miniwaf in sourcedir
-	if [ -z "$WAF" ] ; then
-		if [ -f "${WORKINGDIR}/waf" ] ; then
-			WAF="${WORKINGDIR}/waf"
-			if [ ! -x "$WAF" ] ; then
-				chmod +x $WAF
-			fi
-		fi
-	fi
-	if [ -z "$WAF" ] ; then
-		if [ -f "${WORKINGDIR}/waf-light" ] ; then
-			${WORKINGDIR}/waf-light --make-waf
-			WAF="${WORKINGDIR}/waf"
-		fi
-	fi
-	#global installed waf with waf->waf.py link
-	if [ -z "$WAF" ] ; then
-		WAF=`which waf 2>/dev/null`
-	fi
-	# neither waf nor miniwaf could be found
-	if [ ! -x "$WAF" ] ; then
-		printf $RED"not found"$NORMAL"\n"
-		echo "Go to http://code.google.com/p/waf/"
-		echo "and download a waf version"
-		exit $EXIT_FAILURE
-	else
-		printf $GREEN"$WAF"$NORMAL"\n"
-	fi
-}
-
-# Generates a Makefile. Requires that $WAF is set.
-#
+# Generates a Makefile.
 generateMakefile()
 {
 	cat > Makefile << EOF
@@ -97,44 +33,44 @@
 # Waf Makefile wrapper
 
 all:
-	@$WAF build
+	@./waf build
 
 all-debug:
-	@$WAF -v build
+	@./waf -v build
 
 all-progress:
-	@$WAF -p build
+	@./waf -p build
 
 install:
 	@if test -n "\$(DESTDIR)"; then \\
-		$WAF install --destdir="\$(DESTDIR)"; \\
+		./waf install --destdir="\$(DESTDIR)"; \\
 	else \\
-		$WAF install; \\
+		./waf install; \\
 	fi;
 
 uninstall:
 	@if test -n "\$(DESTDIR)"; then \\
-		$WAF uninstall --destdir="\$(DESTDIR)"; \\
+		./waf uninstall --destdir="\$(DESTDIR)"; \\
 	else \\
-		$WAF uninstall; \\
+		./waf uninstall; \\
 	fi;
 
 clean:
-	@$WAF clean
+	@./waf clean
 
 distclean:
-	@$WAF distclean
+	@./waf distclean
 	@-rm -rf _build_
 	@-rm -f Makefile
 
 distcheck:
-	@$WAF distcheck
+	@./waf distcheck
 
 dist:
-	@$WAF dist
+	@./waf dist
 
 sign:
-	@$WAF --sign
+	@./waf --sign
 
 .PHONY: clean dist distclean check uninstall install all
 
@@ -145,22 +81,20 @@
 # Waf Makefile wrapper
 
 all:
-	cd .. && $WAF build
+	cd .. && ./waf build
 
 all-debug:
-	cd .. && $WAF -v build
+	cd .. && ./waf -v build
 
 clean:
-	cd .. && $WAF clean
+	cd .. && ./waf clean
 
 EOF
 }
 
-checkPython
-checkWAF
-
+checkPython $@
 generateMakefile
 
-"${WAF}" configure $@
+./waf configure $@
 
 exit $?


Property changes on: sion/trunk/wscript
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native




More information about the Goodies-commits mailing list