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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [ylwrap] - Diff between revs 39 and 56

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 39 Rev 56
Line 29... Line 29...
# The program to run.
# The program to run.
prog="$1"
prog="$1"
shift
shift
# Make any relative path in $prog absolute.
# Make any relative path in $prog absolute.
case "$prog" in
case "$prog" in
 /*) ;;
 /* | [A-Za-z]:\\*) ;;
 */*) prog="`pwd`/$prog" ;;
 */*) prog="`pwd`/$prog" ;;
esac
esac
 
 
# The input.
# The input.
input="$1"
input="$1"
shift
shift
case "$input" in
case "$input" in
 /*)
 /* | [A-Za-z]:\\*)
    # Absolute path; do nothing.
    # Absolute path; do nothing.
    ;;
    ;;
 *)
 *)
    # Relative path.  Make it absolute.  Why?  Because otherwise any
    # Relative path.  Make it absolute.  Why?  Because otherwise any
    # debugging info in the generated file will point to the wrong
    # debugging info in the generated file will point to the wrong
    # place.  This is really gross.
    # place.  This is really gross.
    input="`pwd`/$input"
    input="`pwd`/$input"
    ;;
    ;;
esac
esac
 
 
 
# We don't want to use the absolute path if the input in the current
 
# directory like when making a tar ball.
 
input_base=`echo $input | sed -e 's|.*/||'`
 
if test -f $input_base && cmp $input_base $input >/dev/null 2>&1; then
 
  input=$input_base
 
fi
 
 
pairlist=
pairlist=
while test "$#" -ne 0; do
while test "$#" -ne 0; do
   if test "$1" = "--"; then
   if test "$1" = "--"; then
      shift
      shift
      break
      break
Line 65... Line 72...
dirname=ylwrap$$
dirname=ylwrap$$
trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
mkdir $dirname || exit 1
mkdir $dirname || exit 1
 
 
cd $dirname
cd $dirname
 
case "$input" in
 
 /* | [A-Za-z]:\\*)
 
    # Absolute path; do nothing.
 
    ;;
 
 *)
 
    # Make a symbolic link, hard link or hardcopy.
 
    ln -s ../"$input" . > /dev/null 2>&1 || ln ../"$input" . > /dev/null 2>&1 || cp ../"$input" .
 
    ;;
 
esac
$prog ${1+"$@"} "$input"
$prog ${1+"$@"} "$input"
status=$?
status=$?
 
 
if test $status -eq 0; then
if test $status -eq 0; then
   set X $pairlist
   set X $pairlist
Line 77... Line 93...
   while test "$#" -ne 0; do
   while test "$#" -ne 0; do
      if test -f "$1"; then
      if test -f "$1"; then
         # If $2 is an absolute path name, then just use that,
         # If $2 is an absolute path name, then just use that,
         # otherwise prepend `../'.
         # otherwise prepend `../'.
         case "$2" in
         case "$2" in
           /*) target="$2";;
           /* | [A-Za-z]:\\*) target="$2";;
           *) target="../$2";;
           *) target="../$2";;
         esac
         esac
         mv "$1" "$target" || status=$?
         mv "$1" "$target" || status=$?
      else
      else
         # A missing file is only an error for the first file.  This
         # A missing file is only an error for the first file.  This

powered by: WebSVN 2.1.0

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