#! /bin/sh set -e echo "Issue 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 ! -f "../config.status"; then echo "No 'config.status' was found! Run 'make prepare'" 1>&2 echo "from the top level directory (`cd $abs_srcdir/../ && pwd`)" 1>&2 exit 15 fi if test ! -d "$1"; then echo "'$1' is not a valid directory!" 1>&2 exit 12 fi if test ! -d "$2"; then echo "'$2' is not a valid directory!" 1>&2 exit 12 fi if test ! -d "$1/src"; then echo "There are no files we can issue ($1/src is missing)!" 1>&2 exit 13 fi if test "x$3" = "x"; then echo "Second argument must be the name of a file to issue!" fi input="$1/src" output="$2/build" file="$3" base=${base-"../.."} temp=${tree-"../tree"} cache=${cache-"../cache"} shift shift shift test -d "$output" || mkdir "$output" if test ! -d "$output"; then echo 1>&2 "Output dir could not be created (${output})" exit 12 fi # Build absolute paths input=`cd $input && pwd` output=`cd $output && pwd` scatch=`cd $scatch && pwd` base=`cd $base && pwd` temp=`cd $temp && pwd` cache=`cd $cache && pwd` set +e root_dir=`echo ${abs_srcdir}|sed -e 's,/scripts,,'` output_dir=`readlink -f ${root_dir}/tree/lib/current|sed -e 's,.*/,,'` # Waw... couldn't get config.status to give the correct output sed -e "s,@""prefix@,${root_dir}/tree/lib/current,g" \ -e "s,@""srcdir@,${input},g" \ -e "s,@""outdir@,${output}/${output_dir},g" \ -e "s,@""abs_srcdir@,${input},g" \ -e "s,@""top_srcdir@,${root_dir},g" \ -e "s,@""abs_top_srcdir@,${root_dir},g" \ -e "s,@""builddir@,${output},g" \ -e "s,@""libincludes@,${root_dir}/tree/lib/current/include,g" \ -e "s,@""abs_builddir@,${output},g" \ -e "s,@""top_builddir@,${root_dir},g" \ -e "s,@""abs_top_builddir@,${root_dir},g" < "${input}/${file}.in" | ../config.status --file="-:-" $@ | sed -e "s,VVPATH,VPATH," >"${output}/${file}" status=$? set -e if test "x$status" != "x0"; then echo "Issue failed: ../config.status --file='$output/$file' $@" 1>&2 exit 17 fi # remove config.log rm -f ./config.log