From schwern@schwern.org  Thu Oct 30 01:03:16 2003
Return-Path: <schwern@schwern.org>
Received: from m1.dnsix.com (m1.dnsix.com [63.251.171.165])
	by Math.Berkeley.EDU (8.12.10/8.12.10) with ESMTP id h9U93Gm1025547
	for <ilya@math.berkeley.edu>; Thu, 30 Oct 2003 01:03:16 -0800 (PST)
Received: from [207.106.49.22] (helo=orb.pobox.com)
	by m1.dnsix.com with esmtp (Exim 4.24)
	id 1AF8hz-0000uN-Bn
	for nospam-abuse@ilyaz.org; Thu, 30 Oct 2003 01:03:11 -0800
Received: from texas.pobox.com (texas.pobox.com[64.49.223.111])
	by orb.pobox.com (Postfix) with ESMTP id 15147DFCBE;
	Thu, 30 Oct 2003 04:03:10 -0500 (EST)
Received: from windhund.schwern.org (12-225-147-148.client.attbi.com [12.225.147.148])
	by texas.pobox.com (Postfix) with ESMTP
	id 7E7D3454CD; Thu, 30 Oct 2003 04:03:09 -0500 (EST)
Received: by windhund.schwern.org (Postfix, from userid 501)
	id 0B0D1264341; Thu, 30 Oct 2003 01:03:07 -0800 (PST)
Date: Thu, 30 Oct 2003 01:03:07 -0800
From: Michael G Schwern <schwern@pobox.com>
To: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Cc: Mailing list Perl5 <perl5-porters@perl.org>
Subject: Re: [PATCH 5.8.2 @21574] MakeMaker goof
Message-ID: <20031030090307.GB15905@localhost.comcast.net>
References: <20031029212743.GA26246@math.berkeley.edu> <20031030040253.GF1624@localhost.comcast.net> <20031030083041.GA26679@math.berkeley.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20031030083041.GA26679@math.berkeley.edu>
User-Agent: Mutt/1.4i
X-Spam-Status: No, hits=-44.3 required=5.0
	tests=BAYES_10,EMAIL_ATTRIBUTION,IN_REP_TO,PATCH_UNIFIED_DIFF,
	      QUOTED_EMAIL_TEXT,QUOTE_TWICE_1,REFERENCES,
	      REPLY_WITH_QUOTES,UPPERCASE_25_50,USER_AGENT_MUTT
	autolearn=ham version=2.53
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.53 (1.174.2.15-2003-03-30-exp)
Status: RO
Content-Length: 3099
Lines: 76

On Thu, Oct 30, 2003 at 12:30:41AM -0800, Ilya Zakharevich wrote:
> On Wed, Oct 29, 2003 at 08:02:53PM -0800, Michael G Schwern wrote:
> > Could it be because I'm initializing MAKEFILE_OLD and MAKE_APERL_FILE
> > from $(FIRST_MAKEFILE) instead of $self->{MAKEFILE}?  Could you try this
> > patch instead:
> 
> Do not think so.

I'm pretty sure that's the problem.  Looking back to 5.5.3 the code you 
changed has always used MAKEFILE not FIRST_MAKEFILE.  However, when I added 
the MAKEFILE_OLD targets I used FIRST_MAKEFILE whereas most places (including 
the places you changed) used $self->{MAKEFILE}.'.old'.  This looks like
it was around last December.


> > --- lib/ExtUtils/MM_Unix.pm	2003/10/14 06:14:08	1.190
> > +++ lib/ExtUtils/MM_Unix.pm	2003/10/30 04:02:07
> > @@ -1945,8 +1945,8 @@
> >  
> >      $self->{MAKEFILE}           ||= 'Makefile';
> >      $self->{FIRST_MAKEFILE}     ||= $self->{MAKEFILE};
> 
> I think these two assignments should be interchanged.  

Yes, it was originally this:

	$self->{FIRST_MAKEFILE} ||= 'Makefile';
	$self->{MAKEFILE} ||= $self->{FIRST_MAKEFILE};

I accidentally reversed them when rolling back an attempt to use
$(MAKEFILE) instead of $(FIRST_MAKEFILE).  I discovered what you
mentioned below about certain makes using $(MAKEFILE).

Give this a shot.

--- lib/ExtUtils/MM_Unix.pm	2003/10/30 08:03:47	1.194
+++ lib/ExtUtils/MM_Unix.pm	2003/10/30 08:59:04
@@ -1909,10 +1909,10 @@
     $self->{NOOP}               ||= '$(SHELL) -c true';
     $self->{NOECHO}             = '@' unless defined $self->{NOECHO};
 
-    $self->{MAKEFILE}           ||= 'Makefile';
-    $self->{FIRST_MAKEFILE}     ||= $self->{MAKEFILE};
-    $self->{MAKEFILE_OLD}       ||= '$(FIRST_MAKEFILE).old';
-    $self->{MAKE_APERL_FILE}    ||= '$(FIRST_MAKEFILE).aperl';
+    $self->{FIRST_MAKEFILE}     ||= 'Makefile';
+    $self->{MAKEFILE}           ||= $self->{FIRST_MAKEFILE};
+    $self->{MAKEFILE_OLD}       ||= $self->{MAKEFILE}.'.old';
+    $self->{MAKE_APERL_FILE}    ||= $self->{MAKEFILE}.'.aperl';
 
     $self->{SHELL}              ||= $Config{sh} || '/bin/sh';
 

> > I've never fully understood what the diffence is between $self->{MAKEFILE}
> > and $self->{FIRST_MAKEFILE}.  Could you explain?  Under what conditions
> > might they be different?
> 
> As documented, FIRST_MAKEFILE is the name of Makefile to emit ("first"
> there is leaked from Perl distribution makefile - the "dependency
> check" produces a new file generated from Makefile (in turn generated
> from Makefile.PL) - so we need to know which file `make' will look at
> *before* it tries to read Makefile (usually `makefile' or
> `GNUmakefile').
> 
> The same variable name for the generated file is used by Makemaker
> (although the value is usually just `Makefile', since there is no
> chance of name conflict).  MAKEFILE can't be used as a variable inside
> ./Makefile (due to some breakage of some `make's); so its usage is
> only by mixup with FIRST_MAKEFILE, I believe.

Ok, thanks.


-- 
Michael G Schwern        schwern@pobox.com  http://www.pobox.com/~schwern/
It's Paint Chip Eating time!

