如何告诉CPAN Makefile.PL
在一个特定的安装中给出一个特定的参数?
特别.我想安装XML::LibXML
,并apt-get
安装库/usr/lib/libxml2.so.2.6.32
.Makefile.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/
Run Code Online (Sandbox Code Playgroud)
我知道libxml2在哪里,但我不知道怎么告诉它Makefile.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
Run Code Online (Sandbox Code Playgroud)
我不是该机器上的root用户,我无法进行符号链接/usr/lib
或修复它.
bri*_*foy 13
在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
Run Code Online (Sandbox Code Playgroud)
使用cpan命令,您可以使用该-j
开关加载自定义配置文件.您可以从-J
交换机开始转储配置,然后更改所需的值并重新加载它:
$ cpan -J > my_config.pm
.... edit file ....
$ cpan -j my_config.pm -i Some::Module
Run Code Online (Sandbox Code Playgroud)
但是,我怀疑rafl的怀疑是正确的.
Makefile.PL 正在寻找libxml2.so
. 这通常是指向实际 libxml2 共享对象的符号链接,例如libxml2.so.2.6.32
. 如果由于某种原因这个符号链接不存在,因为您删除了它,您的供应商没有随其 libxml2 标头包一起提供它(例如libxml2-dev
在 Debian/Ubuntu/等上),您将需要自己创建它。
您不需要在此处将任何特定参数传递给 Makefile.PL。它已经在寻找正确的地方了。它正在寻找的东西根本不存在。