Mail Archives: djgpp/2011/12/09/17:15:18
Hi,
On Dec 7, 10:04 pm, Eli Zaretskii <e DOT DOT DOT AT gnu DOT org> wrote:
> > From: Rugxulo <rugx DOT DOT DOT AT gmail DOT com>
> > Date: Wed, 7 Dec 2011 18:13:42 -0800 (PST)
>
> > I don't remember exactly why or where, but somewhere (presumably
> > inside Make) it prefers GNU coreutils' echo.exe over built-in DOS
> > command.com's echo or Bash's echo or djecho.exe.
>
> It simply looks for FOO.exe along PATH before falling back on built-in
> shell command FOO.
Make (3.81) apparently does but Bash doesn't. Try a simple makefile or
sh command that does "echo --version", and see what happens. ;-)
Even DOS (command.com) seems to always use built-in echo unless
explicitly told otherwise:
sh -c 'djecho -n hello ; djecho world' (djecho)
sh -c 'echo -n hello ; echo world' (Bash)
sh -c 'help echo' (Bash)
sh -c 'echo --version' (Bash)
sh -c 'echo.exe --version' (CoreUtils)
echo --version (command.com)
echo.exe --version (command.com)
\djgpp\bin\echo --version (CoreUtils)
> > In other words, without Coreutils' echo.exe installed, "make depend"
> > fails.
>
> Probably because it uses some features that are not present in the
> builtin 'echo'.
Well, it's vaguely complicated. But yes, after some lightweight
testing, I can (almost?) 100% conclude that he (tm) should use
DJECHO.EXE in his mk_djgpp.mak instead of default, preferably via $
(ECHO).
DJECHO works, confirmed, same binary is outputted (matches and also
same size), same results from "hi chk_all". (The lib files presumably
are the same too, but a simple cmp shows some minor differences, and
I'm blindly guessing it's some internal timestamp.) The good thing
about DJECHO is that it's included by default in every DJGPP install
(DJDEV*.ZIP), so it's no extra burden to require or grab anything
else.
Apparently djecho.c isn't very complicated, only 66 lines! ;-) And
while CoreUtils echo.c has a few extra complications (due to
portability?), even it is still only 244 lines (not counting a few
extra local headers). Though I find it funny that the author of the
latter is (was?) officially "FIXME unknown", heh.
P.S. IIRC, at one time (DJGPP 2.00? [sic]), DJECHO.EXE was actually
called ECHO.EXE, but it was probably renamed to avoid a clash with the
aforementioned CoreUtils version.
- Raw text -