How to cross compile Perl modules

旧城冷巷雨未停 提交于 2019-12-24 06:48:02

问题


I am trying to install Unix Bench into iMX6 Yocto. I successfully cross-compiled Unix Bench source code. When I run it, get error like this:

root@imx6qsabresd:/home/UnixBench# ./Run
Can't locate POSIX.pm in @INC

It looks like Perl the module is missing. So How to install these dependent modules into Yocto?

use POSIX qw(strftime);
use Time::HiRes;
use IO::Handle;
use FindBin;

BTW, is there any Unix Bench version run without Perl?


回答1:


The OpenEmbedded build system aggressively splits default Perl package into tiny modules minimizing size of the target system (when you don't need all core Perl modules you just don't install all of them), so to install 'perl' package there is not the same as to install 'perl' package in Debian or some other standard distro. You can see what is installed with 'perl' via opkg files perl command (if you're using ipk packages, of course).

So what you need is to install additional packages that are already built when building Perl. They have very simple naming scheme of perl-module-*, so for your package that would be perl-module-posix, perl-module-time-hires, perl-module-io-handle and perl-module-findbin. Of course they can also have some dependencies, so better make a proper recipe for your program and specify RDEPENDS appropriately.



来源:https://stackoverflow.com/questions/43510787/how-to-cross-compile-perl-modules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!