www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/24/06:25:26

Date: Mon, 24 Nov 1997 13:25:06 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Nate Eldredge <eldredge AT ap DOT net>
cc: djgpp AT delorie DOT com, djgpp-workers AT delorie DOT com
Subject: Re: Problems with GCC building process
In-Reply-To: <199711240228.SAA02776@adit.ap.net>
Message-ID: <Pine.SUN.3.91.971124132444.23713S-100000@is>
MIME-Version: 1.0

On Sun, 23 Nov 1997, Nate Eldredge wrote:

> Suggestion: Change it to `redir -o s-objlist echo.exe $(OBJS)'. This will
> work regardless of what `echo' is in use. A simple change to
> config/msdos/top.sed should do it.

The use of echo -o is ancient history.  Once upon a time redirection
in a Makefile caused Make to call COMMAND.COM because DJGPP's `system'
couldn't handle redirection.  COMMAND.COM is an absolute no-no, since
the list of object files is longer than 126 characters.  `redir'
wasn't around either, so DJ added -o to his `echo'.

All of this isn't required anymore, so just use redirection, like
this: "echo $(OBJS) > s-objlist".

Btw, in practice, this problem is mostly harmless: if your `echo' is
from Textutils, it will output the list to the screen, and you will
use the file s-objlist which comes with the GCC distribution.  You
shouldn't see any problems unless you change the list of object
files.

> I don't understand at all why the batch file method is used. I would think
> there would be an easier way to do it. For instance, since `mklibgcc' knows
> all the CFLAGS, etc, why can't it do the compiling itself? (`system')
> Any comments, let me know.

mklibgcc is a C program that does what the original Makefile.in did
using shell features.  There was no shell port available at the time
that would run this, so DJ wrote a program that replaced it.  I'd
guess that `system' wasn't used because it couldn't handle long
command lines (that feature wasn't available until v2.01).

The simplest way to change that is to have mklibgcc put CFLAGS into a
file, call it `cflags', and append "@cflags" to the gcc commands it
writes to the batch file instead of putting the contents of CFLAGS
verbatim.  Since the rest of the gcc command line is fixed, this
should never risk overflowing the 126-char limit.

Btw, is this at all relevant for the next versions of GCC?  I think DJ
told that they want to switch to autoconf, so we will have to use Bash
to build GCC.  If that is correct, the original Makefile should run
unaltered.

- Raw text -


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