summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-10-23 09:37:32 +0200
committerAnton Khirnov <anton@khirnov.net>2013-10-30 11:27:11 +0100
commit5121d3bcf501be5532e62b8c06c9a025e9d532c0 (patch)
treece7a2234ee9d3a9a2b696ac9dfd04718d4381959 /configure
Initial commit.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure51
1 files changed, 51 insertions, 0 deletions
diff --git a/configure b/configure
new file mode 100755
index 0000000..d274f96
--- /dev/null
+++ b/configure
@@ -0,0 +1,51 @@
+#!/bin/sh
+#
+# Cactus build repo configure script
+# partially based on the Libav configure script
+# Copyright (c) 2000-2002 Fabrice Bellard
+# Copyright (c) 2005-2008 Diego Biurrun
+# Copyright (c) 2005-2008 Mans Rullgard
+#
+
+# Prevent locale nonsense from breaking basic text processing.
+LC_ALL=C
+export LC_ALL
+
+ln_s="ln -s -f"
+logfile="config.log"
+
+log(){
+ echo "$@" >> $logfile
+}
+
+log_file(){
+ log BEGIN $1
+ pr -n -t $1 >> $logfile
+ log END $1
+}
+
+echolog(){
+ log "$@"
+ echo "$@"
+}
+
+die(){
+ echolog "$@"
+ exit 1
+}
+
+# find source path
+if test -f configure; then
+ source_path=.
+else
+ source_path=$(cd $(dirname "$0"); pwd)
+ echo "$source_path" | grep -q '[[:blank:]]' &&
+ die "Out of tree builds are impossible with whitespace in source path."
+ test -e "$source_path/config.h" &&
+ die "Out of tree builds are impossible with config.h in source dir."
+fi
+
+test -e arrangements || $ln_s "$source_path/arrangements"
+test -e lib || $ln_s "$source_path/repos/cactus/lib"
+test -e Makefile || $ln_s "$source_path/repos/cactus/Makefile"
+test -e src || $ln_s "$source_path/repos/cactus/src"