开发者

How do I locate a C library header file from a Makefile.PL?

How can I locate a C library header file from a Makefile.PL?

There is开发者_如何学Python ExtUtils::Liblist to find libraries, but I can't see the equivalent for header files.


Devel::CheckLib is what most authors seem to be use for that. It checks both for the existance of libraries as well as header files, as those libraries are probably useless without them.


Why not write a small lib to do this (and let it live in inc/lib/FindHeaders.pm or some such under the top level of your package dir). Just use Config (see incpath) along with File::Find and glob and you should be able to have a small library which can walk your default include path and map a hash of header files on your system, returning it to a call from Makefile.PL. It would be trivial to extend this to include non-standard include paths as well with a constructor argument to your lib. Easy peasy.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜