This is the mail archive of the gcc-patches@gcc.gnu.org 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:

> > I assume you mean write a C program to do this?
>
> Yes.
>
> > That seems like a lot of effort to me
>
> What, one call to qsort and a loop with a strcmp in it?  That replaces
> a number of other commands, and removes any trace of unportability.

It's a lot of effort relative to a one line change to the Makefile.
I'm just not inspired enough to write the equivalent C code...


> Hmm... goes gnu make have these features?  Meaning, sort and unique?

I don't know, but if it does I don't mind using them instead.


The patch below works for me, it's clear, portable and easy(ier).

Okay for mainline?

		--Kaveh




2006-10-12  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	PR bootstrap/29402
	* Makefile.in (ALL_GTFILES_H): Use awk instead of tr.

diff -rup orig/egcc-SVN20061011/gcc/Makefile.in egcc-SVN20061011/gcc/Makefile.in
--- orig/egcc-SVN20061011/gcc/Makefile.in	2006-10-10 20:01:28.000000000 -0400
+++ egcc-SVN20061011/gcc/Makefile.in	2006-10-13 01:39:45.823063178 -0400
@@ -2883,7 +2883,7 @@ GTFILES_FILES_FILES_H = $(addprefix gt-,
 	$(subst /,-,$(GTFILES_FILES_FILES_C:.c=.h)))
 GTFILES_LANG_DIR_NAMES_H = $(foreach d,$(GTFILES_LANG_DIR_NAMES), gtype-$(d).h)
 ALL_GTFILES_H := $(shell echo $(GTFILES_FILES_FILES_H) \
-	$(GTFILES_LANG_DIR_NAMES_H) | tr ' ' '\n'  | sort -u)
+	$(GTFILES_LANG_DIR_NAMES_H) | $(AWK) '{for(x=1;x<=NF;x++)print$x}' | sort -u)

 $(ALL_GTFILES_H) : s-gtype ; @true


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