2010年9月13日星期一

RE: [PerlChina] 安装Log-Dispatch-2.26模块 make test出错

我猜想会不会因为Config.pm里面的信息有不统一的地方呢?问题是如何确定该修改哪个Config.pm文件,另外该如何修改Config.pm文件呢?
 
昨天我安装了某个模块后,(不记得具体是哪个了) 再调用perlgcc Makefile.PL的时候就总会开始出现下面的warning,以这次编译ExtUtils-ParseXS-2.2206为例:
# perlgcc Makefile.PL
Have /usr/perl5/5.8.4/lib/Sun/Solaris/PerlGcc
Want /usr/perl5/5.8.4/lib/sun4-solaris-64int
Your perl and your Config.pm seem to have different ideas about the
architecture they are running on.
Perl thinks: [PerlGcc]
Config says: [sun4-solaris-64int]
This may or may not cause problems. Please check your installation of perl
if you have problems building this extension.
Writing Makefile for ExtUtils::ParseXS
我刚才查看测试文件more.t,应该是在38行的have_comiler(ExtUtils::CBuilder)的时候返回空,所以把相关编译的cases都跳过了。看文档ExtUtils::CBuilder是从Config.pm 读取编译工具的相关信息。我猜想我的编译方式比较特殊(在Solaris下用gcc编译而不是cc),所以它没能找到gcc ?
 
    =============more.t==============================
    33  my $quiet = $ENV{PERL_CORE} && !$ENV{HARNESS_ACTIVE};
    34  my $b = ExtUtils::CBuilder->new(quiet => $quiet);
    35
    36  SKIP: {
    37    skip "no compiler available", 2
    38      if ! $b->have_compiler;

    39    $obj_file = $b->compile( source => $source_file );
    40    ok $obj_file;
    41    ok -e $obj_file, "Make sure $obj_file exists";
    42  }



From: ZHANG Jiaqiang A
Sent: 2010年9月14日 10:47
To: 'perlchina@googlegroups.com'
Subject: RE: [PerlChina] 安装Log-Dispatch-2.26模块 make test出错

多谢,这回执行成功了。
 
似乎前面的很多case都跳过去了,没找到编译器么?这台机器安装的是标准solaris,莫非是root的环境变量弄得不对?
 
# perl -Mlib=./lib,./blib/lib,./blib/arch t/more.t
1..25
ok 1 - require ExtUtils::ParseXS;
ok 2 - Create an output file
ok 3 # skip no compiler available
ok 4 # skip no compiler available
ok 5 # skip no dynamic loading
ok 6 # skip no dynamic loading
ok 7 # skip no dynamic loading
ok 8 # skip no dynamic loading
ok 9 # skip no dynamic loading
ok 10 # skip no dynamic loading
# Looks like you planned 25 tests but ran 10.
 
# which gcc
/usr/sfw/bin/gcc
# gcc -v
Reading specs from /usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/specs
Configured with: /sfw10/builds/build/sfw10-patch/usr/src/cmd/gcc/gcc-3.4.3/configure --prefix=/usr/sfw --with-as=/usr/ccs/bin/as --without-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++ --enable-shared
Thread model: posix
gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
# env
HOME=/root
HZ=
LD_LIBRARY_PATH=/usr/local/lib
LOGNAME=root
MAIL=/var/mail/root
PATH=/usr/sbin:/usr/bin:/usr/sfw/bin:/usr/ccs/bin:/usr/perl5/bin
SHELL=/sbin/sh
TERM=xterm
TZ=PRC
 

没有评论: