Sisyphus wrote:
> "Chris" <> wrote in message
> news: oups.com...
> > Anyone know of a way to compile C in Perl modules that require C using
> > gcc instead of cc_r under AIX (5.2)? I've installed gcc on our AIX
> > box, but Config for Perl is still pointing to cc_r (eg. $Config{cc} =
> > 'cc_r'). Just changing the config option for the C compiler doesn't
> > help since cc_r C flags are being passed to gcc instead of gcc flags.
>
> Yes, you need to change them too and there are probably other things that
> need to be changed, too - eg ldflags, libpth, cpp, cpprun, cppstdin.
Errr... One option that I considered and played with but got tedious
real fast. Everyone wants the easy way, but sometimes, it ain't there.
I was hoping though.
> There's
> a module on cpan called ExtUtils::FakeConfig that does the job (but probably
> only for Win32) - it enables use of MinGW (gcc) compiler with a perl built
> using Microsoft's Visual Studio compiler. In all, it rewrites about 30
> Config.pm values, though in your case I would expect (without really
> knowing) the number of required rewrites to be a little less.
> ExtUtils::FakeConfig creates a Config file called Confg_m.pm that contains
> the rewritten values. The original Config.pm remains untouched, and perl -V
> reports what it has always reported in the past. If you want to use the
> "rewritten" values, you run (eg):
> perl -MConfig_m Makefile.PL
This could be helpful in performing the net effect of the above.
> Perhaps it may be of use in "showing the way" to a solution for you.
> However, you'll need to know (or find out) what the appropriate values for
> gcc are. If you have access to a machine that has a gcc-built perl on it,
> then that could be very useful.
Well, yeah, I was hoping for something along those lines. If it was
quick. Like "Yeah, set CCFLAGS to ____ and CCLDFLAGS to _____ and
LDFLAGS to _____ and you should be set."
> >
> > Wondering if anyone has worked through this before. I'm surprised to
> > find nothing that matches this problem on Google. (Plenty of people
> > trying to compile Perl itself using gcc, but not trying to compile C
> > code for module support with the Perl installation on AIX that IBM
> > created, obviously with cc_r...)
> >
>
> You may well find it's simpler to build perl with gcc, rather than modify
> the Config values. That way you automatically get the correct Config values
> without even having to think about it.
Another thing I worked on as well under the same premise as you
present. Building under AIX using gcc isn't quite so straightforward
however as articles I *did* find explained as well as from experience
this afternoon. cc_r -q qualifiers still were being passed to gcc as
well as other library type settings not being found. It's not simple,
but I had this same notion.
> If you create a module to do the job, then you should consider putting it on
> cpan - perhaps ExtUtils::FakeConfig_AIX
Will do. Thanks for confirming my worst fears on this effort...!
-ceo