#! /bin/sh set -e echo "Configure called: $*" # Try to avoid strange tricks with # patsh (get any help we may have from configure) abs_srcdir="@abs_srcdir@" case $abs_srcdir in @*@) abs_srcdir="$(dirname $(readlink -f $(which $0)))" ;; esac cd "$abs_srcdir" if test "x$1" = "x"; then echo "First argument _must_ be the name of the build tree" exit 11 fi case $1 in --*) echo "Uhm... something wrong in configure parameters: $*" exit 15 ;; esac output="$1" scatch=${scatch-"../scatch"} base=${base-"../.."} temp=${tree-"../tree"} cache=${cache-"../cache"} shift # Build absolute paths output=`cd $output && pwd` scatch=`cd $scatch && pwd` base=`cd $base && pwd` temp=`cd $temp && pwd` cache=`cd $cache && pwd` if test ! -d "$output"; then set +e mkdir "$output" &>/dev/null set -e fi if test ! -d "$output"; then echo 1>&2 "Output dir is not a directory (${output})" echo 1>&2 "and could not be created!" exit 12 fi cd "$output" echo "${spacing}Cleaning up output tree ($output)..." rm -rf ./* mkdir build echo "${spacing}Configuring ($@)... (configure.log)" cd build set +e $base/configure --cache-file="$cache/configure.cache" --prefix="$output" $@ &> configure.log status="$?" if test "x$status" != "x0"; then echo "** Configure failed" echo "** Command line: $base/configure --cache-file='$cache/configure.cache' --prefix='$output' $@" tail "./configure.log" cd .. exit 1 fi cd ..