How to find the C library header file from Makefile.PL?

How can I find the C library header file from Makefile.PL?

There is ExtUtils :: Liblist for searching libraries, but I don't see the equivalent for header files.

+4
source share
2 answers

Devel::CheckLib is what seems to be for most authors. It checks for libraries as well as header files, as these libraries are probably useless without them.

+5
source

Why not write a small library for this (and let it live in inc / lib / FindHeaders.pm or some of them below the top level of your dir package). Just use Config (see Incpath) along with File :: Find and glob, and you should have a small library that can go by default, include the path and display the hash of headers on your system, returning it to the call from Makefile.PL. It would be trivial to extend this to include non-standard include paths, as well as a constructor argument for your library. Easy peasy.

0
source

Source: https://habr.com/ru/post/1334347/


All Articles