www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/01/12/02:31:43

To: Stephen Turnbull <turnbull AT shako DOT sk DOT tsukuba DOT ac DOT jp>
Cc: babcock AT cfa DOT harvard DOT edu, djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Changing system() [was: bug in djgpp's make]
Date: Thu, 12 Jan 95 08:41:15 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>

>     I'm suddenly realizing that I'm not entirely sure what should be
> done by make and what make is expected to turn over to the shell.  But
> I would hope that most things will be handled in a way compatible with
> the user's shell-of-choice.

This is at least questionable.  Unlike Unix, where the various shells
share much of the functionality (but even there some shell differences
plague portable Makefiles), under DOS there is tremendous variability
in the features and mis-features the shells provide, because the basic
shell is so crippled.  Thus, too much of a dependence on a shell which
is used by whoever wrote the Makefile can easily produce a Makefile
which is broken for you.  I don't think I need to explain the
frustration we all feel when we get a package with a README file saying
``just run Make'', then the next thing you see is a long list of strange
error messages like ``Bad command or filename'', and suddenly you are
forced to figure out what the heck should be done to build a program you
are not familiar with...

If I wasn't afraid to be lynched, I would be almost tempted to say Make
should *always* call COMMAND.COM, even if the user said otherwise,
because this at least would assure portability.  As it stands, I think
system() should do its best to handle everything it can (including
indirection) by itself.  If it decides that it can't do it (e.g. if
somebody called an alias and the program by that name isn't found on
the PATH), it should call the shell as last resort.  AFAIK, that is
exactly what happens in DJGPP (see exec.c in the library source; the
redirection handling isn't there yet in 1.12, but it will be in v2.0).

As an escape for those who likes using features specific to their shell
in a Makefile (did I say that I think it's a bad habit?) there is the
SHELL= statement in the Makefile, which even today causes Make to call
that shell unconditionally.  So you can have the cake both ways.

> I'm willing to accept the "system() emulates shell" solution.  It will
> be a severe pain in my butt (I'll have to change a couple of deeply
> embedded makefile habits, which are reinforced frequently by
> programming under Linux), and may well chase me away from DJGPP
> entirely, except to beta test certain packages which are used with

Seems a bit of exaggeration to me.  Religious wars is one thing, but
this is like an outright Armageddon.  (Which, btw, is a twisted
pronunciation of Mount (``har'' in Hebrew) Megiddo, a place some 100
miles from where I write this, so I guess I should know about these
things, right?)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019