4

背景

使用 OS X 并macports用于其他实用程序和库。正在将所有内容macports安装到/opt/local. 但是默认的 perlmacports是 5.12,指定更高的版本会破坏许多端口,所以我使用我自己安装的 5.16 perl perlbrew

所以,我有默认库/usr/lib(由 Apple 提供),但希望将基于 XS 的 perl 模块与macports提供的库链接并包含在/opt/local.

现在的问题是,在使用(到我的 perlbrew 的 perl 树中)安装模块时cpanm,这里是否有某种方式如何在全局范围内指定库的默认搜索路径并包括cpanm(到模块构建过程)首先搜索/opt/local/{lib|include}

AFAIKcpanm没有任何开关,所以也许是一些ENV变量?或者任何更简单的解决方案,如编辑每个 Makefile.PL?

4

1 回答 1

4

Install half manually. Run cpanm --look Some::Dist and supply the appropriate INC and LIBS or --include_dirs and --extra_compiler_flags to the build tool on the command line to configure, then finish off with the build, test, install steps and close the subshell.

Alternatively, if you need to fully automate this, then use a full-featured CPAN client instead of cpanm. For example, run the cpan shell and configure makepl_arg and mbuildpl_arg. This is then supplied to subsequent installations (instead of just one, as above).

于 2013-05-15T11:48:10.393 回答