configure.ac
can contains checks for headers and libraries:
AC_CHECK_LIB(cap,cap_compare,[cap_libs="-lcap"])
AC_CHECK_HEADERS([sys/acl.h linux/netlink.h])
As there an autotools support just to simply get list of these files (their default location even if not presented or at least location to these which are presented):
/usr/include/sys/acl.h
/lib/x86_64-linux-gnu/libcap.so.2
I'm trying to find/create tool which would from autotools input generated missing packages of a Linux distro.
UPDATE I see I didn't express myself correctly and mislead you with incorrect statements. I'm one of the developers of LTP project. I extended our autotools macros, so I have some knowledge how it works. As this project is aimed to be compiled from source code (there is not going to be a package in distros), I want to make it easy for users compiling it to provide it list of package dependencies for all major Linux distros.
It would probably be easiest way just to maintain these dependencies manually. But because we have these dependencies in form of autotools AC_CHECK_LIB()
and AC_CHECK_HEADERS()
macros, I'd like to use that. Somehow take input of autotools (configure.ac
and all m4/*.m4
) and generate list of headers and directories:
sys/acl.h
linux/netlink.h
...
libcap.so
...
This list would be big help for me. This is what I want to know.
Of course, I can make this list manually or use regular expressions to parse it either from autotools or from source code, but it would be nice to get it from autotools out of the box.
Ideas what to do with this list: I'd have another script with predefined include path and default library path (/usr/include/
would be include path for most distros add e.g. /lib/x86_64-linux-gnu/
for Debian/Ubuntu or /usr/lib64
for openSUSE) which I put in front of headers and libraries. IMHO pkg-config
is not an option as it's *.pc
config files are installed with dependencies, so it will not be available when the package I'm searching for isn't installed.
Then I'd search with this list for packages, using distribution tools which are able to search online (i.e. don't depend on package being installed, i.e. apt-file
for Debian/Ubuntu, dnf
, yum
or zypper
) or search online (https://packages.qa.debian.org/, ...), but that's another topic.