Subject: | XML::Parser Improperly Compiles in dylds on Mac OS X |
Distribution: XML-Parser-2.31
I've found that, even though I've compiled and installed expat-1.95.4 into /usr/local/lib, XML::Parser will fail all of its tests after it builds. The failures look like this:
mercury# make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/astress.........dyld: /usr/bin/perl Undefined symbols:
_XML_DefaultCurrent
_XML_ErrorString
_XML_ExternalEntityParserCreate
_XML_GetBase
_XML_GetBuffer
_XML_GetCurrentByteCount
_XML_GetCurrentByteIndex
_XML_GetCurrentColumnNumber
_XML_GetCurrentLineNumber
_XML_GetErrorCode
_XML_GetInputContext
<snip/>
The solution is to pass the paths in to Makefile.PL as you have documented in Makefile.PL:
perl Makefile.PL EXPATLIBPATH=/usr/local/lib EXPATINCPATH=/usr/local/include
The Makefile this generates is identical to the makefile generated without those arguments, so I can't tell how or why it makes a difference. But it does. All tests pass.
Note that, because C<ExtUtils::Liblist->ext('-lexpat')> returns a value on Mac OS X v. 10.2 (although it does generate the warning "Note (probably harmless): No library found for -lexpat"), the section in which you actually test for the presence of the dynamic library never gets executed. Therefore, the helpful information about the EXPATLIBPATH and EXPATINCPATH arguments never gets printed.
Hrm...I just commented out the whole ExtUtils::Liblist section, which allowed Makefile.PL to find the dyld in your "# Test for existence of libexpat" section. I'm not sure what kind of magic you're using to get this information to the compiler, but the upshot is that, on Mac OS X at least, C<ExtUtils::Liblist->ext('-lexpat')> isn't doing the job.
Enough blather. Here's my config:
mercury# perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
Platform:
osname=darwin, osvers=6.0, archname=darwin
uname='darwin mercury.kineticode.com 6.0 darwin kernel version 6.0: sat jul 27 13:18:52 pdt 2002; root:xnuxnu-344.obj~1release_ppc power macintosh powerpc '
config_args='-des -Uversiononly -Dprefix=/usr/local -Dccflags=-I/sw/include -Dldflags=-L/sw/lib -Dperladmin=david@kineticode.com'
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 ='-I/sw/include -pipe -fno-common -no-cpp-precomp -fno-strict-aliasing',
optimize='-O3',
cppflags='-no-cpp-precomp -I/sw/include -pipe -fno-common -no-cpp-precomp -fno-strict-aliasing'
ccversion='', gccversion='3.1 20020420 (prerelease)', 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='cc', ldflags ='-L/sw/lib -flat_namespace'
libpth=/usr/lib
libs=-lm -lc
perllibs=-lm -lc
libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true, libperl=libperl.dylib
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dyld.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-L/sw/lib -flat_namespace -bundle -undefined suppress'
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under darwin
Compiled at Aug 18 2002 23:33:47
%ENV:
PERL5LIB=":/usr/local/bricolage/lib:/Users/david/dev/perl/myco/classes:/usr/local/bricolage/lib:/Users/david/dev/perl/myco/classes"
@INC:
/usr/local/lib/perl5/5.8.0/darwin
/usr/local/lib/perl5/5.8.0
/usr/local/lib/perl5/site_perl/5.8.0/darwin
/usr/local/lib/perl5/site_perl/5.8.0
/usr/local/lib/perl5/site_perl
.
Thanks!
David