develooper Front page | perl.perl5.porters | Postings from November 2003

Re: [PATCH] MakeMaker, XS and C++

Thread Next
From:
Salvador "Fandi�o"
Date:
November 20, 2003 12:43
Subject:
Re: [PATCH] MakeMaker, XS and C++
Message ID:
20031120204308.78510.qmail@web13407.mail.yahoo.com
Hi,

Now that 5.8.2 has been released, Michael G Schwern has accepted to
consider my patch to add support for C++ modules for inclusion on
MakeMaker but he has requested me to get it reviewed by somebody on
here first so...

A new version of the patch is available from here:
  http://www.nondoc.org/perl/cxx-0.10.patch.gz

The full ExtUtils::MakeMaker+patch package is here:
  http://www.nondoc.org/perl/ExtUtils-MakeMaker-6.22_01.tar.gz

An a simple sample C++ module to test here:
  http://www.nondoc.org/perl/CxxTest-0.01.tar.gz

I have already been able to test it on Windows+VC6 and Linux+gcc for
perls 5.6.2, 5.8.0 and 5.8.2.

C++ modules are expected to contain a .xss file instead of the usual
.xs one. That file is preprocessed by xsubpp to a .cpp file and then
compiled by the C++ compiler.

Two new variables can be used on Makefile.PL: CXX to set the C++
compiler and CXXLD to set the linker to be used for C++ modules. As
there isn't any information available from Config.pm about the C++
compiler, linker, libs, etc., I had to  use some heuristics to find
default values for those variables from the C config. Also, new hints
should be added for compilers others than gcc and MSVC and support
for other vars (CXXFLAGS, CXXLIBS?) could be needed.

The user can also set CXX and CXXLD himself when running Makefile.PL
from the command line (or even set them on CPAN.pm config).

Deducting C++ compiler config from info on Config.pm is not bullet
proof but the only alternative would be to run some kind of
auto-config process, that doesn't seem easy to implement... any
volunteer?

Cheers,

  - Salva.



--- Michael G Schwern <schwern@pobox.com> wrote:
> On Fri, Nov 14, 2003 at 05:37:33AM -0800, Salvador Fandi�o wrote:
> > > > Here is the patch for the current version of MakeMaker.
> > > > 
> > > > I have updated all the MM_* modules but only tested on Unix.
> > > > 
> > > > BTW, I believe there was a bug in the xs_c rule on MM_VMS.pm
> that
> > > was
> > > > missing the ".c" termination for the generated file. I have
> also
> > > > changed it but somebody with more VMS experience should check
> it
> > > is
> > > > ok.
> > > 
> > > I'm putting this patch on hold because I'm trying to shove a
> stable
> > > release
> > > out the door for 5.8.1.  It effects XS voodoo that I don't
> > > understand and 
> > > isn't covered by the tests.
> > >  
> > > Sorry. :(  I'll consider it after 5.8.1.  Remind me.
> > 
> > 5.8.2 is out, so I think it's time to remind you about this patch
> ;-)
> 
> Ok, but I still don't understand it.  You've have to get someone
> else on 
> here who groks XS and C++ to look it over.
> 
> 
> -- 
> Michael G Schwern        schwern@pobox.com 
> http://www.pobox.com/~schwern/
> Cottleston, Cottleston, Cottleston Pie.
> A fly can't bird, but a bird can fly.
> Ask me a riddle and I reply:
> "Cottleston, Cottleston, Cottleston Pie."


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