OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [gdb/] [gdb_indent.sh] - Diff between revs 834 and 842

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 834 Rev 842
#!/bin/sh
#!/bin/sh
 
 
# Try to find a GNU indent.  There could be a BSD indent in front of a
# Try to find a GNU indent.  There could be a BSD indent in front of a
# GNU gindent so when indent is found, keep looking.
# GNU gindent so when indent is found, keep looking.
 
 
# Make certain that the script is not running in an internationalized
# Make certain that the script is not running in an internationalized
# environment.
# environment.
LANG=c ; export LANG
LANG=c ; export LANG
LC_ALL=c ; export LC_ALL
LC_ALL=c ; export LC_ALL
 
 
gindent=
gindent=
indent=
indent=
paths=`echo $PATH | sed \
paths=`echo $PATH | sed \
        -e 's/::/:.:/g' \
        -e 's/::/:.:/g' \
        -e 's/^:/.:/' \
        -e 's/^:/.:/' \
        -e 's/:$/:./' \
        -e 's/:$/:./' \
        -e 's/:/ /g'`
        -e 's/:/ /g'`
for path in $paths
for path in $paths
do
do
    if test ! -n "${gindent}" -a -x ${path}/gindent
    if test ! -n "${gindent}" -a -x ${path}/gindent
    then
    then
        gindent=${path}/gindent
        gindent=${path}/gindent
        break
        break
    elif test ! -n "${indent}" -a -x ${path}/indent
    elif test ! -n "${indent}" -a -x ${path}/indent
    then
    then
        indent=${path}/indent
        indent=${path}/indent
    fi
    fi
done
done
 
 
if test -n "${gindent}"
if test -n "${gindent}"
then
then
    indent=${gindent}
    indent=${gindent}
elif test -n "${indent}"
elif test -n "${indent}"
then
then
    :
    :
else
else
    echo "Indent not found" 1>&2
    echo "Indent not found" 1>&2
fi
fi
 
 
 
 
# Check that the indent found is both GNU and a reasonable version.
# Check that the indent found is both GNU and a reasonable version.
# Different indent versions give different indentation.
# Different indent versions give different indentation.
 
 
m1=2
m1=2
m2=2
m2=2
m3=9
m3=9
 
 
version=`${indent} --version 2>/dev/null < /dev/null`
version=`${indent} --version 2>/dev/null < /dev/null`
case "${version}" in
case "${version}" in
    *GNU* ) ;;
    *GNU* ) ;;
    * ) echo "error: GNU indent $m1.$m2.$m3 expected" 1>&2 ; exit 1;;
    * ) echo "error: GNU indent $m1.$m2.$m3 expected" 1>&2 ; exit 1;;
esac
esac
v1=`echo "${version}" | sed 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)$/\1/'`
v1=`echo "${version}" | sed 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)$/\1/'`
v2=`echo "${version}" | sed 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)$/\2/'`
v2=`echo "${version}" | sed 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)$/\2/'`
v3=`echo "${version}" | sed 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)$/\3/'`
v3=`echo "${version}" | sed 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)$/\3/'`
 
 
if test $m1 -ne $v1 -o $m2 -ne $v2 -o $m3 -gt $v3
if test $m1 -ne $v1 -o $m2 -ne $v2 -o $m3 -gt $v3
then
then
    echo "error: Must be GNU indent version $m1.$m2.$m3 or later" 1>&2
    echo "error: Must be GNU indent version $m1.$m2.$m3 or later" 1>&2
    exit 1
    exit 1
fi
fi
 
 
if test $m3 -ne $v3
if test $m3 -ne $v3
then
then
    echo "warning: GNU indent version $m1.$m2.$m3 recommended" 1>&2
    echo "warning: GNU indent version $m1.$m2.$m3 recommended" 1>&2
fi
fi
 
 
# Check that we're in the GDB source directory
# Check that we're in the GDB source directory
 
 
case `pwd` in
case `pwd` in
    */gdb ) ;;
    */gdb ) ;;
    */sim/* ) ;;
    */sim/* ) ;;
    * ) echo "Not in GDB directory" 1>&2 ; exit 1 ;;
    * ) echo "Not in GDB directory" 1>&2 ; exit 1 ;;
esac
esac
 
 
 
 
# Run indent per GDB specs
# Run indent per GDB specs
 
 
types="\
types="\
-T FILE \
-T FILE \
-T bfd -T asection -T pid_t \
-T bfd -T asection -T pid_t \
-T prgregset_t -T fpregset_t -T gregset_t -T sigset_t \
-T prgregset_t -T fpregset_t -T gregset_t -T sigset_t \
-T td_thrhandle_t -T td_event_msg_t -T td_thr_events_t \
-T td_thrhandle_t -T td_event_msg_t -T td_thr_events_t \
-T td_notify_t -T td_thr_iter_f -T td_thrinfo_t \
-T td_notify_t -T td_thr_iter_f -T td_thrinfo_t \
-T caddr_t \
-T caddr_t \
`cat *.h | sed -n \
`cat *.h | sed -n \
    -e 's/^.*[^a-z0-9_]\([a-z0-9_]*_ftype\).*$/-T \1/p' \
    -e 's/^.*[^a-z0-9_]\([a-z0-9_]*_ftype\).*$/-T \1/p' \
    -e 's/^.*[^a-z0-9_]\([a-z0-9_]*_func\).*$/-T \1/p' \
    -e 's/^.*[^a-z0-9_]\([a-z0-9_]*_func\).*$/-T \1/p' \
    -e 's/^typedef.*[^a-zA-Z0-9_]\([a-zA-Z0-9_]*[a-zA-Z0-9_]\);$/-T \1/p' \
    -e 's/^typedef.*[^a-zA-Z0-9_]\([a-zA-Z0-9_]*[a-zA-Z0-9_]\);$/-T \1/p' \
    | sort -u`"
    | sort -u`"
 
 
${indent} ${types} "$@"
${indent} ${types} "$@"
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.