summaryrefslogtreecommitdiffhomepage
path: root/configure
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-05-08 23:22:07 -0400
committermidipix <writeonce@midipix.org>2015-05-08 23:22:07 -0400
commitfeffc7263bb2fd33ae467de2dd51f1ddbbb1b895 (patch)
tree983daec02a2d1833796ad8bd04d43d9b3ec42765 /configure
parent23329916dde5e0ffa056f74a81aeda1bfb7e54cc (diff)
downloadpemagine-feffc7263bb2fd33ae467de2dd51f1ddbbb1b895.tar.bz2
pemagine-feffc7263bb2fd33ae467de2dd51f1ddbbb1b895.tar.xz
initial commit.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure114
1 files changed, 114 insertions, 0 deletions
diff --git a/configure b/configure
new file mode 100755
index 0000000..1e02d8f
--- /dev/null
+++ b/configure
@@ -0,0 +1,114 @@
+#!/bin/sh
+
+# a simple configure-make wrapper for use in conjunction with the 'lazy' build script.
+# 'lazy' is deviant, occasionally useful, and permissively licensed; get_lazy() below,
+# then look for configure.template in the root directory.
+
+init_vars()
+{
+ lz_config_dir=`readlink -f $(dirname $0)`
+ lz_pwd=`pwd`
+
+ if [ x"$lz_config" = x ]; then
+ . $lz_config_dir/config.lzy || exit 2
+ else
+ . "$lz_config" || exit 2
+ fi
+}
+
+
+error_msg()
+{
+ echo $@ >&2
+}
+
+
+require_out_of_tree()
+{
+ if [ x"$lz_config_dir" = x"$lz_pwd" ]; then
+ error_msg "$lz_package: out-of-tree builds are required."
+ error_msg "please invoke configure again from a clean build directory."
+ exit 2
+ fi
+
+ return 0
+}
+
+
+get_lazy()
+{
+ which lazy && lazy=`which lazy` && return 0
+
+ if ! [ -d slazy ]; then
+ git clone git://midipix.org/lazy slazy || exit 2
+ fi
+
+ lazy=$lz_pwd/slazy/lazy
+}
+
+
+lazy_approach()
+{
+ if [ x"$lz_prefix" = x ]; then
+ error_msg "prefix is required."
+ exit 2
+ fi
+
+ if [ x"$lz_arch" = x ]; then lz_arch=$lz_default_arch; fi
+ if [ x"$lz_target" = x ]; then lz_target=$lz_default_target; fi
+ if [ x"$lz_compiler" = x ]; then lz_compiler=$lz_default_compiler; fi
+ if [ x"$lz_compiler" = x ]; then lz_compiler=gcc; fi
+
+ $lazy -x config $lz_debug \
+ -t $lz_target \
+ -c $lz_compiler \
+ -n $lz_package \
+ -p $lz_config_dir \
+ -f $lz_prefix \
+ || exit 2
+
+}
+
+
+lazy_copy()
+{
+ cp "$lz_config_dir/Makefile.in" "$lz_pwd/Makefile"
+}
+
+
+for arg ; do
+ case "$arg" in
+ --help) usage
+ ;;
+
+ --prefix=*)
+ lz_prefix=${arg#*=}
+ ;;
+ --host=*)
+ lz_target=${arg#*=}
+ ;;
+ --target=*)
+ lz_target=${arg#*=}
+ ;;
+ --compiler=*)
+ lz_compiler=${arg#*=}
+ ;;
+ --config=*)
+ lz_config=${arg#*=}
+ ;;
+ --debug)
+ lz_debug='-d'
+ ;;
+ *)
+ error_msg ${arg#}: "unsupported config argument."
+ exit 2
+ ;;
+ esac
+done
+
+
+init_vars
+require_out_of_tree
+get_lazy
+lazy_approach
+lazy_copy