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]

[RFA:] Adjust for non-GNU make (was: Re: Committed: fix gcc_updateinvocation from within sub-make invocation.)


On Tue, 16 Nov 2004, Eric Botcazou wrote:

> > Since we now require GNU make, I had no second thoughts about using a GNU
> > make specific option.  Sure, it could be fixed by adding the option
> > --no-print-directory to the recursive call in my own makefile, but it's
> > obviously better to treat gcc_update as a black box without such
> > requirements on its caller.  Though it might now be redundant, I kept the
> > -s option for cases where make might want to emit other messages.
> >
> > 	* gcc_update (touch_files): Explicitly pass --no-print-directory.
>
> While we certainly require GNU make to bootstrap the compiler, I don't think
> we require it to be the default 'make' on the system.

We don't?  (Other comments about broken SUN make elided.)
;-)

>  Your patch broke
> gcc_update on Solaris because of this assumption.  Would you mind fixing it?

There's a work-around to set MAKE before calling gcc_update,
though that of course may be just as ugly as requiring
-no-print-directory in GNU make-callers of gcc_update.

Anyway, I think this can be done in a matter that's less
susceptible to GNU make oddities as well as those of other
makes.  I kept the -s option, since it's known to be reasonably
portable and may hopefully stop destructive verbosity levels set
by environment variables (stretching here...)

I don't have Sun make readily available, so can you please test
this patch?  Sanity-tested with a really old GNU make, 3.75, in
a situation where no touches were done and one in where a couple
of files were touched.

Authorized maintainer: Ok to commit if it works?

	* gcc_update (touch_files): Don't rely on "make" being GNU make;
	grep for "Touching" to determine that the rule executes.

Index: gcc_update
===================================================================
RCS file: /cvs/gcc/gcc/contrib/gcc_update,v
retrieving revision 1.78
diff -p -c -r1.78 gcc_update
*** gcc_update	14 Nov 2004 06:31:00 -0000	1.78
--- gcc_update	16 Nov 2004 08:02:51 -0000
*************** touch_files () {
*** 129,140 ****
      echo '	touch $@' >> Makefile.$$
      files_and_dependencies | sed 's,[^ ]* ,,;s,$, :,' >> Makefile.$$

!     # We need to explicitly shut off the "Entering... Leaving..."
      # messages through "--no-print-directory" to handle the case when
      # we were called from a recursive invocation (i.e. "$(MAKE)" in a
      # Makefile, not just make).  Passing only "-s" doesn't help then,
      # because make has helpfully added "-w" to MAKEFLAGS automatically.
!     while ${MAKE-make} -s --no-print-directory -f Makefile.$$ all | grep . > /dev/null; do
        sleep 1
      done 2>&1
      rm -f Makefile.$$
--- 129,143 ----
      echo '	touch $@' >> Makefile.$$
      files_and_dependencies | sed 's,[^ ]* ,,;s,$, :,' >> Makefile.$$

!     # We would have to explicitly shut off the "Entering... Leaving..."
      # messages through "--no-print-directory" to handle the case when
      # we were called from a recursive invocation (i.e. "$(MAKE)" in a
      # Makefile, not just make).  Passing only "-s" doesn't help then,
      # because make has helpfully added "-w" to MAKEFLAGS automatically.
!     # Unfortunately we do not require GNU make other than for building
!     # and testing, so let's just grep known text explicitly echoed by
!     # the rule.
!     while ${MAKE-make} -s -f Makefile.$$ all | grep Touching > /dev/null; do
        sleep 1
      done 2>&1
      rm -f Makefile.$$

brgds, H-P


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