Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jan 2001 02:30:09 +0100
From:      Thomas Moestl <tmoestl@gmx.net>
To:        David Wolfskill <dhw@whistle.com>
Cc:        stable@FreeBSD.ORG
Subject:   Re: make vs. gmake (was: Re: Roadmap for perl upgrades to STABLE?)
Message-ID:  <20010105023009.A1100@crow.dom2ip.de>
In-Reply-To: <200101041616.f04GGsh72194@pau-amma.whistle.com>; from dhw@whistle.com on Thu, Jan 04, 2001 at 08:16:54AM -0800
References:  <20001226231547.R72273@elvis.mu.org> <200101041616.f04GGsh72194@pau-amma.whistle.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--OXfL5xGRrasGEqWY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu, Jan 04, 2001 at 08:16:54AM -0800, David Wolfskill wrote:
> >>     Not that I'm a fan of the GPL, but wouldn't importation of gmake
> >> into the toolchain that gets installed by default help this problem
> >> along enormously?
> >What can it do that bmake can't?
> Compile amanda 2.4.2.  :-(
> 
> [Ref.  http://www.FreeBSD.org/cgi/query-pr.cgi?pr=23328 -- seems that
> some Makefiles created by automake (which the amanda folks use) get
> created in a way that cause our make to behave in unexpected ways.  I
> was able to generate a simpler test case that re-creates the problem
> (and it's in the PR), but have no fix, nor is it likely I will be able to
> devote the time required to become familiar enough with make's internals
> to get much of a clue anytime soon, unfortunately.  I expect to be able
> to help test, though, and am quite willing to do that.]
I have attached a patch (against -CURRENT) that fixes the test case in
the PR for me. It would be interesting to know how well it works with
real-world examples like the amanda Makefile.
I have just rolled a complete "make buildworld" with the patched make
without problems. Anyone who is brave enough to try this should make
a backup copy of his make anyway, because it is a pain to recover a 
broken make ;-)

Feedback is very welcome! If there are no problems with the patch, I
will submit a PR soon.

	- thomas


--OXfL5xGRrasGEqWY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="make.diff"

*** src/usr.bin/make/suff.c~	Sat Dec  2 21:24:38 2000
--- src/usr.bin/make/suff.c	Fri Jan  5 02:12:31 2001
***************
*** 460,467 ****
  {
      Lst_Concat (suffClean, sufflist, LST_CONCLINK);
      sufflist = Lst_Init(FALSE);
!     sNum = 0;
      suffNull = emptySuff;
  }
  
  /*-
--- 460,475 ----
  {
      Lst_Concat (suffClean, sufflist, LST_CONCLINK);
      sufflist = Lst_Init(FALSE);
!     sNum = 1;
      suffNull = emptySuff;
+     /*
+      * Clear suffNull's children list (the other suffixes are built new, but
+      * suffNull is used as is).
+      * NOFREE is used because all suffixes are are on the suffClean list.
+      * suffNull should not have parents.
+      */
+     Lst_Destroy(suffNull->children, NOFREE); 
+     suffNull->children = Lst_Init(FALSE);
  }
  
  /*-
***************
*** 714,733 ****
      Suff    	*s = (Suff *) sp;
      char 	*cp;
      LstNode	ln;
!     Suff  	*s2;
  
      /*
       * First see if it is a transformation from this suffix.
       */
      cp = SuffStrIsPrefix(s->name, transform->name);
      if (cp != (char *)NULL) {
! 	ln = Lst_Find(sufflist, (void *)cp, SuffSuffHasNameP);
! 	if (ln != NULL) {
  	    /*
  	     * Found target. Link in and return, since it can't be anything
  	     * else.
  	     */
- 	    s2 = (Suff *)Lst_Datum(ln);
  	    SuffInsert(s2->children, s);
  	    SuffInsert(s->parents, s2);
  	    return(0);
--- 722,746 ----
      Suff    	*s = (Suff *) sp;
      char 	*cp;
      LstNode	ln;
!     Suff  	*s2 = NULL;
  
      /*
       * First see if it is a transformation from this suffix.
       */
      cp = SuffStrIsPrefix(s->name, transform->name);
      if (cp != (char *)NULL) {
!         if (cp[0] == '\0')  /* null rule */
! 	    s2 = suffNull;
! 	else {
! 	    ln = Lst_Find(sufflist, (void *)cp, SuffSuffHasNameP);
! 	    if (ln != NULL) 
! 	        s2 = (Suff *)Lst_Datum(ln);
! 	}
! 	if (s2 != NULL) {
  	    /*
  	     * Found target. Link in and return, since it can't be anything
  	     * else.
  	     */
  	    SuffInsert(s2->children, s);
  	    SuffInsert(s->parents, s2);
  	    return(0);
***************
*** 2359,2365 ****
      void * s;
      void * dummy;
  {
!     printf ("%s ", ((Suff *) s)->name);
      return (dummy ? 0 : 0);
  }
  
--- 2372,2378 ----
      void * s;
      void * dummy;
  {
!     printf ("`%s' ", ((Suff *) s)->name);
      return (dummy ? 0 : 0);
  }
  

--OXfL5xGRrasGEqWY--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010105023009.A1100>