代码之家  ›  专栏  ›  技术社区  ›  Karel Bílek

如何设置库和包含路径生成文件.PL一次安装?

  •  8
  • Karel Bílek  · 技术社区  · 16 年前

    Makefile.PL 在一个特定的安装中有一个特定的参数?

    XML::LibXML ,和 apt-get 已将库安装到 /usr/lib/libxml2.so.2.6.32 . 生成文件.PL 有问题告诉我:

    using fallback values for LIBS and INC
    options:
      LIBS='-L/usr/local/lib -L/usr/lib -lxml2 -lm'
      INC='-I/usr/local/include -I/usr/include'
    If this is wrong, Re-run as:
      $ /usr/bin/perl Makefile.PL LIBS='-L/path/to/lib' INC='-I/path/to/include'
    
    looking for -lxml2... no
    looking for -llibxml2... no
    libxml2 not found
    Try setting LIBS and INC values on the command line
    Or get libxml2 from 
      http://xmlsoft.org/
    

    生成文件.PL .

    编辑:当我这样做 dpkg -L libxml2 (这是一个debian),我明白了

    /.
    /usr
    /usr/lib
    /usr/lib/libxml2.so.2.6.32
    /usr/share
    /usr/share/doc
    /usr/share/doc/libxml2
    /usr/share/doc/libxml2/AUTHORS
    /usr/share/doc/libxml2/changelog.Debian.gz
    /usr/share/doc/libxml2/copyright
    /usr/share/doc/libxml2/README
    /usr/share/doc/libxml2/README.Debian
    /usr/share/doc/libxml2/NEWS.gz
    /usr/share/doc/libxml2/changelog.gz
    /usr/share/doc/libxml2/TODO.gz
    /usr/lib/libxml2.so.2
    

    我不是那台机器的根,我不能在里面做符号链接 /usr/lib 或者修理它。

    2 回复  |  直到 16 年前
        1
  •  3
  •   rafl    16 年前

    这个生成文件.PL正在寻找 libxml2.so libxml2.so.2.6.32 . 如果由于某种原因,这个符号链接不存在,因为您删除了它,那么您的供应商没有将它与libxml2头包一起提供(例如。 libxml2-dev 在Debian/Ubuntu/etc)上,您需要自己创建它。

        2
  •  13
  •   Community Mohan Dere    9 年前

    在CPAN shell中,可以设置所需的值:

    $ cpan
    cpan shell -- CPAN exploration and modules installation (v1.9205)
    ReadLine support available (maybe install Bundle::CPAN or Bundle::CPANxxl?)
    
    cpan[1]> o conf makepl_arg
        makepl_arg         []
    Type 'o conf' to view all configuration items
    
    
    cpan[2]> o conf makepl_arg "LIBS=-L/foo/bar INC=-I/foo/bar/include"
        makepl_arg         [LIBS=-L/foo/bar INC=-I/foo/bar/include]
    Please use 'o conf commit' to make the config permanent!
    
    cpan[3]> install Some::Module
    

    通过cpan命令,可以使用 -j -J

     $ cpan -J > my_config.pm
     .... edit file ....
     $ cpan -j my_config.pm -i Some::Module
    

    rafl's suspicions are right .