develooper Front page | perl.perl5.porters | Postings from February 2009

Re: merging make_ext and make_ext_cross

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
February 7, 2009 07:08
Subject:
Re: merging make_ext and make_ext_cross
Message ID:
20090207150740.GI81285@plum.flirble.org
On Fri, Feb 06, 2009 at 11:00:10PM -0600, Craig A. Berry wrote:
> On Fri, Feb 6, 2009 at 3:24 PM, Nicholas Clark <nick@ccl4.org> wrote:
> > On Fri, Feb 06, 2009 at 09:16:41PM +0000, Nicholas Clark wrote:
> >
> >> but I don't know how to write the VMS system() invocations inside make_ext.pl
> >> (Or exactly how to munge the paths to work out the number of '-' for the
> >> directory specs to find lib in -I). So:
> >
> > Ah. I forgot. Does the file for MMS contain a working config target?
> > So that the "make config" logic in make_ext.pl will work on VMS too.
> >
> >    if (!$target or $target !~ /clean$/) {
> >        # Give makefile an opportunity to rewrite itself.
> >        # reassure users that life goes on...
> >        my @config = (@run, @make, 'config', @$pass_through);
> >        system @config and print "@config failed, continuing anyway...\n";
> >    }
> 
> No, there  is no config target at all as far as I can tell.  What does
> it do, just memoize the entire ./Configure command line so it can spew
> it back for you later?

In the makefiles generated by Makefile.PL in each extension's directory. I see:

config :: $(FIRST_MAKEFILE) blibdirs
	$(NOECHO) $(NOOP)

and:

# We take a very conservative approach here, but it's worth it.
# We move Makefile to Makefile.old here to avoid gnu make looping.
$(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP)
	$(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?"
	$(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..."
	-$(NOECHO) $(RM_F) $(MAKEFILE_OLD)
	-$(NOECHO) $(MV)   $(FIRST_MAKEFILE) $(MAKEFILE_OLD)
	- $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL)
	$(PERLRUN) Makefile.PL "INSTALLDIRS=perl" "INSTALLMAN3DIR=none" "PERL_CORE=1" "LIBPERL_A=libperl.a" "LINKTYPE=dynamic"
	$(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <=="
	$(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command.  <=="
	false

and:

# Where is the Config information that we are using/depend on
CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h


which results in the Makefile re-running Makfile.PL if it thinks that it's out
of date with respect to Makefile.PL and perl.


> Hmm.  Where exactly do we need path munging?  Is that only when
> generating the DCL that will be a fallback for doing clean-up?  I
> thought we weren't going to need that since we delete miniperl later
> than is done elsewhere.

No, for each extension. make_ext.pl runs a top-level loop in some directory
(on Windows it's running from win32/ - does VMS run from the top, or from
vms/?)

So it does

    chdir "ext/Some/Extension";
    system "../../../miniperl", "-I../../../lib", "Makfile.PL" ... # if needed
    system "make" "config";
    system "make" or die;
    chdir "../../..";

to end up where it started. Right now, as extensions are at various levels
below ext/, it needs to work out how many "../"s it needs to reach the top.

Win32 is happy with -I../../.. for "up 3".
VMS would require "-I[---]" ?

The inability of HP to provide any replacement for Testdrive is hindering our
ability to support their OS. They made some mention of a suggested alternative
- did they drop the ball on that?

> > 5: Rename the directories in ext/ to that format, so that ext/ is flat, with
> >   all extensions at the top level
> > 6: Simplify all the ext scanning code - no need to recurse directories, no
> >   need to limit the depth to 10 to avoid infinite symlink loops, no need for
> >   special cases for ext/threads/shared and ext/Hash/Util
> >
> > At this point there is a one to one mapping between extensions and directories
> > in ext. Every directory there is an extension. So
> >
> > 7: Add logic to make_ext.pl to write a Makefile.PL automatically for any
> >   directory in ext/ that doesn't have one. (and clean it up at the end)
> > 8: Start moving dual life modules from lib/ to ext/
> >
> > (I should add that for step 8, I envisage laying each out in ext/ identically
> > to how its CPAN distribution is laid out. Which should reduce the insanity)
> 
> If there's anything that has a Makefile.PL and does not need to have
> its directory structure flattened, it could, as far as I know, be
> moved before we get make_ext.pl working on VMS (but hopefully that
> won't be long in any case).

It can't exist. :-)

I wasn't planning to add in each Makfile.PL from CPAN distributions, merely to
move their files from lib to ext/.../

I've moved the two extensions that VMS doesn't build - ext/IPC/SysV and
ext/Sys/Syslog are now ext/IPC-SysV and ext/Sys-Syslog respectively.

I don't think that I can do any more until VMS is unified into the build
system. VMS will choke if I move other directories around in ext/
I can't start on step 7 until 6 is complete, and 6 until 5 is complete.

Nicholas Clark

Thread Previous | Thread Next


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