summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-03-29 09:21:04 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-03-29 09:21:04 (GMT)
commite2a586e4a6442a80f44f46d8a5acfb42788ffba6 (patch)
tree8d6417f8f10de7be275cdf58c370c522494b74c8 /autogen.sh
parent3937c077709b9cb615b7c3b7d23331d6cc0c40a3 (diff)
downloadlibkolabxml-e2a586e4a6442a80f44f46d8a5acfb42788ffba6.tar.gz
Enhance autogen.sh just a little
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh61
1 files changed, 58 insertions, 3 deletions
diff --git a/autogen.sh b/autogen.sh
index 8ed1fd5..9a1a45f 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,9 +1,64 @@
#!/bin/bash
-# Rebuilds the entire foo in one go. One shot, one kill.
+dobuild=0
+doprep=0
+dotest=0
+
+srcdir=$(pwd)
+
+while [ $# -gt 0 ]; do
+ case "$1" in
+ --build|-b)
+ dobuild=1
+ shift
+ ;;
+
+ --prep|-p)
+ doprep=1
+ shift
+ ;;
+
+ --test|-t)
+ dotest=1
+ shift
+ ;;
+
+ esac
+done
+
+if [ ${dobuild} -eq 0 -a ${doprep} -eq 0 -a ${dotest} -eq 0 ]; then
+ dobuild=1
+ doprep=1
+ dotest=1
+fi
+# Rebuilds the entire foo in one go. One shot, one kill.
rm -rf build/
mkdir -p build
cd build
-cmake ..
-make
+if [ ${doprep} -eq 1 ]; then
+ cmake \
+ -DCMAKE_VERBOSE_MAKEFILE=ON \
+ ..
+fi
+
+if [ ${dobuild} -eq 1 ]; then
+ make
+fi
+
+if [ ${dotest} -eq 1 ]; then
+ # Execute some tests?
+
+ if [ -f "${srcdir}/build/src/csharp/test.exe" ]; then
+ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/build/src/csharp/ MONO_LOG_LEVEL=debug mono ${srcdir}/build/src/csharp/test.exe
+ fi
+
+ if [ -f "${srcdir}/build/src/php/test.php" ]; then
+ php ${srcdir}/build/src/php/test.php
+ fi
+
+ if [ -f "${srcdir}/build/src/python/test.py" ]; then
+ python ${srcdir}/build/src/python/test.py
+ fi
+fi
+