summaryrefslogtreecommitdiffstats
path: root/parts/appwizard/common/scons/configure
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch)
treeacaf47eb0fa12142d3896416a69e74cbf5a72242 /parts/appwizard/common/scons/configure
downloadtdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz
tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'parts/appwizard/common/scons/configure')
-rwxr-xr-xparts/appwizard/common/scons/configure87
1 files changed, 87 insertions, 0 deletions
diff --git a/parts/appwizard/common/scons/configure b/parts/appwizard/common/scons/configure
new file mode 100755
index 00000000..289a6843
--- /dev/null
+++ b/parts/appwizard/common/scons/configure
@@ -0,0 +1,87 @@
+#! /bin/sh
+# Fancy colors used to beautify the output a bit.
+#
+NORMAL="\033[0m"
+BOLD="\033[1m"
+RED="\033[91m"
+YELLOW="\033[93m"
+GREEN="\033[92m"
+
+# 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`
+ fi
+ echo -n "Checking for Python : "
+ if [ ! -x "$PYTHON" ]; then
+ echo -e $GREEN"not found!"$NORMAL
+ 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"
+ exit 1
+ fi
+ echo -e $GREEN"$PYTHON"$NORMAL
+}
+
+# Checks for SCons. Honours $SCONS if set. Stores path to 'scons' in $SCONS.
+# Requires that $PYTHON is set.
+#
+checkSCons()
+{
+ echo -n "Checking for SCons : "
+ if [ -z $SCONS ]; then
+ SCONS=`which scons 2>/dev/null`
+ fi
+ if [ ! -x "$SCONS" ]; then
+ echo -e $BOLD"not found, will use mini distribution."$NORMAL
+ tar xjf admin/scons-mini.tar.bz2
+ SCONS="./scons"
+ else
+ echo -e $GREEN"$SCONS"$NORMAL
+ fi
+ SCONS="$SCONS -Q"
+}
+
+# Generates a Makefile. Requires that $SCONS is set.
+#
+generateMakefile()
+{
+ cat > Makefile << EOF
+all:
+ @$SCONS
+
+# it is also possible to use
+# @$SCONS -j4
+
+install:
+ @$SCONS install
+
+clean:
+ @$SCONS -c
+
+uninstall:
+ @$SCONS -c install
+
+dist:
+ @$SCONS dist
+
+distclean:
+ @$SCONS -c
+ rm -rf cache/
+EOF
+}
+
+checkPython
+checkSCons
+
+if [[ "$1" == "--help" ]]; then
+ $SCONS --help
+ exit
+fi
+
+generateMakefile
+$SCONS configure $@
+