develooper Front page | perl.perl5.porters | Postings from July 2001

[PATCH 5.7.2] MakeMaker FIRST_MAKEFILE and subdir

From:
Ilya Zakharevich
Date:
July 23, 2001 15:43
Subject:
[PATCH 5.7.2] MakeMaker FIRST_MAKEFILE and subdir
Message ID:
20010723184342.A14494@math.ohio-state.edu
The command-line arguments to MakeMaker are ignored in the
Makefile.PL's found in subdirs.  This has an unfortunate effect of kid
Makefile.PL's overwriting an existing Makefile even when
FIRST_MAKEFILE is specified.

This is not 100% backward-compatible with existing Makefile.PL's which
override subdirs section - they will not work if
FIRST_MAKEFILE=Makefile.xxx is specified on the command line,  On the
other hand, such Makefile.PL's probably were not used where
FIRST_MAKEFILE was specified, since the old behaviour was beating the
purpose of FIRST_MAKEFILE.

[I did find any such module in my huge CPAN build cache.]

Enjoy,
Ilya

--- ./lib/ExtUtils/MM_Unix.pm-pre	Tue Jun 26 11:19:22 2001
+++ ./lib/ExtUtils/MM_Unix.pm	Sun Jul 22 14:39:14 2001
@@ -3339,7 +3339,7 @@ sub subdir_x {
 subdirs ::
 @[
 	cd $subdir
-	\$(MAKE) all \$(PASTHRU)
+	\$(MAKE) -f \$(FIRST_MAKEFILE) all \$(PASTHRU)
 	cd ..
 ]
 EOT
@@ -3348,7 +3348,7 @@ EOT
 	    return <<EOT;
 subdirs ::
 	cd $subdir
-	\$(MAKE) all \$(PASTHRU)
+	\$(MAKE) -f \$(FIRST_MAKEFILE) all \$(PASTHRU)
 	cd ..
 EOT
 	}
@@ -3356,7 +3356,7 @@ EOT
 	return <<EOT;
 
 subdirs ::
-	$self->{NOECHO}cd $subdir && \$(MAKE) all \$(PASTHRU)
+	$self->{NOECHO}cd $subdir && \$(MAKE) -f \$(FIRST_MAKEFILE) all \$(PASTHRU)
 
 EOT
     }
--- ./lib/ExtUtils/MakeMaker.pm-pre-firstmakefile	Sun Jul 22 04:01:18 2001
+++ ./lib/ExtUtils/MakeMaker.pm	Sun Jul 22 14:51:08 2001
@@ -421,6 +421,8 @@ sub ExtUtils::MakeMaker::new {
 		    }
 	    }
 	}
+	my @fm = grep /^FIRST_MAKEFILE=/, @ARGV;
+	parse_args($self,@fm) if @fm;
     } else {
 	parse_args($self,split(' ', $ENV{PERL_MM_OPT} || ''),@ARGV);
     }



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About