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

Re: merging make_ext and make_ext_cross

Thread Previous | Thread Next
From:
Craig A. Berry
Date:
February 7, 2009 07:58
Subject:
Re: merging make_ext and make_ext_cross
Message ID:
c9ab31fc0902070758n6cce68edsae5cf5564c995e4a@mail.gmail.com
On Sat, Feb 7, 2009 at 9:07 AM, Nicholas Clark <nick@ccl4.org> wrote:
> On Fri, Feb 06, 2009 at 11:00:10PM -0600, Craig A. Berry wrote:

>> 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

Oops.  I thought we were talking about the top-level makefile, not the
extension-specific ones, which have similar (nearly identical) code on
VMS:


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
$(MMS$SOURCE_LIST)"
        $(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 "INST_LIB=[--.lib]"
"INST_ARCHLIB=[--.lib]" "PERL_CORE=1"
        $(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

All of this is done by MakeMaker, which does a pretty decent job of
abstracting out the platform differences.  It's not perfect, like the
fact that "false" is not a valid DCL command, but that's a MakeMaker
problem, not a make_ext.pl problem.

>
>> 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[---]" ?

Not for Perl's chdir, nor for library location in miniperl, which will
handle Unix specs just fine (e.g., "-I../../../lib" will work).  In
order to get the correct path to miniperl, we can probably just use
$^X, which gives us an absolute path and appears to be what Win32 is
already doing.  I don't know offhand how MakeMaker comes up with the
relative paths in a line like:

        $(PERLRUN) Makefile.PL "INST_LIB=[--.lib]"
"INST_ARCHLIB=[--.lib]" "PERL_CORE=1"

but hopefully it will DTRT.


> 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?

It's pretty clear what you're supposed to do if you're a commercial
software vendor, and not so clear what you're supposed to do if you're
anyone else.  I, too, thought there had been discussion about access
for open source developers.  Was it Merijn who had made contact?

In any case, the testdrive shutdown does not affect the VMS systems
until they have support for running under an HP-UX partition, which is
currently scheduled for the second half of 2009.  I can still get in
today:

% telnet td183.testdrive.hp.com
Trying 15.170.178.183...
Connected to td183.testdrive.hp.com.
Escape character is '^]'.

send mail to testdrive@hp.com for password resets

Username:

> I don't think that I can do any more until VMS is unified into the build
> system.

Well, I had better get moving then.  I didn't want to wade into
make_ext.pl while it was a moving target, but now I have no excuse
:-).

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