Lin Wu wrote:
> Dear Mr. Schwern,
>
> I am a CS student at UC Irvine. I met a small problem on using
> ExtUtils::ModuleMaker on a research project. The problem is very simple.
>
> I have both C and C++ code for a PERL module extension. To make the
> code to work, I have to use gcc to compile C code and g++ for C++.
> However, by default ExtUtils::ModuleMaker will use g++ to compile both
> files. I am wondering whether you could give me a small example
> Makefile.PL code, such that ExtUtils::ModuleMaker will use different
> compilers for different kinds of source code.
>
> The question may look silly for you. But even though I search the web
> for a long time and read many Makefile.PL files, I cannot figure out how
> to do it.
I don't do much C compilation myself. MakeMaker generally goes with whatever
perl was configured to use. Check your Config settings, particuarlly
$Config{cpp} and $Config{cpprun}. I think you can override this by passing
CCCMD=g++ when running make (ie. make CCCMD=g++). I don't think there's a way
to change it in the Makefile.PL short of editing your Config.pm.