This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH]: Fix PR bootstrap/29402 parallel make bug

On Thu, 12 Oct 2006, DJ Delorie wrote:

> > +	$(GTFILES_LANG_DIR_NAMES_H) | tr ' .' "$$gcc_LF_and_dot"  | sort -u)
> If line endings are \r\n, won't this replace spaces with \r and
> EVERYTHING ELSE with \n's ?

I believe dot "." is not a wildcard in tr, so it won't replace "EVERYTHING
ELSE" as you say.  However I don't know what tr does when the length of
string1 does not equal the length of string2.  It seems to to different
things depending on which tr program I use.  There are no less than four
different tr programs on solaris, and throwing in gnu tr would make five.

Maybe using awk to split lines would be better, i.e.:

awk '{for(x=1;x<=NF;x++)print$x}'

We can use AC_PROG_AWK to find awk.  The gcc/ already errors
if there is no system awk.

> Might be easier to have the build first build a helper program that
> does these weird make things, then rely on that instead of bizzare
> shell-isms.  The DJGPP build system does that; one helper with a bunch
> of command line options to do all the odd things the build needs that
> it can't rely on DOS for.
> For example, that rule would be:
> Hmmm... that's something that could go in libiberty, perhaps?

I assume you mean write a C program to do this?  That seems like a lot of
effort to me unless you already have something hidden away in your back

To me, using awk would avoid "bizarre shell-isms".  It's clear and simple.
What do you think?

Kaveh R. Ghazi

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]