Subject: | M::B's API is unable to build PathTools, but the command line version can |
Hi,
I really thought i had reported this before, but i can't find any of it in my mailbox or on RT, so forgive me is this is a duplicate.
Module::Build's API seems to not do quite the same thing as it's commandline equivalent. Due to this, the PathTools distribution is uninstallable using M::B's API (using the makefile.PL shipped with it, it works again... odd!)
Consider this code:
[kane@coke ~...build/PathTools-3.06]$ cat x.pl
use Module::Build;
warn "Using version: $Module::Build::VERSION\n";
my $mb = eval { Module::Build->new_from_context( %buildflags ) };
$mb->dispatch('build');
Running this makes Cwd not find ppport.h:
[kane@coke ~...build/PathTools-3.06]$ perlc x.pl
Using version: 0.261
/opt/bin/perl Build.PL
Deleting _build
Creating custom builder _build/lib/MyModuleBuilder.pm in _build/lib
Checking whether your kit is complete...
Looks good
Deleting Build
Removed previous script 'Build'
Creating new 'Build' script for 'PathTools' version '3.06'
cc -I/opt/lib/perl5/5.8.3/darwin-2level/CORE -c -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -Os -o lib/Cwd.o lib/Cwd.c
Cwd.xs:5:20: ppport.h: No such file or directory
error building .o file from 'lib/Cwd.c' at /opt/lib/perl5/site_perl/5.8.3/Module/Build/Base.pm line 2515.
However, if we do the standard command line invocation, it works:
[kane@coke ~...build/PathTools-3.06]$ perlc Build.PL; ./Build;
Deleting _build
Creating custom builder _build/lib/MyModuleBuilder.pm in _build/lib
Checking whether your kit is complete...
Looks good
Deleting Build
Removed previous script 'Build'
Creating new 'Build' script for 'PathTools' version '3.06'
ppport.h -> lib/ppport.h
Cwd.pm -> blib/lib/Cwd.pm
cc -I/opt/lib/perl5/5.8.3/darwin-2level/CORE -c -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -Os -o lib/Cwd.o lib/Cwd.c
ExtUtils::Mkbootstrap::Mkbootstrap('lib/Cwd')
env MACOSX_DEPLOYMENT_TARGET=10.3 cc -bundle -undefined dynamic_lookup -o blib/arch/auto/Cwd/Cwd.bundle lib/Cwd.o
Manifying blib/lib/File/Spec/VMS.pm -> blib/libdoc/File::Spec::VMS.3
Manifying blib/lib/File/Spec/Win32.pm -> blib/libdoc/File::Spec::Win32.3
Manifying blib/lib/Cwd.pm -> blib/libdoc/Cwd.3
Manifying blib/lib/File/Spec/Functions.pm -> blib/libdoc/File::Spec::Functions.3
Manifying blib/lib/File/Spec/Unix.pm -> blib/libdoc/File::Spec::Unix.3
Manifying blib/lib/File/Spec/Epoc.pm -> blib/libdoc/File::Spec::Epoc.3
Manifying blib/lib/File/Spec.pm -> blib/libdoc/File::Spec.3
Manifying blib/lib/File/Spec/Mac.pm -> blib/libdoc/File::Spec::Mac.3
Manifying blib/lib/File/Spec/Cygwin.pm -> blib/libdoc/File::Spec::Cygwin.3
Manifying blib/lib/File/Spec/OS2.pm -> blib/libdoc/File::Spec::OS2.3
Here's my perl -V for completeness sake:
[kane@coke ~...build/PathTools-3.06]$ perlc -V
Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration:
Platform:
osname=darwin, osvers=7.2.0, archname=darwin-2level
uname='darwin coke.xs4all.nl 7.2.0 darwin kernel version 7.2.0: thu dec 11 16:20:23 pst 2003; root:xnuxnu-517.3.7.obj~1release_ppc power macintosh powerpc '
config_args='-Dprefix=/opt -des'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing',
optimize='-Os',
cppflags='-no-cpp-precomp -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing'
ccversion='', gccversion='3.3 20030304 (Apple Computer, Inc. build 1495)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =''
libpth=/usr/lib
libs=-ldbm -ldl -lm -lc
perllibs=-ldl -lm -lc
libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dyld.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup'
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under darwin
Compiled at Feb 16 2004 15:14:24
%ENV:
PERL5LIB="/sw/lib/perl5:/sw/lib/perl5/darwin:/Users/kane/sources/p4/other/archive-extract/lib:/Users/kane/sources/p4/other/file-fetch/lib:/Users/kane/sources/p4/other/archive-tar-new/lib:/Users/kane/sources/p4/other/carp-trace/lib:/Users/kane/sources/p4/other/log-message/lib:/Users/kane/sources/p4/other/module-load/lib:/Users/kane/sources/p4/other/params-check/lib:/Users/kane/sources/p4/other/qmail-checkpassword/lib:/Users/kane/sources/p4/other/module-load-conditional/lib:/Users/kane/sources/p4/other/term-ui/lib:/Users/kane/sources/p4/other/ipc-cmd/lib:/Users/kane/sources/p4/other/config-auto/lib:/Users/kane/sources/p4/other/object-accessor/lib/"
PERL5OPT=""
PERL5_CPANPLUS_IS_RUNNING="1866"
PERL_READLINE_NOWARN="1"
@INC:
/sw/lib/perl5
/sw/lib/perl5/darwin
/Users/kane/sources/p4/other/archive-extract/lib
/Users/kane/sources/p4/other/file-fetch/lib
/Users/kane/sources/p4/other/archive-tar-new/lib
/Users/kane/sources/p4/other/carp-trace/lib
/Users/kane/sources/p4/other/log-message/lib
/Users/kane/sources/p4/other/module-load/lib
/Users/kane/sources/p4/other/params-check/lib
/Users/kane/sources/p4/other/qmail-checkpassword/lib
/Users/kane/sources/p4/other/module-load-conditional/lib
/Users/kane/sources/p4/other/term-ui/lib
/Users/kane/sources/p4/other/ipc-cmd/lib
/Users/kane/sources/p4/other/config-auto/lib
/Users/kane/sources/p4/other/object-accessor/lib/
/opt/lib/perl5/5.8.3/darwin-2level
/opt/lib/perl5/5.8.3
/opt/lib/perl5/site_perl/5.8.3/darwin-2level
/opt/lib/perl5/site_perl/5.8.3
/opt/lib/perl5/site_perl
.
[kane@coke ~...build/PathTools-3.06]$