gpt4 book ai didi

perl - cpanm 使用自定义库和 cflags

转载 作者:行者123 更新时间:2023-12-04 01:47:44 25 4
gpt4 key购买 nike

在我的 mac OS X 机器上 Darwin maci 15.6.0 Darwin Kernel Version 15.6.0我已经在以下自定义目录中安装了 libxml2 和 libxslt/usr/local/MyLibs/libxml2-2.9.2和 libxslt/usr/local/MyLibs/libxslt-1.1.29现在我想使用这些库来构建我的 CPANM 模块 XML::LibXSLT .
This告诉我可以使用 --configure-args (它仍然是实验性的)。所以我做类似的事情,

cpanm http://search.cpan.org/CPAN/authors/id/S/SH/SHLOMIF/XML-LibXSLT-1.94.tar.gz --configure-args="--cflags=-I/usr/local/libxslt-1.1.29/include -I/usr/include/libxml2 -I/usr/local/MyLibs/libxml2-2.9.2/include/libxml2 --libs=-L/usr/local/libxslt-1.1.29/lib -lxslt -lxml2 -lz -lpthread -licucore -lm -L/usr/local/MyLibs/libxml2-2.9.2/lib -lxml2 -lz -lpthread -liconv -lm" --force
但是,构建日志说它没有使用安装在我的自定义位置的库。
有什么我做的不对吗?

最佳答案

来自发行版的 README ,

The Makefile.PL tries to determine the correct compiler and linkerflags for its library dependencies using pkg-config andxslt-config. If this fails, you may override the values like this


perl Makefile.PL INC="..." LIBS="..."

where INC contains flags for the compiler (such as -I/some_path/include etc.) and LIBS contains linker flags (such as -L/some_path/lib -llibsomething ...).


放弃 cpanm 可能更简单并自己安装模块。
curl -L -o - http://search.cpan.org/CPAN/authors/id/S/SH/SHLOMIF/XML-LibXSLT-1.95.tar.gz | tar xz
cd XML-LibXSLT-1.95
perl Makefile.PL INC="..." LIBS="..."
make test
make install

关于perl - cpanm 使用自定义库和 cflags,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42484675/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com