On Wed, Sep 24, 2008 at 12:52 AM, Martin Evans
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> I was hoping someone might be able to help me find a solution to building
> DBDs on strawberry Perl. A typical example of a failure is:
>
> http://www.nntp.perl.org/group/perl.cpan.testers/2008/09/msg2282300.html
>
> and it seems to be down to the fact that when people using strawberry perl
> attempt to install a DBD from cpan shell, perl is executed with paths on the
> command line that override the paths injected into the Makefile by
> Makefile.PL (Makefile.PL adds the path to the DBI's header files). As a
> result the build always fails with various DBI header files not found even
> though DBI is installed. This is getting quite frustrating for me as I got a
> number of cpan testers failures in the past for this and I get this issue
> reported to me regularly but I have as yet found permanent solution other
> than tinkering with the Makefile after it is generated.
>
> See http://rt.cpan.org/Public/Bug/Display.html?id=32789 where this issue was
> first reported and http://rt.cpan.org/Ticket/Display.html?id=32811.
>
> Anyone have any ideas how to get Makefile.PL to add to the INC path when INC
> is specified on the perl command line?

I dug into all of this, and I have a hazy idea of what's going on.  I
don't have a solid fix however.

In Strawberry's CPAN::Config (C:\strawberry\perl\lib\CPAN\Config.pm),
there's this:

  makepl_arg                    => q[LIBS=-LC:\\strawberry\\c\\lib
INC=-IC:\\strawberry\\c\\include],

According to the docs for the CPAN module, the above argument is added
to any invocation of 'perl Makefile.PL' when run from anywhere that
uses the CPAN module; this is what's being passed down to Makefile.PL
when CPAN invokes ExtUtils::MakeMaker, and hence being set inside the
resulting Makefile.

How to test?

Download and install Strawberry, and then run the 'cpan -i DBD::ODBC'
command; the dmake will fail, due to the DBI include path not being
used from where it is obtained in the Makefile.PL, it's being
overridden by the CPAN module when ExtUtils::MakeMaker is run by the
CPAN module.  Exit out of CPAN, go to the downloaded DBD::ODBC
directory (somewhere in C:\strawberry\cpan\build\), and go in there
and from a command prompt run 'perl Makefile.PL' by hand.  correct
include path for the DBI header directory is now picked up, and
DBD::ODBC will now build.

How to fix?

Remove that INC variable from CPAN's Config.pm? Modify INC during the
CPAN session somehow (o conf makepl_arg '')?  The perldoc page for
CPAN.pm mentions that PERL5_CPAN_IS_EXECUTING is set in the
environment when CPAN goes to run 'perl Makefile.PL'.  There might be
other ninja ways of doing it, but they're escaping me at the moment.

Thanks,

Brian

Reply via email to