Re: fallback-echo, finding a suitable $ECHO

2005-03-12 Thread Ralf Wildenhues
Slooowly cycling through the list..

* Alexandre Oliva wrote on Sun, Jan 30, 2005 at 01:05:59AM CET:
 On Jan 27, 2005, Ralf Wildenhues [EMAIL PROTECTED] wrote:
 
  Which systems do actually need libtool's --fallback-echo?
 
 Probably ones that didn't support shell functions either.

Nope.  The answer was in
  info '(autoconf.info)Here-Documents'
all the time, I just needed to read carefully enough.  :)

 I don't recall exactly which systems required --fallback-echo, but I
 do recall it was added for a very good reason, given how disgusting it
 is :-)

ACK.

 Since we've now moved on to better systems, supporting shell functions
 and all, we might as well give libtool a new try without this gunk and
 see how it goes.  Failing that, a shell function might be good enough,
*snip*

Naah, no need to kill something while it supposedly still works
reasonably well and actually _might_ be of use to somebody.

We'll just wait another seven years.  :)

Regards,
Ralf


___
http://lists.gnu.org/mailman/listinfo/libtool


Re: fallback-echo, finding a suitable $ECHO

2005-01-30 Thread Ralf Wildenhues
* Alexandre Oliva wrote on Sun, Jan 30, 2005 at 01:05:59AM CET:
 On Jan 27, 2005, Ralf Wildenhues [EMAIL PROTECTED] wrote:
 
  Which systems do actually need libtool's --fallback-echo?
 
 Probably ones that didn't support shell functions either.  I don't
 recall exactly which systems required --fallback-echo, but I do recall
 it was added for a very good reason, given how disgusting it is :-)
 
 Since we've now moved on to better systems, supporting shell functions
 and all, we might as well give libtool a new try without this gunk and
 see how it goes.  Failing that, a shell function might be good enough,
 although the fact that not even bash gets it right in some cases
 doesn't exactly give me a warm fuzzy feeling about this construct :-)

Oh, I should have written

  :   # work around old bash bug

, and the bug is really independent of the eval (halts the script if the
last cmd in a function returns nonzero, plus `set -e' is in effect).
On second thought, maybe I don't mind if it really halts then -- let's
just remove the workaround.

Thanks,
Ralf

  func_fallback_echo ()
  {
  # Without the eval, Bourne shells create the here doc at definition 
  time.
  eval 'cat _LT_EOF
  $*
  _LT_EOF
  '
  :   # work around bash bug
  }


___
http://lists.gnu.org/mailman/listinfo/libtool


Re: fallback-echo, finding a suitable $ECHO

2005-01-29 Thread Alexandre Oliva
On Jan 27, 2005, Ralf Wildenhues [EMAIL PROTECTED] wrote:

 Which systems do actually need libtool's --fallback-echo?

Probably ones that didn't support shell functions either.  I don't
recall exactly which systems required --fallback-echo, but I do recall
it was added for a very good reason, given how disgusting it is :-)

Since we've now moved on to better systems, supporting shell functions
and all, we might as well give libtool a new try without this gunk and
see how it goes.  Failing that, a shell function might be good enough,
although the fact that not even bash gets it right in some cases
doesn't exactly give me a warm fuzzy feeling about this construct :-)

 func_fallback_echo ()
 {
 # Without the eval, Bourne shells create the here doc at definition time.
 eval 'cat _LT_EOF
 $*
 _LT_EOF
 '
 : # work around bash bug
 }

-- 
Alexandre Oliva http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   [EMAIL PROTECTED], gcc.gnu.org}
Free Software Evangelist  [EMAIL PROTECTED], gnu.org}


___
http://lists.gnu.org/mailman/listinfo/libtool


Re: fallback-echo, finding a suitable $ECHO

2005-01-27 Thread Ralf Wildenhues
* Ralf Wildenhues wrote on Thu, Jan 27, 2005 at 09:39:46AM CET:
 
 I have attached a small script, and encourage
 people to test it on all their shells they can find on their systems.
 It should reveal at least one working echo, and, in most cases, find
 builtins to do the job.

and here it is..
#! /bin/sh

# Be Bourne compatible
if test -n ${ZSH_VERSION+set}  (emulate sh) /dev/null 21; then
  emulate sh
  NULLCMD=:
  # Zsh 3.x and 4.x performs word splitting on ${1+$@}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '${1+$@}'='$@'
  setopt NO_GLOB_SUBST
elif test -n ${BASH_VERSION+set}${KSH_VERSION+set}  (set -o posix) 
/dev/null 21; then
  set -o posix
fi
BIN_SH=xpg4; export BIN_SH # for Tru64
DUALCASE=1; export DUALCASE # for MKS sh

: ${lt_ECHO=echo}

func_fallback_echo ()
{
# Without the eval, Bourne shells create the here doc at definition time.
eval 'cat _LT_EOF
$*
_LT_EOF
'
:   # work around bash bug
}

for ECHO in $lt_ECHO 'print -r' 'printf %s\n' func_fallback_echo \
'/usr/bin/printf %s\n' false
do
  if test X`{ $ECHO '\t'; } 2/dev/null` = 'X\t'; then
set x $ECHO; shift
type $1
case `{ type $1; } 2/dev/null` in
  *builtin*) $ECHO $ECHO is a working builtin echo. ;;
  *) $ECHO $ECHO is a working external echo. ;;
esac
  fi
done
___
http://lists.gnu.org/mailman/listinfo/libtool