1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
# This is used in (copied into) each script to adjust
# our location to the code directory above dwarfdump, libdwarf, etc.
# If not invoked from code or code/scripts it exits.
# This is the original copy (not used directly).
l=`pwd`
echo $l
lb=`basename $l`
ld=`dirname $l`
#echo " lb: $lb"
#echo " ld: $ld"
cdtarg=.
sloc=$l/scripts
if [ x$lb = "xscripts" ]
then
#echo "ld: $ld"
ldb=`basename $ld`
#echo "ldb: $ldb"
if [ x$ldb = "xcode" ]
then
cdtarg=..
sloc=$l
else
echo "Run from */code, not $l , giving up."
exit 1
fi
cd $cdtarg
if [ $? -ne 0 ]
then
echo "cd $cdtarg failed, giving up."
exit 1
fi
else
if [ x$lb = "xcode" ]
then
cdtarg="."
else
echo "Run from */code, not $l , giving up."
exit 1
fi
# No need to cd.
fi
l=`pwd`
#echo "Now at $l"
#echo "sloc $sloc"
|