如何构建Perl扩展XML :: Sablotron?

时间:2013-04-02 16:36:25

标签: perl

我在尝试安装XML::Sablotron时遇到错误。如何成功构建此模块需要做什么?

perl -V

Summary of my perl5 (revision 5 version 14 subversion 2) configuration:
Platform:
osname=cygwin, osvers=1.7.15(0.26053), archname=cygwin-thread-multi-64int
uname='cygwin_nt-5.1 winxp 1.7.15(0.26053) 2012-05-09 10:25 i686 cygwin '
config_args='-de -Dlibperl=cygperl5_14.dll -Dcc=gcc-4 -Dld=g++-4 -Darchname=                       i686-cygwin-threads-64int -Dmksymlinks -Dusethreads -Accflags=-g'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc-4', ccflags ='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -g -fno-stric                       t-aliasing -pipe -fstack-protector',
optimize='-O3',
cppflags='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -g -fno-strict-aliasing -                       pipe -fstack-protector'
ccversion='', gccversion='4.5.3', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lsee                       ksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='g++-4', ldflags =' -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl                       ,--enable-auto-image-base -fstack-protector -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib /lib
libs=-lgdbm -ldb -ldl -lcrypt -lgdbm_compat
perllibs=-ldl -lcrypt
libc=/usr/lib/libc.a, so=dll, useshrplib=true, libperl=cygperl5_14.dll
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' --shared  -Wl,--enable-auto-import -Wl,--export-                       all-symbols -Wl,--enable-auto-image-base -L/usr/local/lib -fstack-protector'


Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
                    PERL_IMPLICIT_CONTEXT PERL_PRESERVE_IVUV
                    PERL_USE_SAFE_PUTENV USE_64_BIT_INT USE_ITHREADS
                    USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF
                    USE_REENTRANT_API
 Locally applied patches:
    Bug#55162 File::Spec::case_tolerant performance
    CYG07 $vendorarch/auto/.rebase
    CYG15 static Win32CORE
    CYG17 cyg-1.7 paths-utf8
    0c612ce82 Fix building static extensions on cygwin, -UUSEIMPORTLIB
    1bac5ecc1 Fix 64-bit threading sv.c: S_anonymise_cv_maybe
    Cygwin::sync_winenv added
Built under cygwin
Compiled at Jul 12 2012 14:17:21
@INC:
/usr/lib/perl5/site_perl/5.14/i686-cygwin-threads-64int
/usr/lib/perl5/site_perl/5.14
/usr/lib/perl5/vendor_perl/5.14/i686-cygwin-threads-64int
/usr/lib/perl5/vendor_perl/5.14
/usr/lib/perl5/5.14/i686-cygwin-threads-64int
/usr/lib/perl5/5.14
/usr/lib/perl5/site_perl/5.10
/usr/lib/perl5/vendor_perl/5.10
/usr/lib/perl5/site_perl/5.8

Cygwin版本是2.774。 pango library存在问题,但我认为这不是以下问题

我尝试构建XML::Sablotron时遇到的错误(在perl makeFile.PL之后):

make[1]: Entering directory `/usr/src/XML-Sablotron-1.01/DOM'
make[1]: Leaving directory `/usr/src/XML-Sablotron-1.01/DOM'
make[1]: Entering directory `/usr/src/XML-Sablotron-1.01/Situation'
make[1]: Leaving directory `/usr/src/XML-Sablotron-1.01/Situation'
make[1]: Entering directory `/usr/src/XML-Sablotron-1.01/SXP'
make[1]: Leaving directory `/usr/src/XML-Sablotron-1.01/SXP'
make[1]: Entering directory `/usr/src/XML-Sablotron-1.01/Processor'
make[1]: Leaving directory `/usr/src/XML-Sablotron-1.01/Processor'
gcc-4 -c    -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -g -fno-strict-aliasing -pipe -   fstack-protector -DUSEIMPORTLIB -O3    -DVERSION=\"1.01\"  -DXS_VERSION=\"1.01\"  "-I/usr/lib/perl5/5.14/i686-cygwin-threads-64int/CORE"  -DPERL_POLLUTE Sablotron.c
In file included from Sablotron.xs:88:0:
DOM/DOM.h: In Funktion »__createNodeOld«:
DOM/DOM.h:90:17: Warnung: Typkonvertierung von Zeiger auf Ganzzahl anderer Breite
In file included from Sablotron.xs:88:0:
DOM/DOM.h: In Funktion »__checkNodeInstanceData«:
DOM/DOM.h:120:22: Warnung: Typkonvertierung in Zeiger von Ganzzahl anderer Breite
DOM/DOM.h: In Funktion »__createNodeNew«:
DOM/DOM.h:153:5: Warnung: Typkonvertierung von Zeiger auf Ganzzahl anderer Breite
In file included from Sablotron.xs:89:0:
Processor/Processor.h: In Funktion »MessageHandlerMakeCodeStub«:
Processor/Processor.h:122:7: Fehler: »sv_undef« undeclared (first use in this function)
Processor/Processor.h:122:7: Anmerkung: each undeclared identifier is reported only     
once for each function it appears in
Processor/Processor.h: In Funktion »MessageHandlerLogStub«:
...
In file included from Sablotron.xs:91:0:
Situation/Situation.h: In Funktion »_SV2SXP_Node«:
Situation/Situation.h:113:19: Warnung: Typkonvertierung in Zeiger von Ganzzahl anderer     
Breite
./DOM/DOM.xsh: In Funktion »XS_XML__Sablotron__DOM_parse«:
./DOM/DOM.xsh:53:30: Warnung: Typkonvertierung in Zeiger von Ganzzahl anderer Breite
....
(the same error for Processor/Processor.xsh and Situation/Situation.xsh)

当然,最好的办法是不使用Sablotron。但由于时间关系,我宁愿不改变一切。

1 个答案:

答案 0 :(得分:2)

你刚刚表现出一种非常危险的特质。您收到了错误,例如:

Processor/Processor.h: In Funktion »MessageHandlerMakeCodeStub«:
Processor/Processor.h:122:7: Fehler: »sv_undef« undeclared

并做出了一系列无根据的假设并得出了以下结论:1)问题是Cygwin和Windows特有的; 2)问题是由perl配置use64bitint=define的事实引起的; 3)解决方案是改变整数大小。 (顺便说一句,在错误消息中混合使用德语和英语有什么用?)

我刚尝试使用XML::Sablotron ed perl和MacPorts构建的sablotron库在我的OSX 10.8笔记本电脑上安装perlbrew

Searching Google for sv_undef引导其前往Old CPAN modules with sv_undef主题ExtUtils::MakeMaker

  

POLLUTE

     

通过提供用于扩展源兼容性的预处理器宏,发布5.005旧的全局符号名称。从5.6版开始,默认情况下这些预处理器定义不可用。 POLLUTE标志指定仍应定义旧名称:

  perl Makefile.PL POLLUTE=1
     

如果需要在5.6或更高版本下成功安装模块,请通知模块作者。

不幸的是,这个简单的解决方案并没有带来成功的构建。

相反,使用Devel::PPPort生成ppport.h,您可以根据系统生成补丁。

这与Cywgin或32对64位无关。您的问题与XML::Sablotron使用已弃用a long time ago的内容有关。